[open-ils-commits] r9232 - trunk/Open-ILS/web/opac/common/js

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Apr 4 15:29:38 EDT 2008


Author: miker
Date: 2008-04-04 14:53:01 -0400 (Fri, 04 Apr 2008)
New Revision: 9232

Modified:
   trunk/Open-ILS/web/opac/common/js/opac_utils.js
   trunk/Open-ILS/web/opac/common/js/org_utils.js
Log:
begin exposing lassos in the OPAC

Modified: trunk/Open-ILS/web/opac/common/js/opac_utils.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/opac_utils.js	2008-04-04 16:03:55 UTC (rev 9231)
+++ trunk/Open-ILS/web/opac/common/js/opac_utils.js	2008-04-04 18:53:01 UTC (rev 9232)
@@ -109,12 +109,18 @@
 	/* handle the location var */
 	var org;
 	var loc = cgi.param(PARAM_LOCATION);
-	if( loc ) {
-		org = findOrgUnit(loc);
-		if(!org) org = findOrgUnitSN(loc);
-	} 
-	LOCATION	= (org) ? org.id() : null;
 
+    if (loc) {
+    	if(isNaN(loc)) org = findOrgUnitSN(loc);
+
+	    if( !org ) {
+            if ( parseInt(loc) < 0 ) org = findOrgLasso( -1 * loc );
+    		else org = findOrgUnit(loc);
+    	} 
+    }
+
+	LOCATION = org ? org.id() : null;
+
 	org = null;
 	loc = cgi.param(PARAM_ORIGLOC);
 	if( loc ) {

Modified: trunk/Open-ILS/web/opac/common/js/org_utils.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/org_utils.js	2008-04-04 16:03:55 UTC (rev 9231)
+++ trunk/Open-ILS/web/opac/common/js/org_utils.js	2008-04-04 18:53:01 UTC (rev 9232)
@@ -47,6 +47,14 @@
 	return (typeof org_id == 'object') ? org_id : orgArraySearcher[org_id];
 }
 
+function findOrgLasso(lasso_id) {
+	if (typeof lasso_id == 'object') return lasso_id;
+    for (var i in _lasso) {
+        if (_lasso[i].id() == lasso_id) return _lasso[i];
+    }
+    return null;
+}
+
 var orgArraySearcherSN = {};
 function findOrgUnitSN(shortname) {
 	if (typeof shortname == 'object') return shortname;



More information about the open-ils-commits mailing list