From: Bill Erickson Date: Fri, 9 May 2014 20:39:48 +0000 (-0400) Subject: open circ exists handler for checkout X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=14c40c4dc4219025b6ee34dddbf61fb9e42127db;p=working%2FEvergreen.git open circ exists handler for checkout Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/circ/patron/t_circ_exists_dialog.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_circ_exists_dialog.tt2 new file mode 100644 index 0000000000..b687325512 --- /dev/null +++ b/Open-ILS/src/templates/staff/circ/patron/t_circ_exists_dialog.tt2 @@ -0,0 +1,23 @@ +
+
+ +
+
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js index c5194dad2c..5828706b7b 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js @@ -147,6 +147,10 @@ function($scope, $q, $modal, $routeParams, egCore, egUser, patronSvc , } break; + case 'OPEN_CIRCULATION_EXISTS': + openCircExistsDialog(args, evt); + break; + /* stuff to consider PERM_FAILURE PATRON_EXCEEDS_OVERDUE_COUNT @@ -206,6 +210,47 @@ function($scope, $q, $modal, $routeParams, egCore, egUser, patronSvc , ); } + 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',