LP#1714566 - enable hold notes set to print on slip to be shown
authorCesar Velez <cesar.velez@equinoxinitiative.org>
Mon, 2 Oct 2017 21:57:39 +0000 (17:57 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 17 Oct 2017 18:04:17 +0000 (14:04 -0400)
Adds a bit of code and edits the realted templates in order
to be able to see any hold notes set to print on the slip.

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/templates/staff/circ/share/t_hold_shelf_dialog.tt2
Open-ILS/src/templates/staff/share/print_templates/t_hold_shelf_slip.tt2
Open-ILS/web/js/ui/default/staff/circ/services/circ.js

index 8fa2d4b..c7b3d4a 100644 (file)
       <span>{{hold.request_time | date:$root.egDateFormat}}</span>
     </div>
     <div>
+      <span>[% l('Request Notes:') %]</span>
+      <ul><li ng-repeat="n in holdslip_notes"><strong>{{n.title}}</strong>: {{n.body}}</li></ul>
+    </div>
+    <div>
       <span>[% l('Slip Date:') %]</span>
       <span>{{today | date:$root.egDateFormat}}</span>
     </div>
index 2d1a9f7..315c155 100644 (file)
@@ -13,6 +13,7 @@ Template for printing hold request slips. Fields include:
 * hold.phone_notify
 * hold.sms_notify
 * hold.email_notify
+* holdslip_notes (array of slip-printable notes)
 
 -->
 <div>
@@ -44,7 +45,11 @@ Template for printing hold request slips. Fields include:
   <div ng-if="hold.phone_notify">[% l('Notify by phone: [_1]', '{{hold.phone_notify}}') %]</div>
   <div ng-if="hold.sms_notify">[% l('Notify by text: [_1]', '{{hold.sms_notify}}') %]</div>
   <div ng-if="hold.email_notify == 't'">[% l('Notify by email: [_1]', '{{patron.email}}') %]</div>
-
+    <div ng-if="holdslip_notes">
+      <ul>Notes:
+        <li ng-repeat="note in holdslip_notes">{{note}}</li>
+      </ul>
+    </div>
   <br/>
 
   <div>[% l('Request Date: [_1]', 
index 5910127..06166df 100644 (file)
@@ -1504,6 +1504,15 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,
 
             if (data.patron) {
                 print_context.hold = egCore.idl.toHash(evt.payload.hold);
+                var notes = print_context.hold.notes;
+                if(notes.length > 0){
+                    print_context.holdslip_notes = [];
+                    angular.forEach(notes, function(n){
+                        if (n.slip){
+                            print_context.holdslip_notes.push(n);
+                        }
+                    });
+                }
                 print_context.patron = egCore.idl.toHash(data.patron);
             }