[open-ils-commits] [GIT] Evergreen ILS branch rel_3_1 updated. 3502fda66eff7a4331ca5a4b2b2906e0f254fc57

Evergreen Git git at git.evergreen-ils.org
Thu Jun 28 14:53:00 EDT 2018


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_1 has been updated
       via  3502fda66eff7a4331ca5a4b2b2906e0f254fc57 (commit)
       via  79e742059e1df2692545467a79bff40e4f475112 (commit)
       via  02b792bf0f587ac5d03156552e23fe0b1eac5ba8 (commit)
       via  33de2414555fc2772cbd65f4b16d153d7b6dd845 (commit)
      from  a51393b20defc3cf573c52ddf9bba412ff1ed052 (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 3502fda66eff7a4331ca5a4b2b2906e0f254fc57
Author: Kathy Lussier <klussier at masslnc.org>
Date:   Fri Jun 1 09:51:07 2018 -0400

    LP#1635386: Restore to xul colors and remove colors from class names
    
    This commit restores the xul display where overdue items were highlighted
    in red and long overdue items were highlighted in orange. Also removes
    the colors from the class names since people may decide to use totally different
    colors or style the rows in different ways.
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2
index 94e4e86..ff61b4a 100644
--- a/Open-ILS/src/templates/staff/css/style.css.tt2
+++ b/Open-ILS/src/templates/staff/css/style.css.tt2
@@ -346,29 +346,29 @@ table.list tr.selected td { /* deprecated? */
 }
 
 /* patron bill row-highlighting */
-.red-row-highlight {
+.overdue-row {
   color: #FFF;
   background-color: #EB0000 !important;
 }
-.red-row-highlight a:link, .dark-red-row-highlight a:link {
+.overdue-row a:link, .lost-row a:link {
   color: #B8ECFF;
 }
-.orange-row-highlight {
+.longoverdue-row {
   color: #000;
   background-color: #FFE1A8 !important;
 }
-.dark-red-row-highlight {
+.lost-row {
   color: #FFF;
   background-color: #800000 !important;
 
 }
-.eg-grid-row-selected.red-row-highlight {
+.eg-grid-row-selected.overdue-row {
   background-color: #CF0000 !important;
 }
-.eg-grid-row-selected.orange-row-highlight {
+.eg-grid-row-selected.longoverdue-row {
   background-color: #FFCF75 !important;
 }
-.eg-grid-row-selected.dark-red-row-highlight {
+.eg-grid-row-selected.lost-row {
   background-color: #5C0000 !important;
 }
 
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
index bd1e9be..63a7121 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
@@ -225,11 +225,11 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
         apply: function(item) {
             if (!item['circulation.checkin_time']) {
                 if (item['circulation.stop_fines'] == 'LOST') {
-                    return 'dark-red-row-highlight';
+                    return 'lost-row';
                 } else if (item['circulation.stop_fines'] == 'LONGOVERDUE') {
-                    return 'red-row-highlight';
+                    return 'longoverdue-row';
                 } else {
-                    return 'orange-row-highlight';
+                    return 'overdue-row';
                 }
             }
         }

commit 79e742059e1df2692545467a79bff40e4f475112
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Fri Mar 23 17:21:36 2018 -0400

    LP#1635386 Clarify and simplify row highlighting code
    
    The existing code had a few functional problems for me.  In the process
    of fixing them, I decided it best to also apply a number of small
    refactorings.  Here is a list of changes in rough order of significance:
    
    -Made the new CSS classes test and apply once per row rather than once
    per cell
    
    -Fixed the test case for overdues: we now just look for no checkin-time
    + no lost/long-overdue stop-fines (matches XUL test)
    
    -Made the color and icon tests totally consistent, and also simplified
    where possible
    
    -Made the widened configuration header style (to accommodate status
    column) functional again (it was using old 'statusicon' class)
    
    -Made row highlight colors '!important' to avoid bad interactions with
    alternating row color styles
    
    -Changed status-cell (and statusCell) to status-column (and
    statusColumn) for a little extra clarity
    
    -Changed nested function name from 'rowClass()' to 'apply()' for greater
    code distinction (i.e. avoid 'rowClass.rowClass()' calls, and instead
    have 'rowClass.apply()')
    
    -Removed some unused variable assignments from grid.js
    
    -Cleaned up a few field attributes for necessity and consistency
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Dawn Dale <ddale at georgialibraries.org>

diff --git a/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2
index ad1db19..c843bbb 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2
@@ -8,7 +8,7 @@
   persist-key="circ.patron.bills"
   dateformat="{{$root.egDateAndTimeFormat}}"
   row-class="colorizeBillsList"
-  status-cell="statusIconColumn">
+  status-column="statusIconColumn">
 
   <eg-grid-menu-item label="[% l('Bill Patron') %]" 
     handler="showBillDialog"></eg-grid-menu-item>
@@ -50,7 +50,7 @@
   <eg-grid-action label="[% l('Full Details') %]" 
     handler="showFullDetails"></eg-grid-action>
 
-  <eg-grid-field label="[% l('Balance Owed') %]" path='summary.balance_owed' required></eg-grid-field>
+  <eg-grid-field label="[% l('Balance Owed') %]" path='summary.balance_owed'></eg-grid-field>
   <eg-grid-field label="[% l('Bill #') %]" path='id'></eg-grid-field>
   <eg-grid-field label="[% l('Start') %]" path='xact_start' datatype="timestamp"></eg-grid-field>
   <eg-grid-field label="[% l('Total Billed') %]" path='summary.total_owed'></eg-grid-field>
@@ -103,8 +103,8 @@
   <eg-grid-field path='circulation.circ_lib' required hidden></eg-grid-field>
   <eg-grid-field path='circulation.duration' required hidden></eg-grid-field>
   <eg-grid-field path='circulation.due_date' dateonlyinterval="circulation.duration" datecontext="circulation.circ_lib" required hidden></eg-grid-field>
-  <eg-grid-field label="[% l('Stop Fines') %]" path="circulation.stop_fines" hidden required>  </eg-grid-field>
-  <eg-grid-field path="circulation.checkin_time" hidden required></eg-grid-field>
+  <eg-grid-field label="[% l('Stop Fines') %]" path="circulation.stop_fines" required hidden></eg-grid-field>
+  <eg-grid-field path="circulation.checkin_time" required hidden></eg-grid-field>
   <eg-grid-field path='circulation.*' hidden> </eg-grid-field>
   <eg-grid-field label="[% l('Checkout / Renewal Library') %]"
     path='circulation.circ_lib.shortname' required hidden> </eg-grid-field>
diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2
index 6ca02ff..94e4e86 100644
--- a/Open-ILS/src/templates/staff/css/style.css.tt2
+++ b/Open-ILS/src/templates/staff/css/style.css.tt2
@@ -301,17 +301,18 @@ table.list tr.selected td { /* deprecated? */
   text-align: center;
 }
 
-.eg-grid-cell-stock-status {
+/* the conf header must be twice the stock flex */
+.eg-grid-cell-conf-header {
   width: 4.4em;
-  text-align: center;
+  font-weight: bold;
 }
 
-/* the conf header must be ~four times the stock flex */
-.eg-grid-cell-conf-header {
+.eg-grid-cell-stock-status {
   width: 4.4em;
-  font-weight: bold;
+  text-align: center;
 }
 
+/* the conf header must be 4x the stock width when status is present */
 .eg-grid-cell-conf-header-status {
   width: 8.8em;
   font-weight: bold;
@@ -347,28 +348,28 @@ table.list tr.selected td { /* deprecated? */
 /* patron bill row-highlighting */
 .red-row-highlight {
   color: #FFF;
-  background-color: #EB0000;
+  background-color: #EB0000 !important;
 }
 .red-row-highlight a:link, .dark-red-row-highlight a:link {
   color: #B8ECFF;
 }
 .orange-row-highlight {
   color: #000;
-  background-color: #FFE1A8;
+  background-color: #FFE1A8 !important;
 }
 .dark-red-row-highlight {
   color: #FFF;
-  background-color: #800000;
+  background-color: #800000 !important;
 
 }
-.eg-grid-row-selected .red-row-highlight {
-  background-color: #CF0000;
+.eg-grid-row-selected.red-row-highlight {
+  background-color: #CF0000 !important;
 }
-.eg-grid-row-selected .orange-row-highlight {
-  background-color: #FFCF75;
+.eg-grid-row-selected.orange-row-highlight {
+  background-color: #FFCF75 !important;
 }
-.eg-grid-row-selected .dark-red-row-highlight {
-  background-color: #5C0000;
+.eg-grid-row-selected.dark-red-row-highlight {
+  background-color: #5C0000 !important;
 }
 
 .eg-grid-cell-content::selection {
diff --git a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 b/Open-ILS/src/templates/staff/share/t_autogrid.tt2
index 21d602b..58b3534 100644
--- a/Open-ILS/src/templates/staff/share/t_autogrid.tt2
+++ b/Open-ILS/src/templates/staff/share/t_autogrid.tt2
@@ -228,7 +228,7 @@
           type='checkbox' ng-model="selectAll"/> 
       </div>
     </div>
-    <div class="eg-grid-cell eg-grid-cell-stock-status" ng-show="statusCell.isEnabled">
+    <div class="eg-grid-cell eg-grid-cell-stock-status" ng-show="statusColumn.isEnabled">
       <div title="[% l('Status Icon Column') %]">[% l('Status') %]</div>
     </div>
     <div class="eg-grid-cell"
@@ -261,7 +261,7 @@
   <!-- Inline grid configuration row -->
   <div class="eg-grid-row eg-grid-conf-row" ng-show="showGridConf">
     <div class="eg-grid-cell"
-      ng-class="statusicon.isEnabled ? 'eg-grid-cell-conf-header-status' : 'eg-grid-cell-conf-header'">
+      ng-class="statusColumn.isEnabled ? 'eg-grid-cell-conf-header-status' : 'eg-grid-cell-conf-header'">
       <div class="eg-grid-conf-cell-entry">[% l('Expand') %]</div>
       <div class="eg-grid-conf-cell-entry">[% l('Shrink') %]</div>
     </div>
@@ -292,18 +292,16 @@
         id="eg-grid-row-{{$index + 1}}"
         ng-repeat="item in items"
         ng-show="items.length > 0"
-        ng-class="{'eg-grid-row-selected' : selected[indexValue(item)]}">
+        ng-class="[{'eg-grid-row-selected' : selected[indexValue(item)]}, rowClass.apply(item)]">
       <div class="eg-grid-cell eg-grid-cell-stock" ng-show="showIndex"
-        ng-click="handleRowClick($event, item)" title="[% l('Row Index') %]"
-          ng-class="rowClass.rowClass(item)">
+        ng-click="handleRowClick($event, item)" title="[% l('Row Index') %]">
         <a href ng-show="gridControls.activateItem" 
           ng-click="gridControls.activateItem(item)" style="font-weight:bold">
           {{$index + offset() + 1}}
         </a>
         <div ng-hide="gridControls.activateItem">{{$index + offset() + 1}}</div>
       </div>
-      <div class="eg-grid-cell eg-grid-cell-stock" ng-show="canMultiSelect"
-          ng-class="rowClass.rowClass(item)">
+      <div class="eg-grid-cell eg-grid-cell-stock" ng-show="canMultiSelect">
         <!-- ng-click=handleRowClick here has unintended 
              consequences and is unnecessary, avoid it -->
         <div>
@@ -312,17 +310,15 @@
             ng-model="selected[indexValue(item)]"/>
         </div>
       </div>
-      <div class="eg-grid-cell eg-grid-cell-stock-status" ng-show="statusCell.isEnabled"
-          ng-class="rowClass.rowClass(item)">
-          <span ng-bind-html="statusCell.template(item)"></span>
+      <div class="eg-grid-cell eg-grid-cell-stock-status" ng-show="statusColumn.isEnabled">
+          <span ng-bind-html="statusColumn.template(item)"></span>
       </div>
       <div class="eg-grid-cell eg-grid-cell-content"
           ng-click="handleRowClick($event, item)"
           ng-dblclick="gridControls.activateItem(item)"
           ng-repeat="col in columns"
           style="text-align:{{col.align}}; flex:{{col.flex}}"
-          ng-show="col.visible"
-          ng-class="rowClass.rowClass(item)">
+          ng-show="col.visible">
 
           <!-- if the cell comes with its own template,
                translate that content into HTML and insert it here -->
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
index a84ab2c..bd1e9be 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
@@ -222,14 +222,13 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
     // -------------
     // Apply coloring to rows based on fines stop reason
     $scope.colorizeBillsList = {
-        rowClass: function(item) {
+        apply: function(item) {
             if (!item['circulation.checkin_time']) {
                 if (item['circulation.stop_fines'] == 'LOST') {
                     return 'dark-red-row-highlight';
                 } else if (item['circulation.stop_fines'] == 'LONGOVERDUE') {
                     return 'red-row-highlight';
-                } else if (item['circulation.due_date'] &&  // Still checked out - need feedback on this approach, feel like there's a better way
-                          !item['circulation.stop_fines']) {
+                } else {
                     return 'orange-row-highlight';
                 }
             }
@@ -240,29 +239,17 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
     $scope.statusIconColumn = {
         isEnabled: true,
         template: function(item) {
-            var template = "";
-            var icons = [];
-            var now = new Date();
-
-            if (item['circulation.due_date'] &&
-                !item['circulation.checkin_time']) {
-                var due_date = new Date(item['circulation.due_date']);
-
-                if (item['circulation.stop_fines'] &&
-                    item['circulation.stop_fines'] == "LOST") {
-                    icons.push('glyphicon-question-sign');
-                } else if (item['circulation.stop_fines'] &&
-                    item['circulation.stop_fines'] == "LONGOVERDUE") {
-                    icons.push('glyphicon-exclamation-sign');
-                } else if (now >= due_date) {
-                    icons.push('glyphicon-time');
+            var icon = '';
+            if (!item['circulation.checkin_time']) {
+                if (item['circulation.stop_fines'] == "LOST") {
+                    icon = 'glyphicon-question-sign';
+                } else if (item['circulation.stop_fines'] == "LONGOVERDUE") {
+                    icon = 'glyphicon-exclamation-sign';
+                } else {
+                    icon = 'glyphicon-time';
                 }
             }
-
-            angular.forEach(icons, function(icon) {
-                template = template + "<i class='glyphicon " + icon + "'></i>"
-            });
-            return template;
+            return "<i class='glyphicon " + icon + "'></i>"
         }
     }
 
diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js
index 71e271c..c774c7f 100644
--- a/Open-ILS/web/js/ui/default/staff/services/grid.js
+++ b/Open-ILS/web/js/ui/default/staff/services/grid.js
@@ -60,7 +60,7 @@ angular.module('egGridMod',
 
             // optional: object that enables status icon field and contains
             //    function to handle what status icons should exist and why.
-            statusCell : '=',
+            statusColumn : '=',
 
             // optional primary grid label
             mainLabel : '@',
@@ -118,9 +118,6 @@ angular.module('egGridMod',
             scope.handleAutoFields();
             scope.collect();
 
-            var statusCell = scope.statusCell;
-            var rowClass = scope.rowClass;
-
             scope.grid_element = element;
             $(element)
                 .find('.eg-grid-content-body')

commit 02b792bf0f587ac5d03156552e23fe0b1eac5ba8
Author: Kathy Lussier <klussier at masslnc.org>
Date:   Tue Jan 30 15:51:13 2018 -0500

    LP#1635386: Improve contrast for colors used in Bills interface
    
    The contrast between cell contents and background colors did not
    meet WCAG standards. This commit provides adequate contrast to
    meet AA level of WCAG standards. The red and dark red background
    colors are similar to what we saw in the XUL client. The orange
    for long overdue is much lighter.
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Dawn Dale <ddale at georgialibraries.org>

diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2
index ebeab4a..6ca02ff 100644
--- a/Open-ILS/src/templates/staff/css/style.css.tt2
+++ b/Open-ILS/src/templates/staff/css/style.css.tt2
@@ -347,21 +347,25 @@ table.list tr.selected td { /* deprecated? */
 /* patron bill row-highlighting */
 .red-row-highlight {
   color: #FFF;
-  background-color: #FF0000;
+  background-color: #EB0000;
+}
+.red-row-highlight a:link, .dark-red-row-highlight a:link {
+  color: #B8ECFF;
 }
 .orange-row-highlight {
-  color: #FFF;
-  background-color: #FFA500 ;
+  color: #000;
+  background-color: #FFE1A8;
 }
 .dark-red-row-highlight {
   color: #FFF;
   background-color: #800000;
+
 }
 .eg-grid-row-selected .red-row-highlight {
   background-color: #CF0000;
 }
 .eg-grid-row-selected .orange-row-highlight {
-  background-color: #DE9000;
+  background-color: #FFCF75;
 }
 .eg-grid-row-selected .dark-red-row-highlight {
   background-color: #5C0000;

commit 33de2414555fc2772cbd65f4b16d153d7b6dd845
Author: Kyle Huckins <khuckins at catalyte.io>
Date:   Fri Nov 17 23:54:53 2017 +0000

    lp1635386 Items Column & Styles for Bill Item Status
    
    - CSS classes for red, dark red, and orange eg-grid-cells.
    - New parameter for eg-grid 'rowClass' to take an object with a function
    to set the class of a cell, allowing such customizations as coloring based
    on item fields.
    - Implementation of 'rowClass' on the Patron Bills interface to display
    colors indicating current Fines Stop reason, based on XUL client.
    - New parameter for eg-grid 'statusCell' to take an object with a function
    to programattically add status icons to a new "Status Icon" column. Said
    column requires a boolean in the object in order to display.
    - Implementation of 'statusCell' on the Patron Bills interface to display
    glyphicons based on if the bill is for a circ that is lost, overdue, or long
    overdue.
    
    Signed-off-by: Kyle Huckins <khuckins at catalyte.io>
    
     Changes to be committed:
    	modified:   Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2
    	modified:   Open-ILS/src/templates/staff/css/style.css.tt2
    	modified:   Open-ILS/src/templates/staff/share/t_autogrid.tt2
    	modified:   Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
    	modified:   Open-ILS/web/js/ui/default/staff/services/grid.js
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Dawn Dale <ddale at georgialibraries.org>

diff --git a/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2
index a6be0cc..ad1db19 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2
@@ -6,7 +6,9 @@
   grid-controls="gridControls"
   revision="gridRevision"
   persist-key="circ.patron.bills"
-  dateformat="{{$root.egDateAndTimeFormat}}">
+  dateformat="{{$root.egDateAndTimeFormat}}"
+  row-class="colorizeBillsList"
+  status-cell="statusIconColumn">
 
   <eg-grid-menu-item label="[% l('Bill Patron') %]" 
     handler="showBillDialog"></eg-grid-menu-item>
@@ -48,7 +50,7 @@
   <eg-grid-action label="[% l('Full Details') %]" 
     handler="showFullDetails"></eg-grid-action>
 
-  <eg-grid-field label="[% l('Balance Owed') %]" path='summary.balance_owed'></eg-grid-field>
+  <eg-grid-field label="[% l('Balance Owed') %]" path='summary.balance_owed' required></eg-grid-field>
   <eg-grid-field label="[% l('Bill #') %]" path='id'></eg-grid-field>
   <eg-grid-field label="[% l('Start') %]" path='xact_start' datatype="timestamp"></eg-grid-field>
   <eg-grid-field label="[% l('Total Billed') %]" path='summary.total_owed'></eg-grid-field>
@@ -101,6 +103,8 @@
   <eg-grid-field path='circulation.circ_lib' required hidden></eg-grid-field>
   <eg-grid-field path='circulation.duration' required hidden></eg-grid-field>
   <eg-grid-field path='circulation.due_date' dateonlyinterval="circulation.duration" datecontext="circulation.circ_lib" required hidden></eg-grid-field>
+  <eg-grid-field label="[% l('Stop Fines') %]" path="circulation.stop_fines" hidden required>  </eg-grid-field>
+  <eg-grid-field path="circulation.checkin_time" hidden required></eg-grid-field>
   <eg-grid-field path='circulation.*' hidden> </eg-grid-field>
   <eg-grid-field label="[% l('Checkout / Renewal Library') %]"
     path='circulation.circ_lib.shortname' required hidden> </eg-grid-field>
diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2
index b70887b..ebeab4a 100644
--- a/Open-ILS/src/templates/staff/css/style.css.tt2
+++ b/Open-ILS/src/templates/staff/css/style.css.tt2
@@ -301,12 +301,22 @@ table.list tr.selected td { /* deprecated? */
   text-align: center;
 }
 
-/* the conf header must be twice the stock flex */
+.eg-grid-cell-stock-status {
+  width: 4.4em;
+  text-align: center;
+}
+
+/* the conf header must be ~four times the stock flex */
 .eg-grid-cell-conf-header {
   width: 4.4em;
   font-weight: bold;
 }
 
+.eg-grid-cell-conf-header-status {
+  width: 8.8em;
+  font-weight: bold;
+}
+
 .eg-grid-row-selected {
   color: #000;
   background-color: rgb(201, 221, 225);
@@ -333,6 +343,30 @@ table.list tr.selected td { /* deprecated? */
   background: rgb(201, 221, 225);
   border-bottom: 1px solid #888;
 }
+
+/* patron bill row-highlighting */
+.red-row-highlight {
+  color: #FFF;
+  background-color: #FF0000;
+}
+.orange-row-highlight {
+  color: #FFF;
+  background-color: #FFA500 ;
+}
+.dark-red-row-highlight {
+  color: #FFF;
+  background-color: #800000;
+}
+.eg-grid-row-selected .red-row-highlight {
+  background-color: #CF0000;
+}
+.eg-grid-row-selected .orange-row-highlight {
+  background-color: #DE9000;
+}
+.eg-grid-row-selected .dark-red-row-highlight {
+  background-color: #5C0000;
+}
+
 .eg-grid-cell-content::selection {
   color: #000;
   background: rgb(201, 221, 225);
diff --git a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 b/Open-ILS/src/templates/staff/share/t_autogrid.tt2
index 0519012..21d602b 100644
--- a/Open-ILS/src/templates/staff/share/t_autogrid.tt2
+++ b/Open-ILS/src/templates/staff/share/t_autogrid.tt2
@@ -228,6 +228,9 @@
           type='checkbox' ng-model="selectAll"/> 
       </div>
     </div>
+    <div class="eg-grid-cell eg-grid-cell-stock-status" ng-show="statusCell.isEnabled">
+      <div title="[% l('Status Icon Column') %]">[% l('Status') %]</div>
+    </div>
     <div class="eg-grid-cell"
         eg-grid-column-drag-dest
         ng-class="{'eg-grid-column-last-mod' : isLastModifiedColumn(col)}"
@@ -257,7 +260,8 @@
 
   <!-- Inline grid configuration row -->
   <div class="eg-grid-row eg-grid-conf-row" ng-show="showGridConf">
-    <div class="eg-grid-cell eg-grid-cell-conf-header">
+    <div class="eg-grid-cell"
+      ng-class="statusicon.isEnabled ? 'eg-grid-cell-conf-header-status' : 'eg-grid-cell-conf-header'">
       <div class="eg-grid-conf-cell-entry">[% l('Expand') %]</div>
       <div class="eg-grid-conf-cell-entry">[% l('Shrink') %]</div>
     </div>
@@ -290,14 +294,16 @@
         ng-show="items.length > 0"
         ng-class="{'eg-grid-row-selected' : selected[indexValue(item)]}">
       <div class="eg-grid-cell eg-grid-cell-stock" ng-show="showIndex"
-        ng-click="handleRowClick($event, item)" title="[% l('Row Index') %]">
+        ng-click="handleRowClick($event, item)" title="[% l('Row Index') %]"
+          ng-class="rowClass.rowClass(item)">
         <a href ng-show="gridControls.activateItem" 
           ng-click="gridControls.activateItem(item)" style="font-weight:bold">
           {{$index + offset() + 1}}
         </a>
         <div ng-hide="gridControls.activateItem">{{$index + offset() + 1}}</div>
       </div>
-      <div class="eg-grid-cell eg-grid-cell-stock" ng-show="canMultiSelect">
+      <div class="eg-grid-cell eg-grid-cell-stock" ng-show="canMultiSelect"
+          ng-class="rowClass.rowClass(item)">
         <!-- ng-click=handleRowClick here has unintended 
              consequences and is unnecessary, avoid it -->
         <div>
@@ -306,12 +312,17 @@
             ng-model="selected[indexValue(item)]"/>
         </div>
       </div>
+      <div class="eg-grid-cell eg-grid-cell-stock-status" ng-show="statusCell.isEnabled"
+          ng-class="rowClass.rowClass(item)">
+          <span ng-bind-html="statusCell.template(item)"></span>
+      </div>
       <div class="eg-grid-cell eg-grid-cell-content"
           ng-click="handleRowClick($event, item)"
           ng-dblclick="gridControls.activateItem(item)"
           ng-repeat="col in columns"
           style="text-align:{{col.align}}; flex:{{col.flex}}"
-          ng-show="col.visible">
+          ng-show="col.visible"
+          ng-class="rowClass.rowClass(item)">
 
           <!-- if the cell comes with its own template,
                translate that content into HTML and insert it here -->
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
index 89110aa..a84ab2c 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
@@ -219,6 +219,52 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
             return ['xact_start']; 
         }
     }
+    // -------------
+    // Apply coloring to rows based on fines stop reason
+    $scope.colorizeBillsList = {
+        rowClass: function(item) {
+            if (!item['circulation.checkin_time']) {
+                if (item['circulation.stop_fines'] == 'LOST') {
+                    return 'dark-red-row-highlight';
+                } else if (item['circulation.stop_fines'] == 'LONGOVERDUE') {
+                    return 'red-row-highlight';
+                } else if (item['circulation.due_date'] &&  // Still checked out - need feedback on this approach, feel like there's a better way
+                          !item['circulation.stop_fines']) {
+                    return 'orange-row-highlight';
+                }
+            }
+        }
+    }
+
+    // Status Icon Column definition
+    $scope.statusIconColumn = {
+        isEnabled: true,
+        template: function(item) {
+            var template = "";
+            var icons = [];
+            var now = new Date();
+
+            if (item['circulation.due_date'] &&
+                !item['circulation.checkin_time']) {
+                var due_date = new Date(item['circulation.due_date']);
+
+                if (item['circulation.stop_fines'] &&
+                    item['circulation.stop_fines'] == "LOST") {
+                    icons.push('glyphicon-question-sign');
+                } else if (item['circulation.stop_fines'] &&
+                    item['circulation.stop_fines'] == "LONGOVERDUE") {
+                    icons.push('glyphicon-exclamation-sign');
+                } else if (now >= due_date) {
+                    icons.push('glyphicon-time');
+                }
+            }
+
+            angular.forEach(icons, function(icon) {
+                template = template + "<i class='glyphicon " + icon + "'></i>"
+            });
+            return template;
+        }
+    }
 
     billSvc.fetchSummary().then(function(s) {$scope.summary = s});
 
diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js
index 15d61f2..71e271c 100644
--- a/Open-ILS/web/js/ui/default/staff/services/grid.js
+++ b/Open-ILS/web/js/ui/default/staff/services/grid.js
@@ -54,6 +54,14 @@ angular.module('egGridMod',
             //                 column
             features : '@',
 
+            // optional: object containing function to conditionally apply
+            //    class to each row.
+            rowClass : '=',
+
+            // optional: object that enables status icon field and contains
+            //    function to handle what status icons should exist and why.
+            statusCell : '=',
+
             // optional primary grid label
             mainLabel : '@',
 
@@ -110,6 +118,9 @@ angular.module('egGridMod',
             scope.handleAutoFields();
             scope.collect();
 
+            var statusCell = scope.statusCell;
+            var rowClass = scope.rowClass;
+
             scope.grid_element = element;
             $(element)
                 .find('.eg-grid-content-body')

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

Summary of changes:
 .../templates/staff/circ/patron/t_bills_list.tt2   |    6 +++-
 Open-ILS/src/templates/staff/css/style.css.tt2     |   39 ++++++++++++++++++++
 Open-ILS/src/templates/staff/share/t_autogrid.tt2  |   11 +++++-
 .../web/js/ui/default/staff/circ/patron/bills.js   |   33 +++++++++++++++++
 Open-ILS/web/js/ui/default/staff/services/grid.js  |    8 ++++
 5 files changed, 94 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list