From 5255a3d761243fec36e0c8216f00cf1f8881ca50 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 7 Oct 2015 20:00:08 +0000 Subject: [PATCH] webstaff: teach egVolumeList more tricks The directive now accepts two new attributes: * editVolumes - controls display of the 'Edit volumes' button * editCopies - if true, adds a 'Edit volumes and copies button' Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- .../src/templates/staff/cat/share/t_volume_list.tt2 | 3 ++- .../web/js/ui/default/staff/cat/services/holdings.js | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/templates/staff/cat/share/t_volume_list.tt2 b/Open-ILS/src/templates/staff/cat/share/t_volume_list.tt2 index 56f1c0728f..1c029e0890 100644 --- a/Open-ILS/src/templates/staff/cat/share/t_volume_list.tt2 +++ b/Open-ILS/src/templates/staff/cat/share/t_volume_list.tt2 @@ -5,7 +5,8 @@ grid-controls="holdingsGridControls" persist-key="cat.record_overlay.holdings"> - + + diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js b/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js index a0806c5c53..22018128a4 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js +++ b/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js @@ -278,7 +278,9 @@ function(egCore , $q) { return { restrict: 'AE', scope: { - recordId : '=' + recordId : '=', + editVolumes : '@', + editCopies : '@' }, templateUrl: './cat/share/t_volume_list', controller: @@ -302,7 +304,7 @@ function(egCore , $q) { return cp_id_list; } - $scope.edit_volumes = function () { + $scope.edit_volumes = function (copies_too) { egCore.net.request( 'open-ils.actor', 'open-ils.actor.anon_cache.set_value', @@ -310,7 +312,7 @@ function(egCore , $q) { record_id: $scope.recordId, copies: gatherHoldingsIds(), hide_vols : false, - hide_copies : true + hide_copies : (copies_too) ? false : true } ).then(function(key) { if (key) { @@ -330,6 +332,9 @@ function(egCore , $q) { } }); } + $scope.edit_copies = function() { + $scope.edit_volumes(true); + } function load_holdings() { holdingsSvcInst.fetch({ -- 2.43.2