From 8423062c19f3ef6d4a78ab43be8475a0d7d807d1 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 4 Apr 2008 18:53:01 +0000 Subject: [PATCH 1/1] begin exposing lassos in the OPAC git-svn-id: svn://svn.open-ils.org/ILS/trunk@9232 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/common/js/opac_utils.js | 16 +++++++++++----- Open-ILS/web/opac/common/js/org_utils.js | 8 ++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js index 26870bec34..b8b4499576 100644 --- a/Open-ILS/web/opac/common/js/opac_utils.js +++ b/Open-ILS/web/opac/common/js/opac_utils.js @@ -109,11 +109,17 @@ function initParams() { /* 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); diff --git a/Open-ILS/web/opac/common/js/org_utils.js b/Open-ILS/web/opac/common/js/org_utils.js index 0cba53293d..2acf826cb7 100644 --- a/Open-ILS/web/opac/common/js/org_utils.js +++ b/Open-ILS/web/opac/common/js/org_utils.js @@ -47,6 +47,14 @@ function findOrgUnit(org_id) { 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; -- 2.43.2