--- /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 a new note') %]</h4>
+ </div>
+ <div class="modal-body">
+ <div class="form-group row">
+ <div class="col-md-3">
+ <label for="note-pub">[% l('Patron Visible?') %]</label>
+ </div>
+ <div class="col-md-9">
+ <input type="checkbox" class="checkbox"
+ id="note-pub" ng-model="args.pub"/>
+ </div>
+ </div>
+ <div class="form-group row">
+ <div class="col-md-3">
+ <label for="note-slip">[% l('Print on Slip?') %]</label>
+ </div>
+ <div class="col-md-9">
+ <input type="checkbox" class="checkbox"
+ id="note-slip" ng-model="args.slip"/>
+ </div>
+ </div>
+ <div class="form-group row">
+ <div class="col-md-3">
+ <label for="note-title">[% l('Title') %]</label>
+ </div>
+ <div class="col-md-9">
+ <input type="text" class="form-control" focus-me='focusNote' required
+ id="note-title" ng-model="args.title" placeholder="[% l('Title...') %]"/>
+ </div>
+ </div>
+ <div class="form-group row">
+ <div class="col-md-3">
+ <label for="note-body">[% l('Note Body') %]</label>
+ </div>
+ <div class="col-md-9">
+ <textarea class="form-control" required
+ id="note-body" ng-model="args.body" placeholder="[% l('Note Body...') %]">
+ </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>
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;
});
}
- /*
$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();