if ($self->apache->headers_in->get('OILS-Search-Lib')) {
return $self->apache->headers_in->get('OILS-Search-Lib');
}
+ if ($self->cgi->cookie('eg_search_lib')) {
+ return $self->cgi->cookie('eg_search_lib');
+ }
my $pref_lib = $self->_get_pref_lib();
return $pref_lib if $pref_lib;
if ($self->apache->headers_in->get('OILS-Pref-Lib')) {
return $self->apache->headers_in->get('OILS-Pref-Lib');
}
+ if ($self->cgi->cookie('eg_pref_lib')) {
+ return $self->cgi->cookie('eg_pref_lib');
+ }
if ($ctx->{user}) {
# See if the user has a search library preference
</div>
<div class="row new-entry">
+ <div class="col-md-4">
+ <label for="search_lib_selector">[% ('Default Search Library') %]</label>
+ <p>[% l('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.') %]</p>
+ </div>
+ <div class="col-md-2">
+ <eg-org-selector id="search_lib_selector"
+ selected="search_lib"
+ onchange="handle_search_lib_changed">
+ </eg-org-selector>
+ </div>
+ </div>
+
+ <div class="row new-entry">
+ <div class="col-md-4">
+ <label for="pref_lib_selector">[% ('Preferred Library') %]</label>
+ <p>[% l('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.') %]</p>
+ </div>
+ <div class="col-md-2">
+ <eg-org-selector id="pref_lib_selector"
+ selected="pref_lib"
+ onchange="handle_pref_lib_changed">
+ </eg-org-selector>
+ </div>
+ </div>
+
+ <div class="row new-entry">
+ <div class="col-md-4">
+ <label for="adv_pane_selector">[% ('Advanced Search Default Pane') %]</label>
+ <p>[% l('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.') %]</p>
+ </div>
+ <div class="col-md-2">
+ <select id="adv_pane_selector" ng-model="adv_pane">
+ <option value="advanced">[% l('Advanced (default)') %]</option>
+ <option value="numeric" >[% l('Numeric') %]</option>
+ <option value="expert" >[% l('MARC Expert') %]</option>
+ </select>
+ </div>
+ </div>
+
+ <div class="row new-entry">
<div class="col-md-6">
<span class="glyphicon glyphicon-pushpin"></span>
<a target="_self" href="./admin/workstation/workstations">
$scope.disable_sound = val;
});
+ egCore.hatch.getItem('eg.search.search_lib').then(function(val) {
+ $scope.search_lib = egCore.org.get(val);
+ });
+ $scope.handle_search_lib_changed = function(org) {
+ egCore.hatch.setItem('eg.search.search_lib', org.id());
+ };
+
+ egCore.hatch.getItem('eg.search.pref_lib').then(function(val) {
+ $scope.pref_lib = egCore.org.get(val);
+ });
+ $scope.handle_pref_lib_changed = function(org) {
+ egCore.hatch.setItem('eg.search.pref_lib', org.id());
+ };
+
+ $scope.adv_pane = 'advanced'; // default value if not explicitly set
+ egCore.hatch.getItem('eg.search.adv_pane').then(function(val) {
+ $scope.adv_pane = val;
+ });
+ $scope.$watch('adv_pane', function(newVal, oldVal) {
+ if (newVal != oldVal) {
+ egCore.hatch.setItem('eg.search.adv_pane', newVal);
+ }
+ });
+
$scope.apply_sound = function() {
if ($scope.disable_sound) {
egCore.hatch.setItem('eg.audio.disable', true);
.controller('CatalogCtrl',
['$scope','$routeParams','$location','$window','$q','egCore','egHolds','egCirc','egConfirmDialog','ngToast',
'egGridDataProvider','egHoldGridActions','$timeout','$uibModal','holdingsSvc','egUser','conjoinedSvc',
+ '$cookies',
function($scope , $routeParams , $location , $window , $q , egCore , egHolds , egCirc , egConfirmDialog , ngToast ,
- egGridDataProvider , egHoldGridActions , $timeout , $uibModal , holdingsSvc , egUser , conjoinedSvc) {
+ egGridDataProvider , egHoldGridActions , $timeout , $uibModal , holdingsSvc , egUser , conjoinedSvc,
+ $cookies
+) {
var holdingsSvcInst = new holdingsSvc();
if ($routeParams.record_id) $scope.from_route = true;
else $scope.from_route = false;
+ // set search and preferred library cookies
+ egCore.hatch.getItem('eg.search.search_lib').then(function(val) {
+ $cookies.put('eg_search_lib', val, { path : '/' });
+ });
+ egCore.hatch.getItem('eg.search.pref_lib').then(function(val) {
+ $cookies.put('eg_pref_lib', val, { path : '/' });
+ });
+
// will hold a ref to the opac iframe
$scope.opac_iframe = null;
$scope.parts_iframe = null;
});
}
+ // if we're displaying the advanced search form, select
+ // whatever default pane the user has chosen via workstation
+ // preference
+ if (url.match(/\/opac\/advanced$/)) {
+ var adv_pane = egCore.hatch.getLocalItem('eg.search.adv_pane');
+ if (adv_pane) {
+ url += '?pane=' + encodeURIComponent(adv_pane);
+ }
+ }
+
$scope.catalog_url = url;
}