From: Jeff Godin Date: Tue, 7 Apr 2015 15:17:14 +0000 (-0400) Subject: TADL missing pieces customizations X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bdf9118b441e9d2155990449b9f6930497699a92;p=evergreen%2Ftadl.git TADL missing pieces customizations * Do not use patron letter * Check items out to patron and make due in 7 days * No renewals * set STOPFINES Signed-off-by: Jeff Godin --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm index 3e438ce69c..fb664cd645 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm @@ -1486,6 +1486,21 @@ sub mark_item_missing_pieces { $e->update_asset_copy($copy) or return $e->die_event; + ### Update circ to prevent fines + my $new_circ = $e->search_action_circulation([ + { target_copy => $copy->id}, + { limit => 1, + order_by => {circ => "xact_start DESC"} + } + ])->[0]; + + $new_circ->renewal_remaining(0); + $new_circ->stop_fines('MAXFINES'); + $new_circ->stop_fines_time($new_circ->xact_start); + my $due_date = DateTime->now(time_zone => 'local')->add(days => 7); + $new_circ->due_date(cleanse_ISO8601( $due_date->strftime('%FT%T%z') )); + $e->update_action_circulation($new_circ) or return $e->die_event; + if ($e->commit) { my $ses = OpenSRF::AppSession->create('open-ils.trigger'); diff --git a/Open-ILS/xul/staff_client/server/cat/util.js b/Open-ILS/xul/staff_client/server/cat/util.js index 2a7578e7dd..243148a140 100644 --- a/Open-ILS/xul/staff_client/server/cat/util.js +++ b/Open-ILS/xul/staff_client/server/cat/util.js @@ -890,34 +890,7 @@ cat.util.mark_item_as_missing_pieces = function(copy_ids) { [ ses(), penalty ] ); } - // 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(); + // TADL does not use the Patron Letter } 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() ]) );