[open-ils-commits] r9222 - in trunk/Open-ILS/src: . extras

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Apr 4 08:35:01 EDT 2008


Author: miker
Date: 2008-04-04 07:58:26 -0400 (Fri, 04 Apr 2008)
New Revision: 9222

Added:
   trunk/Open-ILS/src/extras/org_lasso_js.pl
Modified:
   trunk/Open-ILS/src/Makefile
   trunk/Open-ILS/src/extras/autogen.sh
Log:
adding lasso data support for use by the OPAC

Modified: trunk/Open-ILS/src/Makefile
===================================================================
--- trunk/Open-ILS/src/Makefile	2008-04-04 04:57:59 UTC (rev 9221)
+++ trunk/Open-ILS/src/Makefile	2008-04-04 11:58:26 UTC (rev 9222)
@@ -105,6 +105,7 @@
 	@echo $@
 	cp extras/fieldmapper.pl $(BINDIR)
 	cp extras/org_tree_js.pl $(BINDIR)
+	cp extras/org_lasso_js.pl $(BINDIR)
 	cp extras/org_tree_html_options.pl $(BINDIR)
 	cp extras/org_tree_proximity.pl $(BINDIR)
 	cp extras/autogen.sh $(BINDIR)

Modified: trunk/Open-ILS/src/extras/autogen.sh
===================================================================
--- trunk/Open-ILS/src/extras/autogen.sh	2008-04-04 04:57:59 UTC (rev 9221)
+++ trunk/Open-ILS/src/extras/autogen.sh	2008-04-04 11:58:26 UTC (rev 9222)
@@ -84,6 +84,9 @@
 echo "Updating OrgTree HTML";
 perl org_tree_html_options.pl "$CONFIG" "$SLIMPACDIR/lib_list.inc";
 
+echo "Updating Search Groups";
+perl org_lasso_js.pl "$CONFIG" > "$JSDIR/OrgLasso.js";
+
 if [ "$PROXIMITY" ]
 then
 	echo "Refreshing proximity of org units";

Added: trunk/Open-ILS/src/extras/org_lasso_js.pl
===================================================================
--- trunk/Open-ILS/src/extras/org_lasso_js.pl	                        (rev 0)
+++ trunk/Open-ILS/src/extras/org_lasso_js.pl	2008-04-04 11:58:26 UTC (rev 9222)
@@ -0,0 +1,34 @@
+#!/usr/bin/perl
+use strict; use warnings;
+
+# ------------------------------------------------------------
+# turns the actor.org_lasso table into a js file
+# ------------------------------------------------------------
+
+use OpenSRF::System;
+use OpenILS::Utils::Fieldmapper;
+use OpenSRF::Utils::SettingsClient;
+use OpenSRF::Utils::JSON;
+
+die "usage: perl org_tree_js.pl <bootstrap_config>" unless $ARGV[0];
+OpenSRF::System->bootstrap_client(config_file => $ARGV[0]);
+
+Fieldmapper->import(IDL => OpenSRF::Utils::SettingsClient->new->config_value("IDL"));
+
+# must be loaded after the IDL is parsed
+require OpenILS::Utils::CStoreEditor;
+
+# fetch the org_unit's and org_unit_type's
+my $e = OpenILS::Utils::CStoreEditor->new;
+my $lassos = $e->request(
+    'open-ils.cstore.direct.actor.org_lasso.search.atomic',
+    {id => {"!=" => undef}},
+    {order_by => {lasso => 'name'}}
+);
+
+print
+    "var _lasso = [\n  " .
+    join( ",\n  ", map { OpenSRF::Utils::JSON->perl2JSON( $_ ) } @$lassos ) .
+    "\n]; /* Org Search Groups (Lassos) */ \n";
+
+



More information about the open-ils-commits mailing list