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

Evergreen Git git at git.evergreen-ils.org
Wed May 17 16:07:05 EDT 2017


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  997e45aa27126442f1e3441a8b4d4e734a1fe365 (commit)
       via  8f47b6d7f4473e8edba641a6a9e136019f42d2e0 (commit)
      from  2ea92ed9110e596c8cb36bd55111277bfbfa58d2 (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 997e45aa27126442f1e3441a8b4d4e734a1fe365
Author: Bill Erickson <berickxx at gmail.com>
Date:   Wed Apr 26 12:42:21 2017 -0400

    LP#1618949 Required patron stats format repairs
    
    Fixes a broken div column class, which caused the patron stat cats to
    stretch across the page.
    
    Other div nesting/formatting fixes and additional inline code comments.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
index 073ccd4..4f4cc6e 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
@@ -860,50 +860,43 @@ within the "form" by name for validation.
 <div class="row reg-field-row"
      ng-show="show_field('stat_cats') || hasRequiredStatCat" ng-repeat="cat in stat_cats">
      <!-- Display this stat cat when displaying all stat cats
-       or when this stat cat is required.  Wrap the body of 
+       or when this stat cat is required.  Wrap the body of
        stat cat display in a div for easy show/hide.  -->
   <div ng-if="show_field('stat_cats') || cat.required() == 1">
-  <div class="col-md-3 reg-field-label">
-    <label>{{cat.name()}}</label>
-  </div>
-  <div class="reg-field-input">
-
-    <!-- Editable typeahead is not support in this version of 
-        angularjs-bootstrap.  Requires Angular 1.4 and 
-        angularjs-bootstrap version 1.1+ -->
-
-    <!-- typeahead is wonky.  Consider updating -->
-    <!--
-    <input type="text" ng-model="stat_cat_entry_maps[cat.id()]"
-      typeahead="value as entry.value() for entry in cat.entries() | filter:$viewValue | limitTo:8" 
-      class="form-control">
-    -->
-    
-    <div ng-if="cat.entries().length != 0">
-      <div class="btn-group" uib-dropdown>
-        <button type="button" class="btn btn-default" uib-dropdown-toggle>
-          <span style="padding-right: 5px;">
-            {{stat_cat_entry_maps[cat.id()]}}</span>
-          <span class="caret"></span>
-        </button>
-        <ul uib-dropdown-menu>
-          <li ng-repeat="entry in cat.entries()">
-            <a href 
-              ng-click="field_modified();stat_cat_entry_maps[cat.id()]=entry.value()"> 
-              {{entry.value()}}
-            </a>
-          </li>
-        </ul>
+
+    <div class="col-md-3 reg-field-label">
+      <label>{{cat.name()}}</label>
+    </div>
+    <div class="col-md-3 reg-field-input">
+      <div ng-if="cat.entries().length != 0">
+        <div class="btn-group" uib-dropdown>
+          <button type="button" class="btn btn-default" uib-dropdown-toggle>
+            <span style="padding-right: 5px;">
+              {{stat_cat_entry_maps[cat.id()]}}</span>
+            <span class="caret"></span>
+          </button>
+          <ul uib-dropdown-menu>
+            <li ng-repeat="entry in cat.entries()">
+              <a href
+                ng-click="field_modified();stat_cat_entry_maps[cat.id()]=entry.value()">
+                {{entry.value()}}
+              </a>
+            </li>
+          </ul>
+        </div>
       </div>
     </div>
-  </div>
 
-  <!-- Stat cat retrieval API uses open-ils.storage under the covers
-      which represents DB bools at 1/0 instead of cstore-style t/f -->
-  <div class="col-md-3 reg-field-input" ng-show="show_field('stat_cats') || hasRequiredStatCat" ng-if="cat.allow_freetext() == '1'">
-    <input type="text" ng-model="stat_cat_entry_maps[cat.id()]" class="form-control" ng-required="cat.required() == 1"/>
-  </div>
-  </div><!-- show/hide -->
+    <!-- Stat cat retrieval API uses open-ils.storage under the covers
+        which represents DB bools at 1/0 instead of cstore-style t/f -->
+    <div class="col-md-3 reg-field-input"
+      ng-show="show_field('stat_cats') || hasRequiredStatCat"
+      ng-if="cat.allow_freetext() == '1'">
+      <input type="text" ng-model="stat_cat_entry_maps[cat.id()]"
+        class="form-control" ng-required="cat.required() == 1"/>
+    </div>
+
+  </div><!-- show/hide wrapper -->
 </div>
 
 <!-- surveys -->
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
index d6e1c47..02e9902 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
@@ -1216,9 +1216,10 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
         if ($scope.patron.isnew) 
             set_new_patron_defaults(prs);
 
+        // Stat cats are fetched from open-ils.storage, where 't'==1
         $scope.hasRequiredStatCat = prs.stat_cats.filter(
                 function(cat) {return cat.required() == 1} ).length > 0;
-            
+
         $scope.page_data_loaded = true;
 
         prs.set_field_patterns(field_patterns);
@@ -1274,7 +1275,7 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
         'stat_cats' : 1,
         'surveys' : 1
     }; 
