CAT-182 SCKO Fine Tab Outline
authorKyle Huckins <khuckins@catalyte.io>
Tue, 6 Feb 2018 18:31:38 +0000 (18:31 +0000)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
- Apply CSS outline to Fines tab when a positive
fine exists.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
Signed-off-by: Alex Cautley <acautley@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/web/css/skin/kcls/selfcheck.css
modified:   Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js

Open-ILS/web/css/skin/kcls/selfcheck.css
Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js

index 946834c..28a4c71 100644 (file)
@@ -290,6 +290,14 @@ body .dijitAlignClient {
     width:0px !important;
 }
 
+.fines-exist {
+    outline-style: solid !important;
+    outline-color: yellow !important;
+    outline-width: 6px !important;
+    -moz-outline-radius: 15px 15px 0 0 !important;
+}
+
+
 .hideMe {
     display: none;
 }
index b6726ad..bf11cd5 100644 (file)
@@ -599,11 +599,28 @@ SelfCheckManager.prototype.updateFinesSummary = function() {
                 var finesSum = dojo.byId('acct_fines');
                 var bal = summary ? summary.balance_owed() : 0;
                 var bal2 = parseFloat(bal);
-
                 self.creditPayableBalance = bal2 + '';
             }
         }
     );
+
+    fieldmapper.standardRequest(
+        ['open-ils.actor', 'open-ils.actor.user.transactions.have_balance.fleshed'],
+        {   async : false,
+            params : [this.authtoken, this.patron.id()],
+            oncomplete : function(r) {
+                var dataList = openils.Util.readResponse(r);
+                var hasPositiveFee = false;
+                for(var i = 0; i < dataList.length; i++) {
+                    var data = dataList[i];
+                    if(data.transaction.balance_owed() > 0) {
+                        hasPositiveFee = true;
+                    }
+                }
+
+                if (hasPositiveFee) openils.Util.addCSSClass( dojo.byId('oils-selfck-view-fines-link'), 'fines-exist' );
+            }
+    });
 }