--- /dev/null
+<form ng-submit="ok(args)" role="form">
+ <div class="modal-header">
+ <button type="button" class="close" ng-click="cancel()"
+ aria-hidden="true">×</button>
+ <h4 class="modal-title">[% l('Create Record of Hold Notification') %]</h4>
+ </div>
+ <div class="modal-body">
+ <div class="form-group row">
+ <div class="col-md-3">
+ <label for="note-method">[% l('Notification Method') %]</label>
+ </div>
+ <div class="col-md-9">
+ <input type="text" class="form-control" focus-me='focusNote' required
+ id="note-method" ng-model="args.method" placeholder="[% l('Notification Method...') %]"/>
+ </div>
+ </div>
+ <div class="form-group row">
+ <div class="col-md-3">
+ <label for="note-note">[% l('Note') %]</label>
+ </div>
+ <div class="col-md-9">
+ <textarea class="form-control" required
+ id="note-note" ng-model="args.note" placeholder="[% l('Note') %]">
+ </textarea>
+ </div>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <input type="submit" class="btn btn-primary" value="[% l('OK') %]"/>
+ <button class="btn btn-warning" ng-click="cancel($event)">[% l('Cancel') %]</button>
+ </div>
+ </div> <!-- modal-content -->
+</form>
});
}
+ $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();
});