-    
+
     // Returns true if the selected field should be visible
     // given the current required/suggested/all setting.
     // The visibility flag applied to each field as a result of calling

commit 8f47b6d7f4473e8edba641a6a9e136019f42d2e0
Author: Billy Horn <bhorn at catalystdevworks.com>
Date:   Mon Nov 7 14:29:53 2016 -0800

    LP#1618949 Patron edit forces required stat cats
    
    Display required stat cats as required form fields and prevent the
    patron editor form from submitting when required stat cats do not have
    values.
    
    Signed-off-by: Billy Horn <bhorn at catalystdevworks.com>
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
index 4acd97e..073ccd4 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
@@ -853,16 +853,20 @@ within the "form" by name for validation.
 </div>
 
 <div class="alert alert-success row" role="alert" 
-    ng-show="show_field('stat_cats')" ng-if="stat_cats.length > 0">
+    ng-show="show_field('stat_cats') || hasRequiredStatCat" ng-if="stat_cats.length > 0">
     <div class="col-md-6">[% l('Statistical Categories') %]</div>
 </div>
 
-<div class="row reg-field-row" 
-    ng-show="show_field('stat_cats')" ng-repeat="cat in stat_cats">
+<div class="row reg-field-row"
+     ng-show="show_field('stat_cats') || hasRequiredStatCat" ng-repeat="cat in stat_cats">
+     <!-- Display this stat cat when displaying all stat cats
+       or when this stat cat is required.  Wrap the body of 
+       stat cat display in a div for easy show/hide.  -->
+  <div ng-if="show_field('stat_cats') || cat.required() == 1">
   <div class="col-md-3 reg-field-label">
     <label>{{cat.name()}}</label>
   </div>
-  <div class="col-md-3 reg-field-input">
+  <div class="reg-field-input">
 
     <!-- Editable typeahead is not support in this version of 
         angularjs-bootstrap.  Requires Angular 1.4 and 
@@ -896,9 +900,10 @@ within the "form" by name for validation.
 
   <!-- Stat cat retrieval API uses open-ils.storage under the covers
       which represents DB bools at 1/0 instead of cstore-style t/f -->
-  <div class="col-md-3 reg-field-input" ng-if="cat.allow_freetext() == '1'">
-    <input type="text" ng-model="stat_cat_entry_maps[cat.id()]"/>
+  <div class="col-md-3 reg-field-input" ng-show="show_field('stat_cats') || hasRequiredStatCat" ng-if="cat.allow_freetext() == '1'">
+    <input type="text" ng-model="stat_cat_entry_maps[cat.id()]" class="form-control" ng-required="cat.required() == 1"/>
   </div>
+  </div><!-- show/hide -->
 </div>
 
 <!-- surveys -->
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
index f0a45cd..d6e1c47 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
@@ -1216,6 +1216,9 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
         if ($scope.patron.isnew) 
             set_new_patron_defaults(prs);
 
+        $scope.hasRequiredStatCat = prs.stat_cats.filter(
+                function(cat) {return cat.required() == 1} ).length > 0;
+            
         $scope.page_data_loaded = true;
 
         prs.set_field_patterns(field_patterns);
@@ -1271,7 +1274,7 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
         'stat_cats' : 1,
         'surveys' : 1
     }; 
-
+    
     // Returns true if the selected field should be visible
     // given the current required/suggested/all setting.
     // The visibility flag applied to each field as a result of calling

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

Summary of changes:
 .../src/templates/staff/circ/patron/t_edit.tt2     |   76 ++++++++++----------
 .../web/js/ui/default/staff/circ/patron/regctl.js  |    4 +
 2 files changed, 41 insertions(+), 39 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list