[open-ils-commits] r14729 - in trunk/Open-ILS/xul/staff_client/server: cat circ locale/en-US patron (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Nov 2 19:18:46 EST 2009


Author: phasefx
Date: 2009-11-02 19:18:45 -0500 (Mon, 02 Nov 2009)
New Revision: 14729

Modified:
   trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js
   trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js
   trunk/Open-ILS/xul/staff_client/server/circ/util.js
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
   trunk/Open-ILS/xul/staff_client/server/patron/holds.js
   trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
Log:
Fix minor typos for plural versus singular strings, and change a few identifiters to protect against accidental column collisions.

Meat of this changeset is to allow manipulation of the mint_condition fields on items and holds.  The desired functionality is a way to let holds opt for pristine/complete/or-just-plain-better copies 
or not, with the idea being that an item missing pieces or slightly damaged could be marked as mint_condition = false.  I've re-cast mint condition as Quality/Copy Quality as far as labels go, with 
Good and Mediocre/Any Copy instead of True or False.  I'm open to better suggestions.  There's some dissonance here with the Damaged copy status.



Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js	2009-11-02 23:21:55 UTC (rev 14728)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js	2009-11-03 00:18:45 UTC (rev 14729)
@@ -916,6 +916,13 @@
             input: 'c = function(v){ g.apply("ref",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( [ [ $("catStrings").getString("staff.cat.copy_editor.field.reference.yes_or_true"), get_db_true() ], [ $("catStrings").getString("staff.cat.copy_editor.field.reference.no_or_false"), get_db_false() ] ] ); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
         }
     ],
+    [
+        $('catStrings').getString('staff.cat.copy_editor.field.mint_condition.label'),
+        { 
+            render: 'get_bool( fm.mint_condition() ) ? $("catStrings").getString("staff.cat.copy_editor.field.mint_condition.yes_or_true") : $("catStrings").getString("staff.cat.copy_editor.field.mint_condition.no_or_false")', 
+            input: 'c = function(v){ g.apply("mint_condition",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( [ [ $("catStrings").getString("staff.cat.copy_editor.field.mint_condition.yes_or_true"), get_db_true() ], [ $("catStrings").getString("staff.cat.copy_editor.field.mint_condition.no_or_false"), get_db_false() ] ] ); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
+        }
+    ]
 ],
 
 'right_pane4' : 

Modified: trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js	2009-11-02 23:21:55 UTC (rev 14728)
+++ trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js	2009-11-03 00:18:45 UTC (rev 14729)
@@ -28,7 +28,7 @@
                 'title' : { 'hidden' : false },
                 'location' : { 'hidden' : false },
                 'call_number' : { 'hidden' : false },
-                'status' : { 'hidden' : false },
+                'acp_status' : { 'hidden' : false },
                 'alert_message' : { 'hidden' : false },
                 'due_date' : { 'hidden' : false }
             },

