From: Victoria Lewis Date: Tue, 2 May 2017 20:59:39 +0000 (-0700) Subject: CAT-60 Patron editor and item summary print additions X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8c3694c6293ecf237795d8af26f46bec09b94909;p=working%2FEvergreen.git CAT-60 Patron editor and item summary print additions - Add new template item_status_detailed to print most of the data from quick summary - Make an array to hold the data to print in alternate_copy_summary.js - Make a new template called item_status_detailed for the print additions - Add print-detailed button to alternate_copy_summary.xul - Add print functionality to patron edit screen - Add print functionality to item quick summary - Add experimental node exploration and testing to copy_status.js Signed-off-by: Billy Horn Signed-off-by: Skye Howard Signed-off-by: Kyle Huckins Changes to be committed: modified: Open-ILS/web/js/ui/default/actor/user/register.js modified: Open-ILS/xul/staff_client/chrome/content/util/print.js modified: Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js modified: Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul modified: Open-ILS/xul/staff_client/server/skin/print_list_templates Return receipt template file to pretty-printed JSON format to avoid clobbering the whole file. -- Bill. --- diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js index 30a12afaaf..dacdb5a5c9 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -2644,6 +2644,21 @@ function printable_output() { } } else { label = w.idlField.label; + // map the patron's home library, profile, and net access level + // values to their display names by pulling the objects from + // the widget data store. + if (w.idlField.name == 'net_access_level' || + w.idlField.name == 'profile' || + w.idlField.name == 'home_ou') { + + w.widget.store.fetch({ + onComplete : function(items) { + if (!items[0]) return + val = w.widget.store.getValue(items[0], 'name'); + }, + query : {id : val+''} + }); + } } if (temp != w._wtype) { temp = w._wtype; diff --git a/Open-ILS/xul/staff_client/chrome/content/util/print.js b/Open-ILS/xul/staff_client/chrome/content/util/print.js index 372449ba9c..38e834dcd1 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/print.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js @@ -433,6 +433,8 @@ util.print.prototype = { try{b = s; s = s.replace(/%patron_barcode%/g,this.escape_html(params.patron_barcode));} catch(E){s = b; this.error.sdump('D_WARN','string = <' + s + '> error = ' + js2JSON(E)+'\n');} + try{b = s; s = s.replace(/%recurring_fine_rule%/g,this.escape_html(params.row.recurring_fine_rule));} + catch(E){s = b; this.error.sdump('D_WARN','string = <' + s + '> error = ' + js2JSON(E)+'\n');} try{b = s; s = s.replace(/%LIBRARY%/g,this.escape_html(params.lib.name()));} catch(E){s = b; this.error.sdump('D_WARN','string = <' + s + '> error = ' + js2JSON(E)+'\n');} diff --git a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js index ef06cfae69..f347dece50 100644 --- a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js +++ b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js @@ -3,6 +3,11 @@ var network; var data; var transit_list; var hold_list; +var obj = this; +var print_list = ""; +var namey = []; +var value = []; +var count = 0; function my_init() { try { @@ -68,6 +73,25 @@ function my_init() { function () { xulG.from_item_details_new = false; load_item(); }, 1000 ); + JSAN.use('util.controller'); obj.controller = new util.controller(); + obj.controller.init( + { + control_map : { + 'cmd_alternate_copy_summary_print' : [ + ['command'], + function() { + try { + JSAN.use('util.print'); + var print = new util.print('default'); + print.simple(print_list, {'content_type':'text/plain'}); + } catch(E) { + obj.error.standard_unexpected_error_alert('print',E); + } + } + ], + } + } + ); } catch(E) { try { error.standard_unexpected_error_alert('main/test.xul',E); } catch(F) { alert(E); } @@ -92,6 +116,127 @@ function set(name,value,data) { } } +function fill_print(name){ + var print_item = document.getElementsByAttribute('name',name); + var replace; + switch(replace = print_item.item(0).getAttribute('name')){ + case 'barcode': + replace = 'Barcode\t\t\t'; + break; + case 'copy_circ_lib': + replace = 'Circ Library\t\t'; + break; + case 'call_number': + replace = 'Item Call #\t\t'; + break; + case 'copy_status': + replace = 'Status\t\t\t'; + break; + case 'price': + replace = 'Price\t\t\t'; + break; + case 'owning_lib': + replace = 'Owning Library\t\t'; + break; + case 'renewal_type': + replace = 'Renewal Type\t\t'; + break; + case 'due_date': + replace = 'Due Date\t\t'; + break; + case 'isbn': + replace = 'ISBN\t\t\t'; + break; + case 'location': + replace = 'Copy Location\t\t'; + break; + case 'total_circ_count': + replace = 'Total Circs\t\t'; + break; + case 'xact_start': + replace = 'Checkout Date\t\t'; + break; + case 'copy_create_date': + replace = 'Date Created\t\t'; + break; + case 'loan_duration': + replace = 'Loan Duration\t\t'; + break; + case 'total_circ_count_curr_year': + replace = 'Total Circs - Current Year'; + break; + case 'checkout_workstation': + replace = 'Checkout Workstation\t'; + break; + case 'copy_active_date': + replace = 'Date Active\t\t'; + break; + case 'fine_level': + replace = 'Fine Level\t\t'; + break; + case 'total_circ_count_prev_year': + replace = 'Total Circs - Prev Year\t'; + break; + case 'duration_rule': + replace = 'Duration Rule\t\t'; + break; + case 'status_changed_time': + replace = 'Status Changed\t\t'; + break; + case 'ref': + replace = 'Reference\t\t'; + break; + case 'renewal_workstation': + replace = 'Renewal Workstation\t'; + break; + case 'recurring_fine_rule': + replace = 'Recurring Fine Rule\t'; + break; + case 'copy_id': + replace = 'Copy ID\t\t\t'; + break; + case 'opac_visible': + replace = 'OPAC Visible\t\t'; + break; + case 'renewal_remaining': + replace = 'Remaining Renewals\t'; + break; + case 'max_fine_rule': + replace = 'Max Fine Rule\t\t'; + break; + case 'tcn': + replace = 'TCN\t\t\t'; + break; + case 'holdable': + replace = 'Holdable\t\t'; + break; + case 'checkin_time': + replace = 'Checkin Time\t\t'; + break; + case 'floating': + replace = 'Floating\t\t'; + break; + case 'circulate': + replace = 'Circulate\t\t'; + break; + case 'checkin_scan_time': + replace = 'Checkin Scan Time\t'; + break; + case 'circ_modifier': + replace = 'Circ Modifier\t\t'; + break; + case 'checkin_workstation': + replace = 'Checkin Workstation\t'; + break; + default: + replace = ''; + } + namey[count] = replace; + value[count] = print_item.item(0).getAttribute('value'); + print_list += namey[count] + '\t: ' + value[count] + "\n"; + count++; +} + function set_tooltip(name,value) { if (typeof value == 'undefined' || typeof value == 'null') { return; } var nodes = document.getElementsByAttribute('name',name); @@ -734,6 +879,46 @@ function load_item() { d.reset_iframe( urls.XUL_MARC_VIEW, {}, { 'docid' : details.mvr ? details.mvr.doc_id() : -1 } ); } + function fill_prints(){ + fill_print('barcode'); + fill_print('price'); + fill_print('isbn'); + fill_print('copy_create_date'); + fill_print('copy_active_date'); + fill_print('status_changed_time'); + fill_print('copy_id'); + fill_print('tcn'); + fill_print('floating'); + fill_print('copy_circ_lib'); + fill_print('owning_lib'); + fill_print('location'); + fill_print('loan_duration'); + fill_print('fine_level'); + fill_print('ref'); + fill_print('opac_visible'); + fill_print('holdable'); + fill_print('circulate'); + fill_print('circ_modifier'); + fill_print('call_number'); + fill_print('renewal_type'); + fill_print('total_circ_count'); + fill_print('total_circ_count_curr_year'); + fill_print('total_circ_count_prev_year'); + fill_print('renewal_workstation'); + fill_print('renewal_remaining'); + fill_print('copy_status'); + fill_print('due_date'); + fill_print('xact_start'); + fill_print('checkout_workstation'); + fill_print('duration_rule'); + fill_print('recurring_fine_rule'); + fill_print('max_fine_rule'); + fill_print('checkin_time'); + fill_print('checkin_scan_time'); + fill_print('checkin_workstation'); + } + setTimeout(fill_prints, 1000); + } catch(E) { alert(E); } diff --git a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul index aaf6b565c6..4c439acd5c 100644 --- a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul +++ b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul @@ -33,6 +33,10 @@