[open-ils-commits] [GIT] Evergreen ILS branch rel_3_4 updated. bd8f92a1852f2e5ab20fbe3a25511da6b4a6f508
Evergreen Git
git at git.evergreen-ils.org
Fri Dec 27 16:03:07 EST 2019
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_4 has been updated
via bd8f92a1852f2e5ab20fbe3a25511da6b4a6f508 (commit)
from 21616b507941b9b35ff092045f10ea0d5d7144ed (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 bd8f92a1852f2e5ab20fbe3a25511da6b4a6f508
Author: Katlyn Beck <kbeck at catalyte.io>
Date: Mon Nov 26 21:23:48 2018 +0000
lp1712644 Prevent check out due date in past
- Prevents selecting past due date when checking out an item
- Prevents saving a due date with hatch when input date is invalid
Signed-off-by: Katlyn Beck <kbeck at catalyte.io>
Signed-off-by: Kyle Huckins <khuckins at catalyte.io>
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_checkout.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
index 65d56fb8ff..7cbe4927c7 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
@@ -30,7 +30,8 @@
id="patron-checkout-barcode" type="text"/>
<input class="btn btn-default" type="submit"
- ng-class="{disabled : disable_checkout()}" value="[% l('Submit') %]"/>
+ ng-disabled="disable_checkout()"
+ value="[% l('Submit') %]"/>
</div>
</form>
@@ -76,7 +77,9 @@
</label>
</div> -->
<div class="col-md-12 col-lg-6">
- <eg-date-input ng-model="checkoutArgs.due_date" ng-disabled="!date_options.has_sticky_date" show-time-picker></eg-date-input>
+ <eg-date-input min-date="minDate" out-of-range="outOfRange"
+ ng-model="checkoutArgs.due_date" ng-disabled="!date_options.has_sticky_date" show-time-picker>
+ </eg-date-input>
</div>
</div>
</div>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
index d79811c705..3d1b60e2f7 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
@@ -19,6 +19,8 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
due_date : new Date()
};
+ $scope.minDate = new Date();
+ $scope.outOfRange = false;
$scope.gridDataProvider = egGridDataProvider.instance({
get : function(offset, count) {
return this.arrayNotifier($scope.checkouts, offset, count);
@@ -31,7 +33,8 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
patronSvc.current.active() == 'f' ||
patronSvc.current.deleted() == 't' ||
patronSvc.current.card().active() == 'f' ||
- patronSvc.fetchedWithInactiveCard()
+ patronSvc.fetchedWithInactiveCard() ||
+ $scope.outOfRange == true
);
}
@@ -87,8 +90,12 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
});
$scope.$watch('checkoutArgs.due_date', function(newval) {
- if ( $scope.date_options.is_until_logout ) {
- egCore.hatch.setSessionItem('eg.circ.checkout.due_date', newval);
+ if ( $scope.date_options.is_until_logout && !isNaN(newval)) {
+ if (!$scope.outOfRange) {
+ egCore.hatch.setSessionItem('eg.circ.checkout.due_date', newval);
+ } else {
+ egCore.hatch.setSessionItem('eg.circ.checkout.due_date', $scope.checkoutArgs.due_date);
+ }
}
});
diff --git a/Open-ILS/web/js/ui/default/staff/services/ui.js b/Open-ILS/web/js/ui/default/staff/services/ui.js
index 0fe9918e37..f8f7cd16a3 100644
--- a/Open-ILS/web/js/ui/default/staff/services/ui.js
+++ b/Open-ILS/web/js/ui/default/staff/services/ui.js
@@ -1356,13 +1356,12 @@ https://stackoverflow.com/questions/24764802/angular-js-automatically-focus-inpu
if ($scope.outOfRange !== undefined && (maxDateObj || minDateObj)) {
$scope.$watch('ngModel', function (n,o) {
- if (n && n != o) {
- var bad = false;
- var newdate = new Date(n);
- if (maxDateObj && newdate.getTime() > maxDateObj.getTime()) bad = true;
- if (minDateObj && newdate.getTime() < minDateObj.getTime()) bad = true;
- $scope.outOfRange = bad;
- }
+ var bad = false;
+ var newdate = new Date(n);
+ if (isNaN(newdate.getTime())) bad = true;
+ if (maxDateObj && newdate.getTime() > maxDateObj.getTime()) bad = true;
+ if (minDateObj && newdate.getTime() < minDateObj.getTime()) bad = true;
+ $scope.outOfRange = bad;
});
}
}],
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 | 7 +++++--
Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js | 13 ++++++++++---
Open-ILS/web/js/ui/default/staff/services/ui.js | 13 ++++++-------
3 files changed, 21 insertions(+), 12 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list