Modified: trunk/Open-ILS/xul/staff_client/server/circ/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/util.js	2009-11-02 23:21:55 UTC (rev 14728)
+++ trunk/Open-ILS/xul/staff_client/server/circ/util.js	2009-11-03 00:18:45 UTC (rev 14729)
@@ -747,7 +747,23 @@
         },
         {
             'persist' : 'hidden width ordinal',
+            'id' : 'acp_mint_condition',
             'fm_class' : 'acp',
+            'label' : document.getElementById('circStrings').getString('staff.circ.utils.acp_mint_condition'),
+            'flex' : 0,
+            'primary' : false,
+            'hidden' : true,
+            'editable' : false, 'render' : function(my) {
+                if (get_bool( my.acp.mint_condition() )) {
+                    return document.getElementById('circStrings').getString('staff.circ.utils.acp_mint_condition.true');
+                } else {
+                    return document.getElementById('circStrings').getString('staff.circ.utils.acp_mint_condition.false');
+                }
+            }
+        },
+        {
+            'persist' : 'hidden width ordinal',
+            'fm_class' : 'acp',
             'id' : 'ref',
             'label' : document.getElementById('circStrings').getString('staff.circ.utils.reference'),
             'flex' : 1,
@@ -1156,7 +1172,7 @@
         {
             'persist' : 'hidden width ordinal',
             'fm_class' : 'acp',
-            'id' : 'status',
+            'id' : 'acp_status',
             'label' : document.getElementById('commonStrings').getString('staff.acp_label_status'),
             'flex' : 1,
             'primary' : false,
@@ -1665,7 +1681,7 @@
         },
         {
             'persist' : 'hidden width ordinal',
-            'id' : 'status',
+            'id' : 'ahr_status',
             'label' : document.getElementById('commonStrings').getString('staff.ahr_status_label'),
             'flex' : 1,
             'primary' : false,
@@ -1704,6 +1720,21 @@
         },
         {
             'persist' : 'hidden width ordinal',
+            'id' : 'ahr_mint_condition',
+            'label' : document.getElementById('circStrings').getString('staff.circ.utils.ahr_mint_condition'),
+            'flex' : 0,
+            'primary' : false,
+            'hidden' : true,
+            'editable' : false, 'render' : function(my) {
+                if (get_bool( my.ahr.mint_condition() )) {
+                    return document.getElementById('circStrings').getString('staff.circ.utils.ahr_mint_condition.true');
+                } else {
+                    return document.getElementById('circStrings').getString('staff.circ.utils.ahr_mint_condition.false');
+                }
+            }
+        },
+        {
+            'persist' : 'hidden width ordinal',
             'id' : 'frozen',
             'label' : document.getElementById('circStrings').getString('staff.circ.utils.active'),
             'flex' : 0,

Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties	2009-11-02 23:21:55 UTC (rev 14728)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties	2009-11-03 00:18:45 UTC (rev 14729)
@@ -184,6 +184,9 @@
 staff.cat.copy_editor.field.reference.label=Reference?
 staff.cat.copy_editor.field.reference.yes_or_true=Yes
 staff.cat.copy_editor.field.reference.no_or_false=No
+staff.cat.copy_editor.field.mint_condition.label=Quality
+staff.cat.copy_editor.field.mint_condition.yes_or_true=Good
+staff.cat.copy_editor.field.mint_condition.no_or_false=Mediocre
 staff.cat.copy_notes.render_notes.label=Add New Note
 staff.cat.copy_notes.render_notes.accesskey=A
 staff.cat.copy_notes.widgets_apply.note_id=Note ID:

Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties	2009-11-02 23:21:55 UTC (rev 14728)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties	2009-11-03 00:18:45 UTC (rev 14729)
@@ -234,6 +234,9 @@
 staff.circ.utils.status_changed_time=Status Changed Time
 staff.circ.utils.reference=Reference?
 staff.circ.utils.deposit=Deposit?
+staff.circ.utils.acp_mint_condition=Quality
+staff.circ.utils.acp_mint_condition.true=Good
+staff.circ.utils.acp_mint_condition.false=Mediocre
 # The < and > highlight that the value is not set; translate Unset and change the delimiters as needed
 staff.circ.utils.unset=<Unset>
 staff.circ.utils.checkout_lib=Checkout Library
@@ -319,6 +322,9 @@
 staff.circ.utils.route_item_status_error=status of Holds Shelf, but no actual hold found.
 staff.circ.utils.payload.hold.barcode=Barcode: %1$s
 staff.circ.utils.payload.hold.title=Title: %1$s
+staff.circ.utils.ahr_mint_condition=Copy Quality
+staff.circ.utils.ahr_mint_condition.true=Good
+staff.circ.utils.ahr_mint_condition.false=Any
 # Hold for patron familyName, firstName secondName
 staff.circ.utils.payload.hold.patron=Hold for patron %1$s, %2$s %3$s
 staff.circ.utils.payload.hold.patron_alias=Hold for patron %1$s

Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties	2009-11-02 23:21:55 UTC (rev 14728)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties	2009-11-03 00:18:45 UTC (rev 14729)
@@ -160,7 +160,7 @@
 staff.patron.holds.holds_edit_email_notify.enable_email.singular=Are you sure you would like to enable email notification for hold %1$s?
 staff.patron.holds.holds_edit_email_notify.enable_email.plural=Are you sure you would like to enable email notification for holds %1$s?
 staff.patron.holds.holds_edit_email_notify.disable_email.singular=Are you sure you would like to disable email notification for hold %1$s?
-staff.patron.holds.holds_edit_email_notify.disable_email.plural=Are you sure you would like to disable email notification for hold %1$s?
+staff.patron.holds.holds_edit_email_notify.disable_email.plural=Are you sure you would like to disable email notification for holds %1$s?
 staff.patron.holds.holds_edit_email_notify.mod_holds_title=Modifying Holds
 
 staff.patron.holds.holds_cut_in_line.description=Move to the front of the holds queue above other holds that are not likewise flagged Top of Queue?
@@ -174,9 +174,23 @@
 staff.patron.holds.holds_cut_in_line.enable_cut.singular=Are you sure you would like to enable Top of Queue for hold %1$s?
 staff.patron.holds.holds_cut_in_line.enable_cut.plural=Are you sure you would like to enable Top of Queue for holds %1$s?
 staff.patron.holds.holds_cut_in_line.disable_cut.singular=Are you sure you would like to disable Top of Queue for hold %1$s?
-staff.patron.holds.holds_cut_in_line.disable_cut.plural=Are you sure you would like to disable Top of Queue for hold %1$s?
+staff.patron.holds.holds_cut_in_line.disable_cut.plural=Are you sure you would like to disable Top of Queue for holds %1$s?
 staff.patron.holds.holds_cut_in_line.mod_holds_title=Modifying Holds
 
+staff.patron.holds.holds_desire_mint_condition.description=Accept only "good condition" copies?
+staff.patron.holds.holds_desire_mint_condition.btn_good.label=Good Condition
+staff.patron.holds.holds_desire_mint_condition.btn_good.accesskey=G
+staff.patron.holds.holds_desire_mint_condition.btn_mediocre.label=Any Condition
+staff.patron.holds.holds_desire_mint_condition.btn_mediocre.accesskey=A
+staff.patron.holds.holds_desire_mint_condition.btn_cancel.label=Cancel
+staff.patron.holds.holds_desire_mint_condition.btn_cancel.accesskey=C
+staff.patron.holds.holds_desire_mint_condition.set_notifs=Set Desired Copy Quality for Holds
+staff.patron.holds.holds_desire_mint_condition.enable_good.singular=Are you sure you would like to restrict to Good Condition copies for hold %1$s?
+staff.patron.holds.holds_desire_mint_condition.enable_good.plural=Are you sure you would like to restrict to Good Condition copies for holds %1$s?
+staff.patron.holds.holds_desire_mint_condition.disable_good.singular=Are you sure you would like to NOT restrict to Good Condition copies for hold %1$s?
+staff.patron.holds.holds_desire_mint_condition.disable_good.plural=Are you sure you would like to NOT restrict to Good Condition copies for holds %1$s?
+staff.patron.holds.holds_desire_mint_condition.mod_holds_title=Modifying Holds
+
 staff.patron.holds.holds_retarget.reset_hold_message.singular=Are you sure you would like to reset hold %1$s?
 staff.patron.holds.holds_retarget.reset_hold_message.plural=Are you sure you would like to reset holds %1$s?
 staff.patron.holds.holds_retarget.reset_hold_title=Resetting Holds

Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds.js	2009-11-02 23:21:55 UTC (rev 14728)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds.js	2009-11-03 00:18:45 UTC (rev 14729)
@@ -136,6 +136,7 @@
                         obj.controller.view.sel_patron.setAttribute('disabled','false');
                         obj.controller.view.cmd_retrieve_patron.setAttribute('disabled','false');
                         obj.controller.view.cmd_holds_edit_pickup_lib.setAttribute('disabled','false');
+                        obj.controller.view.cmd_holds_edit_desire_mint_condition.setAttribute('disabled','false');
                         obj.controller.view.cmd_holds_edit_phone_notify.setAttribute('disabled','false');
                         obj.controller.view.cmd_holds_edit_email_notify.setAttribute('disabled','false');
                         obj.controller.view.cmd_holds_edit_selection_depth.setAttribute('disabled','false');
@@ -155,6 +156,7 @@
                         obj.controller.view.sel_patron.setAttribute('disabled','true');
                         obj.controller.view.cmd_retrieve_patron.setAttribute('disabled','true');
                         obj.controller.view.cmd_holds_edit_pickup_lib.setAttribute('disabled','true');
+                        obj.controller.view.cmd_holds_edit_desire_mint_condition.setAttribute('disabled','true');
                         obj.controller.view.cmd_holds_edit_phone_notify.setAttribute('disabled','true');
                         obj.controller.view.cmd_holds_edit_email_notify.setAttribute('disabled','true');
                         obj.controller.view.cmd_holds_edit_selection_depth.setAttribute('disabled','true');
@@ -604,7 +606,63 @@
                             }
                         }
                     ],
