Merge branch 'master' of git.evergreen-ils.org:Evergreen into template-toolkit-opac...
authorBill Erickson <berick@esilibrary.com>
Thu, 11 Aug 2011 21:50:09 +0000 (17:50 -0400)
committerBill Erickson <berick@esilibrary.com>
Thu, 11 Aug 2011 21:50:09 +0000 (17:50 -0400)
Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm
Open-ILS/xul/staff_client/chrome/content/util/network.js
Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/locale/en-US/circ.properties

index 4a3d345..2b563a8 100644 (file)
@@ -521,7 +521,7 @@ sub retrieve_queued_records {
         'search_vandelay_queued_bib_record' : 'search_vandelay_queued_authority_record';
 
     if ($self->api_name =~ /export/) {
-        my $rec_list = $e->$search({id => [map { $_->{id} } @$record_ids]});
+        my $rec_list = $e->$search({id => [map { $_->{id} } @$record_ids]}, {substream => 1});
         if ($self->api_name =~ /print/) {
 
             $e->rollback;
index 4fcca50..931d174 100644 (file)
@@ -49,7 +49,14 @@ util.network.prototype = {
             if (req.cancelled) {
                 result = fake_ilsevent_for_network_errors;
             } else {
-                result = req.getResultObject();    
+                result = req.getResultObject();   
+                if(result && req._reported_events) {
+                    if(typeof result.ilsevent != 'undefined') {
+                        result._reported_events = req._reported_events;
+                    } else {
+                        result[0]._reported_events = req._reported_events;
+                    }
+                } 
             }
         } catch(E) {
             try {
@@ -449,6 +456,7 @@ util.network.prototype = {
         try {
             if (!override_params.text) override_params.text = {};
             if (!override_params.auto_override_these_events) override_params.auto_override_these_events = [];
+            if (!override_params.report_override_on_events) override_params.report_override_on_events = [];
             function override(r) {
                 try {
                     // test to see if we can suppress this dialog and auto-override
@@ -479,7 +487,7 @@ util.network.prototype = {
                     netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
                     var xml = '<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">' + 
                         '<groupbox><caption label="' + offlineStrings.getString('network.override.exceptions') + '"/>' + 
-                        '<grid><columns><column/><column/></columns><rows>';
+                        '<grid><columns><column/><column flex="1"/></columns><rows>';
                     for (var i = 0; i < r.length; i++) {
                         var t1 = String(r[i].ilsevent).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
                         var t2 = String(r[i].textcode).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
@@ -507,6 +515,20 @@ util.network.prototype = {
                     );
                     if (fancy_prompt_data.fancy_status == 'complete') {
                         req = obj._request(app,name + '.override',params);
+                        if (req && override_params.report_override_on_events.length > 0 && typeof result == 'object') {
+                            var reported_events = [];
+                            for (var i = 0; i < r.length; i++) {
+                                if (typeof r[i].ilsevent != 'undefined') {
+                                    if (override_params.report_override_on_events.indexOf( r[i].ilsevent == null ? null : Number(r[i].ilsevent) ) != -1) {
+                                        reported_events.push(Number(r[i].ilsevent));
+                                    }
+                                    if (override_params.report_override_on_events.indexOf( r[i].textcode ) != -1) {
+                                        reported_events.push(r[i].textcode);
+                                    }
+                                }
+                            }
+                            req._reported_events = reported_events;
+                        }
                     }
                     return req;
                 } catch(E) {
index 53a4b0d..ee4d317 100644 (file)
@@ -18,6 +18,8 @@ circ.checkout.prototype = {
 
         obj.patron_id = params.patron_id;
 
+        obj.auto_override_events = [];
+
         JSAN.use('circ.util');
         var columns = circ.util.columns( 
             { 
@@ -653,13 +655,29 @@ circ.checkout.prototype = {
                         7016 /* ITEM_ON_HOLDS_SHELF */,
                         7013 /* PATRON_EXCEEDS_FINES */
                     ],
+                    'report_override_on_events' : [ /* Allow auto-override of Patron overrides only */
+                        1212 /* PATRON_EXCEEDS_OVERDUE_COUNT */,
+                        1213 /* PATRON_BARRED */,
+                        7002 /* PATRON_EXCEEDS_CHECKOUT_COUNT */,
+                        7013 /* PATRON_EXCEEDS_FINES */
+                    ],
+                    'auto_override_these_events' : obj.auto_override_events,
                     'text' : {
+                        '1212' : function(r) {
+                            return document.getElementById('circStrings').getString('staff.circ.checkout.override.will_auto');
+                        },
+                        '1213' : function(r) {
+                            return document.getElementById('circStrings').getString('staff.circ.checkout.override.will_auto');
+                        },
                         '1232' : function(r) {
                             return document.getElementById('circStrings').getString('staff.circ.checkout.override.item_deposit_required.warning');
                         },
                         '1233' : function(r) {
                             return document.getElementById('circStrings').getString('staff.circ.checkout.override.item_rental_fee_required.warning');
                         },
+                        '7002' : function(r) {
+                            return document.getElementById('circStrings').getString('staff.circ.checkout.override.will_auto');
+                        },
                         '7004' : function(r) {
                             try {
                                 status_name = obj.data.hash.ccs[ r.payload.status() ].name();
@@ -670,6 +688,9 @@ circ.checkout.prototype = {
                         },
                         '7010' : function(r) {
                             return r.payload;
+                        },
+                        '7013' : function(r) {
+                            return document.getElementById('circStrings').getString('staff.circ.checkout.override.will_auto');
                         }
                     }
                 }
@@ -697,7 +718,9 @@ circ.checkout.prototype = {
             /**********************************************************************************************************************/
             /* Normal case, proceed with checkout */
             if (permit.ilsevent === '0') {
-
+                if(permit._reported_events != 'undefined') {
+                    obj.auto_override_events = obj.auto_override_events.concat(permit._reported_events);
+                }
                 JSAN.use('util.sound'); var sound = new util.sound(); sound.circ_good();
                 params.permit_key = permit.payload;
                 obj._checkout( params, permit ); 
index b155e5b..dcfbd18 100644 (file)
@@ -48,6 +48,7 @@ staff.circ.checkout.barcode.failed.alert=Check Out Failed %1$s
 staff.circ.checkout.override.confirm=Override Checkout Failure?
 staff.circ.checkout.override.item_deposit_required.warning=A billing for an Item Deposit will be added to the patron's account if this action is overrided.
 staff.circ.checkout.override.item_rental_fee_required.warning=A billing for an Item Rental Fee will be added to the patron's account if this action is overrided.
+staff.circ.checkout.override.will_auto=If overriden now, subsequent checkouts during this patron's session will auto-override this event.
 staff.circ.checkout.not_cataloged.confirm=Mis-scan or non-cataloged item.  Checkout as a pre-cataloged item?
 staff.circ.pre_cataloged=Pre-cataloged
 staff.circ.non_cataloged=Non-cataloged