From b640c3372a451c16ba7b6a0b01545f17b1d81439 Mon Sep 17 00:00:00 2001
From: Victoria Lewis
+
+
[%
IF adv_chunk.adv_special;
SWITCH adv_chunk.adv_special;
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 9fe7d9cecf..7c3aa616b9 100644
--- a/Open-ILS/src/templates/opac/parts/pref_lib_display.tt2
+++ b/Open-ILS/src/templates/opac/parts/pref_lib_display.tt2
@@ -1,6 +1,6 @@
-[%- IF ctx.pref_ou && ctx.pref_ou != ctx.search_ou; %]
-[%
- l('Preferred library: [_1]', '' _ ctx.get_aou(ctx.pref_ou).name _ '');
+[%- IF ctx.pref_ou && ctx.pref_ou != ctx.search_ou; ctx.pref_ou = CGI.cookie('pplib')%]
+ [%
+ l('Preferred library: [_1]','' _ ctx.get_aou(ctx.pref_ou).name _ '');
IF NOT ctx.is_staff %][% l('?') %][% END; %]
diff --git a/Open-ILS/src/templates/staff/admin/workstation/index.tt2 b/Open-ILS/src/templates/staff/admin/workstation/index.tt2
index 0512483109..46ed053ea7 100644
--- a/Open-ILS/src/templates/staff/admin/workstation/index.tt2
+++ b/Open-ILS/src/templates/staff/admin/workstation/index.tt2
@@ -15,6 +15,7 @@ angular.module('egCoreMod').run(['egStrings', function(s) {
'[% l('Delete content for key "[_1]"?', '{{deleteKey}}') %]';
s.DEFAULT_WS_LABEL = '[% l('[_1] (Default)', '{{ws}}') %]';
s.DEFAULT_ORG_LABEL = '[% l( '[_1] {{org}}') %]';
+ s.DEFAULT_PREF_ORG_LABEL = '[% l( '[_1] {{org}}') %]';
s.WS_EXISTS = '[% l("Workstation name already exists. Use it anyway?") %]';
}]);
diff --git a/Open-ILS/src/templates/staff/admin/workstation/t_search_prefs.tt2 b/Open-ILS/src/templates/staff/admin/workstation/t_search_prefs.tt2
index cde8e6811b..5b1c12a433 100644
--- a/Open-ILS/src/templates/staff/admin/workstation/t_search_prefs.tt2
+++ b/Open-ILS/src/templates/staff/admin/workstation/t_search_prefs.tt2
@@ -41,8 +41,7 @@
-
-
[% l('Record Buckets') %]
diff --git a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
index 34142519b9..5b38f1979f 100644
--- a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
+++ b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
@@ -192,6 +192,22 @@ function($scope , $window , $location, egCore, egOrg, egConfirmDialog, egAuth) {
}
});
+ egCore.hatch.getItem('eg.pref.lib.default')
+ .then(function(def) {
+ if (def == undefined) {
+ egCore.hatch.setItem(
+ 'eg.pref.lib.default', $scope.orgList[0]);
+ def = $scope.orgList[0].shortname;
+ }
+ //This lets our dropdown auto-select our default preferred lib.
+ $scope.selectedPrefOrg = def;
+ angular.forEach($scope.orgList, function(val, key) {
+ if(JSON.stringify(def.shortname) == JSON.stringify(val.shortname)){
+ $scope.selectedPrefOrg = val.shortname;
+ }
+ });
+ });
+
egCore.hatch.getItem('eg.search.lib.default')
.then(function(def) {
if (def == undefined) {
@@ -213,12 +229,28 @@ function($scope , $window , $location, egCore, egOrg, egConfirmDialog, egAuth) {
egCore.strings.$replace(egCore.strings.DEFAULT_ORG_LABEL, {org:org}) :org;
}
- $scope.setDefaultSearchLib = function() {
+ $scope.getPrefOrgLabel = function(org) {
+ return org == $scope.defaultPrefLib?
+ egCore.strings.$replace(egCore.strings.DEFAULT_PREF_ORG_LABEL, {pref:org}) :org;
+ }
+
+ $scope.setDefaultLibs = function() {
+ setDefaultSearchLib();
+ setDefaultPrefLib();
+ }
+
+ function setDefaultSearchLib() {
egCore.hatch.setItem(
'eg.search.lib.default', JSON.parse($scope.selectedOrg))
.then(function() { $scope.defaultSearchLib = $scope.selectedOrg });
}
+ function setDefaultPrefLib() {
+ egCore.hatch.setItem(
+ 'eg.pref.lib.default', JSON.parse($scope.selectedPrefOrg))
+ .then(function() { $scope.defaultPrefLib = $scope.selectedPrefOrg });
+ }
+
// ---------------------
// Hatch Configs
$scope.hatchURL = egCore.hatch.hatchURL();
@@ -235,7 +267,6 @@ function($scope , $window , $location, egCore, egOrg, egConfirmDialog, egAuth) {
'eg.hatch.url', $scope.hatchURL);
}
-
}])
.controller('PrintConfigCtrl',
diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
index 6593210851..0f356b55bf 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
@@ -263,10 +263,16 @@ function($scope , $routeParams , $location , $q , egCore , egHolds,
var default_search_library = egCore.hatch.getLocalItem('eg.search.lib.default');
var url = $location.absUrl().replace(/\/staff.*/, '/opac/advanced');
+ var preferred_search_library = egCore.hatch.getLocalItem('eg.pref.lib.default');
if (default_search_library.id) {
url += '?locg=' + default_search_library.id;
}
+
+ if (preferred_search_library.id) {
+ url += '&plib=' + preferred_search_library.id;
+ }
+
// A record ID in the path indicates a request for the record-
// specific page.
if ($routeParams.record_id) {
--
2.11.0