LP#1643927 Copy note captures initials; shows date
authorBill Erickson <berickxx@gmail.com>
Thu, 21 Sep 2017 20:04:03 +0000 (16:04 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 25 Sep 2017 20:41:26 +0000 (16:41 -0400)
Fixes thinko in copy note staff initials tracking.  Offloads the
formatting of the copy note to egStrings.  Adds the workstation org unit
to the initials block a la the XUL client.

This does not add the create date to the initials block as with the XUL
client, because the create date is part of the note.  Instead, we now
display the note create date in the copy note display form.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Open-ILS/src/templates/staff/cat/volcopy/index.tt2
Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index 97996b7..f93cb56 100644 (file)
@@ -15,6 +15,9 @@
 angular.module('egCoreMod').run(['egStrings', function(s) {
     s.VOL_COPY_TEMPLATE_SUCCESS_SAVE = "[% l('Saved volume/copy template(s)') %]";
     s.VOL_COPY_TEMPLATE_SUCCESS_DELETE = "[% l('Deleted volume/copy template') %]";
+    [%# Note the "~" characters escape the gettext brackets %]
+    s.COPY_NOTE_INITIALS = 
+      "[% l('[_1] ~[ [_2] @ [_3] ~]', '{{value}}', '{{initials}}', '{{ws_ou}}') %]"
 }]);
 </script>
 [% END %]
index 8b875f0..a679afa 100644 (file)
             </div>
           </div>
           <div class="row pad-vert">
-            <div class="col-md-12">
+            <div class="col-md-10">
               <textarea class="form-control" ng-change="n.value(value) && n.ischanged(1)"
                 ng-model="value" placeholder="[% l('Note...') %]" ng-disabled="deleted">
               </textarea>
             </div>
+            <div class="col-md-2">
+              {{n.create_date() | date:$root.egDateFormat}} 
+            </div>
           </div>
           <div class="row">
             <div class="col-md-12">
index 4a0c956..11fa2a7 100644 (file)
@@ -1697,7 +1697,16 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
 
                 $scope.ok = function(note) {
 
-                    if (note.initials) note.value += ' [' + note.initials + ']';
+                    if ($scope.initials) {
+                        note.value = egCore.strings.$replace(
+                            egCore.strings.COPY_NOTE_INITIALS, {
+                            value : note.value, 
+                            initials : $scope.initials,
+                            ws_ou : egCore.org.get(
+                                egCore.auth.user().ws_ou()).shortname()
+                        });
+                    }
+
                     angular.forEach(copy_list, function (cp) {
                         if (!angular.isArray(cp.notes())) cp.notes([]);
                         var n = new egCore.idl.acpn();