--- /dev/null
+<form class="form-validated" novalidate ng-submit="ok()" name="form">
+ <div>
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close"
+ ng-click="cancel()" aria-hidden="true">×</button>
+ <h4 class="modal-title">[% l('Open Circulation') %]</h4>
+ </div>
+ <div class="modal-body">
+[% |l("{{circDate | date:'shortDate'}}") %]
+There is an open circulation on the requested item.
+This copy was checked out by another patron on [_1].
+[% END %]
+ </div>
+ <div class="modal-footer">
+ <button class="btn btn-warning"
+ ng-click="cancel()">[% l('Cancel') %]</button>
+ <input type="submit" class="btn btn-primary"
+ value="[% l('Normal Checkin then Checkout') %]"/>
+ </div>
+ </div> <!-- modal-content -->
+ </div> <!-- modal-dialog -->
+</form>
}
break;
+ case 'OPEN_CIRCULATION_EXISTS':
+ openCircExistsDialog(args, evt);
+ break;
+
/* stuff to consider
PERM_FAILURE
PATRON_EXCEEDS_OVERDUE_COUNT
);
}
+ function openCircExistsDialog(coArgs, evt) {
+ $modal.open({
+ templateUrl: './circ/patron/t_circ_exists_dialog',
+ controller:
+ ['$scope','$modalInstance','openCirc',
+ function($scope , $modalInstance , openCirc) {
+ $scope.circDate = openCirc.xact_start();
+ $scope.ok = function() { $modalInstance.close() }
+ $scope.cancel = function () { $modalInstance.dismiss() }
+ }],
+ resolve : {
+ openCirc : function() {
+ return egCore.pcrud.search('circ',
+ {target_copy : evt.payload.copy.id()},
+ {order_by : {circ : 'xact_start desc' }, limit : 1}
+ );
+ }
+ }
+ }).result.then(
+ function() {
+ egCore.net.request(
+ 'open-ils.circ',
+ 'open-ils.circ.checkin',
+ egCore.auth.token(),
+ {barcode :coArgs.copy_barcode, noop : true}
+
+ ).then(function(resp) {
+
+ if (evt = egCore.evt.parse(resp)) {
+ if (evt.textcode == 'SUCCESS') {
+ performCheckout(coArgs);
+ } else {
+ alert(evt); // FIXME
+ }
+ }
+ })
+ }
+ );
+ }
+
+
function openPrecatDialog(copy_barcode) {
$modal.open({
templateUrl: './circ/patron/t_precat_dialog',