],
'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}); } ],
obj.error.standard_unexpected_error_alert('printing 1',E);
}
},
+ 'items_print_selected': function(which) {
+ var obj = this;
+ try {
+ JSAN.use('patron.util');
+ // JSAN.use('util.functional');
+ var list = ( which == 2 ? obj.list2 : obj.list);
+ // Selected Rows
+ var list_dump = list.dump_with_keys();
+ var pick_list = ( which == 2 ? obj.retrieve_ids2 : obj.retrieve_ids );
+ if (!pick_list || pick_list.length == 0) return;
+
+ // I don't know a better way to just get all the data from one row
+ for (var i=0; i<pick_list.length; i++) {
+ var bc = pick_list[i].barcode;
+ for (var j=0; j<list_dump.length; j++) {
+ if (pick_list[i].barcode == list_dump[j].barcode) {
+ pick_list[i] = list_dump[j];
+ }
+ }
+ }
+ var params = {
+ 'list': pick_list,
+ 'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),obj.patron_id),
+ 'printer_context' : 'receipt',
+ 'template' : 'items_out'
+ };
+ list.print( params );
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('items_print_selected has failed',E);
+ }
+ },
'items_export' : function(which) {
var obj = this;
try {
<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" />
<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" />
<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;" />
</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>