[open-ils-commits] [GIT] Evergreen ILS branch master updated. c3e39cf81df60b372ce42a94bda822c717fbe5d9

Evergreen Git git at git.evergreen-ils.org
Tue Oct 16 21:11:37 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  c3e39cf81df60b372ce42a94bda822c717fbe5d9 (commit)
       via  471582a3a5da21f2541ba4eaffd2f1970f63dc83 (commit)
       via  8c71fe6abc72720993a8448e39e82d2f782d274f (commit)
      from  95d400fa439135d3d42b26b9fe3c14d2ec767788 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c3e39cf81df60b372ce42a94bda822c717fbe5d9
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Mon Oct 1 15:18:19 2012 -0400

    Allow choice of default search pane
    
    Some workflows prefer numeric or expert search, so accomodate them.
    
    Also, add a "Clear All" button to clear the search prefs.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd
index ce9e816..1ef0eb3 100644
--- a/Open-ILS/web/opac/locale/en-US/lang.dtd
+++ b/Open-ILS/web/opac/locale/en-US/lang.dtd
@@ -3638,6 +3638,14 @@
 <!ENTITY staff.search_prefs.search_lib.description "The default search library setting determines what library is searched from the advanced search screen and portal page by default. Manual selection of a search library will override it. One recommendation is to set the search library to the highest point you would normally want to search.">
 <!ENTITY staff.search_prefs.pref_lib.caption "Preferred Library">
 <!ENTITY staff.search_prefs.pref_lib.description "The preferred library is used to show copies and URIs regardless of the library searched. One recommendation is to set this to your workstation library so that local copies show up first in search results.">
+<!ENTITY staff.search_prefs.adv_pane.caption "Advanced Search Default Pane">
+<!ENTITY staff.search_prefs.adv_pane.description "Advanced search has secondary panes for Numeric and MARC Expert searching. You can change which one is loaded by default when opening a new catalog window here.">
+<!ENTITY staff.search_prefs.adv_pane.advanced "Advanced (default)">
+<!ENTITY staff.search_prefs.adv_pane.numeric "Numeric">
+<!ENTITY staff.search_prefs.adv_pane.expert "MARC Expert">
 <!ENTITY staff.search_prefs.save.label "Save">
 <!ENTITY staff.search_prefs.save.accesskey "S">
 <!ENTITY staff.search_prefs.saved_message "Preferences saved">
+<!ENTITY staff.search_prefs.clear.label "Clear All">
+<!ENTITY staff.search_prefs.clear.accesskey "C">
+<!ENTITY staff.search_prefs.cleared_message "Preferences cleared">
diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
index 807f2f0..a59d44f 100644
--- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
+++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
@@ -616,6 +616,16 @@ function set_opac() {
         } else {
             content_params.url = xulG.url_prefix( 'browser', secure_opac );
         }
