webstaff: add print action and template for item status page
authorGalen Charlton <gmc@esilibrary.com>
Wed, 16 Nov 2016 10:54:25 +0000 (05:54 -0500)
committerKathy Lussier <klussier@masslnc.org>
Mon, 9 Jan 2017 15:58:58 +0000 (10:58 -0500)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>

Open-ILS/src/templates/staff/cat/item/t_list.tt2
Open-ILS/src/templates/staff/share/print_templates/t_item_status.tt2 [new file with mode: 0644]
Open-ILS/web/js/ui/default/staff/cat/item/app.js

index 596a24b..087c4e0 100644 (file)
   </eg-grid-field>
 </eg-grid>
 
+<div class="flex-row pad-vert">
+  <div class="flex-cell"></div>
+  <div class="pad-horiz">
+    <button class="btn btn-default"
+      ng-click="print_list()">[% l('Print') %]</button>
+  </div>
+</div>
diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_item_status.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_item_status.tt2
new file mode 100644 (file)
index 0000000..0de9e1e
--- /dev/null
@@ -0,0 +1,26 @@
+<!--
+Template for printing copies from the Item Status page. Available
+macros include:
+
+copies - list; each entry is a fleshed, flattened copy record
+with a variety of keys, including
+
+  barcode
+  call_number.record.simple_record.title (title)
+  call_number.label 
+  location.name
+
+-->
+<div>
+  <div>[% l('The following items have been examined:') %]</div>
+  <hr/>
+  <ol>
+    <li ng-repeat="copy in copies">
+      <div>[% l('Title: [_1] <br> Barcode: [_2]',
+        "{{copy['call_number.record.simple_record.title']}}",
+        '{{copy.barcode}}') %]</div>
+    </li>
+  </ol>
+  <hr/>
+  <div>{{current_location.shortname}} {{today | date:'short'}}</div>
+<br/>
index 7a26635..33cc22c 100644 (file)
@@ -796,6 +796,17 @@ function($scope , $q , $routeParams , $location , $timeout , $window , egCore ,
         }
     }
 
+    $scope.print_list = function() {
+        var print_data = { copies : copyGrid.allItems() };
+
+        if (print_data.copies.length == 0) return $q.when();
+
+        return egCore.print.print({
+            template : 'item_status',
+            scope : print_data
+        });
+    }
+
     if (copyId.length > 0) {
         itemSvc.fetch(null,copyId).then(
             function() {