LP1537214 Staff Initials in Patron Notes
authorKyle Huckins <khuckins@catalystdevworks.com>
Wed, 19 Oct 2016 18:59:57 +0000 (11:59 -0700)
committerKathy Lussier <klussier@masslnc.org>
Tue, 22 Nov 2016 15:32:37 +0000 (10:32 -0500)
Add Initials field to new note dialog when
Require Staff Initials option is active.  Notes with
initials will use the following format:
          "Note [Initials]"

Signed-off-by: Kyle Huckins <khuckins@catalystdevworks.com>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/circ/patron/t_new_note_dialog.tt2
modified:   Open-ILS/web/js/ui/default/staff/circ/patron/app.js

Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/circ/patron/t_new_note_dialog.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/app.js

index cfc5b40..6e9919a 100644 (file)
       </div>
     </div>
     <div class="modal-footer">
+      <div class="col-md-2">
+        <input type="text" class="form-control" ng-hide="!require_initials"
+          id="initials" ng-model="args.initials" placeholder="[% l('Initials') %]" 
+          ng-required="require_initials" />
+      </div>
       <input type="submit" class="btn btn-primary" value="[% l('OK') %]"/>
       <button class="btn btn-warning" ng-click="cancel()">[% l('Cancel') %]</button>
     </div>
index 356bdfe..31b2358 100644 (file)
@@ -29,6 +29,7 @@ angular.module('egPatronApp', ['ngRoute', 'ui.bootstrap',
         // specific settings from within their respective controllers
         egCore.env.classLoaders.aous = function() {
             return egCore.org.settings([
+                'ui.staff.require_initials.patron_info_notes',
                 'circ.do_not_tally_claims_returned',
                 'circ.tally_lost',
                 'circ.obscure_dob',
@@ -1312,8 +1313,8 @@ function($scope,  $routeParams , $location , egCore , patronSvc) {
 }])
 
 .controller('PatronNotesCtrl',
-       ['$scope','$routeParams','$location','egCore','patronSvc','$uibModal',
-function($scope,  $routeParams , $location , egCore , patronSvc , $uibModal) {
+       ['$scope', '$filter', '$routeParams','$location','egCore','patronSvc','$uibModal',
+function($scope,  $filter, $routeParams , $location , egCore , patronSvc , $uibModal) {
     $scope.initTab('other', $routeParams.id);
     var usr_id = $routeParams.id;
 
@@ -1338,6 +1339,7 @@ function($scope,  $routeParams , $location , egCore , patronSvc , $uibModal) {
             function($scope, $uibModalInstance) {
                 $scope.focusNote = true;
                 $scope.args = {};
+                $scope.require_initials = egCore.env.aous['ui.staff.require_initials.patron_info_notes'];
                 $scope.ok = function(count) { $uibModalInstance.close($scope.args) }
                 $scope.cancel = function () { $uibModalInstance.dismiss() }
             }],
@@ -1350,6 +1352,8 @@ function($scope,  $routeParams , $location , egCore , patronSvc , $uibModal) {
                 note.value(args.value);
                 note.pub(args.pub ? 't' : 'f');
                 note.creator(egCore.auth.user().id());
+                if (args.initials) 
+                    note.value(note.value() + ' [' + args.initials + ']');
                 egCore.pcrud.create(note).then(function() {refreshPage()});
             }
         );