From f23f0c1ddad8e8946bdafb28add12be1373949d1 Mon Sep 17 00:00:00 2001 From: phasefx Date: Fri, 9 Oct 2009 19:15:00 +0000 Subject: [PATCH] More CSS configurability for Checkin/Hold Capture interfaces, mostly so we can style those states from the Checkin Modifiers menu-button, like Amnesty Mode and Auto-Print Hold and Transit Slips. Problem is, I don't know a good way to style them. End-users could create a circ_custom.css file mimicking circ.css and give any rules the ! important flag to override the stock CSS. git-svn-id: svn://svn.open-ils.org/ILS/trunk@14338 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 5 +- Open-ILS/xul/staff_client/server/circ/checkin.js | 64 ++++++++++++++++++++-- Open-ILS/xul/staff_client/server/circ/checkin.xul | 11 +++- .../staff_client/server/circ/checkin_overlay.xul | 27 ++++----- Open-ILS/xul/staff_client/server/skin/circ.css | 14 +++++ 5 files changed, 94 insertions(+), 27 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 3a43f96267..aa12fd1bbd 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1781,7 +1781,6 @@ - @@ -1795,8 +1794,8 @@ - - + + diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js index 21b68514b0..019455701c 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -222,18 +222,28 @@ circ.checkin.prototype = { var x = document.getElementById('background'); if (x) { if ( ev.target.value == util.date.formatted_date(new Date(),'%F') ) { - x.setAttribute('style','background-color: green'); + //addCSSClass(x,'checkin_screen_normal'); + removeCSSClass(x,'checkin_screen_backdating'); + removeCSSClass(document.getElementById('background'),'checkin_screen_do_not_alert_on_precat'); + removeCSSClass(document.getElementById('background'),'checkin_screen_suppress_holds_and_transits'); + removeCSSClass(document.getElementById('background'),'checkin_screen_amnesty_mode'); + removeCSSClass(document.getElementById('background'),'checkin_screen_checkin_auto_print_slips'); document.getElementById('background-text').setAttribute('value',document.getElementById('circStrings').getString('staff.circ.process_item')); } else { - x.setAttribute('style','background-color: red'); + addCSSClass(x,'checkin_screen_backdating'); + //removeCSSClass(x,'checkin_screen_normal'); document.getElementById('background-text').setAttribute('value',document.getElementById('circStrings').getFormattedString('staff.circ.backdated_checkin', [ev.target.value])); } } - } catch(E) { var x = document.getElementById('background'); if (x) { - x.setAttribute('style','background-color: green'); + //addCSSClass(x,'checkin_screen_normal'); + removeCSSClass(x,'checkin_screen_backdating'); + removeCSSClass(document.getElementById('background'),'checkin_screen_do_not_alert_on_precat'); + removeCSSClass(document.getElementById('background'),'checkin_screen_suppress_holds_and_transits'); + removeCSSClass(document.getElementById('background'),'checkin_screen_amnesty_mode'); + removeCSSClass(document.getElementById('background'),'checkin_screen_checkin_auto_print_slips'); document.getElementById('background-text').setAttribute('value',document.getElementById('circStrings').getString('staff.circ.process_item')); } dump('checkin:effective_date: ' + E + '\n'); @@ -277,6 +287,50 @@ circ.checkin.prototype = { 'cmd_csv_to_file' : [ ['command'], function() { obj.list.dump_csv_to_file( { 'defaultFileName' : 'checked_in.txt' } ); obj.controller.view.checkin_barcode_entry_textbox.focus(); + } ], + 'cmd_do_not_alert_on_precat' : [ ['command'], function(ev) { + dump('in cmd_do_not_alert_on_precat\n'); + var bg = document.getElementById('background'); + var cb = document.getElementById('do_not_alert_on_precat'); + var ind = document.getElementById('do_not_alert_on_precat_indicator'); + var cn = 'checkin_screen_do_not_alert_on_precat'; + if (cb.getAttribute('checked') == 'true') { addCSSClass(bg,cn); } else { removeCSSClass(bg,cn); } + ind.hidden = cb.getAttribute('checked') != 'true'; + document.getElementById('checkin_barcode_entry_textbox').focus(); + return true; + } ], + 'cmd_suppress_holds_and_transits' : [ ['command'], function(ev) { + dump('in cmd_suppress_holds_and_transits\n'); + var bg = document.getElementById('background'); + var cb = document.getElementById('suppress_holds_and_transits'); + var ind = document.getElementById('suppress_holds_and_transits_indicator'); + var cn = 'checkin_screen_suppress_holds_and_transits'; + if (cb.getAttribute('checked') == 'true') { addCSSClass(bg,cn); } else { removeCSSClass(bg,cn); } + ind.hidden = cb.getAttribute('checked') != 'true'; + document.getElementById('checkin_barcode_entry_textbox').focus(); + return true; + } ], + 'cmd_amnesty_mode' : [ ['command'], function(ev) { + dump('in cmd_amnesty_mode\n'); + var bg = document.getElementById('background'); + var cb = document.getElementById('amnesty_mode'); + var ind = document.getElementById('amnesty_mode_indicator'); + var cn = 'checkin_screen_amnesty_mode'; + if (cb.getAttribute('checked') == 'true') { addCSSClass(bg,cn); } else { removeCSSClass(bg,cn); } + ind.hidden = cb.getAttribute('checked') != 'true'; + document.getElementById('checkin_barcode_entry_textbox').focus(); + return true; + } ], + 'cmd_checkin_auto_print_slips' : [ ['command'], function(ev) { + dump('in cmd_checkin_auto_print_slips\n'); + var bg = document.getElementById('background'); + var cb = document.getElementById('checkin_auto_print_slips'); + var ind = document.getElementById('checkin_auto_print_slips_indicator'); + var cn = 'checkin_screen_checkin_auto_print_slips'; + if (cb.getAttribute('checked') == 'true') { addCSSClass(bg,cn); } else { removeCSSClass(bg,cn); } + ind.hidden = cb.getAttribute('checked') != 'true'; + document.getElementById('checkin_barcode_entry_textbox').focus(); + return true; } ] } } @@ -355,7 +409,7 @@ circ.checkin.prototype = { if ( obj.test_barcode(barcode) ) { /* good */ } else { /* bad */ return; } } var backdate = obj.controller.view.checkin_effective_datepicker.value; - var auto_print = document.getElementById('checkin_auto'); + var auto_print = document.getElementById('checkin_auto_print_slips'); if (auto_print) auto_print = auto_print.getAttribute('checked') == 'true'; JSAN.use('circ.util'); var params = { diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.xul b/Open-ILS/xul/staff_client/server/circ/checkin.xul index 892670d3f8..9d824eb167 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.xul +++ b/Open-ILS/xul/staff_client/server/circ/checkin.xul @@ -42,11 +42,12 @@ var tab_name; if (xul_param('hold_capture')) { - document.getElementById('checkin_auto').checked = true; - document.getElementById('checkin_auto').hidden = true; + var cb1 = document.getElementById('checkin_auto_print_slips'); cb1.hidden = true; cb1.checked = true; + var cb1_ind = document.getElementById('checkin_auto_print_slips_indicator'); cb1_ind.hidden = false; + var cb2 = document.getElementById('suppress_holds_and_transits'); cb2.hidden = true; cb2.checked = false; + var cb2_ind = document.getElementById('suppress_holds_and_transits_indicator'); cb2_ind.hidden = true; document.getElementById('checkin_effective_date_hbox').hidden = true; document.getElementById('caption').setAttribute('label',document.getElementById('circStrings').getString('staff.circ.checkin.hold_capture')); - document.getElementById('hold_capture_blurb').hidden = false; tab_name = document.getElementById('circStrings').getString('staff.circ.checkin.hold_capture'); } else { tab_name = document.getElementById('circStrings').getString('staff.circ.checkin.check_in.tab'); @@ -95,6 +96,10 @@ + + + + diff --git a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul index 7c02fb3135..c7d0dff877 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul +++ b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul @@ -38,16 +38,15 @@ - + - - + - - - - + + + + @@ -136,18 +135,14 @@ accesskey="&staff.circ.checkin_overlay.checkin_modifiers_btn.accesskey;" type="menu" allowevents="false"> - - - - + diff --git a/Open-ILS/xul/staff_client/server/skin/circ.css b/Open-ILS/xul/staff_client/server/skin/circ.css index 4c201685c7..52995df6c5 100644 --- a/Open-ILS/xul/staff_client/server/skin/circ.css +++ b/Open-ILS/xul/staff_client/server/skin/circ.css @@ -2,3 +2,17 @@ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); @namespace html url("http://www.w3.org/TR/REC-html40"); + +.checkin_screen_normal { background-color: green; } +.checkin_screen_backdating { background-color: red; } +.checkin_screen_do_not_alert_on_precat { } +.checkin_screen_suppress_holds_and_transits { } +.checkin_screen_amnesty_mode { } +.checkin_screen_checkin_auto_print_slips { } + +#background-text { font-size: x-large; font-weight: bold; } +#do_not_alert_on_precat_indicator { background-color: -moz-dialog; color: -moz-dialog-text; font-size: large; font-weight: bold; } +#suppress_holds_and_transits_indicator { background-color: -moz-dialog; color: -moz-dialog-text; font-size: large; font-weight: bold; } +#amnesty_mode_indicator { background-color: -moz-dialog; color: -moz-dialog-text; font-size: large; font-weight: bold; } +#checkin_auto_print_slips_indicator { background-color: -moz-dialog; color: -moz-dialog-text; font-size: large; font-weight: bold; } + -- 2.11.0