patron holds; printing
authorBill Erickson <berick@esilibrary.com>
Mon, 7 Jul 2014 13:24:07 +0000 (09:24 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 7 Jul 2014 13:24:07 +0000 (09:24 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/admin/workstation/t_print_templates.tt2
Open-ILS/src/templates/staff/circ/patron/t_holds.tt2
Open-ILS/src/templates/staff/share/print_templates/t_holds_for_patron.tt2 [new file with mode: 0644]
Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
Open-ILS/web/js/ui/default/staff/circ/patron/holds.js

index b0856db..0502538 100644 (file)
@@ -18,6 +18,7 @@
       <option value="checkout">[% l('Checkout') %]</option>
       <option value="hold_transit_slip">[% l('Hold Transit Slip') %]</option>
       <option value="hold_shelf_slip">[% l('Hold Shelf Slip') %]</option>
+      <option value="holds_for_patron">[% l('Holds for Patron') %]</option>
       <option value="patron_address">[% l('Patron Address') %]</option>
       <option value="patron_note">[% l('Patron Note') %]</option>
       <option value="transit_slip">[% l('Transit Slip') %]</option>
index a14d6ff..afd2092 100644 (file)
@@ -19,6 +19,7 @@
 
   <eg-grid-action handler="show_recent_circs"
     label="[% l('Show Last Few Circulations') %]"></eg-grid-action>
+  <eg-grid-action divider="true"></eg-grid-action>
   <eg-grid-action handler="set_copy_quality"
     label="[% l('Set Desired Copy Quality') %]"></eg-grid-action>
   <eg-grid-action handler="edit_pickup_lib"
@@ -41,6 +42,7 @@
     label="[% l('Mark Item Damaged') %]"></eg-grid-action>
   <eg-grid-action handler="mark_missing"
     label="[% l('Mark Item Missing') %]"></eg-grid-action>
+  <eg-grid-action divider="true"></eg-grid-action>
   <eg-grid-action handler="retarget"
     label="[% l('Find Another Target') %]"></eg-grid-action>
   <eg-grid-action handler="cancel_hold"
   <eg-grid-field path='hold.*' parent-idl-class="ahr" hidden></eg-grid-field>
   <eg-grid-field path='copy.*' parent-idl-class="acp" hidden></eg-grid-field>
   <eg-grid-field path='volume.*' parent-idl-class="acn" hidden></eg-grid-field>
-  <eg-grid-field path='mvr.*' parent-idl-class="ahr" hidden></eg-grid-field>
+  <eg-grid-field path='mvr.*' parent-idl-class="mvr" hidden></eg-grid-field>
 </eg-grid>
 
+<div class="flex-row pad-vert">
+  <div class="flex-cell"></div>
+  <div><button class="btn btn-default" ng-click="print()">
+    [% l('Print') %]
+  </button>
+</div>
+
diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_holds_for_patron.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_holds_for_patron.tt2
new file mode 100644 (file)
index 0000000..492454c
--- /dev/null
@@ -0,0 +1,14 @@
+<div>
+  <div>[% l('Welcome to [_1]', '{{current_location.name}}') %]</div>
+  <div>[% l('You have the following title on hold:') %]</div>
+  <hr/>
+  <ol>
+    <li ng-repeat="hold in holds">
+      <div>{{hold.title}}</div>
+    </li>
+  </ol>
+  <hr/>
+  <div>{{current_location.shortname}} {{today | date:'short'}}</div>
+  <div>[% l('You were helped by [_1]', '{{staff.first_given_name}}') %]</div>
+<br/>
+
index 2a2aba6..51a4240 100644 (file)
@@ -351,6 +351,15 @@ function($scope , $q , egCore) {
         barcode : '33434322323'
     }
 
+    var one_hold = {
+        behind_desk : 'f',
+        phone_notify : '111-222-3333',
+        sms_notify : '111-222-3333',
+        email_notify : 'user@example.org',
+        request_time : new Date().toISOString()
+    }
+
+
     $scope.preview_scope = {
         //bills
         transactions : [
@@ -414,13 +423,12 @@ function($scope , $q , egCore) {
         author : seed_record.author,
         patron : egCore.idl.toHash(egCore.auth.user()),
         address : seed_addr,
-        hold : {
-            behind_desk : 'f',
-            phone_notify : '111-222-3333',
-            sms_notify : '111-222-3333',
-            email_notify : 'user@example.org',
-            request_time : new Date().toISOString()
-        }
+        hold : one_hold,
+        holds : [
+            {hold : one_hold, title : 'Some Title 1', author : 'Some Author 1'},
+            {hold : one_hold, title : 'Some Title 2', author : 'Some Author 2'},
+            {hold : one_hold, title : 'Some Title 3', author : 'Some Author 3'}
+        ]
     }
 
     $scope.preview_scope.payments = [
index 086a7cf..723adb2 100644 (file)
@@ -173,6 +173,24 @@ function($scope,  $q,  $routeParams,  egCore,  egUser,  patronSvc,
         egHolds.retarget(hold_ids).then(refresh_all);
     }
 
+    $scope.print = function() {
+        var holds = [];
+        angular.forEach(patronSvc.holds, function(item) {
+            holds.push({
+                hold : egCore.idl.toHash(item.hold),
+                copy : egCore.idl.toHash(item.copy),
+                volume : egCore.idl.toHash(item.volume),
+                title : item.mvr.title(),
+                author : item.mvr.author()
+            });
+        });
+
+        egCore.print.print({
+            context : 'receipt', 
+            template : 'holds_for_patron', 
+            scope : {holds : holds}
+        });
+    }
 
 }])