From: Bill Erickson Date: Mon, 7 Jul 2014 20:51:58 +0000 (-0400) Subject: patron holds / add hold note X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b6aa311c5d268b119b02630821557f23eef2fd33;p=working%2FEvergreen.git patron holds / add hold note Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/circ/share/t_hold_note_dialog.tt2 b/Open-ILS/src/templates/staff/circ/share/t_hold_note_dialog.tt2 new file mode 100644 index 0000000000..92113da7cc --- /dev/null +++ b/Open-ILS/src/templates/staff/circ/share/t_hold_note_dialog.tt2 @@ -0,0 +1,51 @@ +
+ + + + +
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 022da4f1fd..f6063b0ed4 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 @@ -343,8 +343,8 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog , egAlertDialog) showPatron : '=' }, controller : [ - '$scope','egCore','egHolds','egCirc', - function($scope , egCore , egHolds , egCirc) { + '$scope','$modal','egCore','egHolds','egCirc', + function($scope , $modal , egCore , egHolds , egCirc) { function draw() { if (!$scope.holdId) return; @@ -390,12 +390,36 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog , egAlertDialog) }); } - /* $scope.new_note = function() { - $modal.open({ - templateUrl : './circ/patron + return $modal.open({ + templateUrl : './circ/share/t_hold_note_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.ahrn(); + note.hold($scope.hold.id()); + // use t/f instead of bools here so template is happy + note.staff('t'); + note.slip(args.slip ? 't' : 'f'); + note.pub(args.pub ? 't' : 'f'); + note.title(args.title); + note.body(args.body); + return egCore.pcrud.create(note).then(function() { + $scope.hold.notes().push(note); + }); + }); } - */ $scope.$watch('holdId', function(newVal, oldVal) { if (newVal != oldVal) draw();