[open-ils-commits] r9233 - in trunk/Open-ILS/web/opac: common/js
skin/default/js skin/default/xml/common
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Apr 4 17:09:05 EDT 2008
Author: miker
Date: 2008-04-04 16:32:28 -0400 (Fri, 04 Apr 2008)
New Revision: 9233
Modified:
trunk/Open-ILS/web/opac/common/js/opac_utils.js
trunk/Open-ILS/web/opac/common/js/org_utils.js
trunk/Open-ILS/web/opac/skin/default/js/depth_selector.js
trunk/Open-ILS/web/opac/skin/default/xml/common/js_common.xml
Log:
trying to move towards lassos
Modified: trunk/Open-ILS/web/opac/common/js/opac_utils.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/opac_utils.js 2008-04-04 18:53:01 UTC (rev 9232)
+++ trunk/Open-ILS/web/opac/common/js/opac_utils.js 2008-04-04 20:32:28 UTC (rev 9233)
@@ -111,16 +111,21 @@
var loc = cgi.param(PARAM_LOCATION);
if (loc) {
- if(isNaN(loc)) org = findOrgUnitSN(loc);
+ org = findOrgUnit(loc);
+ LOCATION = org ? org.id() : null;
- if( !org ) {
- if ( parseInt(loc) < 0 ) org = findOrgLasso( -1 * loc );
- else org = findOrgUnit(loc);
+ if( !LOCATION ) {
+ if ( loc < 0 ) {
+ org = findOrgLasso( -loc );
+ LOCATION = org ? -org.id() : null;
+ }
+ if ( !LOCATION ){
+ org = findOrgUnit(loc);
+ LOCATION = org ? org.id() : null;
+ }
}
}
- 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 18:53:01 UTC (rev 9232)
+++ trunk/Open-ILS/web/opac/common/js/org_utils.js 2008-04-04 20:32:28 UTC (rev 9233)
@@ -44,7 +44,9 @@
/* returns an org unit by id. if an object is passed in as the id,
then the object is assumed to be an org unit and is returned */
function findOrgUnit(org_id) {
- return (typeof org_id == 'object') ? org_id : orgArraySearcher[org_id];
+ var o = (typeof org_id == 'object') ? org_id : orgArraySearcher[org_id];
+ if (!o) o = new aou();
+ return o;
}
function findOrgLasso(lasso_id) {
Modified: trunk/Open-ILS/web/opac/skin/default/js/depth_selector.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/depth_selector.js 2008-04-04 18:53:01 UTC (rev 9232)
+++ trunk/Open-ILS/web/opac/skin/default/js/depth_selector.js 2008-04-04 20:32:28 UTC (rev 9233)
@@ -75,7 +75,8 @@
removeChildren(selector);
var location = findOrgUnit(loc);
- var type = findOrgType(location.ou_type());
+ var type;
+ if (location) type = findOrgType(location.ou_type());
while( type && location ) {
var n = node.cloneNode(true);
Modified: trunk/Open-ILS/web/opac/skin/default/xml/common/js_common.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/common/js_common.xml 2008-04-04 18:53:01 UTC (rev 9232)
+++ trunk/Open-ILS/web/opac/skin/default/xml/common/js_common.xml 2008-04-04 20:32:28 UTC (rev 9233)
@@ -11,6 +11,7 @@
<script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/fmgen.js' type='text/javascript'></script>
<script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/opac_utils.js' type='text/javascript'></script>
<script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/OrgTree.js' type='text/javascript'></script>
+ <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/OrgLasso.js' type='text/javascript'></script>
<script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/org_utils.js' type='text/javascript'></script>
<script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/RemoteRequest.js' type='text/javascript'></script>
<script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/init.js' type='text/javascript'></script>
More information about the open-ils-commits
mailing list