Allows to print a single item receipt from the list of items out.
authoredoceo <code@edoceo.com>
Tue, 11 Dec 2012 04:35:59 +0000 (20:35 -0800)
committeredoceo <code@edoceo.com>
Tue, 5 Feb 2013 06:10:56 +0000 (22:10 -0800)
There is a new button below the lists and a context menu item

Signed-off-by: edoceo <code@edoceo.com>
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/patron/items.js
Open-ILS/xul/staff_client/server/patron/items_overlay.xul

index 4957a7d..087ec60 100644 (file)
 <!ENTITY staff.patron.items_overlay.show_noncats.label "Show Non-Cataloged Circulations in List Above">
 <!ENTITY staff.patron.items_overlay.show_noncats.accesskey "N">
 <!ENTITY staff.patron.items_overlay.items_export.label "Export">
+<!ENTITY staff.patron.items_overlay.print_one.label "Print Item">
 <!ENTITY staff.generic.list_actions.label "List Actions">
 <!ENTITY staff.generic.list_actions.accesskey "L">
 <!ENTITY staff.generic.list_actions.sel_clip.label "Copy to Clipboard">
index 65e36b7..f91f81f 100644 (file)
@@ -149,6 +149,8 @@ patron.items.prototype = {
                     ],
                     'cmd_items_print' : [ ['command'], function() { obj.items_print(1); } ],
                     'cmd_items_print2' : [ ['command'], function() { obj.items_print(2); } ],
+                    'cmd_items_print_selected' : [ ['command'], function() { obj.items_print_selected(1); } ],
+                    'cmd_items_print_selected2' : [ ['command'], function() { obj.items_print_selected(2); } ],
                     'cmd_items_export' : [ ['command'], function() { obj.items_export(1); } ],
                     'cmd_items_export2' : [ ['command'], function() { obj.items_export(2); } ],
                     'cmd_items_renew' : [ ['command'], function() { obj.items_renew({which_list:1}); } ],
@@ -292,6 +294,32 @@ patron.items.prototype = {
         }
     },
 
