<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>
</a>
</eg-grid-field>
-
<eg-grid-field label="[% l('Acquisition Cost') %]" path="cost" hidden></eg-grid-field>
<eg-grid-field label="[% l('Age-Based Hold Protection') %]" path="age_protect" hidden></eg-grid-field>
<eg-grid-field label="[% l('Author') %]" path="call_number.record.simple_record.author" hidden></eg-grid-field>
<eg-grid-field label="[% l('TCN') %]" path="call_number.record.tcn_value" hidden></eg-grid-field>
<eg-grid-field label="[% l('TCN Source') %]" path="call_number.record.tcn_source" hidden></eg-grid-field>
<eg-grid-field label="[% l('Transaction Complete') %]" path="_circ.xact_finish" datatype="timestamp" hidden></eg-grid-field>
-</eg-grid>
+ <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 path="acp.circ_modifier.name" label="[% l('Circulation Modifier') %]"></eg-grid-field>
<eg-grid-field path="acp.circ_lib.shortname" label="[% l('Circulation Library') %]"></eg-grid-field>
<eg-grid-field path="acn.owning_lib.shortname" label="[% l('Owning Library') %]"></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();
});
}
+ $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;
// Non-cat circs don't return the full list of circs.
// Refresh the list of non-cat circs from the server.
patronSvc.getUserNonCats(patronSvc.current.id());
+ 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 : []}
flesh : 3,
flesh_fields : {
acp : ['call_number','location','status','location','floating','circ_modifier',
- 'age_protect','circ_lib'],
+ 'age_protect','circ_lib','copy_alerts'],
acn : ['record','prefix','suffix','label_class'],
bre : ['simple_record','creator','editor']
},
flatCopy._duration = copyData.circ.duration();
}
flatCopy.index = service.index++;
+ flatCopy.copy_alert_count = copy.copy_alerts().filter(function(aca) {
+ return !aca.ack_time();
+ }).length;
+
service.copies.unshift(flatCopy);
}