<!ENTITY staff.server.admin.index.transits "Transits">
<!ENTITY staff.server.admin.index.transit_list "Transit List">
<!ENTITY staff.server.admin.index.conify "Server Settings">
+<!ENTITY staff.server.admin.index.external_text_editor.label "External Text Editor Command">
+<!ENTITY staff.server.admin.index.external_text_editor.accesskey "x">
<!ENTITY staff.server.admin.index.booking "Booking">
<!ENTITY staff.server.admin.index.booking.reservation "Create/Cancel Reservations">
['oncommand'],
function() { open_eg_web_page('conify/global/permission/grp_penalty_threshold'); }
],
+ 'cmd_local_admin_external_text_editor' : [
+ ['oncommand'],
+ function() {
+ var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
+ var key = 'oils.text_editor.external.cmd';
+ var has_key = prefs.prefHasUserValue(key);
+ var value = has_key ? prefs.getCharPref(key) : 'C:\\Windows\\notepad.exe %letter.txt%';
+ var cmd = window.prompt(
+ document.getElementById('offlineStrings').getString('text_editor.prompt_for_external_cmd'),
+ value
+ );
+ if (!cmd) { return; }
+ prefs.setCharPref(key,cmd);
+ }
+ ],
'cmd_local_admin_idl_field_doc' : [
['oncommand'],
function() { open_eg_web_page('conify/global/config/idl_field_doc'); }
<command id="cmd_local_admin_standing_penalty"/>
<command id="cmd_local_admin_grp_penalty_threshold"/>
<command id="cmd_local_admin_copy_location_order"/>
+ <command id="cmd_local_admin_external_text_editor"
+ label="&staff.server.admin.index.external_text_editor.label;"
+ accesskey="&staff.server.admin.index.external_text_editor.accesskey;"/>
<command id="cmd_local_admin_idl_field_doc"/>
<command id="cmd_local_admin_action_trigger"/>
<command id="cmd_local_admin_survey"/>
<menuitem label="&staff.server.admin.index.closed_dates;" command="cmd_local_admin_closed_dates"/>
<menuitem label="&staff.server.admin.index.copy_locations;" command="cmd_local_admin_copy_locations"/>
<menuitem label="&staff.main.menu.admin.local_admin.conify.copy_location_order.label;" command="cmd_local_admin_copy_location_order"/>
+ <menuitem command="cmd_local_admin_external_text_editor"/>
<menuitem label="&staff.main.menu.admin.local_admin.conify.idl_field_doc.label;" command="cmd_local_admin_idl_field_doc"/>
<menuitem label="&staff.server.admin.index.fonts_and_sounds;" command="cmd_local_admin_fonts_and_sounds"/>
<menuitem label="&staff.main.menu.admin.local_admin.conify.grp_penalty_threshold.label;" command="cmd_local_admin_grp_penalty_threshold"/>
printing.nothing_to_reprint=Nothing to re-print
printing.prompt_for_external_print_cmd=Enter external print command and parameters (use %receipt.txt% or %receipt.html% as the file containing the print data. Those values will be substituted with the proper path.):
printing.print_strategy_saved=Print strategy (%1$s) saved to file system.
+text_editor.prompt_for_external_cmd=Enter external text editor command and parameters (use %letter.txt% as the file containing the text. This value will be substituted with the proper path.):
'chrome,resizable,modal',
{ 'copy_id' : copies[i].id() }
);
- // TODO: patron notes/messages
+ // Patron Message
var my_xulG = win.open(
urls.XUL_NEW_STANDING_PENALTY,
'new_standing_penalty',
[ ses(), penalty ]
);
}
- // TODO: Invoke 3rd party app with letter to patron
+ // Patron Letter
+
+ var txt_file = new util.file('letter.txt');
+ txt_file.write_content('truncate',robj.payload.letter.template_output().data());
+ var text_path = '"' + txt_file._file.path + '"';
+ txt_file.close();
+
+ var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
+ var key = 'oils.text_editor.external.cmd';
+ var has_key = prefs.prefHasUserValue(key);
+ var oils_external_letter_opener_cmd = has_key ? prefs.getCharPref(key) : 'C:\\Windows\\notepad.exe %letter.txt%';
+
+ var cmd = oils_external_letter_opener_cmd.replace('%letter.txt%',text_path);
+
+ var file = new util.file('letter.bat');
+ file.write_content('truncate+exec',cmd);
+ file.close();
+ file = new util.file('letter.bat');
+
+ dump('letter exec: ' + cmd + '\n');
+ var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
+ process.init(file._file);
+
+ var args = [];
+
+ dump('process.run = ' + process.run(false, args, args.length) + '\n');
+
+ file.close();
+
} else if (robj.ilsevent == 1500 /* ACTION_CIRCULATION_NOT_FOUND */) {
alert( $("catStrings").getFormattedString('staff.cat.util.mark_item_missing_pieces.circ_not_found',[ copies[i].barcode() ]) );
} else {