TADL missing pieces customizations
authorJeff Godin <jgodin@tadl.org>
Tue, 7 Apr 2015 15:17:14 +0000 (11:17 -0400)
committerJeff Godin <jgodin@tadl.org>
Sun, 22 May 2016 05:09:03 +0000 (01:09 -0400)
* 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 <jgodin@tadl.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
Open-ILS/xul/staff_client/server/cat/util.js

index 3e438ce..fb664cd 100644 (file)
@@ -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');
index 2a7578e..243148a 100644 (file)
@@ -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() ]) );