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 <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
grid-controls="holdingsGridControls"
persist-key="cat.record_overlay.holdings">
- <eg-grid-menu-item handler="edit_volumes" label="[% l('Edit volumes') %]" />
+ <eg-grid-menu-item handler="edit_volumes" label="[% l('Edit volumes') %]" ng-if="editVolumes"></eg-grid-menu-item>
+ <eg-grid-menu-item handler="edit_copies" label="[% l('Edit volumes and copies') %]" ng-if="editCopies"></eg-grid-menu-item>
<eg-grid-field label="[% l('Owning Library') %]" path="owner_label" flex="4" align="right" visible></eg-grid-field>
<eg-grid-field label="[% l('Call Number') %]" path="call_number.label" visible></eg-grid-field>
return {
restrict: 'AE',
scope: {
- recordId : '='
+ recordId : '=',
+ editVolumes : '@',
+ editCopies : '@'
},
templateUrl: './cat/share/t_volume_list',
controller:
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',
record_id: $scope.recordId,
copies: gatherHoldingsIds(),
hide_vols : false,
- hide_copies : true
+ hide_copies : (copies_too) ? false : true
}
).then(function(key) {
if (key) {
}
});
}
+ $scope.edit_copies = function() {
+ $scope.edit_volumes(true);
+ }
function load_holdings() {
holdingsSvcInst.fetch({