[open-ils-commits] [GIT] Evergreen ILS branch master updated. 6105bf23093781fcad169f7acd03736a11a4ab9d

Evergreen Git git at git.evergreen-ils.org
Tue Feb 6 15:58:36 EST 2018


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  6105bf23093781fcad169f7acd03736a11a4ab9d (commit)
       via  fdc204457e58bd5755f74dd7f34f6dda0d0cd2c0 (commit)
      from  94d2a1033ff5b5589c8cca08ab6c0d143f810656 (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 6105bf23093781fcad169f7acd03736a11a4ab9d
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Tue Feb 6 15:58:57 2018 -0500

    LP#1743262: (follow-up) disable submit button if approval code not supplied
    
    This patch causes the submit button to be disabled on the CC payment
    dialog if the user specifies recording an externally-process CC payment
    but has not yet supplied an approval code.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/staff/circ/patron/t_cc_payment_dialog.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_cc_payment_dialog.tt2
index e25bd86..1551f56 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_cc_payment_dialog.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_cc_payment_dialog.tt2
@@ -110,7 +110,7 @@
   </div><!--panel-->
 </div><!--modal-body-->
 <div class="modal-footer">
-  <button class="btn btn-primary" ng-click="ok()">[% l('Submit') %]</button>
+  <button class="btn btn-primary" ng-click="ok()" ng-disabled="context.cc.where_process == 0 && !context.cc.approval_code">[% l('Submit') %]</button>
   <button class="btn btn-warning" ng-click="cancel()">[% l('Cancel') %]</button>
 </div>
 

commit fdc204457e58bd5755f74dd7f34f6dda0d0cd2c0
Author: Bill Erickson <berickxx at gmail.com>
Date:   Mon Feb 5 16:24:38 2018 -0500

    LP#1743262 CC external payment requires app. code
    
    1. Indicate in the CC form that the approval_code field is required,
       styled consistently with the patron edit app.
    
    2. Prevent the form dialog from closing via Submit when no approval code
       is set.
    
    3. Handle payment failures better by preventing the post-API code from
       running (i.e. receipt printing) when the API fails.
    
    To test
    -------
    [1] In the web staff client, attempt to record an externally-supplied
        credit card payment without specifying an approval code. Note that
        an alert message is presented.
    [2] Apply the patch and repeat step 1. This time, the approval code is
        displayed as a required field and the dialog cannot be submitted
        until one is specified.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Terran McCanna <tmccanna at georgialibraries.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/staff/circ/patron/t_cc_payment_dialog.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_cc_payment_dialog.tt2
index 3a0ec69..e25bd86 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_cc_payment_dialog.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_cc_payment_dialog.tt2
@@ -5,7 +5,7 @@
     [% l('Credit Card Information') %]
   </h4>
 </div>
-<div class="modal-body tight-vert-form">
+<div class="modal-body tight-vert-form" id="patron-pay-by-credit-form">
   <div class="panel panel-default">
     <div class="panel-heading">[% l('Credit Card Info') %]</div>
     <div class="panel-body">
@@ -45,7 +45,8 @@
         <div class="row form-group">
           <div class="col-md-4"><label>[% l('Approval Code') %]</label></div>
           <div class="col-md-8">
-            <input type='text' class="form-control" ng-model="context.cc.approval_code"/>
+            <input type='text' class="form-control" 
+              required ng-model="context.cc.approval_code"/>
           </div>
         </div>
       </div><!--cc-external-wrapper-->
diff --git a/Open-ILS/src/templates/staff/css/circ.css.tt2 b/Open-ILS/src/templates/staff/css/circ.css.tt2
index 8f3475b..24d5550 100644
--- a/Open-ILS/src/templates/staff/css/circ.css.tt2
+++ b/Open-ILS/src/templates/staff/css/circ.css.tt2
@@ -162,7 +162,8 @@ but the ones I'm finding aren't quite cutting it..*/
 /* Angular applies these classes based on the field's 
  * required and pattern settings */
 #patron-reg-container .ng-invalid,
-#patron-reg-container .ng-invalid-required {
+#patron-reg-container .ng-invalid-required,
+#patron-pay-by-credit-form .ng-invalid {
   background-color: yellow;
   color: red;
 }
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
index 46fc0b9..97c2d93 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
@@ -40,6 +40,15 @@ function($q , egCore , egWorkLog , patronSvc) {
             patronSvc.current.last_xact_id()
         ).then(function(resp) {
             console.debug('payments: ' + js2JSON(resp));
+
+            if (evt = egCore.evt.parse(resp)) {
+                // Ideally, all scenarios that lead to this alert appearing
+                // will be avoided by the application logic.  Leave the alert
+                // in place now to root out any that remain to be addressed.
+                alert(evt);
+                return $q.reject(''+evt);
+            }
+
             var total = 0; angular.forEach(payments,function(p) { total += p[1]; });
             var msg;
             switch(type) {
@@ -58,8 +67,6 @@ function($q , egCore , egWorkLog , patronSvc) {
                     'total_amount' : total
                 }
             );
-            if (evt = egCore.evt.parse(resp)) 
-                return alert(evt);
 
             // payment API returns the update xact id so we can track it
             // for future payments without having to refresh the user.
@@ -321,15 +328,20 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
         var make_payments = generatePayments();
         billSvc.applyPayment($scope.payment_type, 
             make_payments, note, $scope.check_number, cc_args)
-        .then(function(payment_ids) {
+        .then(
+            function(payment_ids) {
 
-            if (!$scope.disable_auto_print && $scope.receipt_on_pay.isChecked) {
-                printReceipt(
-                    $scope.payment_type, payment_ids, make_payments, note);
-            }
+                if (!$scope.disable_auto_print && $scope.receipt_on_pay.isChecked) {
+                    printReceipt(
+                        $scope.payment_type, payment_ids, make_payments, note);
+                }
 
-            refreshDisplay();
-        })
+                refreshDisplay();
+            },
+            function(msg) {
+                console.error('Payment was rejected: ' + msg);
+            }
+        )
     }
 
     $scope.onReceiptOnPayChanged = function(){
@@ -587,6 +599,12 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
                     }
 
                     $scope.ok = function() {
+                        // CC payment form is not a <form>, 
+                        // so apply validation manually.
+                        if ( $scope.context.cc.where_process == 0 && 
+                            !$scope.context.cc.approval_code)
+                            return;
+
                         $uibModalInstance.close($scope.context.cc);
                     }
 

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

Summary of changes:
 .../staff/circ/patron/t_cc_payment_dialog.tt2      |    7 ++--
 Open-ILS/src/templates/staff/css/circ.css.tt2      |    3 +-
 .../web/js/ui/default/staff/circ/patron/bills.js   |   36 +++++++++++++++-----
 3 files changed, 33 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list