From 7c3e039e1bc7b5dc3bccc148c0d13b9ce2b90962 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 8 Jul 2014 10:47:01 -0400 Subject: [PATCH] patron holds / add notification Signed-off-by: Bill Erickson --- .../circ/share/t_hold_notification_dialog.tt2 | 33 ++++++++++++++++++++++ .../web/js/ui/default/staff/circ/services/holds.js | 29 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 Open-ILS/src/templates/staff/circ/share/t_hold_notification_dialog.tt2 diff --git a/Open-ILS/src/templates/staff/circ/share/t_hold_notification_dialog.tt2 b/Open-ILS/src/templates/staff/circ/share/t_hold_notification_dialog.tt2 new file mode 100644 index 0000000000..01b5b48115 --- /dev/null +++ b/Open-ILS/src/templates/staff/circ/share/t_hold_notification_dialog.tt2 @@ -0,0 +1,33 @@ +
+ + + + +
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js index 5b67f834c4..347c687e63 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js @@ -432,6 +432,35 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog , egAlertDialog) }); } + $scope.new_notification = function() { + return $modal.open({ + templateUrl : './circ/share/t_hold_notification_dialog', + controller : + ['$scope', '$modalInstance', + function($scope, $modalInstance) { + $scope.args = {}; + $scope.ok = function() { + $modalInstance.close($scope.args) + }, + $scope.cancel = function($event) { + $modalInstance.dismiss(); + $event.preventDefault(); + } + } + ] + }).result.then(function(args) { + var note = new egCore.idl.ahn(); + note.hold($scope.hold.id()); + note.method(args.method); + note.note(args.note); + note.notify_staff(egCore.auth.user().id()); + note.notify_time('now'); + return egCore.pcrud.create(note).then(function() { + $scope.hold.notifications().push(note); + }); + }); + } + $scope.$watch('holdId', function(newVal, oldVal) { if (newVal != oldVal) draw(); }); -- 2.11.0