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

Evergreen Git git at git.evergreen-ils.org
Fri Jul 31 18:09:34 EDT 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, master has been updated
       via  bcccbf03c9631558c050372507d3560fee3009c9 (commit)
      from  3cbd3d76e094e1c8160c684922517431bcf10370 (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 bcccbf03c9631558c050372507d3560fee3009c9
Author: Josh Stompro <stompro at stompro.org>
Date:   Tue Jan 28 10:04:02 2020 -0600

    LP#1783793 - Suspend holds when activation date set in web client angularjs
    
    1. Modify Dates popup changed to not allow picking dates in the past for hold
      activation date both in the date picker, and if typed in manually.  If a
      date in the past is typed in, it is changed to today's date and an alert
      message is displayed.  The date picker just won't allow past days to be
      selected.  The alert message remains until a date in the future is selected.
    
    2. Suspend holds when the activation date is set and saved.
    
    3. Adds a note about the fact that the hold will be suspended when the hold
      activation date is selected for editing.  This makes the behavior clear so
      staff don't have to figure it out by trial and error.
    
    4. Updates several sr-only (Screen Reader Only) labels in the holds date popup
      template that were set to the wrong values.  The file was copied from the hold
      notification popup and the screen reader descriptions were left unchanged from
      those values.
    
    Signed-off-by: Josh Stompro <stompro at stompro.org>
    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/share/t_hold_dates.tt2 b/Open-ILS/src/templates/staff/circ/share/t_hold_dates.tt2
index 3c25872f56..9aea27fb0a 100644
--- a/Open-ILS/src/templates/staff/circ/share/t_hold_dates.tt2
+++ b/Open-ILS/src/templates/staff/circ/share/t_hold_dates.tt2
@@ -15,7 +15,7 @@
     <hr/>
     <div class="row">
       <div class="col-md-1">
-        <label for="modify_thaw_date" class="sr-only">[% l('Update Activate Email') %]</label>
+        <label for="modify_thaw_date" class="sr-only">[% l('Update Hold Activate Date') %]</label>
         <input id='modify_thaw_date' ng-model="args.modify_thaw_date" type="checkbox"/>
       </div>
       <div class="col-md-4">
@@ -23,13 +23,18 @@
       </div>
       <div class="col-md-7">
         <eg-date-input id='thaw_date'
-          ng-disabled="!args.modify_thaw_date" ng-model="args.thaw_date">
+          ng-disabled="!args.modify_thaw_date" ng-model="args.thaw_date" min-date="minDate">
         </eg-date-input>
+        <p ng-hide="!args.modify_thaw_date">[% l('Setting an activation date will also suspend hold.') %]
+        </p>
+        <p ng-hide="!args.thaw_date_error" class="alert alert-warning">
+          [% l('Activation dates in the past not allowed, resetting to today!') %]
+        </p>
       </div>
     </div>
     <div class="row">
       <div class="col-md-1">
-        <label for="modify_request_time" class="sr-only">[% l('Update Phone Number') %]</label>
+        <label for="modify_request_time" class="sr-only">[% l('Update Request Time') %]</label>
         <input id='modify_request_time' ng-model="args.modify_request_time" type="checkbox"/>
       </div>
       <div class="col-md-4">
@@ -57,7 +62,7 @@
     </div>
     <div class="row">
       <div class="col-md-1">
-        <label for="modify_shelf_expire_time" class="sr-only">[% l('Update SMS Carrier') %]</label>
+        <label for="modify_shelf_expire_time" class="sr-only">[% l('Update Shelf Expire Date') %]</label>
         <input id='modify_shelf_expire_time' ng-model="args.modify_shelf_expire_time" type="checkbox"/>
       </div>
       <div class="col-md-4">
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js
index dcc1d11e6c..0ae837aef7 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js
@@ -305,8 +305,13 @@ function($uibModal , $q , egCore , egConfirmDialog , egAlertDialog) {
                 angular.forEach(
                     ['thaw_date', 'request_time', 'expire_time', 'shelf_expire_time'], 
                     function(field) {
-                        if (modal_scope.args['modify_' + field]) 
+                        if (modal_scope.args['modify_' + field]) { 
                             val[field] = modal_scope.args[field].toISOString();
+                            if (field === 'thaw_date') {
+                            //If we are setting the thaw_date, freeze the hold.
+                                val['frozen'] = true;
+                            }
+                        }
                     }
                 );
 
@@ -335,6 +340,17 @@ function($uibModal , $q , egCore , egConfirmDialog , egAlertDialog) {
                         relay_to_update($scope).then($uibModalInstance.close);
                     }
                     $scope.cancel = function() { $uibModalInstance.dismiss() }
+                    $scope.minDate = new Date();
+                    //watch for changes to the hold dates, and perform validations
+                    $scope.$watch('args', function(newValue,oldValue,scope) {
+                        if (newValue['thaw_date'] && newValue['thaw_date'] < today) {
+                            $scope.args['thaw_date'] = today;
+                            $scope.args.thaw_date_error = true;
+                        }
+                        if (newValue['thaw_date'] && newValue['thaw_date'] > today) {
+                            $scope.args.thaw_date_error = false;
+                        }
+                    }, true);
                 }
             ],
         }).result;

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

Summary of changes:
 .../src/templates/staff/circ/share/t_hold_dates.tt2    | 13 +++++++++----
 .../web/js/ui/default/staff/circ/services/holds.js     | 18 +++++++++++++++++-
 2 files changed, 26 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list