--- /dev/null
+<form ng-submit="ok(note)" role="form">
+ <div class="modal-header">
+ <button type="button" class="close" ng-click="cancel()"
+ aria-hidden="true">×</button>
+ <h4 class="modal-title">[% l('New Copy Note') %]</h4>
+ </div>
+ <div class="modal-body">
+ <div class="row">
+ <div class="col-md-6">
+ <input class="form-control" type="text"
+ ng-model="note.title" placeholder="[% l('Title...') %]"/>
+ </div>
+ <div class="col-md-3">
+ <label>
+ <input type="checkbox" ng-model="note.pub"/>
+ [% l('Public Note') %]
+ </label>
+ </div>
+ </div>
+ <div class="row pad-vert">
+ <div class="col-md-12">
+ <textarea class="form-control"
+ ng-model="note.value" placeholder="[% l('Note...') %]">
+ </textarea>
+ </div>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <div class="row">
+ <div class="col-md-2">
+ <input type="text" class="form-control" ng-hide="!require_initials"
+ ng-model="initials" placeholder="[% l('Initials') %]" ng-required="require_initials"/>
+ </div>
+ <div class="col-md-10 pull-right">
+ <input type="submit" class="btn btn-primary" value="[% l('OK') %]"/>
+ <button class="btn btn-warning" ng-click="cancel($event)">[% l('Cancel') %]</button>
+ </div>
+ </div>
+
+ <div class="row pad-vert" ng-if="note_list.length > 0">
+ <div class="col-md-12">
+ <div class="row">
+ <div class="col-md-12">
+ <hr/>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-12">
+ <h4 class="pull-left">[% l('Existing Copy Notes') %]</h4>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="row" ng-repeat="n in note_list" ng-init="pub = n.pub(); title = n.title(); value = n.value(); deleted = n.isdeleted()">
+ <div class="col-md-12">
+ <div class="row">
+ <div class="col-md-6">
+ <input class="form-control" type="text" ng-change="n.title(title) && n.ischanged(1)"
+ ng-model="title" placeholder="[% l('Title...') %]" ng-disabled="deleted"/>
+ </div>
+ <div class="col-md-3">
+ <label>
+ <input type="checkbox" ng-model="pub" ng-change="n.pub(pub) && n.ischanged(1)" ng-disabled="deleted"/>
+ [% l('Public Note') %]
+ </label>
+ </div>
+ <div class="col-md-3">
+ <label>
+ <input type="checkbox" ng-model="deleted" ng-change="n.isdeleted(deleted)"/>
+ [% l('Deleted?') %]
+ </label>
+ </div>
+ </div>
+ <div class="row pad-vert">
+ <div class="col-md-12">
+ <textarea class="form-control" ng-change="n.value(value) && n.ischanged(1)"
+ ng-model="value" placeholder="[% l('Note...') %]" ng-disabled="deleted">
+ </textarea>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-12">
+ <hr/>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ </div>
+</form>
</label>
</div>
<div class="col-xs-6">
+ <label>
+ <input type="checkbox" ng-change="saveDefaults()" ng-model="defaults.copy_notes"/>
+ [% l('Add/Edit Copy Notes') %]
+ </label>
</div>
</div>
</label>
</div>
<div class="col-xs-6">
- <h6>[% l('Statistical Categories') %]</h6>
+ <label>
+ <input type="checkbox" ng-change="saveDefaults()" ng-model="defaults.copy_notes_pub"/>
+ [% l('Copy Notes are Public') %]
+ </label>
</div>
</div>
</label>
</div>
<div class="col-xs-6">
- <label>
- <eg-org-selector selected="defaults.statcat_filter" noDefault label="[% l('Default Filter Library') %]" disableTest="cant_have_vols"></eg-org-selector>
- </label>
+ <h6>[% l('Statistical Categories') %]</h6>
</div>
</div>
</div>
<div class="col-xs-6">
<label>
- <input type="checkbox" ng-change="saveDefaults()" ng-model="defaults.statcats"/>
- [% l('Edit Statistical Data') %]
+ <eg-org-selector
+ selected="defaults.statcat_filter"
+ noDefault label="[% l('Default Filter Library') %]"
+ disableTest="cant_have_vols"></eg-org-selector>
</label>
</div>
</div>
</label>
</div>
<div class="col-xs-6">
+ <label>
+ <input type="checkbox" ng-change="saveDefaults()" ng-model="defaults.statcats"/>
+ [% l('Edit Statistical Data') %]
+ </label>
</div>
</div>
service.flesh = {
flesh : 3,
flesh_fields : {
- acp : ['call_number','parts','stat_cat_entries'],
+ acp : ['call_number','parts','stat_cat_entries', 'notes'],
acn : ['label_class','prefix','suffix']
}
}
* Edit controller!
*/
.controller('EditCtrl',
- ['$scope','$q','$window','$routeParams','$location','$timeout','egCore','egNet','egGridDataProvider','itemSvc',
-function($scope , $q , $window , $routeParams , $location , $timeout , egCore , egNet , egGridDataProvider , itemSvc) {
+ ['$scope','$q','$window','$routeParams','$location','$timeout','egCore','egNet','egGridDataProvider','itemSvc','$modal',
+function($scope , $q , $window , $routeParams , $location , $timeout , egCore , egNet , egGridDataProvider , itemSvc , $modal) {
$scope.defaults = { // If defaults are not set at all, allow everything
statcats : true,
+ copy_notes : true,
attributes : {
status : true,
loan_duration : true,
'open-ils.cat.asset.volume.fleshed.batch.update.override',
egCore.auth.token(), cnList, 1, { auto_merge_vols : 1, create_parts : 1 }
).then(function(update_count) {
- alert(update_count + ' call numbers updated');
if (and_exit) {
$scope.dirty = false;
$timeout(function(){$window.close()});
}
+ $scope.copy_notes_dialog = function(copy_list) {
+ var default_pub = Boolean($scope.defaults.copy_notes_pub);
+ if (!angular.isArray(copy_list)) copy_list = [copy_list];
+
+ return $modal.open({
+ templateUrl: './cat/volcopy/t_copy_notes',
+ animation: true,
+ controller:
+ ['$scope','$modalInstance',
+ function($scope , $modalInstance) {
+ $scope.focusNote = true;
+ $scope.note = {
+ creator : egCore.auth.user().id(),
+ title : '',
+ value : '',
+ pub : default_pub,
+ };
+
+ $scope.require_initials = false;
+ egCore.org.settings([
+ 'ui.staff.require_initials.copy_notes'
+ ]).then(function(set) {
+ $scope.require_initials = Boolean(set['ui.staff.require_initials.copy_notes']);
+ });
+
+ $scope.note_list = [];
+ if (copy_list.length == 1) {
+ $scope.note_list = copy_list[0].notes();
+ }
+
+ $scope.ok = function(note) {
+
+ if (note.initials) note.value += ' [' + note.initials + ']';
+ angular.forEach(copy_list, function (cp) {
+ var n = new egCore.idl.acpn();
+ n.creator(note.creator);
+ n.pub(note.pub);
+ n.title(note.title);
+ n.value(note.value);
+ n.owning_copy(cp.id());
+ cp.notes().push( n );
+ });
+
+ $modalInstance.close();
+ }
+
+ $scope.cancel = function($event) {
+ $modalInstance.dismiss();
+ $event.preventDefault();
+ }
+ }]
+ });
+ }
+
}])
.directive("egVolTemplate", function () {
$scope.defaults = { // If defaults are not set at all, allow everything
statcats : true,
+ copy_notes : true,
attributes : {
status : true,
loan_duration : true,