+                    'cmd_holds_edit_desire_mint_condition' : [
+                        ['command'],
+                        function() {
+                            try {
+                                var xml = '<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1" style="overflow: vertical">';
+                                xml += '<description>'+$("patronStrings").getString('staff.patron.holds.holds_desire_mint_condition.description')+'</description>';
+                                xml += '<hbox><button value="good" label="'+$("patronStrings").getString('staff.patron.holds.holds_desire_mint_condition.btn_good.label')+'"';
+                                xml += ' accesskey="'+$("patronStrings").getString('staff.patron.holds.holds_desire_mint_condition.btn_good.accesskey')+'" name="fancy_submit"/>';
+                                xml += '<button value="nogood" label="'+$("patronStrings").getString('staff.patron.holds.holds_desire_mint_condition.btn_mediocre.label')+'"';
+                                xml += '  accesskey="'+$("patronStrings").getString('staff.patron.holds.holds_desire_mint_condition.btn_mediocre.accesskey')+'" name="fancy_submit"/></hbox>';
+                                xml += '</vbox>';
+                                var bot_xml = '<hbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1" style="overflow: vertical">';
+                                bot_xml += '<spacer flex="1"/><button label="'+$("patronStrings").getString('staff.patron.holds.holds_desire_mint_condition.btn_cancel.label')+'"';
+                                bot_xml += ' accesskey="'+$("patronStrings").getString('staff.patron.holds.holds_desire_mint_condition.btn_cancel.accesskey')+'" name="fancy_cancel"/></hbox>';
+                                netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
+                                JSAN.use('util.window'); var win = new util.window();
+                                var fancy_prompt_data = win.open(
+                                    urls.XUL_FANCY_PROMPT,
+                                    'fancy_prompt', 'chrome,resizable,modal',
+                                    { 'xml' : xml, 'bottom_xml' : bot_xml, 'title' : $("patronStrings").getString('staff.patron.holds.holds_desire_mint_condition.set_notifs') }
+                                );
+                                if (fancy_prompt_data.fancy_status == 'incomplete') { return; }
+                                var good = fancy_prompt_data.fancy_submit == 'good' ? get_db_true() : get_db_false();
 
+                                var hold_list = util.functional.map_list(obj.retrieve_ids, function(o){return o.id;});
+                                var msg = '';
+                                if(get_bool(good)) {
+                                    if(obj.retrieve_ids.length > 1) {
+                                        msg = $("patronStrings").getFormattedString('staff.patron.holds.holds_desire_mint_condition.enable_good.plural', [hold_list.join(', ')]);
+                                    } else {
+                                        msg = $("patronStrings").getFormattedString('staff.patron.holds.holds_desire_mint_condition.enable_good.singular', [hold_list.join(', ')]);
+                                    }
+                                } else {
+                                    if(obj.retrieve_ids.length > 1) {
+                                        msg = $("patronStrings").getFormattedString('staff.patron.holds.holds_desire_mint_condition.disable_good.plural', [hold_list.join(', ')]);
+                                    } else {
+                                        msg = $("patronStrings").getFormattedString('staff.patron.holds.holds_desire_mint_condition.disable_good.singular', [hold_list.join(', ')]);
+                                    }
+                                }
+
+                                var r = obj.error.yns_alert(msg,
+                                        $("patronStrings").getString('staff.patron.holds.holds_desire_mint_condition.mod_holds_title'),
+                                        $("commonStrings").getString('common.yes'),
+                                        $("commonStrings").getString('common.no'),
+                                        null,
+                                        $("commonStrings").getString('common.check_to_confirm')
+                                );
+                                if (r == 0) {
+                                    circ.util.batch_hold_update(hold_list, { 'mint_condition' : good }, { 'progressmeter' : progressmeter, 'oncomplete' :  function() { obj.clear_and_retrieve(true); } });
+                                }
+                            } catch(E) {
+                                obj.error.standard_unexpected_error_alert($("patronStrings").getString('staff.patron.holds.holds_not_modified'),E);
+                            }
+                        }
+                    ],
+
+
                     'cmd_holds_suspend' : [
                         ['command'],
                         function() {

Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul	2009-11-02 23:21:55 UTC (rev 14728)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul	2009-11-03 00:18:45 UTC (rev 14729)
@@ -20,6 +20,7 @@
         <command id="cmd_holds_print" />
         <command id="cmd_show_catalog" />
         <command id="cmd_retrieve_patron" />
+        <command id="cmd_holds_edit_desire_mint_condition" />
         <command id="cmd_holds_edit_pickup_lib" />
         <command id="cmd_holds_edit_phone_notify" />
         <command id="cmd_holds_edit_email_notify" />
@@ -49,6 +50,7 @@
             <menuseparator />
             <menuitem label="&staff.circ.holds.retrieve_patron;" command="cmd_retrieve_patron" accesskey="&staff.circ.holds.retrieve_patron.accesskey;"/>
             <menuseparator />
+            <menuitem label="&staff.circ.holds.edit_desire_mint_condition;" command="cmd_holds_edit_desire_mint_condition" accesskey="&staff.circ.holds.edit_desire_mint_condition.accesskey;"/>
             <menuitem label="&staff.circ.holds.edit_pickup_library;" command="cmd_holds_edit_pickup_lib" accesskey="&staff.circ.holds.edit_pickup_library.accesskey;"/>
             <menuitem label="&staff.circ.holds.edit_phone_notification;" command="cmd_holds_edit_phone_notify" accesskey="&staff.circ.holds.edit_phone_notification.accesskey;"/>
             <menuitem label="&staff.circ.holds.set_email_notification;" command="cmd_holds_edit_email_notify" accesskey="&staff.circ.holds.set_email_notification.accesskey;"/>
@@ -123,6 +125,7 @@
                     <menuseparator />
                     <menuitem label="&staff.circ.holds.retrieve_patron;" command="cmd_retrieve_patron" accesskey="&staff.circ.holds.retrieve_patron.accesskey;"/>
                     <menuseparator />
+                    <menuitem label="&staff.circ.holds.edit_desire_mint_condition;" command="cmd_holds_edit_desire_mint_condition" accesskey="&staff.circ.holds.edit_desire_mint_condition.accesskey;"/>
                     <menuitem label="&staff.circ.holds.edit_pickup_library;" command="cmd_holds_edit_pickup_lib" accesskey="&staff.circ.holds.edit_pickup_library.accesskey;"/>
                     <menuitem label="&staff.circ.holds.edit_phone_notification;" command="cmd_holds_edit_phone_notify" accesskey="&staff.circ.holds.edit_phone_notification.accesskey;"/>
                     <menuitem label="&staff.circ.holds.set_email_notification;" command="cmd_holds_edit_email_notify" accesskey="&staff.circ.holds.set_email_notification.accesskey;"/>



More information about the open-ils-commits mailing list