[open-ils-commits] [GIT] Evergreen ILS branch rel_3_3 updated. e479598477cd3d28c08572614cb71edbd6a0ea1f

Evergreen Git git at git.evergreen-ils.org
Fri Feb 21 10:54:56 EST 2020


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, rel_3_3 has been updated
       via  e479598477cd3d28c08572614cb71edbd6a0ea1f (commit)
      from  d9a1f9601c9f3c5f8ab6cdf1690a27aba1eccb61 (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 e479598477cd3d28c08572614cb71edbd6a0ea1f
Author: Dan Briem <dbriem at wlsmail.org>
Date:   Fri Jan 24 18:03:07 2020 -0500

    LP1849370 Mark items as damaged - changing fee usability issues
    
    The prop that conditionally renders the fee interface is bound to the fee input
    so it removes itself from the DOM when cleared. The patch uses a separate prop.
    
    The fee input's by the edge so you may mistakenly close the modal if you try to
    click & drag to highlight the fee. The patch sets the prop backdrop to static.
    
    A $0 item price will cause the modal to keep reloading on submit. If you set a
    $0 fee manually without clicking No Charge it charges the full item price. The
    patch sets the apply_fines param for the Perl API dynamically on submission.
    
    To test:
    1. Make sure the OU setting "Charge item price when marked damaged" is true
    2. Check out an item with a price to a user
    3. Mark it damaged (from Item Status or Checkin screen)
    4. Note if you clear the fee input it removes itself, if you drag the mouse off
    the modal & release it closes, & if you charge $0 without using "No Charge" it
    charges the user the full item price
    5. Apply patch and repeat steps 1-3
    6. Note the input stays when cleared, the modal doesn't close if you release
    the mouse on the backdrop, & charging $0 doesn't charge the user
    
    Signed-off-by: Dan Briem <dbriem at wlsmail.org>
    Signed-off-by: Terran McCanna <tmccanna at georgialibraries.org>
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>

diff --git a/Open-ILS/src/templates/staff/circ/share/t_mark_damaged.tt2 b/Open-ILS/src/templates/staff/circ/share/t_mark_damaged.tt2
index 467fa13f32..52d1c8a784 100644
--- a/Open-ILS/src/templates/staff/circ/share/t_mark_damaged.tt2
+++ b/Open-ILS/src/templates/staff/circ/share/t_mark_damaged.tt2
@@ -9,45 +9,45 @@
   <div class="pad-vert row">
     <div class="col-md-12">
       [% l("Item [_1] will be marked damaged. ", "{{barcode}}") %]
-      <span ng-if="circ && billArgs.charge != null">[% l("Was returned ") %]
+      <span ng-if="showBill">[% l("Was returned ") %]
         <span ng-if="circ_checkin_time">[% l("on [_1] ","{{circ_checkin_time | date:'MM/dd/yy H:mm a'}}") %]</span>
       [% l("for [_1] : [_2]. ",
       "{{circ_patron_name}}", "{{circ.usr().usrname()}}") %]
       [% l("Confirmation required to charge this patron [_1] for the damage.", "{{billArgs.charge | currency}}") %]</span>
     </div>
   </div>
-  <div class="pad-vert row" ng-if="circ && billArgs.charge != null">
+  <div class="pad-vert row" ng-if="showBill">
     <div class="col-md-3">
       <label>[% l("Fee") %]
-      <input type="number" min="0" step="any" class="form-control" ng-disabled="applyFine == 'noapply'"
+      <input type="number" min="0" step="any" class="form-control" ng-disabled="mode == 'waive'"
           focus-me='focus' required ng-model="billArgs.charge"></label>
     </div>
     <div class="col-md-6">
       <label>[% l("Type") %]
       <select class="form-control" ng-model="billArgs.type">
         <option ng-repeat="type in billingTypes | orderBy:'name()'" value="{{type.id()}}" 
-          ng-disabled="applyFine == 'noapply'">
+          ng-disabled="mode == 'waive'">
           {{type.name()}}
         </option>
       </select>
       </label>
     </div>
   </div>
-  <div class="pad-vert row" ng-if="circ && billArgs.charge != null">
+  <div class="pad-vert row" ng-if="showBill">
     <div class="col-md-6">
       <label>[% l("Note") %]
-      <textarea rows="3" class="form-control" placeholder="[% l('Note...') %]"  ng-disabled="applyFine == 'noapply'"
+      <textarea rows="3" class="form-control" placeholder="[% l('Note...') %]"  ng-disabled="mode == 'waive'"
         ng-model="billArgs.note"></textarea></label>
     </div>
   </div>
 </div>
 <div class="modal-footer">
-  <div class="btn-group pull-left" ng-if="circ && billArgs.charge != null">
+  <div class="btn-group pull-left" ng-if="showBill">
     <label class="btn btn-primary" ng-model="mode" btn-radio="'charge'"
       ng-class="{active: mode == 'charge'}" ng-click="btnChargeFees()">[% l('Charge Fees') %]</label>
     <label class="btn btn-primary" ng-model="mode" btn-radio="'waive'"
       ng-class="{active: mode == 'waive'}" ng-click="btnWaiveFees()">[% l('No Charge') %]</label>
   </div>
-  <button class="btn btn-primary" ng-disabled="applyFine == 'apply' && circ && (billArgs.charge == null || !billArgs.type)" ng-click="ok()">[% l('Submit') %]</button>
-  <button class="btn btn-warning" ng-if="!billArgs.charge && applyFine != 'noapply'" ng-click="cancel()">[% l('Cancel') %]</button>
+  <button class="btn btn-primary" ng-disabled="showBill && (billArgs.charge == null || billArgs.charge && !billArgs.type)" ng-click="ok()">[% l('Submit') %]</button>
+  <button class="btn btn-warning" ng-click="cancel()">[% l('Cancel') %]</button>
 </div>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
index e6779e4292..7ec804f039 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
@@ -1312,18 +1312,17 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
     service.mark_damaged = function(params) {
         if (!params) return $q.when();
         return $uibModal.open({
+            backdrop: 'static',
             templateUrl: './circ/share/t_mark_damaged',
             controller:
                 ['$scope', '$uibModalInstance', 'egCore', 'egBilling', 'egItem',
                 function($scope, $uibModalInstance, egCore, egBilling, egItem) {
                     var doRefresh = params.refresh;
                     
+                    $scope.showBill = params.charge != null && params.circ;
                     $scope.billArgs = {charge: params.charge};
                     $scope.mode = 'charge';
                     $scope.barcode = params.barcode;
-                    if (params.charge && params.charge > 0) {
-                        $scope.applyFine = "apply";
-                    }
                     if (params.circ) {
                         $scope.circ = params.circ;
                         $scope.circ_checkin_time = params.circ.checkin_time();
@@ -1338,12 +1337,10 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
                     $scope.btnChargeFees = function() {
                         $scope.mode = 'charge';
                         $scope.billArgs.charge = params.charge;
-                        $scope.applyFine = "apply";
                     }
                     $scope.btnWaiveFees = function() {
                         $scope.mode = 'waive';
                         $scope.billArgs.charge = 0;
-                        $scope.applyFine = "noapply";
                     }
 
                     $scope.cancel = function ($event) { 
@@ -1354,15 +1351,19 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
                     }
 
                     var handle_mark_item_damaged = function() {
+                        var applyFines;
+                        if ($scope.showBill)
+                            applyFines = $scope.billArgs.charge ? 'apply' : 'noapply';
+
                         egCore.net.request(
                             'open-ils.circ',
                             'open-ils.circ.mark_item_damaged',
                             egCore.auth.token(), params.id, {
-                                apply_fines: $scope.applyFine,
+                                apply_fines: applyFines,
                                 override_amount: $scope.billArgs.charge,
                                 override_btype: $scope.billArgs.type,
                                 override_note: $scope.billArgs.note,
-                                handle_checkin: !$scope.applyFine
+                                handle_checkin: !applyFines
                         }).then(function(resp) {
                             if (evt = egCore.evt.parse(resp)) {
                                 doRefresh = false;

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

Summary of changes:
 .../src/templates/staff/circ/share/t_mark_damaged.tt2  | 18 +++++++++---------
 Open-ILS/web/js/ui/default/staff/circ/services/circ.js | 15 ++++++++-------
 2 files changed, 17 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list