+        if (g.data.adv_pane) {
+            // For fun, we can have no extra params, extra params with &, or extra params with ;.
+            if (content_params.url.indexOf('?') < 0)
+                content_params.url += '?';
+            else if (content_params.url.indexOf('&') >= 0)
+                content_params.url += '&';
+            else
+                content_params.url += ';';
+            content_params.url += 'pane=' + g.data.adv_pane;
+        }
         browser_frame = bottom_pane.set_iframe( xulG.url_prefix('XUL_BROWSER?name=Catalog'), {}, content_params);
         /* // Remember to use the REMOTE_BROWSER if we ever try to move this to remote xul again
         browser_frame = bottom_pane.set_iframe( xulG.url_prefix('XUL_REMOTE_BROWSER?name=Catalog'), {}, content_params);
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/main.js b/Open-ILS/xul/staff_client/chrome/content/main/main.js
index 53d8b87..139828a 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/main.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/main.js
@@ -378,13 +378,22 @@ function main_init() {
             G.data.server_unadorned = url; G.data.stash('server_unadorned'); G.data.stash_retrieve();
             try {
                 G.data.search_lib = G.pref.getIntPref('open-ils.' + url + '.search_lib');
-                G.data.pref_lib = G.pref.getIntPref('open-ils.' + url + '.pref_lib');
             } catch(E) {
                 G.data.search_lib = null;
+            }
+            try {
+                G.data.pref_lib = G.pref.getIntPref('open-ils.' + url + '.pref_lib');
+            } catch(E) {
                 G.data.pref_lib = null;
             }
+            try {
+                G.data.adv_pane = G.pref.getCharPref('open-ils.' + url + '.adv_pane');
+            } catch(E) {
+                G.data.adv_pane = null;
+            }
             G.data.stash('search_lib');
             G.data.stash('pref_lib');
+            G.data.stash('adv_pane');
 
             if (! url.match( '^(http|https)://' ) ) { url = 'http://' + url; }
 
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/search_prefs.xul b/Open-ILS/xul/staff_client/chrome/content/main/search_prefs.xul
index c36c7eb..c4bf6f9 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/search_prefs.xul
+++ b/Open-ILS/xul/staff_client/chrome/content/main/search_prefs.xul
@@ -26,26 +26,38 @@
         var g = {};
         var search_lib_box;
         var pref_lib_box;
+        var adv_pane_box;
         var prefSvc;
         var data;
         var saved_message;
+        var cleared_message;
         function my_init() {
             JSAN.use('OpenILS.data');
             data = new OpenILS.data();
             data.init({'via':'stash'});
             search_lib_box = document.getElementById('search_lib');
             pref_lib_box = document.getElementById('pref_lib');
+            adv_pane_box = document.getElementById('adv_pane');
             // NOTE: If this ever deals with custom trees, this is where you likely want to mess with things.
             add_aou(data.tree.aou, '');
             prefSvc = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch).QueryInterface(Components.interfaces.nsIPrefBranch2);
             saved_message = document.getElementById('saved_message').textContent;
+            cleared_message = document.getElementById('cleared_message').textContent;
             if (data.search_lib) {
                 search_lib_box.value = data.search_lib;
-                pref_lib_box.value = data.pref_lib;
             } else {
                 search_lib_box.selectedIndex = 0;
+            }
+            if (data.pref_lib) {
+                pref_lib_box.value = data.pref_lib;
+            } else {
                 pref_lib_box.selectedIndex = 0;;
             }
+            if (data.adv_pane) {
+                adv_pane_box.value = data.adv_pane;
+            } else {
+                adv_pane_box.selectedIndex = 0;
+            }
         }
         function add_aou(aou, depth) {
             search_lib_box.appendItem(depth + aou.name(), aou.id(), '');
@@ -56,16 +68,32 @@
         function update_prefs() {
             prefSvc.setIntPref('open-ils.' + data.server_unadorned + '.search_lib', search_lib_box.value);
             prefSvc.setIntPref('open-ils.' + data.server_unadorned + '.pref_lib', pref_lib_box.value);
+            prefSvc.setCharPref('open-ils.' + data.server_unadorned + '.adv_pane', adv_pane_box.value);
             data.search_lib = search_lib_box.value;
             data.pref_lib = pref_lib_box.value;
+            data.adv_pane = adv_pane_box.value;
             data.stash('search_lib');
             data.stash('pref_lib');
+            data.stash('adv_pane');
             alert(saved_message);
         }
+        function clear_prefs() {
+            prefSvc.clearUserPref('open-ils.' + data.server_unadorned + '.search_lib');
+            prefSvc.clearUserPref('open-ils.' + data.server_unadorned + '.pref_lib');
+            prefSvc.clearUserPref('open-ils.' + data.server_unadorned + '.adv_pane');
+            data.search_lib = null;
+            data.pref_lib = null;
+            data.adv_pane = null;
+            data.stash('search_lib');
+            data.stash('pref_lib');
+            data.stash('adv_pane');
+            alert(cleared_message);
+        }
     ]]>
     </script>
     <commandset id="search_prefs_cmds">
         <command id="save_search_prefs" oncommand="update_prefs()" />
+        <command id="clear_search_prefs" oncommand="clear_prefs()" />
     </commandset>
     <vbox id="search_prefs_main">
         <groupbox>
@@ -84,7 +112,20 @@
                 </menupopup>
             </menulist>
         </groupbox>
+        <groupbox>
+            <caption label="&staff.search_prefs.adv_pane.caption;"/>
+            <description>&staff.search_prefs.adv_pane.description;</description>
+            <menulist id="adv_pane">
+                <menupopup>
+                    <menuitem label="&staff.search_prefs.adv_pane.advanced;" value="advanced" />
+                    <menuitem label="&staff.search_prefs.adv_pane.numeric;" value="numeric" />
+                    <menuitem label="&staff.search_prefs.adv_pane.expert;" value="expert" />
+                </menupopup>
+            </menulist>
+        </groupbox>
         <button id="save_button" command="save_search_prefs" label="&staff.search_prefs.save.label;" accesskey="&staff.search_prefs.save.accesskey;"/>
+        <button id="clear_button" command="clear_search_prefs" label="&staff.search_prefs.clear.label;" accesskey="&staff.search_prefs.clear.accesskey;"/>
     </vbox>
     <description id="saved_message" style="display:none">&staff.search_prefs.saved_message;</description>
+    <description id="cleared_message" style="display:none">&staff.search_prefs.cleared_message;</description>
 </window>

commit 471582a3a5da21f2541ba4eaffd2f1970f63dc83
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Thu Sep 20 14:49:01 2012 -0400

    Add tab name for search preferences
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js
index 3214918..e0db32e 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js
@@ -1668,7 +1668,7 @@ main.menu.prototype = {
                 ['oncommand'],
                 function() {
                     try {
-                        obj.set_tab(obj.url_prefix('XUL_SEARCH_PREFS'));
+                        obj.set_tab(obj.url_prefix('XUL_SEARCH_PREFS'),{'tab_name' : offlineStrings.getString('menu.cmd_search_prefs.tab'), 'browser' : false});
                     } catch(E) {
                         alert(E)
                     }
diff --git a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
index 5a5b0c4..39e4974 100644
--- a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
+++ b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
@@ -257,6 +257,7 @@ menu.cmd_booking_reservation_return.tab=Reservation Return
 menu.cmd_booking_pull_list.tab=Booking Pull List
 menu.cmd_booking_capture.tab=Booking Capture
 menu.cmd_authority_manage.tab=Manage Authorities
+menu.cmd_search_prefs.tab=Search Preferences
 menu.local_admin.barcode_completion.tab=Barcode Completion
 menu.local_admin.circ_matrix_matchpoint.tab=Circulation Policies
 menu.local_admin.hold_matrix_matchpoint.tab=Hold Policies

commit 8c71fe6abc72720993a8448e39e82d2f782d274f
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Thu Sep 20 14:33:41 2012 -0400

    Allow staff to pick search/pref libraries
    
    This adds a workstation-level set of settings for search and preferred
    libraries. These override the default search library and the preferred
    library individually, allowing staff to default searching at one OU but
    still get copy information for a different one.
    
    Original use case is "search everywhere, but show my local copies".
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
index 470e381..4dc5ea0 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
@@ -378,6 +378,10 @@ sub _get_search_lib {
     $loc = $self->cgi->param('loc');
     return $loc if $loc;
 
+    if ($self->apache->headers_in->get('OILS-Search-Lib')) {
+        return $self->apache->headers_in->get('OILS-Search-Lib');
+    }
+
     my $pref_lib = $self->_get_pref_lib();
     return $pref_lib if $pref_lib;
 
@@ -392,6 +396,10 @@ sub _get_pref_lib {
     my $plib = $self->cgi->param('plib');
     return $plib if $plib;
 
+    if ($self->apache->headers_in->get('OILS-Pref-Lib')) {
+        return $self->apache->headers_in->get('OILS-Pref-Lib');
+    }
+
     if ($ctx->{user}) {
         # See if the user has a search library preference
         my $lset = $self->editor->search_actor_user_setting({
diff --git a/Open-ILS/src/templates/opac/parts/pref_lib_display.tt2 b/Open-ILS/src/templates/opac/parts/pref_lib_display.tt2
index 635c766..d8c9856 100644
--- a/Open-ILS/src/templates/opac/parts/pref_lib_display.tt2
+++ b/Open-ILS/src/templates/opac/parts/pref_lib_display.tt2
@@ -1,7 +1,7 @@
 [%- IF ctx.pref_ou && ctx.pref_ou != ctx.search_ou; %]
 <span class="preflib">[%
     l('Preferred library: [_1][_2][_3]', '<b>', ctx.get_aou(ctx.pref_ou).name, '</b>');
-    %]<a href="[% mkurl(ctx.opac_root _ '/myopac/prefs_settings')
-    %]" class="preflib_change" title="[% l("Change preferred library"); %]">[% l('?') %]</a>
+    IF NOT ctx.is_staff %]<a href="[% mkurl(ctx.opac_root _ '/myopac/prefs_settings')
+    %]" class="preflib_change" title="[% l("Change preferred library"); %]">[% l('?') %]</a>[% END; %]
 </span>
 [%- END; %]
diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd
index 055f2e3..ce9e816 100644
--- a/Open-ILS/web/opac/locale/en-US/lang.dtd
+++ b/Open-ILS/web/opac/locale/en-US/lang.dtd
@@ -874,6 +874,7 @@
 <!ENTITY staff.main.menu.admin.client.hotkeys.setworkstation.accesskey "">
 <!ENTITY staff.main.menu.admin.client.hotkeys.clearworkstation.label "Clear Workstation Default">
 <!ENTITY staff.main.menu.admin.client.hotkeys.clearworkstation.accesskey "">
+<!ENTITY staff.main.menu.admin.client.search_prefs.label "Set Search Preferences">
 <!ENTITY staff.main.menu.admin.client.toolbars "Toolbars">
 <!ENTITY staff.main.menu.admin.client.toolbars.current "Current">
 <!ENTITY staff.main.menu.admin.client.toolbars.config.label "Configure Toolbars">
@@ -3633,3 +3634,10 @@
 <!ENTITY staff.item.batch.hold.cancel_btn.label "Cancel">
 <!ENTITY staff.item.batch.hold.cancel_btn.accesskey "C">
 <!ENTITY staff.item.batch.hold.failures_and_settings "The settings above may be changed for retries and overrides.">
+<!ENTITY staff.search_prefs.search_lib.caption "Default Search Library">
+<!ENTITY staff.search_prefs.search_lib.description "The default search library setting determines what library is searched from the advanced search screen and portal page by default. Manual selection of a search library will override it. One recommendation is to set the search library to the highest point you would normally want to search.">
+<!ENTITY staff.search_prefs.pref_lib.caption "Preferred Library">
+<!ENTITY staff.search_prefs.pref_lib.description "The preferred library is used to show copies and URIs regardless of the library searched. One recommendation is to set this to your workstation library so that local copies show up first in search results.">
+<!ENTITY staff.search_prefs.save.label "Save">
+<!ENTITY staff.search_prefs.save.accesskey "S">
+<!ENTITY staff.search_prefs.saved_message "Preferences saved">
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
index d3eb6e2..8ec44a8 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
@@ -522,7 +522,8 @@ var urls = {
     'ALT_HOLDS_PRINT' : 'oils://remote/opac/extras/circ/alt_holds_print.html',
     'SERIAL_PRINT_ROUTING_LIST_USERS' : 'oils://remote/eg/serial/print_routing_list_users',
     'XUL_SERIAL_BATCH_RECEIVE': 'oils://remote/xul/server/serial/batch_receive.xul',
-    'EG_TRIGGER_EVENTS' : 'oils://remote/eg/actor/user/event_log'
+    'EG_TRIGGER_EVENTS' : 'oils://remote/eg/actor/user/event_log',
+    'XUL_SEARCH_PREFS' : 'chrome://open_ils_staff_client/content/main/search_prefs.xul'
 }
 
 if(use_tpac) {
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/main.js b/Open-ILS/xul/staff_client/chrome/content/main/main.js
index c131bbe..53d8b87 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/main.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/main.js
@@ -376,6 +376,15 @@ function main_init() {
             var url = G.auth.controller.view.server_prompt.value.match(/^[^\/]*/).toString() || urls.remote;
 
             G.data.server_unadorned = url; G.data.stash('server_unadorned'); G.data.stash_retrieve();