+    'items_print_selected': function(which) {
+
+        var obj = this;
+        JSAN.use('patron.util');
+        JSAN.use('util.functional');
+
+        var ui_list = ( which == 2 ? obj.list2 : obj.list);
+        var id_list = ( which == 2 ? obj.retrieve_ids2 : obj.retrieve_ids );
+
+        // Had to merge to make the right data for print
+        for (var i=0; i < id_list.length; i++) {
+            var x = id_list[i].circ_id;
+            var r = obj.list_circ_map[x].row.my;
+            id_list[i].title = r.mvr.title();
+            id_list[i].due_date = r.circ.due_date();
+        }
+
+        var params = {
+            'list': id_list,
+            'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),obj.patron_id),
+            'printer_context' : 'receipt',
+            'template' : 'items_out'
+        };
+        ui_list.print( params );
+    },
+
     'items_export' : function(which) {
         var obj = this;
         try {
index baa00c7..0da6b2c 100644 (file)
@@ -16,6 +16,7 @@
     <command id="sel_patron"/>
     <command id="cmd_triggered_events"/>
     <command id="cmd_items_print" />
+    <command id="cmd_items_print_selected" />
     <command id="cmd_items_export" />
     <command id="cmd_items_renew" />
     <command id="cmd_items_renew_all" />
@@ -40,6 +41,7 @@
     <command id="sel_patron2"/>
     <command id="cmd_triggered_events2"/>
     <command id="cmd_items_print2" />
+    <command id="cmd_items_print_selected2" />
     <command id="cmd_items_export2" />
     <command id="cmd_items_renew2" />
     <command id="cmd_items_renew_with_date2" />
@@ -59,6 +61,7 @@
 <popupset id="items_popupset">
     <menupopup id="items_actions" position="at_pointer"> 
         <menuitem command="sel_clip" label="&staff.patron.items_overlay.sel_clip.label;" accesskey="&staff.patron.items_overlay.sel_clip.accesskey;"/>
+        <menuitem command="cmd_items_print_selected" label="&staff.patron.items_overlay.print_one.label;"/>
         <menuitem command="sel_bucket" label="&staff.patron.items_overlay.sel_bucket.label;" accesskey="&staff.patron.items_overlay.sel_bucket.accesskey;"/>
         <menuitem label="&staff.patron.items_overlay.show_catalog.label;" command="cmd_show_catalog" />
         <menuitem command="sel_copy_details" label="&staff.patron.items_overlay.sel_copy_details.label;" accesskey="&staff.patron.items_overlay.sel_copy_details.accesskey;" />
@@ -81,6 +84,7 @@
     </menupopup>
     <menupopup id="items_actions2" position="at_pointer"> 
         <menuitem command="sel_clip2" label="&staff.patron.items_overlay.sel_clip.label;" accesskey="&staff.patron.items_overlay.sel_clip.accesskey;" />
+        <menuitem command="cmd_items_print_selected2" label="&staff.patron.items_overlay.print_one.label;"/>
         <menuitem command="sel_bucket2" label="&staff.patron.items_overlay.sel_bucket.label;" accesskey="&staff.patron.items_overlay.sel_bucket.accesskey;"/>
         <menuitem label="&staff.patron.items_overlay.show_catalog.label;" command="cmd_show_catalog2" />
         <menuitem command="sel_copy_details2" label="&staff.patron.items_overlay.sel_copy_details.label;" accesskey="&staff.patron.items_overlay.sel_copy_details.accesskey;" />
         <menu label="&staff.patron.items_overlay.actions_for_selected_items.label;" accesskey="&staff.patron.items_overlay.actions_for_selected_items.accesskey;">
             <menupopup>
                 <menuitem command="sel_clip" label="&staff.patron.items_overlay.sel_clip.label;" accesskey="&staff.patron.items_overlay.sel_clip.accesskey;"/>
+                <menuitem command="cmd_items_print_selected" label="&staff.patron.items_overlay.print_one.label;" />
                 <menuitem command="sel_bucket" label="&staff.patron.items_overlay.sel_bucket.label;" accesskey="&staff.patron.items_overlay.sel_bucket.accesskey;"/>
                 <menuitem label="&staff.patron.items_overlay.show_catalog.label;" command="cmd_show_catalog" />
                 <menuitem command="sel_copy_details" label="&staff.patron.items_overlay.sel_copy_details.label;" accesskey="&staff.patron.items_overlay.sel_copy_details.accesskey;" />
         <menu label="&staff.patron.items_overlay.actions_for_selected_items.label;" old_accesskey="&staff.patron.items_overlay.actions_for_selected_items.accesskey;">
             <menupopup>
                 <menuitem command="sel_clip2" label="&staff.patron.items_overlay.sel_clip.label;" accesskey="&staff.patron.items_overlay.sel_clip.accesskey;" />
+                <menuitem command="cmd_items_print_selected2" label="&staff.patron.items_overlay.print_one.label;" />
                 <menuitem command="sel_bucket2" label="&staff.patron.items_overlay.sel_bucket.label;" accesskey="&staff.patron.items_overlay.sel_bucket.accesskey;"/>
                 <menuitem label="&staff.patron.items_overlay.show_catalog.label;" command="cmd_show_catalog2" />
                 <menuitem command="sel_copy_details2" label="&staff.patron.items_overlay.sel_copy_details.label;" accesskey="&staff.patron.items_overlay.sel_copy_details.accesskey;" />
     <checkbox id="checkin_auto_print_slips" oils_persist="checked" 
         label="&staff.circ.checkin_overlay.checkin_auto_print_slips.label;"
         accesskey="&staff.circ.checkin_overlay.checkin_auto_print_slips.accesskey;"/>
+    <button id="item_print_single" label="&staff.patron.items_overlay.print_one.label;" command="cmd_items_print_selected" />
     <button id="items_print" label="&staff.patron_display.items.print_receipt.label;" command="cmd_items_print" accesskey="&staff.patron_display.items.print_receipt.accesskey;" />
     <button id="items_export" label="&staff.patron.items_overlay.items_export.label;" command="cmd_items_export" accesskey=""/>
 </hbox>
 
 <hbox id="items_bottom_ui2" flex="1">
     <spacer flex="1"/>
+    <button id="item_print_single2" label="&staff.patron.items_overlay.print_one.label;" command="cmd_items_print_selected2" />
     <button id="items_print2" label="&staff.patron_display.items.print_receipt.label;" command="cmd_items_print2" old_accesskey="&staff.patron_display.items.print_receipt.accesskey;" />
     <button id="items_export2" label="&staff.patron.items_overlay.items_export.label;" command="cmd_items_export2" accesskey=""/>
 </hbox>