From: Galen Charlton Date: Wed, 7 Oct 2015 20:00:08 +0000 (+0000) Subject: webstaff: teach egVolumeList more tricks X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5255a3d761243fec36e0c8216f00cf1f8881ca50;p=evergreen%2Fmasslnc.git 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 --- 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({