From: Jason Etheridge Date: Thu, 8 Jun 2017 05:02:17 +0000 (-0400) Subject: lp1686459 webstaff: item editor form validation X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=dc564af7cc95109ba1a4b4b6fa2c61cebc11cb4e;p=working%2FEvergreen.git lp1686459 webstaff: item editor form validation Specifically for stat cats, we mark the select statements as required if the corresponding stat cat is required, but we can also start using HTML5 validation tests elsewhere in the form now as well. I also fixed the entries so that they display instead of blank entries, and forced the Price, Cost, and Deposit Amount fields to be of input type number, though you could still enter invalid numbers here from the database's POV, so better validation tests are still needed there. Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2 b/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2 index 0d61a68aa9..12f1f77c11 100644 --- a/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2 +++ b/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2 @@ -1,4 +1,12 @@ -
+ +
[% l('Template') %]
@@ -51,7 +59,7 @@
@@ -59,7 +67,7 @@
@@ -67,7 +75,7 @@
@@ -213,11 +221,11 @@ ng-disabled="!defaults.attributes.circ_modifier" ng-model="working.circ_modifier" ng-options="m.code() as m.name() for m in circ_modifier_list | orderBy: 'name()'" > - +
- +
@@ -241,7 +249,7 @@
- +
@@ -261,7 +269,7 @@
@@ -311,7 +319,7 @@
- +
@@ -421,8 +429,9 @@ @@ -432,4 +441,4 @@ - + diff --git a/Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2 b/Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2 index fb53858c74..ba58c126a9 100644 --- a/Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2 +++ b/Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2 @@ -113,7 +113,7 @@ persist-key="cat.volcopy.copies" dateformat="{{$root.egDateAndTimeFormat}}"> - diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js index def7cdcb2a..644be2f378 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js @@ -779,6 +779,8 @@ function(egCore , $q) { ['$scope','$q','$window','$routeParams','$location','$timeout','egCore','egNet','egGridDataProvider','itemSvc','$uibModal', function($scope , $q , $window , $routeParams , $location , $timeout , egCore , egNet , egGridDataProvider , itemSvc , $uibModal) { + $scope.forms = {}; // Accessed by t_attr_edit.tt2 + $scope.defaults = { // If defaults are not set at all, allow everything barcode_checkdigit : false, auto_gen_barcode : false, @@ -1285,7 +1287,9 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , can_save = false; } ); - + if ($scope.forms.myForm && $scope.forms.myForm.$invalid) { + can_save = false; + } $scope.can_save = can_save; }