[open-ils-commits] [GIT] Evergreen ILS branch master updated. 07668697cf13b4687eab878b13446b4771ec9c4e

Evergreen Git git at git.evergreen-ils.org
Thu Sep 22 10:33:15 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  07668697cf13b4687eab878b13446b4771ec9c4e (commit)
       via  5e134e4975fc674a2adfd3e893f2eba49a7bc292 (commit)
      from  3ba2b7b83280933a36b9b24a19bf386afa8dab3f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 07668697cf13b4687eab878b13446b4771ec9c4e
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu Sep 22 10:27:11 2011 -0400

    TPac: credit card payment bug fixes / cleanup
    
    * Repaired bug with paying multiple transactions
    * Replaced JS-based back/cancel navigation with a's
    * Added some debug logging
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
index fbcc8e7..726db95 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
@@ -942,8 +942,10 @@ sub load_myopac_pay {
     my $self = shift;
     my $r;
 
-    $r = $self->prepare_fines(undef, undef, [$self->cgi->param('xact'), $self->cgi->param('xact_misc')]) and
-        return $r;
+    my @payment_xacts = ($self->cgi->param('xact'), $self->cgi->param('xact_misc'));
+    $logger->info("tpac paying fines for xacts @payment_xacts");
+
+    $r = $self->prepare_fines(undef, undef, \@payment_xacts) and return $r;
 
     # balance_owed is computed specifically from the fines we're trying
     # to pay in this case.
diff --git a/Open-ILS/src/templates/opac/myopac/main_pay.tt2 b/Open-ILS/src/templates/opac/myopac/main_pay.tt2
index 86ee7e8..7c34682 100644
--- a/Open-ILS/src/templates/opac/myopac/main_pay.tt2
+++ b/Open-ILS/src/templates/opac/myopac/main_pay.tt2
@@ -13,8 +13,16 @@
             [% ctx.payment_response.payload.error_message %]
         </div>
         <p>
-            <a href="[% ctx.opac_root %]/myopac/main"
-                onclick="history.go(-1); return false;">[% l('Go back') %]</a>
+            [%
+                url_args = {xact => [], xact_misc => []};
+                FOR k IN ['xact', 'xact_misc'];
+                    FOR val IN CGI.param(k);
+                        url_args.$k.push(val);
+                    END;
+                END;
+                retry_url =  mkurl(ctx.opac_root _ '/myopac/main_payment_form', url_args, 1);
+            %]
+            <a href="[% retry_url %]">[% l('Go back') %]</a>
             [% l('to try again or to cancel this payment attempt.') %]
         </p>
     [% ELSE %]
diff --git a/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 b/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2
index c54f4e0..cb4d4a1 100644
--- a/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2
+++ b/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2
@@ -18,12 +18,12 @@
     <p><big>[% l("Are you sure you are ready to charge [_1] to your credit card?", money(ctx.fines.balance_owed)) %]</big></p>
     <form action="[% ctx.opac_root %]/myopac/main_pay" method="POST">
         [% FOR k IN CGI.Vars;
-            NEXT UNLESS k %]
-        <input type="hidden" name="[% k | html %]" value="[% CGI.param(k) | html %]" />
-        [% END %]
+            NEXT UNLESS k;
+            FOR val IN CGI.param(k) %]
+        <input type="hidden" name="[% k | html %]" value="[% val | html %]" />
+        [% END; END %]
         <input type="submit" value="[% l('Submit Payment') %]" />
-        <input type="reset" value="[% l('Cancel') %]"
-            onclick="history.go(-1);" />
+        <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]">[% l('Cancel') %]</a>
     [% ELSE %]
     <form method="POST">
         <input type="hidden" name="last_chance" value="1" />
@@ -173,8 +173,7 @@
                 <tr>
                     <td colspan='2' align="center">
                         <input type="submit" value="[% l('Next') %]" />
-                        <input type="reset" value="[% l('Cancel') %]"
-                            onclick="history.go(-1);" />
+                        <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]">[% l('Cancel') %]</a>
                     </td>
                 </tr>
                 [% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %]

commit 5e134e4975fc674a2adfd3e893f2eba49a7bc292
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu Sep 22 10:20:27 2011 -0400

    Tpac: better param array detection in mkurl()
    
    Avoid propagating empty arrays as "ARRAY(JUNK)"
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/templates/opac/parts/header.tt2 b/Open-ILS/src/templates/opac/parts/header.tt2
index 66e47ac..e6addc8 100644
--- a/Open-ILS/src/templates/opac/parts/header.tt2
+++ b/Open-ILS/src/templates/opac/parts/header.tt2
@@ -43,7 +43,9 @@
         # apply user params
         FOR k IN params.keys;
             encoded = [];
-            list = params.$k.0 ? params.$k : [params.$k];
+            max = params.$k.max;
+            list = (params.$k.0 OR max == -1) ? params.$k : [params.$k];
+            IF list.size == 0; NEXT; END;
             # CGI croaks on already-decoded strings.  force-encode to be safe.
             FOR p IN list; encoded.push(ctx.encode_utf8(p)); END;
             foo = cgi.param("-name", k, "-values", encoded);

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/WWW/EGCatLoader/Account.pm         |    6 ++++--
 Open-ILS/src/templates/opac/myopac/main_pay.tt2    |   12 ++++++++++--
 .../templates/opac/myopac/main_payment_form.tt2    |   13 ++++++-------
 Open-ILS/src/templates/opac/parts/header.tt2       |    4 +++-
 4 files changed, 23 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list