[open-ils-commits] r10056 - in branches/rel_1_2/Open-ILS/web/opac:
common/js locale/en-US skin/default/css skin/default/js
skin/default/xml/advanced
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Jul 16 15:11:34 EDT 2008
Author: erickson
Date: 2008-07-16 15:11:31 -0400 (Wed, 16 Jul 2008)
New Revision: 10056
Modified:
branches/rel_1_2/Open-ILS/web/opac/common/js/config.js
branches/rel_1_2/Open-ILS/web/opac/common/js/opac_utils.js
branches/rel_1_2/Open-ILS/web/opac/locale/en-US/opac.dtd
branches/rel_1_2/Open-ILS/web/opac/skin/default/css/layout.css
branches/rel_1_2/Open-ILS/web/opac/skin/default/js/adv_global.js
branches/rel_1_2/Open-ILS/web/opac/skin/default/js/result_common.js
branches/rel_1_2/Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml
Log:
backporting shelving location filter
Modified: branches/rel_1_2/Open-ILS/web/opac/common/js/config.js
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/common/js/config.js 2008-07-16 02:49:36 UTC (rev 10055)
+++ branches/rel_1_2/Open-ILS/web/opac/common/js/config.js 2008-07-16 19:11:31 UTC (rev 10056)
@@ -36,6 +36,7 @@
var PARAM_RDEPTH = 'rd';
var PARAM_REDIR = 're'; /* true if we have been redirected by IP (we're at a real lib) */
var PARAM_AVAIL = 'av'; /* limit search results to available items */
+var PARAM_COPYLOCS = 'cl'; // copy (shelving) locations
/* URL param values (see comments above) */
var TERM;
@@ -69,6 +70,7 @@
var TFORM;
var RDEPTH;
var AVAIL;
+var COPYLOCS;
/* cookie values */
var SBEXTRAS;
Modified: branches/rel_1_2/Open-ILS/web/opac/common/js/opac_utils.js
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/common/js/opac_utils.js 2008-07-16 02:49:36 UTC (rev 10055)
+++ branches/rel_1_2/Open-ILS/web/opac/common/js/opac_utils.js 2008-07-16 19:11:31 UTC (rev 10056)
@@ -154,6 +154,8 @@
TFORM = cgi.param(PARAM_TFORM);
RDEPTH = cgi.param(PARAM_RDEPTH);
AVAIL = cgi.param(PARAM_AVAIL);
+ COPYLOCS = cgi.param(PARAM_COPYLOCS);
+
/* set up some sane defaults */
//if(isNaN(DEPTH)) DEPTH = 0;
@@ -192,6 +194,7 @@
LANGUAGE = null;
RDEPTH = null;
AVAIL = null;
+ COPYLOCS = null;
}
@@ -239,6 +242,7 @@
function getLanguage() { return LANGUAGE; }
function getRdepth() { return RDEPTH; }
function getAvail() { return AVAIL; }
+function getCopyLocs() { return COPYLOCS; }
function findBasePath() {
@@ -387,6 +391,8 @@
string += _appendParam(SORT_DIR, PARAM_SORT_DIR, args, getSortDir, string);
if(getAvail())
string += _appendParam(AVAIL, PARAM_AVAIL, args, getAvail, string);
+ if(getCopyLocs())
+ string += _appendParam(COPYLOCS, PARAM_COPYLOCS, args, getCopyLocs, string);
return string.replace(/\&$/,'').replace(/\?\&/,"?");
}
Modified: branches/rel_1_2/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-07-16 02:49:36 UTC (rev 10055)
+++ branches/rel_1_2/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-07-16 19:11:31 UTC (rev 10056)
@@ -319,6 +319,7 @@
<!ENTITY opac.advanced.quick.tcn "TCN"> <!-- title control number -->
<!ENTITY opac.advanced.quick.barcode "Item Barcode">
<!ENTITY opac.advanced.quick.cn "Call Number">
+<!ENTITY opac.advanced.copy_loc_filter "Shelving Location">
<!-- ==========================================================
MARC expert search
Modified: branches/rel_1_2/Open-ILS/web/opac/skin/default/css/layout.css
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/skin/default/css/layout.css 2008-07-16 02:49:36 UTC (rev 10055)
+++ branches/rel_1_2/Open-ILS/web/opac/skin/default/css/layout.css 2008-07-16 19:11:31 UTC (rev 10056)
@@ -247,4 +247,3 @@
#xul_recipient_me { margin-left: 25px; }
#myopac_holds_thaw_date_form {padding: 10px; text-align: center;}
#myopac_holds_freeze_select_thaw {margin-right: 100px; margin-left: 100px; }
-
Modified: branches/rel_1_2/Open-ILS/web/opac/skin/default/js/adv_global.js
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/skin/default/js/adv_global.js 2008-07-16 02:49:36 UTC (rev 10055)
+++ branches/rel_1_2/Open-ILS/web/opac/skin/default/js/adv_global.js 2008-07-16 19:11:31 UTC (rev 10056)
@@ -1,7 +1,9 @@
attachEvt("common", "run", advgInit);
+attachEvt("common", "locationChanged", advSyncCopyLocLink );
var COOKIE_NOGROUP_RECORDS = 'grpt';
+var advSelectedOrg = null;
function advgInit() {
@@ -45,8 +47,25 @@
$('opac.result.limit2avail').checked = true;
initSearchBoxes();
+
+ advSyncCopyLocLink(getLocation());
}
+function advSyncCopyLocLink(org) {
+ // display the option to filter by copy location
+ advLocationsLoaded = false;
+ advSelectedOrg = org;
+ removeChildren($('adv_copy_location_filter_select'));
+
+ if(isTrue(findOrgType(findOrgUnit(org).ou_type()).can_have_vols())) {
+ unHideMe($('adv_copy_location_filter_row'));
+ advLoadCopyLocations(org);
+ } else {
+ hideMe($('adv_copy_location_filter_row'));
+ }
+
+}
+
function initSearchBoxes() {
/* loads the compiled search from the search cookie
and sets the widgets accordingly */
@@ -137,6 +156,7 @@
var itemforms = advGetVisSelectorVals('adv_global_item_form');
var itemtypes = advGetVisSelectorVals('adv_global_item_type');
var audiences = advGetVisSelectorVals('adv_global_audience');
+ var locations = advGetVisSelectorVals('adv_copy_location_filter_select');
var languages = getSelectedList($('adv_global_lang')) + '';
var limit2avail = $('opac.result.limit2avail').checked ? 1 : ''
@@ -152,6 +172,7 @@
args[PARAM_LITFORM] = litforms;
args[PARAM_AUDIENCE] = audiences;
args[PARAM_LANGUAGE] = languages;
+ args[PARAM_COPYLOCS] = locations;
//args[PARAM_SEARCHES] = js2JSON(searches); /* break these out */
args[PARAM_DEPTH] = depthSelGetDepth();
args[PARAM_LOCATION] = depthSelGetNewLoc();
@@ -229,5 +250,23 @@
}
+// retrieves the shelving locations
+var advLocationsLoaded = false;
+function advLoadCopyLocations(org) {
+ if(org == null)
+ org = advSelectedOrg;
+ var req = new Request(FETCH_COPY_LOCATIONS, org);
+ req.callback(advShowCopyLocations);
+ req.send();
+ advLocationsLoaded = true;
+}
+// inserts the shelving locations into the multi-select
+function advShowCopyLocations(r) {
+ var locations = r.getResultObject();
+ var sel = $('adv_copy_location_filter_select');
+ for(var i = 0; i < locations.length; i++)
+ insertSelectorVal(sel, -1, locations[i].name(), locations[i].id());
+}
+
Modified: branches/rel_1_2/Open-ILS/web/opac/skin/default/js/result_common.js
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/skin/default/js/result_common.js 2008-07-16 02:49:36 UTC (rev 10055)
+++ branches/rel_1_2/Open-ILS/web/opac/skin/default/js/result_common.js 2008-07-16 19:11:31 UTC (rev 10056)
@@ -76,6 +76,7 @@
if(getAudience()) args.audience = getAudience().split(/,/);
if(getLitForm()) args.lit_form = getLitForm().split(/,/);
if(getLanguage()) args.language = getLanguage().split(/,/);
+ if(getCopyLocs()) args.locations = getCopyLocs().split(/,/);
TERM = (TERM+'').replace(/\\/g,'');
Modified: branches/rel_1_2/Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml 2008-07-16 02:49:36 UTC (rev 10055)
+++ branches/rel_1_2/Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml 2008-07-16 19:11:31 UTC (rev 10056)
@@ -169,6 +169,14 @@
</select>
</td>
</tr>
+ <!-- copy location selector -->
+ <tr id='adv_copy_location_filter_row' class='hide_me'>
+ <td align='right'>&opac.advanced.copy_loc_filter;</td>
+ <td align='left' id='adv_copy_location_filter_td'>
+ <select size='3' id='adv_copy_location_filter_select' multiple='multiple'>
+ </select>
+ </td>
+ </tr>
</tbody>
</table>
</td>
More information about the open-ils-commits
mailing list