Fix minor typos for plural versus singular strings, and change a few identifiters...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 3 Nov 2009 00:18:45 +0000 (00:18 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 3 Nov 2009 00:18:45 +0000 (00:18 +0000)
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.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@14729 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/copy_editor.js
Open-ILS/xul/staff_client/server/circ/copy_status.js
Open-ILS/xul/staff_client/server/circ/util.js
Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
Open-ILS/xul/staff_client/server/patron/holds.js
Open-ILS/xul/staff_client/server/patron/holds_overlay.xul

index d24aebd..9163d81 100644 (file)
@@ -916,6 +916,13 @@ g.panes_and_field_names = {
             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' : 
index bfc4bcd..ab1bd13 100644 (file)
@@ -28,7 +28,7 @@ circ.copy_status.prototype = {
                 '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 }
             },
index 1ad6131..744e594 100644 (file)
@@ -747,6 +747,22 @@ circ.util.columns = function(modify,params) {
         },
         {
             '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'),
@@ -1156,7 +1172,7 @@ circ.util.columns = function(modify,params) {
         {
             '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 @@ circ.util.hold_columns = function(modify,params) {
         },
         {
             '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 @@ circ.util.hold_columns = function(modify,params) {
         },
         {
             '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,
index f2301ec..143cc3b 100644 (file)
@@ -184,6 +184,9 @@ staff.cat.copy_editor.field.opac_visible.no_or_false=No
 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:
index d66fe12..6035f01 100644 (file)
@@ -234,6 +234,9 @@ staff.circ.utils.opac_visible=OPAC Visible?
 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_error=We should have received a ROUTE_ITEM
 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
index 8cee5b8..123a0f5 100644 (file)
@@ -160,7 +160,7 @@ staff.patron.holds.holds_edit_email_notify.set_notifs=Set Email Notification for
 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.set_notifs=Set Top of Queue (Force to Front
 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
index ac2858e..f5245ec 100644 (file)
@@ -136,6 +136,7 @@ patron.holds.prototype = {
                         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 @@ patron.holds.prototype = {
                         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,6 +606,62 @@ patron.holds.prototype = {
                             }
                         }
                     ],
+                    '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'],
index 4b84d0a..7571f10 100644 (file)
@@ -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;"/>
                     <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;"/>