# avoid duplicate lookups
return $ctx->{search_ou} if $ctx->{search_ou};
+ #If this is a staff client, and we are loading a menu search then we are starting a new query with
+ #the intention of resetting the search lib to the pref lib, so return the Preferred Search Library
+ #from the workstation, which is passed as the value of the OILS-Search-Lib header.
+
+ if (($ctx->{is_staff}) and (defined $self->cgi->param('menu_search'))) {
+ if ($self->apache->headers_in->get('OILS-Search-Lib')) {
+ return $self->apache->headers_in->get('OILS-Search-Lib');
+ }
+ }
+
my $loc = $ctx->{copy_location_group_org};
return $loc if $loc;
<td colspan="5" class="expert-search-row">
<label for="[% lib_select_id %]"><strong>[% l("Search Library:") %]</strong>
[%- PROCESS "opac/parts/org_selector.tt2";
- INCLUDE build_org_selector id=lib_select_id show_loc_groups=1
+ INCLUDE build_org_selector value=ctx.search_ou id=lib_select_id show_loc_groups=1
%]
</label>
</td>
[%- lib_select_id="numeric_search_library" -%]
<label for="[% lib_select_id %]"><strong>[% l("Search Library:") %]</strong>
[% PROCESS "opac/parts/org_selector.tt2";
- INCLUDE build_org_selector id=lib_select_id show_loc_groups=1
+ INCLUDE build_org_selector value=ctx.search_ou id=lib_select_id show_loc_groups=1
%]
</label>
<br/>
[%-
l('Type: ');
INCLUDE "opac/parts/qtype_selector.tt2" id="qtype";
+ lib_select_id="basic_search_library";
-%]
</label>
<label id="search_itype_label" for="search_itype_selector">
[%-
l('Library: ');
select_lib_label = l("Select search library");
- INCLUDE build_org_selector arialabel=select_lib_label
- id='search_org_selector' show_loc_groups=1
+ INCLUDE build_org_selector value=ctx.search_ou id=lib_select_id show_loc_groups=1
-%]
</label>
<span>
top_pane = new util.deck('top_pane');
bottom_pane = new util.deck('bottom_pane');
- set_opac();
+ var menu_search = g.cgi.param('menu_search') ? true : false;
+
+ set_opac(menu_search);
} catch(E) {
var err_msg = document.getElementById("offlineStrings").getFormattedString("common.exception", ["cat/opac.xul", E]);
}
}
-function set_opac() {
+function set_opac(menu_search) {
g.view = 'opac';
+
try {
var content_params = {
'show_nav_buttons' : true,
content_params.url += ';';
content_params.url += 'pane=' + g.data.adv_pane;
}
+
+ if (menu_search) {
+ 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 += 'menu_search=1';
+ }
+
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);
['oncommand'],
function(event) {
obj.data.stash_retrieve();
- var content_params = { 'session' : ses(), 'authtime' : ses('authtime') };
+ var content_params = { 'session' : ses(), 'authtime' : ses('authtime'), 'menu_search' : true };
obj.command_tab(event,obj.url_prefix('XUL_OPAC_WRAPPER'), {'tab_name':offlineStrings.getString('menu.cmd_search_opac.tab')}, content_params);
}
],
'command_tab' : function(event,url,params,content_params) {
var newTab = false;
var myEvent = event;
+
+ if (content_params.menu_search) {
+ url = url + '?menu_search=1';
+ }
+
if(event && event.sourceEvent) myEvent = event.sourceEvent;
// Note: The last event is not supposed to be myEvent in this if.
if(myEvent && myEvent.explicitOriginalTarget.nodeName.match(/toolbarbutton/) && myEvent.explicitOriginalTarget.command == event.originalTarget.id) {