<eg-grid-field label="[% l('Holdable') %]" datatype="bool" path="holdable"></eg-grid-field>
<eg-grid-field label="[% l('Age-based Hold Protection') %]" path="age_protect.name"></eg-grid-field>
<eg-grid-field label="[% l('Reference') %]" datatype="bool" path="ref"></eg-grid-field>
+ <eg-grid-field label="[% l('Alerts') %]" path="copy_alert_count" handlers="gridCellHandlers" visible compiled>
+ {{item['copy_alert_count']}}
+ <button class="btn btn-sm btn-default" ng-click="col.handlers.copyAlertsEdit(item['id'])">[% l('Manage') %]</button>
+ </eg-grid-field>
</eg-grid>
</div>
{{item['call_number.record.simple_record.title']}} <span ng-show="item['call_number.record.id']" class="glyphicon glyphicon-new-window"/>
</a>
</eg-grid-field>
+
+ <eg-grid-field label="[% l('Alerts') %]" path="copy_alert_count" handlers="gridCellHandlers" visible compiled>
+ {{item['copy_alert_count']}}
+ <button class="btn btn-sm btn-default" ng-click="col.handlers.copyAlertsEdit(item['id'])">[% l('Manage') %]</button>
+ </eg-grid-field>
+
</eg-grid>
<div class="flex-row pad-vert">
<eg-grid-field label="[% l('Author') %]"
path="author" hidden></eg-grid-field>
+ <eg-grid-field label="[% l('Alerts') %]" path="copy_alert_count" handlers="gridCellHandlers" visible compiled>
+ {{item['copy_alert_count']}}
+ <button class="btn btn-sm btn-default" ng-click="col.handlers.copyAlertsEdit(item['acp'].id())">[% l('Manage') %]</button>
+ </eg-grid-field>
+
<eg-grid-field path="circ.*" parent-idl-class="circ" hidden></eg-grid-field>
<eg-grid-field path="acp.*" parent-idl-class="acp" hidden></eg-grid-field>
<eg-grid-field path="acn.*" parent-idl-class="acn" hidden></eg-grid-field>
});
}
+ $scope.gridCellHandlers = {};
+ $scope.gridCellHandlers.copyAlertsEdit = function(id) {
+ egCirc.manage_copy_alerts([id]).then(function() {
+ // update grid items?
+ });
+ };
+
$scope.transferItems = function (){
var xfer_target = egCore.hatch.getLocalItem('eg.cat.item_transfer_target');
var copy_ids = gatherSelectedHoldingsIds();
service.flesh = {
flesh : 3,
flesh_fields : {
- acp : ['call_number','location','status','location','floating','circ_modifier','age_protect'],
+ acp : ['call_number','location','status','location','floating','circ_modifier','age_protect','copy_alerts'],
acn : ['record','prefix','suffix'],
bre : ['simple_record','creator','editor']
},
if (!flatCopy) {
flatCopy = egCore.idl.toHash(copy, true);
flatCopy.index = service.index++;
+ flatCopy.copy_alert_count = copy.copy_alerts().filter(function(aca) {
+ return !aca.ack_time();
+ }).length;
+
service.copies.unshift(flatCopy);
}
});
}
+ $scope.gridCellHandlers = {};
+ $scope.gridCellHandlers.copyAlertsEdit = function(id) {
+ egCirc.manage_copy_alerts([id]).then(function() {
+ // update grid items?
+ });
+ };
+
$scope.showBibHolds = function () {
angular.forEach(gatherSelectedRecordIds(), function (r) {
var url = egCore.env.basePath + 'cat/catalog/record/' + r + '/holds';
service.prototype.flesh = {
flesh : 2,
flesh_fields : {
- acp : ['status','location','circ_lib','parts','age_protect'],
+ acp : ['status','location','circ_lib','parts','age_protect','copy_alerts'],
acn : ['prefix','suffix','copies']
}
}
}
});
+ // create virtual field for copy alert count
+ angular.forEach(svc.copies, function (cp) {
+ cp.copy_alert_count = cp.copy_alerts.length;
+ });
+
// create a label using just the unique part of the owner list
var index = 0;
var prev_owner_list;
row_item.noncat_count = params.noncat_count;
row_item.circ = new egCore.idl.circ();
row_item.circ.due_date(co_resp.evt.payload.noncat_circ.duedate());
+ row_item.copy_alert_count = 0;
+ } else {
+ row_item.copy_alert_count = 0;
+ egCore.pcrud.search(
+ 'aca',
+ { copy : co_resp.data.acp.id(), ack_time : null },
+ null,
+ { atomic : true }
+ ).then(function(list) {
+ row_item.copy_alert_count = list.length;
+ });
}
}
});
}
+ $scope.gridCellHandlers = {};
+ $scope.gridCellHandlers.copyAlertsEdit = function(id) {
+ egCirc.manage_copy_alerts([id]).then(function() {
+ // update grid items?
+ });
+ };
+
$scope.print_receipt = function() {
var print_data = {circulations : []}