From f204124c20c8da9888121b3c128d46f342c68f6b Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Tue, 7 Apr 2015 11:17:14 -0400 Subject: [PATCH] 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 --- .../src/perlmods/lib/OpenILS/Application/Circ.pm | 15 +++++++++++ Open-ILS/xul/staff_client/server/cat/util.js | 29 +--------------------- 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm index 4ed6bf0fd8..f2a4c7d004 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm @@ -1430,6 +1430,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() ]) ); -- 2.11.0