Staff initials for standing penalties. Looks for org setting ui.circ.standing_penalt...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 29 Jul 2009 08:15:50 +0000 (08:15 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 29 Jul 2009 08:15:50 +0000 (08:15 +0000)
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
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js
Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.xul
Open-ILS/xul/staff_client/server/patron/new_standing_penalty.js
Open-ILS/xul/staff_client/server/patron/new_standing_penalty.xul

index 0c85774..68ddd59 100644 (file)
@@ -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,
index bd2a2ab..ac7006e 100644 (file)
 <!ENTITY staff.patron_display.apply_penalty_dialog.cancel_btn.accesskey "C">
 <!ENTITY staff.patron_display.apply_penalty_dialog.apply_btn.label "Apply">
 <!ENTITY staff.patron_display.apply_penalty_dialog.apply_btn.accesskey "A">
+<!ENTITY staff.patron_display.apply_penalty_dialog.initials_entry.label "Initials">
+<!ENTITY staff.patron_display.apply_penalty_dialog.initials_entry.accesskey "I">
 <!ENTITY staff.patron_display.edit_penalty_dialog.title "Modify Standing Penalty/Message">
 <!ENTITY staff.patron_display.edit_penalty_dialog.header "Modify Standing Penalty/Message">
 <!ENTITY staff.patron_display.edit_penalty_dialog.description "Notes, Alerts, Blocks">
 <!ENTITY staff.patron_display.edit_penalty_dialog.cancel_btn.accesskey "C">
 <!ENTITY staff.patron_display.edit_penalty_dialog.apply_btn.label "Modify">
 <!ENTITY staff.patron_display.edit_penalty_dialog.apply_btn.accesskey "M">
+<!ENTITY staff.patron_display.edit_penalty_dialog.initials_entry.label "Initials">
+<!ENTITY staff.patron_display.edit_penalty_dialog.initials_entry.accesskey "I">
 <!ENTITY staff.patron_editor_interface_label "Patron Edit">
 <!ENTITY staff.patron_interface_label "Patron ">
 <!ENTITY staff.patron_navbar.bills 'Bills'>
index 6215f8b..df846f9 100644 (file)
@@ -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
                     }
                 )
index 792baaf..4670318 100644 (file)
     </toolbox>
     <textbox id="note_tb" multiline="true" />
     <hbox>
+        <hbox id="initials_box">
+            <label control="initials_tb" 
+                value="&staff.patron_display.edit_penalty_dialog.initials_entry.label;" 
+                accesskey="&staff.patron_display.edit_penalty_dialog.initials_entry.accesskey;"/>
+            <textbox id="initials_tb" />
+        </hbox>
         <spacer flex="1"/>
         <button id="cancel_btn" label="&staff.patron_display.edit_penalty_dialog.cancel_btn.label;" accesskey="&staff.patron_display.edit_penalty_dialog.cancel_btn.accesskey;" />
-        <button id="apply_btn" label="&staff.patron_display.edit_penalty_dialog.apply_btn.label;" accesskey="&staff.patron_display.edit_penalty_dialog.apply_btn.label;" />
+        <button id="apply_btn" label="&staff.patron_display.edit_penalty_dialog.apply_btn.label;" accesskey="&staff.patron_display.edit_penalty_dialog.apply_btn.accesskey;" />
     </hbox>
 </window>
 
index b40e62a..dffdc24 100644 (file)
@@ -24,6 +24,11 @@ function new_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 behavior */
         document.getElementById('csp_menulist').addEventListener(
             'command',
@@ -64,10 +69,19 @@ function new_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
                     }
                 )
index edb0b7f..cc9b800 100644 (file)
     </toolbox>
     <textbox id="note_tb" multiline="true" />
     <hbox>
+        <hbox id="initials_box">
+            <label control="initials_tb" 
+                value="&staff.patron_display.apply_penalty_dialog.initials_entry.label;" 
+                accesskey="&staff.patron_display.apply_penalty_dialog.initials_entry.accesskey;"/>
+            <textbox id="initials_tb" />
+        </hbox>
         <spacer flex="1"/>
         <button id="cancel_btn" label="&staff.patron_display.apply_penalty_dialog.cancel_btn.label;" accesskey="&staff.patron_display.apply_penalty_dialog.cancel_btn.accesskey;" />
-        <button id="apply_btn" label="&staff.patron_display.apply_penalty_dialog.apply_btn.label;" accesskey="&staff.patron_display.apply_penalty_dialog.apply_btn.label;" />
+        <button id="apply_btn" label="&staff.patron_display.apply_penalty_dialog.apply_btn.label;" accesskey="&staff.patron_display.apply_penalty_dialog.apply_btn.accesskey;" />
     </hbox>
 </window>