From e423a0220dff8fa2b5592224e33a2b03d5f913f4 Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 29 Jul 2009 08:15:50 +0000 Subject: [PATCH] Staff initials for standing penalties. Looks for org setting ui.circ.standing_penalty.require_initials to enable this feature. The Apply/Modify button will jump to the initials textbox if empty. No dedicated initials field in actor.user_standing_penalty, so appending to the note field. Not parsing notes for initials when editing, though we may want to (I'd argue for a dedicated field in this case). git-svn-id: svn://svn.open-ils.org/ILS/trunk@13768 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 5 +++++ Open-ILS/web/opac/locale/en-US/lang.dtd | 4 ++++ .../server/patron/edit_standing_penalty.js | 16 +++++++++++++++- .../server/patron/edit_standing_penalty.xul | 8 +++++++- .../server/patron/new_standing_penalty.js | 16 +++++++++++++++- .../server/patron/new_standing_penalty.xul | 8 +++++++- 6 files changed, 53 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 0c8577477e..68ddd59251 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1782,6 +1782,11 @@ INSERT into config.org_unit_setting_type null, 'bool' ), +( 'ui.circ.standing_penalty.require_initials', + 'Require staff initials for entry/edit of standing penalties.', + null, + 'bool' ), + ( 'ui.general.button_bar', 'Button bar', null, diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index bd2a2ab261..ac7006e299 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1239,6 +1239,8 @@ + + @@ -1252,6 +1254,8 @@ + + diff --git a/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js b/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js index 6215f8b112..df846f9f48 100644 --- a/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js +++ b/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js @@ -24,6 +24,11 @@ function edit_penalty_init() { build_penalty_menu(); + var show_initials = String( data.hash.aous['ui.circ.standing_penalty.require_initials'] ) == 'true'; + if (show_initials) { + document.getElementById('initials_box').hidden = false; + } + /* set widget values */ document.getElementById('csp_menupopup').setAttribute('value',xul_param('id',{'modal_xulG':true})); if (xul_param('id',{'modal_xulG':true})==21) { // SILENT_NOTE @@ -81,10 +86,19 @@ function edit_penalty_init() { document.getElementById('apply_btn').addEventListener( 'command', function() { + var note = document.getElementById('note_tb').value; + if (!document.getElementById('initials_box').hidden) { + var initials_tb = document.getElementById('initials_tb'); + if (initials_tb.value == '') { + initials_tb.focus(); return; + } else { + note = note + ' - ' + initials_tb.value; + } + } update_modal_xulG( { 'id' : document.getElementById('csp_menupopup').getAttribute('value'), - 'note' : document.getElementById('note_tb').value, + 'note' : note, 'modify' : 1 } ) diff --git a/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.xul b/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.xul index 792baaf559..4670318700 100644 --- a/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.xul +++ b/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.xul @@ -58,9 +58,15 @@ + +