From f81efb0230d1acb1926ca6faab0611ffe7ee23ba Mon Sep 17 00:00:00 2001 From: Dan Reuther Date: Thu, 5 Nov 2015 18:08:34 -0500 Subject: [PATCH] KMAIN-1918 Emphasize PC Only Patrons Goal: Give PC Only Patron name a yellow border Solution: Add new CSS class PATRON_PC_ONLY Add handling for removing and adding PATRON_PC_ONLY Signed-off-by: Kyle Huckins modified: Open-ILS/xul/staff_client/server/patron/display.js modified: Open-ILS/xul/staff_client/server/patron/util.js modified: Open-ILS/xul/staff_client/server/skin/patron_display.css --- Open-ILS/xul/staff_client/server/patron/display.js | 1 + Open-ILS/xul/staff_client/server/patron/util.js | 10 ++++++++-- Open-ILS/xul/staff_client/server/skin/patron_display.css | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js index bcc6bcb38f..90a95dbe03 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -193,6 +193,7 @@ patron.display.prototype = { removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_1'); removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_2'); removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_3'); + removeCSSClass(document.documentElement,'PATRON_PC_ONLY'); } ], 'cmd_patron_refresh' : [ diff --git a/Open-ILS/xul/staff_client/server/patron/util.js b/Open-ILS/xul/staff_client/server/patron/util.js index d77b3de07c..ce36b6eb3f 100644 --- a/Open-ILS/xul/staff_client/server/patron/util.js +++ b/Open-ILS/xul/staff_client/server/patron/util.js @@ -710,7 +710,8 @@ patron.util.set_penalty_css = function(patron) { removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_1'); removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_2'); removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_3'); - + removeCSSClass(document.documentElement, 'PATRON_PC_ONLY'); + JSAN.use('util.network'); var net = new util.network(); net.simple_request('FM_MOUS_RETRIEVE.authoritative',[ ses(), patron.id() ], function(req) { var summary = req.getResultObject(); @@ -750,6 +751,7 @@ patron.util.set_penalty_css = function(patron) { return (!(p.isdeleted() || p.stop_date())); } ); + for (var i = 0; i < penalties.length; i++) { /* this comes from /opac/common/js/utils.js */ addCSSClass(document.documentElement,penalties[i].standing_penalty().name()); @@ -786,7 +788,11 @@ patron.util.set_penalty_css = function(patron) { case 1: addCSSClass(document.documentElement,'ONE_PENALTY'); break; default: addCSSClass(document.documentElement,'MULTIPLE_PENALTIES'); break; } - + //Check our permission group. 13 is Full priveliges, 90 is PC Only + if(patron.profile() == 90) { + addCSSClass(document.documentElement, 'PATRON_PC_ONLY'); + } + if (patron.alert_message()) { addCSSClass(document.documentElement,'PATRON_HAS_ALERT'); } diff --git a/Open-ILS/xul/staff_client/server/skin/patron_display.css b/Open-ILS/xul/staff_client/server/skin/patron_display.css index 7f095b8a2b..73aac4e049 100644 --- a/Open-ILS/xul/staff_client/server/skin/patron_display.css +++ b/Open-ILS/xul/staff_client/server/skin/patron_display.css @@ -110,6 +110,8 @@ row#row_billing_zip { padding-bottom: 10px; } .PATRON_JUVENILE .dob { color: purple; } .PATRON_JUVENILE label.juvenile_indicator { display: inline; color: purple; } +.PATRON_PC_ONLY .patronNameLarge { border-color: #faff00; } +.PATRON_PC_ONLY .label_pc_only { display: inline; color: yellow; } /* New user perm editor stuff */ row.odd { background-color: lightcyan; } -- 2.11.0