return dump;
},
+ 'dump_csv' : function(params) {
+ var obj = this;
+ switch(this.node.nodeName) {
+ case 'tree' : return this._dump_tree_csv(params); break;
+ default: throw('NYI: Need .dump_csv() for ' + this.node.nodeName); break;
+ }
+
+ },
+
+ '_dump_tree_csv' : function(params) {
+ var obj = this;
+ var dump = '';
+ for (var j = 0; j < obj.columns.length; j++) {
+ if (obj.columns[j].hidden) {
+ /* skip */
+ } else {
+ if (dump) dump += ',';
+ dump += '"' + obj.columns[j].label.replace(/"/g, '""') + '"';
+ }
+ }
+ dump += '\r\n';
+ for (var i = 0; i < this.treechildren.childNodes.length; i++) {
+ var row = '';
+ var treeitem = this.treechildren.childNodes[i];
+ var treerow = treeitem.firstChild;
+ for (var j = 0; j < treerow.childNodes.length; j++) {
+ if (obj.columns[j].hidden) {
+ /* skip */
+ } else {
+ if (row) row += ',';
+ row += '"' + treerow.childNodes[j].getAttribute('label').replace(/"/g, '""') + '"';
+ }
+ }
+ dump += row + '\r\n';
+ }
+ return dump;
+ },
+
'dump_selected_with_keys' : function(params) {
var obj = this;
switch(this.node.nodeName) {
obj.list2.full_retrieve();
}
],
+ 'cmd_copy_buckets_export' : [
+ ['command'],
+ function() {
+ obj.list2.on_all_fleshed = function() {
+ try {
+ dump(obj.list2.dump_csv() + '\n');
+ copy_to_clipboard(obj.list2.dump_csv());
+ setTimeout(function(){obj.list2.on_all_fleshed = null;},0);
+ } catch(E) {
+ alert(E);
+ }
+ }
+ obj.list2.full_retrieve();
+ }
+ ],
+
'cmd_copy_buckets_reprint' : [
['command'],
function() {
<command id="sel_clip" />
<command id="cmd_copy_buckets_submit_barcode" />
<command id="cmd_copy_buckets_print" />
+ <command id="cmd_copy_buckets_export" />
<command id="cmd_copy_buckets_reprint" />
<command id="cmd_copy_buckets_done" />
<command id="cmd_export_to_copy_status" />
<hbox id="copy_buckets_bottom_ui">
<button id="copy_buckets_print" label="Print" command="cmd_copy_buckets_print" accesskey="P"/>
+ <button id="copy_buckets_export"
+ label="Export"
+ command="cmd_copy_buckets_export"
+ accesskey=""/>
<spacer flex="1"/>
<hbox style="background: grey">
<vbox><spacer flex="1"/><label value="Batch:" style="font-weight: bold"/><spacer flex="1"/></vbox>
}
}
],
+
+ 'cmd_record_buckets_export' : [
+ ['command'],
+ function() {
+ obj.list2.on_all_fleshed = function() {
+ try {
+ dump(obj.list2.dump_csv() + '\n');
+ copy_to_clipboard(obj.list2.dump_csv());
+ setTimeout(function(){obj.list2.on_all_fleshed = null;},0);
+ } catch(E) {
+ alert(E);
+ }
+ }
+ obj.list2.full_retrieve();
+ }
+ ],
+
'cmd_merge_records' : [
['command'],
function() {
<command id="sel_clip" />
<command id="cmd_record_buckets_submit_barcode" />
<command id="cmd_record_buckets_print" />
+ <command id="cmd_record_buckets_export" />
<command id="cmd_record_buckets_reprint" />
<command id="cmd_record_buckets_done" />
<command id="cmd_merge_records" />
</hbox>
<hbox id="record_buckets_bottom_ui">
+ <button id="record_buckets_export"
+ label="Export"
+ command="cmd_record_buckets_export"
+ accesskey=""/>
<spacer flex="1"/>
<hbox style="background: grey">
<vbox><spacer flex="1"/><label value="Batch:" style="font-weight: bold"/><spacer flex="1"/></vbox>
['command'],
function() { obj.list.clipboard(); }
],
+ 'cmd_export' : [
+ ['command'],
+ function() {
+ obj.list.on_all_fleshed = function() {
+ try {
+ dump(obj.list.dump_csv() + '\n');
+ copy_to_clipboard(obj.list.dump_csv());
+ setTimeout(function(){obj.list.on_all_fleshed = null;},0);
+ } catch(E) {
+ alert(E);
+ }
+ }
+ obj.list.full_retrieve();
+ }
+ ],
'cmd_broken' : [
['command'],
function() { alert('Not Yet Implemented'); }
<commandset id="cat_z3950_cmds">
<command id="cmd_broken" />
+ <command id="cmd_export" />
<command id="sel_clip" />
<command id="save_columns" />
</commandset>
<vbox id="result_message" />
<hbox>
<button id="page_next" label="Fetch More Results" accesskey="M" disabled="true"/>
+ <button id="export" label="Export" command="cmd_export" accesskey=""/>
<button id="clip_button" command="sel_clip" label="Copy to Clipboard" disabled="true"/>
<button id="save_cols_btn" command="save_columns" label="Save Columns" />
<spacer flex="1"/>
obj.list.full_retrieve();
}
],
+ 'cmd_checkin_export' : [
+ ['command'],
+ function() {
+ obj.list.on_all_fleshed = function() {
+ try {
+ dump(obj.list.dump_csv() + '\n');
+ copy_to_clipboard(obj.list.dump_csv());
+ setTimeout(function(){obj.list.on_all_fleshed = null;},0);
+ } catch(E) {
+ alert(E);
+ }
+ }
+ obj.list.full_retrieve();
+ }
+ ],
+
'cmd_checkin_reprint' : [
['command'],
function() {
<commandset id="checkin_cmds">
<command id="cmd_checkin_submit_barcode" />
<command id="cmd_checkin_print" />
+ <command id="cmd_checkin_export" />
<command id="cmd_checkin_reprint" />
<command id="cmd_checkin_done" />
<command id="save_columns" />
label="&staff.checkin.print_receipt_label;"
command="cmd_checkin_print"
accesskey="&staff.checkin.print_receipt_label.accesskey;"/>
+ <button id="checkin_export"
+ label="Export"
+ command="cmd_checkin_export"
+ accesskey=""/>
<checkbox id="trim_list" label="Trim List (20 rows)" checked="true" persist="checked"/>
<checkbox id="do_not_alert_on_precat" label="Don't Alert on Pre-Cat" persist="checked"/>
<spacer id="pcii3s" flex="1"/>
}
],
+ 'cmd_checkout_export' : [
+ ['command'],
+ function() {
+ try {
+ obj.export_list();
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('cmd_checkout_export',E);
+ }
+ }
+ ],
+
+
'cmd_checkout_reprint' : [
['command'],
function() {
obj.error.standard_unexpected_error_alert('print',E);
}
},
+
+ 'export_list' : function(silent,f) {
+ var obj = this;
+ try {
+ obj.list.on_all_fleshed = function() {
+ try {
+ dump( obj.list.dump_csv() + '\n' );
+ copy_to_clipboard(obj.list.dump_csv());
+ setTimeout(function(){obj.list.on_all_fleshed = null;if (typeof f == 'function') f();},0);
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('print',E);
+ }
+ }
+ obj.list.full_retrieve();
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('export',E);
+ }
+ },
'check_date' : function(node) {
JSAN.use('util.date');
<commandset id="checkout_cmds">
<command id="cmd_checkout_submit" />
<command id="cmd_checkout_print" />
+ <command id="cmd_checkout_export" />
<command id="cmd_checkout_reprint" />
<command id="cmd_checkout_done" />
<command id="sel_clip" />
label="&staff.patron_display.checkout.print_receipt_label;"
command="cmd_checkout_print"
accesskey="&staff.patron_display.checkout.print_receipt_label.accesskey;"/>
- <button id="checkout_reprint"
- label="&staff.patron_display.checkout.reprint_receipt_label;"
- command="cmd_checkout_reprint"
- accesskey="&staff.patron_display.checkout.reprint_receipt_label.accesskey;"/>
+ <button id="checkout_export"
+ label="Export"
+ command="cmd_checkout_export"
+ accesskey=""/>
<button id="clip_button" disabled="true" command="sel_clip" label="Copy to Clipboard" />
<button id="save_col_btn" command="save_columns" label="Save Columns" />
<spacer id="pcii3s" flex="1"/>
}
}
],
+ 'cmd_copy_status_export' : [
+ ['command'],
+ function() {
+ try {
+ obj.list.on_all_fleshed =
+ function() {
+ try {
+ dump( obj.list.dump_csv() + '\n' );
+ copy_to_clipboard(obj.list.dump_csv());
+ setTimeout(function(){ obj.list.on_all_fleshed = null; },0);
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('export',E);
+ }
+ }
+ obj.list.full_retrieve();
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('export',E);
+ }
+ }
+ ],
+
'cmd_copy_status_reprint' : [
['command'],
function() {
<commandset id="copy_status_cmds">
<command id="cmd_copy_status_submit_barcode" />
<command id="cmd_copy_status_print" />
+ <command id="cmd_copy_status_export" />
<command id="cmd_copy_status_reprint" />
<command id="cmd_copy_status_done" />
<command id="save_columns" />
label="Print"
command="cmd_copy_status_print"
accesskey="P"/>
+ <button id="copy_status_export"
+ label="Export"
+ command="cmd_copy_status_export"
+ accesskey=""/>
<checkbox id="trim_list" label="Trim List (20 rows)" checked="true" persist="checked"/>
<spacer flex="1"/>
</hbox>
obj.list.full_retrieve();
}
],
+ 'cmd_in_house_use_export' : [
+ ['command'],
+ function() {
+ obj.list.on_all_fleshed = function() {
+ try {
+ dump(obj.list.dump_csv() + '\n');
+ copy_to_clipboard(obj.list.dump_csv());
+ setTimeout(function(){obj.list.on_all_fleshed = null;},0);
+ } catch(E) {
+ alert(E);
+ }
+ }
+ obj.list.full_retrieve();
+ }
+ ],
+
'cmd_in_house_use_reprint' : [
['command'],
function() {
<command id="sel_clip" />
<command id="cmd_in_house_use_submit_barcode" />
<command id="cmd_in_house_use_print" />
+ <command id="cmd_in_house_use_export" />
<command id="cmd_in_house_use_reprint" />
<command id="cmd_in_house_use_done" />
<command id="save_columns" />
label="Print List"
command="cmd_in_house_use_print"
accesskey=""/>
+ <button id="in_house_use_export"
+ label="Export"
+ command="cmd_in_house_use_export"
+ accesskey=""/>
<checkbox id="trim_list" label="Trim List (20 rows)" checked="true" persist="checked"/>
<spacer id="pcii3s" flex="1"/>
<button id="clip_button" disabled="true" command="sel_clip" label="Copy to Clipboard" />
}
}
],
+ 'cmd_holds_export' : [
+ ['command'],
+ function() {
+ try {
+ function flesh_callback() {
+ try {
+ dump(obj.list.dump_csv() + '\n');
+ copy_to_clipboard(obj.list.dump_csv());
+ setTimeout(function(){obj.list.on_all_fleshed = null;},0);
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('export 2',E);
+ }
+ }
+ obj.list.on_all_fleshed = flesh_callback;
+ obj.list.full_retrieve();
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('export 1',E);
+ }
+ }
+ ],
+
'cmd_show_notifications' : [
['command'],
function() {
<command id="sel_patron" disabled="true"/>
<command id="sel_clip" />
<command id="cmd_holds_print" />
+ <command id="cmd_holds_export" />
<command id="cmd_show_catalog" />
<command id="cmd_retrieve_patron" />
<command id="cmd_show_notifications" />
<hbox id="holds_bottom_ui" flex="1">
<spacer flex="1"/>
<button id="holds_print" label="Print" command="cmd_holds_print" accesskey="P" />
+ <button id="holds_export"
+ label="Export"
+ command="cmd_holds_export"
+ accesskey=""/>
</hbox>
</overlay>
],
'cmd_items_print' : [ ['command'], function() { obj.items_print(1); } ],
'cmd_items_print2' : [ ['command'], function() { obj.items_print(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(1); alert('Action complete.'); obj.retrieve(); } ],
'cmd_items_renew_all' : [ ['command'], function() { obj.items_renew_all(); } ],
'cmd_items_renew2' : [ ['command'], function() { obj.items_renew(2); alert('Action complete.'); obj.retrieve(); } ],
}
},
+ 'items_export' : function(which) {
+ var obj = this;
+ try {
+ var list = (which==2 ? obj.list2 : obj.list);
+ function flesh_callback() {
+ try {
+ dump( list.dump_csv() + '\n');
+ copy_to_clipboard(list.dump_csv());
+ setTimeout(function(){list.on_all_fleshed = null;},0);
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('export 2',E);
+ }
+ }
+ list.on_all_fleshed = flesh_callback;
+ list.full_retrieve();
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('export 1',E);
+ }
+ },
+
'items_renew_all' : function() {
try {
var obj = this; var list = obj.list;
<command id="sel_copy_details"/>
<command id="sel_patron"/>
<command id="cmd_items_print" />
+ <command id="cmd_items_export" />
<command id="cmd_items_renew" />
<command id="cmd_items_renew_all" />
<command id="cmd_items_claimed_returned" />
<command id="sel_copy_details2"/>
<command id="sel_patron2"/>
<command id="cmd_items_print2" />
+ <command id="cmd_items_export2" />
<command id="cmd_items_renew2" />
<command id="cmd_items_claimed_returned2" />
<command id="cmd_items_checkin2" />
<button id="noncat" label="Show Non-Cataloged Circulations in List Above" command="cmd_show_noncats" accesskey="N"/>
<spacer flex="1"/>
<button id="items_print" label="&staff.patron_display.items.print_receipt_label;" command="cmd_items_print" accesskey="&staff.patron_display.items.print_receipt_label.accesskey;" />
+ <button id="items_export"
+ label="Export"
+ command="cmd_items_export"
+ accesskey=""/>
</hbox>
<hbox id="items_bottom_ui2" flex="1">
<spacer flex="1"/>
<button id="items_print2" label="&staff.patron_display.items.print_receipt_label;" command="cmd_items_print2" old_accesskey="&staff.patron_display.items.print_receipt_label.accesskey;" />
+ <button id="items_export2"
+ label="Export"
+ command="cmd_items_export2"
+ accesskey=""/>
</hbox>
</overlay>