+            try {
+                G.data.search_lib = G.pref.getIntPref('open-ils.' + url + '.search_lib');
+                G.data.pref_lib = G.pref.getIntPref('open-ils.' + url + '.pref_lib');
+            } catch(E) {
+                G.data.search_lib = null;
+                G.data.pref_lib = null;
+            }
+            G.data.stash('search_lib');
+            G.data.stash('pref_lib');
 
             if (! url.match( '^(http|https)://' ) ) { url = 'http://' + url; }
 
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js
index 55a3682..3214918 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js
@@ -1664,6 +1664,16 @@ main.menu.prototype = {
                     xulG.pref.setBoolPref('oils.copy_editor.copy_location_name_first', !curvalue);
                 }
             ],
+            'cmd_search_prefs' : [
+                ['oncommand'],
+                function() {
+                    try {
+                        obj.set_tab(obj.url_prefix('XUL_SEARCH_PREFS'));
+                    } catch(E) {
+                        alert(E)
+                    }
+                }
+            ],
         };
 
         JSAN.use('util.controller');
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
index 70128a9..58caf07 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
+++ b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
@@ -282,6 +282,7 @@
              perm="DEBUG_CLIENT"
              />
     <command id="cmd_copy_editor_copy_location_first_toggle" />
+    <command id="cmd_search_prefs" />
 </commandset>
 
 <!-- The File menu on the main menu -->
