Reduce hard-coded strings in Serial Control interfaces
authordbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Feb 2011 18:57:50 +0000 (18:57 +0000)
committerdbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Feb 2011 18:57:50 +0000 (18:57 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@19419 dcc99617-32d9-48b4-a31d-7c20da2025e4

14 files changed:
Open-ILS/examples/fm_IDL.xml
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/serial/editor_base.js
Open-ILS/xul/staff_client/server/serial/manage_items.xul
Open-ILS/xul/staff_client/server/serial/sbsum_editor.js
Open-ILS/xul/staff_client/server/serial/scap_editor.js
Open-ILS/xul/staff_client/server/serial/sdist_editor.js
Open-ILS/xul/staff_client/server/serial/siss_editor.js
Open-ILS/xul/staff_client/server/serial/siss_editor.xul
Open-ILS/xul/staff_client/server/serial/sisum_editor.js
Open-ILS/xul/staff_client/server/serial/sitem_editor.js
Open-ILS/xul/staff_client/server/serial/sssum_editor.js
Open-ILS/xul/staff_client/server/serial/sstr_editor.js
Open-ILS/xul/staff_client/server/serial/ssub_editor.js

index c974308..6985dcd 100644 (file)
@@ -3674,11 +3674,11 @@ SELECT  usr,
 
        <class id="sbsum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::basic_summary" oils_persist:tablename="serial.basic_summary" reporter:label="Basic Issue Summary">
                <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
-                       <field name="id" reporter:datatype="id" />
-                       <field name="distribution" reporter:datatype="link"/>
-                       <field name="generated_coverage" reporter:datatype="text"/>
-                       <field name="textual_holdings" reporter:datatype="text"/>
-                       <field name="show_generated" reporter:datatype="bool"/>
+                       <field reporter:label="ID" name="id" reporter:datatype="id" />
+                       <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
+                       <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
+                       <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
+                       <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
                </fields>
                <links>
                        <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
@@ -3701,11 +3701,11 @@ SELECT  usr,
 
        <class id="sssum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::supplement_summary" oils_persist:tablename="serial.supplement_summary" reporter:label="Supplemental Issue Summary">
                <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
-                       <field name="id" reporter:datatype="id" />
-                       <field name="distribution" reporter:datatype="link"/>
-                       <field name="generated_coverage" reporter:datatype="text"/>
-                       <field name="textual_holdings" reporter:datatype="text"/>
-                       <field name="show_generated" reporter:datatype="bool"/>
+                       <field reporter:label="ID" name="id" reporter:datatype="id" />
+                       <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
+                       <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
+                       <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
+                       <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
                </fields>
                <links>
                        <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
@@ -3728,11 +3728,11 @@ SELECT  usr,
 
        <class id="sisum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::index_summary" oils_persist:tablename="serial.index_summary" reporter:label="Index Issue Summary">
                <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
-                       <field name="id" reporter:datatype="id" />
-                       <field name="distribution" reporter:datatype="link"/>
-                       <field name="generated_coverage" reporter:datatype="text"/>
-                       <field name="textual_holdings" reporter:datatype="text"/>
-                       <field name="show_generated" reporter:datatype="bool"/>
+                       <field reporter:label="ID" name="id" reporter:datatype="id" />
+                       <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
+                       <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
+                       <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
+                       <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
                </fields>
                <links>
                        <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
index f68ed14..a723b5f 100644 (file)
 <!ENTITY staff.serial.ssub_editor.notes.accesskey "N">
 <!ENTITY staff.serial.manage_dists.actions.cmd_add_sstr.label "Add Stream">
 <!ENTITY staff.serial.manage_dists.actions.cmd_delete_sstr.label "Delete Stream">
+<!ENTITY staff.serial.manage_items.actions.cmd_edit_items.label "Edit Item Attributes">
+<!ENTITY staff.serial.manage_items.actions.cmd_edit_items.access_key "E">
+<!ENTITY staff.serial.manage_items.actions.cmd_delete_items.label "Delete Items">
+<!ENTITY staff.serial.manage_items.actions.cmd_delete_items.access_key "D">
+<!ENTITY staff.serial.manage_items.actions.cmd_reset_items.label "Reset Items to Expected">
+<!ENTITY staff.serial.manage_items.workarea_showing "Showing: ">
+<!ENTITY staff.serial.manage_items.workarea_current_unit "Current Working Unit: ">
+<!ENTITY staff.serial.manage_items.workarea_recently_received "Recently Received">
+<!ENTITY staff.serial.manage_items.mode "Mode:">
+<!ENTITY staff.serial.manage_items.bind.label "Bind">
+<!ENTITY staff.serial.manage_items.receive.label "Receive">
+<!ENTITY staff.serial.manage_items.show_all.label "Show All">
+<!ENTITY staff.serial.manage_items.receive_move.label "Receive/Move Selected &#8595;">
+<!ENTITY staff.serial.manage_items.set_current_unit.label "Set Current Unit">
+<!ENTITY staff.serial.manage_items.auto_per_item.label "Auto per Item">
+<!ENTITY staff.serial.manage_items.new_unit.label "New Unit">
+<!ENTITY staff.serial.manage_items.recent.label "Recent">
+<!ENTITY staff.serial.manage_items.other_unit.label "Other...">
 
 <!ENTITY staff.serial.batch_receive "Batch Receive">
 <!ENTITY staff.serial.batch_receive.bib_search_term.label "Enter an identifier for a bibliographic record:">
index 4108232..efc08fd 100644 (file)
@@ -285,7 +285,7 @@ serial.editor_base = {
 
                 try { 
                     value = eval( cmd );
-                    if (typeof(value) == 'undefined') {
+                    if (value == null) { // true for both 'null' and undefined
                         value = "";
                     }
                     if (dropdown_key) {
@@ -356,7 +356,12 @@ serial.editor_base = {
                         groupbox.setAttribute('class','copy_editor_field_changed');
                     }
                     caption = document.createElement('caption'); groupbox.appendChild(caption);
-                    caption.setAttribute('label',fn); caption.setAttribute('id','caption_'+fn);
+                    if (f[1].label) {
+                        caption.setAttribute('label',f[1].label);
+                    } else {
+                        caption.setAttribute('label',fieldmapper.IDL.fmclasses[fm_type].field_map[fn].label);
+                    }
+                    caption.setAttribute('id','caption_'+fn);
                     vbox = document.createElement('vbox'); groupbox.appendChild(vbox);
                     grid = util.widgets.make_grid( [ { 'flex' : 1 }, {}, {} ] ); vbox.appendChild(grid);
                     grid.setAttribute('flex','1');
index b218ff0..97ae1f1 100644 (file)
@@ -40,15 +40,15 @@ vim:noet:sw=4:ts=4:
     </script>
     <popupset>
         <popup id="serial_manage_items_popup">
-            <menuitem command="cmd_edit_items" label="Edit Item Attributes" accesskey="&staff.cat.copy_browser.actions.cmd_edit_items.accesskey;"/>
-            <menuitem command="cmd_reset_items" label="Reset Item to Expected" />
-            <menuitem command="cmd_delete_items" label="Delete Item" accesskey="&staff.cat.copy_browser.actions.cmd_delete_items.accesskey;"/>
+            <menuitem command="cmd_edit_items" label="&staff.serial.manage_items.actions.cmd_edit_items.label;" accesskey="&staff.serial.manage_items.actions.cmd_edit_items.accesskey;"/>
+            <menuitem command="cmd_reset_items" label="&staff.serial.manage_items.actions.cmd_reset_items.label;" />
+            <menuitem command="cmd_delete_items" label="&staff.serial.manage_items.actions.cmd_delete_items.label;" accesskey="&staff.serial.manage_items.actions.cmd_delete_items.accesskey;"/>
         </popup>
     </popupset>
     <tabpanel id="serial_manage_items" orient="vertical" flex="1">
         <hbox align="center">
             <hbox id="serial_item_lib_menu_box"/>
-            <label value="Mode:" control="mode_receive"/><radiogroup id="serial_manage_items_mode" orient="horizontal"><radio id="mode_receive" label="Receive"/><radio id="mode_bind" label="Bind"/></radiogroup><checkbox id="serial_manage_items_show_all" label="Show All" />
+            <label value="&staff.serial.manage_items.mode;" control="mode_receive"/><radiogroup id="serial_manage_items_mode" orient="horizontal"><radio id="mode_receive" label="&staff.serial.manage_items.receive.label;"/><radio id="mode_bind" label="&staff.serial.manage_items.bind.label;"/></radiogroup><checkbox id="serial_manage_items_show_all" label="&staff.serial.manage_items.show_all.label;" />
             <button id="refresh_button" label="&staff.cat.copy_browser.holdings_maintenance.refresh_button.label;" command="cmd_refresh_list" />
             <spacer flex="1"/>
             <menubar>
@@ -63,9 +63,9 @@ vim:noet:sw=4:ts=4:
                 -->
                 <menu label="&staff.cat.copy_browser.holdings_maintenance.actions.label;" accesskey="&staff.cat.copy_browser.holdings_maintenance.actions.accesskey;">
                     <menupopup>
-                        <menuitem command="cmd_edit_items" label="Edit Item Attributes" accesskey="&staff.cat.copy_browser.actions.cmd_edit_items.accesskey;"/>
-                        <menuitem command="cmd_reset_items" label="Reset Item to Expected" />
-                        <menuitem command="cmd_delete_items" label="Delete Item" accesskey="&staff.cat.copy_browser.actions.cmd_delete_items.accesskey;"/>
+                        <menuitem command="cmd_edit_items" label="&staff.serial.manage_items.actions.cmd_edit_items.label;" accesskey="&staff.serial.manage_items.actions.cmd_edit_items.accesskey;"/>
+                        <menuitem command="cmd_reset_items" label="&staff.serial.manage_items.actions.cmd_reset_items.label;" />
+                        <menuitem command="cmd_delete_items" label="&staff.serial.manage_items.actions.cmd_delete_items.label;" accesskey="&staff.serial.manage_items.actions.cmd_delete_items.accesskey;"/>
                         <menuseparator/>
                         <menuitem command="cmd_refresh_list" label="&staff.cat.copy_browser.holdings_maintenance.cmd_refresh_list.label;" accesskey="&staff.cat.copy_browser.holdings_maintenance.cmd_refresh_list.accesskey;"/>
                         <menuitem command="save_columns" label="&staff.cat.copy_browser.holdings_maintenance.save_columns.label;"/>
@@ -87,25 +87,25 @@ vim:noet:sw=4:ts=4:
         <tree id="item_tree" flex="2" enableColumnDrag="true" context="serial_manage_items_popup" oils_persist="height"/>
         <splitter state="open" collapse="after" resizebefore="closest" resizeafter="farthest" id="splitter" oils_persist="state hidden" oils_persist_peers="item_tree after_splitter"/>
         <hbox align="center" id="after_splitter" oils_persist="height">
-            <label style="font-weight: bold" value="Showing: "/>
-            <label id="serial_workarea_mode_label" value="Recently Received"/>
+            <label style="font-weight: bold" value="&staff.serial.manage_items.workarea_showing;"/>
+            <label id="serial_workarea_mode_label" value="&staff.serial.manage_items.workarea_recently_received;"/>
             <spacer flex="1"/>
-            <button label="Receive/Move Selected &#8595;" command="cmd_receive_items"/>
+            <button label="&staff.serial.manage_items.receive_move.label;" command="cmd_receive_items"/>
         </hbox>
         <hbox align="center">
-            <label style="font-weight: bold" value="Current Working Unit: "/>
-            <description flex="1" id="serial_workarea_sunit_desc">**Auto per Item**</description>
+            <label style="font-weight: bold" value="&staff.serial.manage_items.workarea_current_unit;"/>
+            <description flex="1" id="serial_workarea_sunit_desc">**&staff.serial.manage_items.auto_per_item.label;**</description>
             <spacer flex="1"/>
             <menubar>
-                <menu label="Set Current Unit" id="serial_items_current_sunit" sunit_id="-1" sunit_label="Auto per Item" sdist_id="" sstr_id="">
+                <menu label="&staff.serial.manage_items.set_current_unit.label;" id="serial_items_current_sunit" sunit_id="-1" sunit_label="&staff.serial.manage_items.auto_per_item.label;" sdist_id="" sstr_id="">
                     <menupopup>
-                        <menuitem command="cmd_set_sunit" label="New Unit" sunit_id="-2" sdist_id="" sstr_id=""/>
-                        <menuitem command="cmd_set_sunit" label="Auto per Item" sunit_id="-1" sdist_id="" sstr_id=""/>
-                        <menu label="Recent" id="serial_items_recent_sunits" sunit_json='[]'/>
-                        <menuitem command="cmd_set_other_sunit" label="Other..."/>
+                        <menuitem command="cmd_set_sunit" label="&staff.serial.manage_items.new_unit.label;" sunit_id="-2" sdist_id="" sstr_id=""/>
+                        <menuitem command="cmd_set_sunit" label="&staff.serial.manage_items.auto_per_item.label;" sunit_id="-1" sdist_id="" sstr_id=""/>
+                        <menu label="&staff.serial.manage_items.recent.label;" id="serial_items_recent_sunits" sunit_json='[]'/>
+                        <menuitem command="cmd_set_other_sunit" label="&staff.serial.manage_items.other_unit.label;"/>
                     </menupopup>
                 </menu>
-                <button command="cmd_broken" label="Edit Current Unit..."/>
+                <!--<button command="cmd_broken" label="Edit Current Unit..."/>-->
             </menubar>
         </hbox>
         <tree id="workarea_tree" flex="1" enableColumnDrag="true" context="serial_manage_items_popup"/>
index fe7e9f2..8919a6e 100644 (file)
@@ -67,25 +67,22 @@ serial.sbsum_editor.prototype = {
         'sbsum_editor_left_pane' :
         [
             [
-                'ID',
+                'id',
                 { 
-                    render: '"ID : " + fm.id();', 
                     //input: 'c = function(v){ obj.apply("distribution",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
 
                 }
             ],
             [
-                'Textual Holdings',
+                'textual_holdings',
                 { 
-                    render: 'fm.textual_holdings() == null ? "" : fm.textual_holdings();',
                     input: 'c = function(v){ obj.apply("textual_holdings",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("size", 85); x.setAttribute("value",obj.editor_values.textual_holdings); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                     value_key: 'textual_holdings'
                 }
             ],
             [
-                'Generated Coverage',
+                'generated_coverage',
                 {
-                    render: 'fm.generated_coverage() == null ? "" : fm.generated_coverage();'
                 }
             ]
         ]
index 73c6021..3131794 100644 (file)
@@ -2,7 +2,6 @@ dump('entering serial/scap_editor.js\n');
 // vim:noet:sw=4:ts=4:
 
 JSAN.use('serial.editor_base');
-var pattern_code_key = 'Pattern Code (temporary)';
 
 if (typeof serial == 'undefined') serial = {};
 serial.scap_editor = function (params) {
@@ -68,29 +67,27 @@ serial.scap_editor.prototype = {
         'scap_editor_left_pane' :
         [
             [
-                'ID',
+                'id',
                 { 
-                    render: '"ID : " + fm.id();', 
                     //input: 'c = function(v){ obj.apply("distribution",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
 
                 }
             ],
             [
-                $('catStrings').getString('staff.cat.copy_editor.field.creation_date.label'),
+                'create_date',
                 {
-                    render: 'fm.create_date() == null ? "<Unset>" : util.date.formatted_date( fm.create_date(), "%F");',
+                    render: 'fm.create_date() == null ? "" : util.date.formatted_date( fm.create_date(), "%F");',
                 }
             ],
             [
-                'Type',
+                'type',
                 {
-                    render: 'fm.type();',
                     input: 'c = function(v){ obj.apply("type",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( [ ["basic", "basic"], ["index", "index"], ["supplement", "supplement"] ] ); x.setAttribute("value",obj.editor_values.type); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                     value_key: 'type'
                 }
             ],
             [
-                'Active?',
+                'active',
                 {
                     render: 'fm.active() == null ? $("catStrings").getString("staff.cat.copy_editor.field.unset_or_null") : ( get_bool( fm.active() ) ? $("catStrings").getString("staff.cat.copy_editor.field.circulate.yes_or_true") : $("catStrings").getString("staff.cat.copy_editor.field.circulate.no_or_false") )',
                     input: 'c = function(v){ obj.apply("active",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( [ [ $("catStrings").getString("staff.cat.copy_editor.field.circulate.yes_or_true"), get_db_true() ], [ $("catStrings").getString("staff.cat.copy_editor.field.circulate.no_or_false"), get_db_false() ] ] ); x.setAttribute("value",obj.editor_values.active); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
@@ -99,9 +96,8 @@ serial.scap_editor.prototype = {
                 }
             ],
             [
-                pattern_code_key,
+                'pattern_code',
                 { 
-                    render: 'fm.pattern_code() == null ? "" : fm.pattern_code();',
                     input: 'c = function(v){ obj.apply("pattern_code",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("value",obj.editor_values.pattern_code); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                     value_key: 'pattern_code'
                 }
index 4dc7326..142899e 100644 (file)
@@ -89,16 +89,11 @@ serial.sdist_editor.prototype = {
         obj.holding_lib_changed = (field == 'holding_lib');
         var loop_func = function(sdist) {
             if (obj.holding_lib_changed) {
-                sdist['bind_call_number'](null);
-                obj.changed['Bind Call Number'] = true;
-                sdist['receive_call_number'](null);
-                obj.changed['Receive Call Number'] = true;
-                sdist['bind_unit_template'](null);
-                obj.changed['Bind Unit Template'] = true;
-                sdist['receive_unit_template'](null);
-                obj.changed['Receive Unit Template'] = true;
-                sdist['record_entry'](null);
-                obj.changed['Legacy Record Entry'] = true;
+                var field_name_list = ['bind_call_number','receive_call_number','bind_unit_template','receive_unit_template','record_entry'];
+                for (var i = 0; i < field_name_list.length; i++) {
+                    sdist[field_name_list[i]](null);
+                    obj.changed[fieldmapper.IDL.fmclasses.sdist.field_map[field_name_list[i]].label] = true;
+                }
             }
         }
         obj.editor_base_apply(field, value, loop_func);
@@ -150,33 +145,29 @@ serial.sdist_editor.prototype = {
         '_editor_left_pane' :
         [
             [
-                'ID',
+                'id',
                 { 
-                    render: '"ID : " + fm.id();', 
                     //input: 'c = function(v){ obj.apply("distribution",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
 
                 }
             ],
             [
-                'Label',
+                'label',
                 { 
-                    render: 'fm.label() == null ? "" : fm.label();',
                     input: 'c = function(v){ obj.apply("label",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("value",obj.editor_values.label); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                     value_key: 'label'
                 }
             ],
             [
-                'Unit Label Prefix',
+                'unit_label_prefix',
                 {
-                    render: 'fm.unit_label_prefix() == null ? "" : fm.unit_label_prefix();',
                     input: 'c = function(v){ obj.apply("unit_label_prefix",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("value",obj.editor_values.unit_label_prefix); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                     value_key: 'unit_label_prefix'
                 }
             ],
             [
-                'Unit Label Suffix',
+                'unit_label_suffix',
                 { 
-                    render: 'fm.unit_label_suffix() == null ? "" : fm.unit_label_suffix();',
                     input: 'c = function(v){ obj.apply("unit_label_suffix",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("value",obj.editor_values.unit_label_suffix); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                     value_key: 'unit_label_suffix'
                 }
@@ -186,7 +177,7 @@ serial.sdist_editor.prototype = {
             '_editor_right_pane' :
         [
             [
-                'Holding Lib',
+                'holding_lib',
                 {
                     render: 'typeof fm.holding_lib() == "object" ? fm.holding_lib().shortname() : obj.data.hash.aou[ fm.holding_lib() ].shortname()',
                     input: 'c = function(v){ if (obj.editor_values.holding_lib != v) obj.apply("holding_lib",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( obj.data.list.aou, function(myobj) { var sname = myobj.shortname(); for (i = sname.length; i < 20; i++) sname += " "; return [ myobj.name() ? sname + " " + myobj.name() : myobj.shortname(), myobj.id(), ( ! get_bool( obj.data.hash.aout[ myobj.ou_type() ].can_have_vols() ) ), ( obj.data.hash.aout[ myobj.ou_type() ].depth() * 2), ]; }), obj.data.list.au[0].ws_ou()); x.setAttribute("value",obj.editor_values.holding_lib); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
@@ -199,7 +190,7 @@ serial.sdist_editor.prototype = {
         '_editor_lso_pane' :
         [
             [
-                'Legacy Record Entry',
+                'record_entry',
                 {
                     render: 'obj.render_record_entry(fm.record_entry())',
                     input: 'if(!obj.multi_org_edit) { c = function(v){ obj.apply("record_entry",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( obj.get_sre_details_list(), function(obj) { return [ obj.label, obj.id ]; }).sort()); x.setAttribute("value",obj.editor_values.record_entry); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false); }',
@@ -208,7 +199,7 @@ serial.sdist_editor.prototype = {
                 }
             ],
             [
-                'Receive Call Number',
+                'receive_call_number',
                 {
                     render: 'obj.render_call_number(fm.receive_call_number())',
                     input: 'if(!obj.multi_org_edit) { c = function(v){ obj.apply("receive_call_number",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( obj.get_acn_list(), function(obj) { return [ obj.label(), obj.id() ]; }).sort()); x.setAttribute("value",obj.editor_values.receive_call_number); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false); }',
@@ -217,7 +208,7 @@ serial.sdist_editor.prototype = {
                 }
             ],
             [
-                'Bind Call Number',
+                'bind_call_number',
                 {
                     render: 'obj.render_call_number(fm.bind_call_number())',
                     input: 'if(!obj.multi_org_edit) { c = function(v){ obj.apply("bind_call_number",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( obj.get_acn_list(), function(obj) { return [ obj.label(), obj.id() ]; }).sort()); x.setAttribute("value",obj.editor_values.bind_call_number); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false); }',
@@ -226,7 +217,7 @@ serial.sdist_editor.prototype = {
                 }
             ],
             [
-                'Receive Unit Template',
+                'receive_unit_template',
                 {
                     render: 'obj.render_unit_template(fm.receive_unit_template())',
                     input: 'if(!obj.multi_org_edit) { c = function(v){ obj.apply("receive_unit_template",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( obj.get_act_list(), function(obj) { return [ obj.name(), obj.id() ]; }).sort()); x.setAttribute("value",obj.editor_values.receive_unit_template); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false); }',
@@ -235,7 +226,7 @@ serial.sdist_editor.prototype = {
                 }
             ],
             [
-                'Bind Unit Template',
+                'bind_unit_template',
                 {
                     render: 'obj.render_unit_template(fm.bind_unit_template())',
                     input: 'if(!obj.multi_org_edit) { c = function(v){ obj.apply("bind_unit_template",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( obj.get_act_list(), function(obj) { return [ obj.name(), obj.id() ]; }).sort()); x.setAttribute("value",obj.editor_values.bind_unit_template); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false); }',
@@ -282,7 +273,7 @@ serial.sdist_editor.prototype = {
         win.open(
             urls.XUL_SERIAL_NOTES, 
             //+ '?copy_id=' + window.escape(obj.sdists[0].id()),
-            'Distribution Notes','chrome,resizable,modal',
+            $('serialStrings').getString('staff.serial.sdist_editor.notes'),'chrome,resizable,modal',
             { 'object_id' : obj.sdists[0].id(), 'function_type' : 'SDISTN', 'object_type' : 'distribution', 'constructor' : sdistn }
         );
     },
index f42abce..561e6bb 100644 (file)
@@ -29,7 +29,7 @@ serial.siss_editor.prototype = {
 
     'fm_type' : 'siss',
     'fm_type_plural' : 'sisses',
-    'can_have_notes' : true,
+    'can_have_notes' : false, // XXX no notes table exists yet, but it might make sense
 
     'init' : function (params) {
         var obj = this;
@@ -81,7 +81,7 @@ serial.siss_editor.prototype = {
         } else {
             id = scap.id()
         }
-        return "C/P : #" + id;
+        return $('serialStrings').getFormattedString('serial.manage_subs.scap_id', [id]);
     },
 
     'init_panes' : function () {
@@ -92,27 +92,27 @@ serial.siss_editor.prototype = {
             'siss_editor_left_pane' :
         [
             [
-                $('catStrings').getString('staff.cat.copy_editor.field.creation_date.label') + ' ', //adding extra spaces to satisfy summarize uniqueness requirements
+                'create_date',
                 {
-                    render: 'fm.create_date() == null ? "<Unset>" : util.date.formatted_date( fm.create_date(), "%F");',
+                    render: 'fm.create_date() == null ? "" : util.date.formatted_date( fm.create_date(), "%F");',
                 }
             ],
             [
-                $('catStrings').getString('staff.cat.copy_editor.field.creator.label') + ' ',
+                'creator',
                 {
-                    render: 'fm.creator().usrname() == null ? "<Unset>" : fm.creator().usrname();',
+                    render: 'fm.creator().usrname() == null ? "" : fm.creator().usrname();',
                 }
             ],
             [
-                $('catStrings').getString('staff.cat.copy_editor.field.last_edit_date.label') + ' ',
+                'edit_date',
                 {
-                    render: 'fm.edit_date() == null ? "<Unset>" : util.date.formatted_date( fm.edit_date(), "%F");',
+                    render: 'fm.edit_date() == null ? "" : util.date.formatted_date( fm.edit_date(), "%F");',
                 }
             ],
             [
-                $('catStrings').getString('staff.cat.copy_editor.field.last_editor.label') + ' ',
+                'editor',
                 {
-                    render: 'fm.editor().usrname() == null ? "<Unset>" : fm.editor().usrname();',
+                    render: 'fm.editor().usrname() == null ? "" : fm.editor().usrname();',
                 }
             ],
         ],
@@ -135,15 +135,14 @@ serial.siss_editor.prototype = {
                 }
             ],*/
             [
-                'Holding Code',
+                'holding_code',
                 {
-                    render: 'fm.holding_code();',
                     input: 'c = function(v){ obj.apply("holding_code",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("value",obj.editor_values.holding_code); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                     value_key: 'holding_code'
                 }
             ],
             [
-                'Caption/Pattern',
+                'caption_and_pattern',
                 {
                     render: 'obj.render_scap(fm.caption_and_pattern());',
                     input: 'if(!obj.multi_ssub_edit) { c = function(v){ obj.apply("caption_and_pattern",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( obj.get_scap_list(), function(obj2) { return [ obj.render_scap(obj2.id()), obj2.id() ]; }).sort()); x.setAttribute("value",obj.editor_values.caption_and_pattern); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false); }',
@@ -156,7 +155,7 @@ serial.siss_editor.prototype = {
         'siss_editor_right_pane' :
         [
             [
-                'Date Published',
+                'date_published',
                 {
                     render: 'fm.date_published() == null ? "" : util.date.formatted_date( fm.date_published(), "%F");',
                     input: 'c = function(v){ obj.apply("date_published",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("value",obj.editor_values.date_published); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
@@ -164,9 +163,8 @@ serial.siss_editor.prototype = {
                 }
             ],
             [
-                'Issuance Label',
+                'label',
                 {
-                    render: 'fm.label() == null ? "" : fm.label();',
                     input: 'c = function(v){ obj.apply("label",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("value",obj.editor_values.label); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                     value_key: 'label'
                 }
@@ -206,7 +204,7 @@ serial.siss_editor.prototype = {
         JSAN.use('util.window'); var win = new util.window();
         win.open(
             urls.XUL_SERIAL_NOTES, 
-            'Issuance Notes','chrome,resizable,modal',
+            $('serialStrings').getString('staff.serial.siss_editor.notes'),'chrome,resizable,modal',
             { 'object_id' : obj.sisses[0].id(), 'function_type' : 'SISSN', 'object_type' : 'issuance', 'constructor' : sissn }
         );
     },
index f94189d..3e80105 100644 (file)
@@ -30,8 +30,7 @@
 
                <hbox id="siss_editor_nav">
                        <spacer flex="1"/>
-                       <button id="siss_notes" label="Issuance Notes" accesskey="&staff.cat.copy_editor.copy_notes.accesskey;" oncommand="g.manage_subs.siss_editor.notes()" />
-                       <button id="siss_save" label="Modify Issuances" hidden="true" accesskey="&staff.cat.copy_editor.save.accesskey;" oncommand="g.manage_subs.siss_editor.save()" />
+                       <button id="siss_save" label="&staff.serial.siss_editor.modify.label;" hidden="true" accesskey="&staff.cat.copy_editor.save.accesskey;" oncommand="g.manage_subs.siss_editor.save()" />
                        <!--<button id="cancel" label="&staff.cat.copy_editor.cancel.label;" accesskey="&staff.cat.copy_editor.cancel.accesskey;" oncommand="window.close();"/>-->
                </hbox>
 
index 18c248f..4c0e5c4 100644 (file)
@@ -67,25 +67,22 @@ serial.sisum_editor.prototype = {
         'sisum_editor_left_pane' :
         [
             [
-                'ID',
+                'id',
                 { 
-                    render: '"ID : " + fm.id();' 
                     //input: 'c = function(v){ obj.apply("distribution",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
 
                 }
             ],
             [
-                'Textual Holdings',
+                'textual_holdings',
                 { 
-                    render: 'fm.textual_holdings() == null ? "" : fm.textual_holdings();',
                     input: 'c = function(v){ obj.apply("textual_holdings",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("size", 85); x.setAttribute("value",obj.editor_values.textual_holdings); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                     value_key: 'textual_holdings'
                 }
             ],
             [
-                'Generated Coverage',
+                'generated_coverage',
                 { 
-                    render: 'fm.generated_coverage() == null ? "" : fm.generated_coverage();'
                 }
             ]
         ]
index 7742399..14079f6 100644 (file)
@@ -86,17 +86,13 @@ serial.sitem_editor.prototype = {
         'sitem_editor_left_pane' :
         [
             [
-                'ID',
+                'id',
                 { 
-                    render: '"#" + fm.id();', 
-
                 }
             ],
             [
-                'Status',
+                'status',
                 { 
-                    render: 'fm.status();',
-                    value_key: 'label'
                 }
             ]
         ],
@@ -104,14 +100,15 @@ serial.sitem_editor.prototype = {
         'sitem_editor_middle_pane' :
         [
             [
-                'Distribution',
+                'distribution',
                 {
                     render: 'fm.stream().distribution().label() == null ? "" : fm.stream().distribution().label();',
+                    label: fieldmapper.IDL.fmclasses.sstr.field_map.distribution.label
 
                 }
             ],
             [
-                'Shelving Unit ID',
+                'unit',
                 {
                     render: 'fm.unit() == null ? "" : "#" + fm.unit().id();',
                 }
@@ -122,7 +119,7 @@ serial.sitem_editor.prototype = {
         'sitem_editor_right_pane' :
         [
             [
-                'Date Expected',
+                'date_expected',
                 {
                     render: 'fm.date_expected() == null ? "" : util.date.formatted_date( fm.date_expected(), "%F");',
                     input: 'c = function(v){ var applied = obj.apply("date_expected",v); if (typeof post_c == "function") post_c(v, !applied);}; x = document.createElement("textbox"); x.setAttribute("value",obj.editor_values.date_expected); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
@@ -130,7 +127,7 @@ serial.sitem_editor.prototype = {
                 }
             ],
             [
-                'Date Received',
+                'date_received',
                 {
                     render: 'fm.date_received() == null ? "" : util.date.formatted_date( fm.date_received(), "%F");',
                     input: 'if (obj.editor_values.date_received) { c = function(v){ var applied = obj.apply("date_received",v); if (typeof post_c == "function") post_c(v, !applied);}; x = document.createElement("textbox"); x.setAttribute("value",obj.editor_values.date_received); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false); } else { alert("Cannot edit Date Received for unreceived items."); block = false; }',
index 2c7c8eb..c1a3d1f 100644 (file)
@@ -67,25 +67,22 @@ serial.sssum_editor.prototype = {
         'sssum_editor_left_pane' :
         [
             [
-                'ID',
+                'id',
                 { 
-                    render: '"ID : " + fm.id();', 
                     //input: 'c = function(v){ obj.apply("distribution",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
 
                 }
             ],
             [
-                'Textual Holdings',
+                'textual_holdings',
                 { 
-                    render: 'fm.textual_holdings() == null ? "" : fm.textual_holdings();',
                     input: 'c = function(v){ obj.apply("textual_holdings",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("size", 85); x.setAttribute("value",obj.editor_values.textual_holdings); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                     value_key: 'textual_holdings'
                 }
             ],
             [
-                'Generated Coverage',
+                'generated_coverage',
                 {
-                    render: 'fm.generated_coverage() == null ? "" : fm.generated_coverage();'
                 }
             ]
         ]
index 301f092..5f3f484 100644 (file)
@@ -67,17 +67,17 @@ serial.sstr_editor.prototype = {
         'sstr_editor_left_pane' :
         [
             [
-                'ID',
+                'id',
                 { 
-                    render: '"ID : " + fm.id();', 
+                    //render: 'fm.id() == null ? "" : fm.id();',
                     //input: 'c = function(v){ obj.apply("distribution",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
 
                 }
             ],
             [
-                'Routing Label',
+                'routing_label',
                 { 
-                    render: 'fm.routing_label() == null ? "" : fm.routing_label();',
+                    //render: 'fm.routing_label() == null ? "" : fm.routing_label();',
                     input: 'c = function(v){ obj.apply("routing_label",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("value",obj.editor_values.routing_label); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                     value_key: 'routing_label'
                 }
index c807f72..38b4fe3 100644 (file)
@@ -102,15 +102,14 @@ serial.ssub_editor.prototype = {
         'left_pane' :
         [
             [
-                'ID',
+                'id',
                 { 
-                    render: '"ID : " + fm.id();', 
                     //input: 'c = function(v){ obj.apply("distribution",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
 
                 }
             ],
             [
-                'Owning Lib',
+                'owning_lib',
                 {
                     render: 'typeof fm.owning_lib() == "object" ? fm.owning_lib().shortname() : obj.data.hash.aou[ fm.owning_lib() ].shortname()',
                     input: 'c = function(v){ obj.apply("owning_lib",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( obj.data.list.aou, function(myobj) { var sname = myobj.shortname(); for (i = sname.length; i < 20; i++) sname += " "; return [ myobj.name() ? sname + " " + myobj.name() : myobj.shortname(), myobj.id(), ( ! get_bool( obj.data.hash.aout[ myobj.ou_type() ].can_have_vols() ) ), ( obj.data.hash.aout[ myobj.ou_type() ].depth() * 2), ]; }), obj.data.list.au[0].ws_ou()); x.setAttribute("value",obj.editor_values.owning_lib); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
@@ -123,7 +122,7 @@ serial.ssub_editor.prototype = {
             'right_pane' :
         [
             [
-                'Start Date',
+                'start_date',
                 { 
                     render: 'fm.start_date() == null ? "" : util.date.formatted_date( fm.start_date(), "%F");',
                     input: 'c = function(v){ obj.apply("start_date",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("value",obj.editor_values.start_date); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
@@ -131,7 +130,7 @@ serial.ssub_editor.prototype = {
                 }
             ],
             [
-                'End Date',
+                'end_date',
                 {
                     render: 'fm.end_date() == null ? "" : util.date.formatted_date( fm.end_date(), "%F");',
                     input: 'c = function(v){ obj.apply("end_date",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("value",obj.editor_values.end_date); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
@@ -139,9 +138,8 @@ serial.ssub_editor.prototype = {
                 }
             ],
             [
-                'Date Offset',
+                'expected_date_offset',
                 { 
-                    render: 'fm.expected_date_offset() == null ? "" : fm.expected_date_offset();',
                     input: 'c = function(v){ obj.apply("expected_date_offset",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("value",obj.editor_values.expected_date_offset); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                     value_key: 'expected_date_offset'
                 }
@@ -181,7 +179,7 @@ serial.ssub_editor.prototype = {
         JSAN.use('util.window'); var win = new util.window();
         win.open(
             urls.XUL_SERIAL_NOTES, 
-            'Subscription Notes','chrome,resizable,modal',
+            $('serialStrings').getString('staff.serial.ssub_editor.notes'),'chrome,resizable,modal',
             { 'object_id' : obj.ssubs[0].id(), 'function_type' : 'SSUBN', 'object_type' : 'subscription', 'constructor' : ssubn }
         );
     },