[open-ils-commits] r9863 - in trunk/Open-ILS/web/opac: 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 Jun 18 23:03:53 EDT 2008
Author: erickson
Date: 2008-06-18 23:03:52 -0400 (Wed, 18 Jun 2008)
New Revision: 9863
Modified:
trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
trunk/Open-ILS/web/opac/skin/default/css/layout.css
trunk/Open-ILS/web/opac/skin/default/js/adv_global.js
trunk/Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml
Log:
UI component for selecting copy locations to filter on. todo: plugging in cgi params and middle-layer work
Modified: trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-06-19 02:25:38 UTC (rev 9862)
+++ trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-06-19 03:03:52 UTC (rev 9863)
@@ -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 "Filter by Shelving Location">
<!-- ==========================================================
MARC expert search
Modified: trunk/Open-ILS/web/opac/skin/default/css/layout.css
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/css/layout.css 2008-06-19 02:25:38 UTC (rev 9862)
+++ trunk/Open-ILS/web/opac/skin/default/css/layout.css 2008-06-19 03:03:52 UTC (rev 9863)
@@ -248,3 +248,5 @@
#myopac_holds_thaw_date_form {padding: 10px; text-align: center;}
#myopac_holds_freeze_select_thaw {margin-right: 100px; margin-left: 100px; }
+#adv_copy_location_filter_td { text-align:center; }
+#adv_copy_location_filter_div { padding:5px; margin:5px; }
Modified: trunk/Open-ILS/web/opac/skin/default/js/adv_global.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/adv_global.js 2008-06-19 02:25:38 UTC (rev 9862)
+++ trunk/Open-ILS/web/opac/skin/default/js/adv_global.js 2008-06-19 03:03:52 UTC (rev 9863)
@@ -1,7 +1,9 @@
attachEvt("common", "run", advgInit);
+attachEvt("common", "locationChanged", advSyncCopyLocLink );
var COOKIE_NOGROUP_RECORDS = 'grpt';
+var advSelectedOrg = null;
function advgInit() {
@@ -48,8 +50,26 @@
$('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'));
+ if(!$('adv_copy_location_filter_div').className.match(/hide_me/))
+ advLoadCopyLocations(org);
+ } else {
+ hideMe($('adv_copy_location_filter_row'));
+ }
+
+}
+
function initSearchBoxes() {
/* loads the compiled search from the search cookie
and sets the widgets accordingly */
@@ -234,5 +254,34 @@
}
+// retrieves the shelving locations
+var advLocationsLoaded = false;
+function advLoadCopyLocations(org) {
+ if(advLocationsLoaded) {
+ removeChildren($('adv_copy_location_filter_select'));
+ hideMe($('adv_copy_location_filter_div'));
+ advLocationsLoaded = false;
+ return;
+ }
+ if(org == null) {
+ if(advSelectedOrg == null)
+ org = getLocation();
+ else
+ org = advSelectedOrg;
+ }
+ unHideMe($('adv_copy_location_filter_div'));
+ 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: trunk/Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml 2008-06-19 02:25:38 UTC (rev 9862)
+++ trunk/Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml 2008-06-19 03:03:52 UTC (rev 9863)
@@ -260,6 +260,15 @@
</table>
</td>
</tr>
+ <tr id='adv_copy_location_filter_row' class='hide_me'>
+ <td id='adv_copy_location_filter_td' colspan='2'>
+ <a class='classic_link' href='javascript:advLoadCopyLocations();'>&opac.advanced.copy_loc_filter;</a>
+ <div id='adv_copy_location_filter_div' class='hide_me'>
+ <select id='adv_copy_location_filter_select' multiple='multiple'>
+ </select>
+ </div>
+ </td>
+ </tr>
</table>
</td>
More information about the open-ils-commits
mailing list