From 9a0705241adb554fd33788056b6395ced99b5144 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 19 Jan 2015 21:48:10 -0500 Subject: [PATCH] LP#1402797 Implement "set bottom view as default" Signed-off-by: Mike Rylander Signed-off-by: Bill Erickson --- .../src/templates/staff/cat/catalog/t_catalog.tt2 | 2 ++ Open-ILS/web/js/ui/default/staff/cat/catalog/app.js | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2 b/Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2 index 8953bb7222..29a6eb69f8 100644 --- a/Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2 +++ b/Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2 @@ -31,6 +31,8 @@ [% l('Mark as Title Hold Transfer Destination') %]
  • [% l('Transfer All Title Holds') %]
  • +
  • + [% l('Set bottom view as default') %]
  • 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 f41a3fe515..181a9ffcc5 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 @@ -148,6 +148,14 @@ function($scope , $routeParams , $location , $q , egCore , egHolds, } else { delete $scope.record_id; } + + if ($scope.record_id) { + var default_tab = egCore.hatch.getLocalItem( 'eg.cat.default_record_tab' ); + tab = $routeParams.record_tab || default_tab || 'catalog'; + } else { + tab = $routeParams.record_tab || 'catalog'; + } + $scope.set_record_tab(tab); } // xulG catalog handlers @@ -281,7 +289,18 @@ function($scope , $routeParams , $location , $q , egCore , egHolds, } } - var tab = $routeParams.record_tab || 'catalog'; + $scope.set_default_record_tab = function() { + egCore.hatch.setLocalItem( + 'eg.cat.default_record_tab', $scope.record_tab); + } + + var tab; + if ($scope.record_id) { + var default_tab = egCore.hatch.getLocalItem( 'eg.cat.default_record_tab' ); + tab = $routeParams.record_tab || default_tab || 'catalog'; + } else { + tab = $routeParams.record_tab || 'catalog'; + } $scope.set_record_tab(tab); }]) -- 2.11.0