@@ -448,6 +449,7 @@
                 <menuitem label="&staff.server.admin.index.printer;" command="cmd_local_admin_printer"/>
                 <menuitem label="&staff.main.menu.admin.template_edit.label;" accesskey="&staff.main.menu.admin.template_edit.accesskey;" command="cmd_print_list_template_edit"/>
                 <menuitem label="&staff.server.admin.index.fonts_and_sounds;" command="cmd_local_admin_fonts_and_sounds"/>
+                <menuitem label="&staff.main.menu.admin.client.search_prefs.label;" command="cmd_search_prefs"/>
                 <menuitem type="checkbox" label="&staff.main.menu.admin.client.copy_editor.copy_location.label;" command="cmd_copy_editor_copy_location_first_toggle"/>
                 <menu id="main.menu.admin.client.hotkeys" label="&staff.main.menu.admin.client.hotkeys;">
                     <menupopup id="main.menu.admin.client.hotkeys.popup">
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/search_prefs.xul b/Open-ILS/xul/staff_client/chrome/content/main/search_prefs.xul
new file mode 100644
index 0000000..c36c7eb
--- /dev/null
+++ b/Open-ILS/xul/staff_client/chrome/content/main/search_prefs.xul
@@ -0,0 +1,90 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: Workstation level search preferences -->
+<!--
+ vim:noet:sw=4:ts=4:
+-->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
+
+<!DOCTYPE window SYSTEM "chrome://open_ils_staff_client/locale/lang.dtd">
+
+<?xul-overlay href="chrome://open_ils_staff_client/content/OpenILS/util_overlay_chrome.xul"?>
+
+<window id="search_prefs_diag" 
+    onload="try { my_init(); } catch(E) { alert(E); }"
+    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+    <script type="text/javascript">
+        var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true;
+    </script>
+    <scripts id="openils_util_scripts"/>
+    <script type="text/javascript" src="JSAN.js"/>
+
+    <script>
+    <![CDATA[
+        var g = {};
+        var search_lib_box;
+        var pref_lib_box;
+        var prefSvc;
+        var data;
+        var saved_message;
+        function my_init() {
+            JSAN.use('OpenILS.data');
+            data = new OpenILS.data();
+            data.init({'via':'stash'});
+            search_lib_box = document.getElementById('search_lib');
+            pref_lib_box = document.getElementById('pref_lib');
+            // NOTE: If this ever deals with custom trees, this is where you likely want to mess with things.
+            add_aou(data.tree.aou, '');
+            prefSvc = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch).QueryInterface(Components.interfaces.nsIPrefBranch2);
+            saved_message = document.getElementById('saved_message').textContent;
+            if (data.search_lib) {
+                search_lib_box.value = data.search_lib;
+                pref_lib_box.value = data.pref_lib;
+            } else {
+                search_lib_box.selectedIndex = 0;
+                pref_lib_box.selectedIndex = 0;;
+            }
+        }
+        function add_aou(aou, depth) {
+            search_lib_box.appendItem(depth + aou.name(), aou.id(), '');
+            pref_lib_box.appendItem(depth + aou.name(), aou.id(), '');
+            for(var i = 0; i < aou.children().length; i++)
+                add_aou(aou.children()[i], depth + '  ');
+        }
+        function update_prefs() {
+            prefSvc.setIntPref('open-ils.' + data.server_unadorned + '.search_lib', search_lib_box.value);
+            prefSvc.setIntPref('open-ils.' + data.server_unadorned + '.pref_lib', pref_lib_box.value);
+            data.search_lib = search_lib_box.value;
+            data.pref_lib = pref_lib_box.value;
+            data.stash('search_lib');
+            data.stash('pref_lib');
+            alert(saved_message);
+        }
+    ]]>
+    </script>
+    <commandset id="search_prefs_cmds">
+        <command id="save_search_prefs" oncommand="update_prefs()" />
+    </commandset>
+    <vbox id="search_prefs_main">
+        <groupbox>
+            <caption label="&staff.search_prefs.search_lib.caption;"/>
+            <description>&staff.search_prefs.search_lib.description;</description>
+            <menulist id="search_lib">
+                <menupopup>
+                </menupopup>
+            </menulist>
+        </groupbox>
+        <groupbox>
+            <caption label="&staff.search_prefs.pref_lib.caption;"/>
+            <description>&staff.search_prefs.pref_lib.description;</description>
+            <menulist id="pref_lib">
+                <menupopup>
+                </menupopup>
+            </menulist>
+        </groupbox>
+        <button id="save_button" command="save_search_prefs" label="&staff.search_prefs.save.label;" accesskey="&staff.search_prefs.save.accesskey;"/>
+    </vbox>
+    <description id="saved_message" style="display:none">&staff.search_prefs.saved_message;</description>
+</window>
diff --git a/Open-ILS/xul/staff_client/components/oils_protocol.js b/Open-ILS/xul/staff_client/components/oils_protocol.js
index d986aa8..27a2356 100644
--- a/Open-ILS/xul/staff_client/components/oils_protocol.js
+++ b/Open-ILS/xul/staff_client/components/oils_protocol.js
@@ -192,9 +192,9 @@ oilsProtocol.prototype = {
     newChannel: function(aURI) {
         var ios = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
         var host;
+        var data_cache = Components.classes["@open-ils.org/openils_data_cache;1"].getService().wrappedJSObject.data;
         switch(aURI.host) {
             case 'remote':
-                var data_cache = Components.classes["@open-ils.org/openils_data_cache;1"].getService().wrappedJSObject.data;
                 host = data_cache.server_unadorned;
                 break;
             case 'selfcheck':
@@ -208,7 +208,12 @@ oilsProtocol.prototype = {
             return ios.newChannel("about:blank", null, null); // Bad input. Not really sure what to do. Returning a dummy channel does prevent a crash, though!
         var chunk = aURI.spec.replace(/^oils:\/\/[^\/]*\//,'');
         var channel = ios.newChannel("https://" + host + "/" + chunk, null, null).QueryInterface(Components.interfaces.nsIHttpChannel);
-        channel.QueryInterface(Components.interfaces.nsIHttpChannel).setRequestHeader("OILS-Wrapper", "true", false);
+        channel.setRequestHeader("OILS-Wrapper", "true", false);
+        // If we have a search/pref lib, set them too!
+        if (data_cache.search_lib && data_cache.search_lib != null)
+            channel.setRequestHeader("OILS-Search-Lib", data_cache.search_lib, false);
+        if (data_cache.pref_lib && data_cache.pref_lib != null)
+            channel.setRequestHeader("OILS-Pref-Lib", data_cache.pref_lib, false);
         if(this._system_principal == null) {
             // We don't have the owner?
             var chrome_service = Components.classesByID['{61ba33c0-3031-11d3-8cd0-0060b0fc14a3}'].getService().QueryInterface(Components.interfaces.nsIProtocolHandler);

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm   |    8 ++
 .../src/templates/opac/parts/pref_lib_display.tt2  |    4 +-
 Open-ILS/web/opac/locale/en-US/lang.dtd            |   16 +++
 .../xul/staff_client/chrome/content/cat/opac.js    |   10 ++
 .../staff_client/chrome/content/main/constants.js  |    3 +-
 .../xul/staff_client/chrome/content/main/main.js   |   18 +++
 .../xul/staff_client/chrome/content/main/menu.js   |   10 ++
 .../chrome/content/main/menu_frame_menus.xul       |    2 +
 .../chrome/content/main/search_prefs.xul           |  131 ++++++++++++++++++++
 .../chrome/locale/en-US/offline.properties         |    1 +
 .../xul/staff_client/components/oils_protocol.js   |    9 +-
 11 files changed, 207 insertions(+), 5 deletions(-)
 create mode 100644 Open-ILS/xul/staff_client/chrome/content/main/search_prefs.xul


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list