[open-ils-commits] r17614 - in trunk/Open-ILS/xul/staff_client: chrome/content/OpenILS server/cat server/circ server/locale/en-US server/serial (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Sep 12 14:43:42 EDT 2010
Author: phasefx
Date: 2010-09-12 14:43:38 -0400 (Sun, 12 Sep 2010)
New Revision: 17614
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js
trunk/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js
trunk/Open-ILS/xul/staff_client/server/circ/pre_cat_fields.xul
trunk/Open-ILS/xul/staff_client/server/circ/util.js
trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties
trunk/Open-ILS/xul/staff_client/server/serial/batch_receive.js
Log:
staff.circ_modifier.display localization for rendering circ modifiers
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2010-09-12 18:33:30 UTC (rev 17613)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2010-09-12 18:43:38 UTC (rev 17614)
@@ -519,9 +519,11 @@
this.chain.push(
function() {
try {
- var robj = obj.network.simple_request('CIRC_MODIFIER_LIST',[]);
+ var robj = obj.network.simple_request('CIRC_MODIFIER_LIST',[{'full':true}]);
if (typeof robj.ilsevent != 'undefined') throw(robj);
- obj.list.circ_modifier = robj;
+ obj.list.ccm = robj == null ? [] : robj;
+ obj.hash.ccm = util.functional.convert_object_list_to_hash( obj.list.ccm );
+ obj.list.circ_modifier = util.functional.map_list( obj.list.ccm, function(o) { return o.code(); } );
obj.data_progress('Retrieved circ modifier list. ');
} catch(E) {
var error = 'Error: ' + js2JSON(E);
Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js 2010-09-12 18:33:30 UTC (rev 17613)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js 2010-09-12 18:43:38 UTC (rev 17614)
@@ -888,8 +888,8 @@
[
$('catStrings').getString('staff.cat.copy_editor.field.circulation_modifier.label'),
{
- render: 'fm.circ_modifier() == null ? $("catStrings").getString("staff.cat.copy_editor.field.unset_or_null") : fm.circ_modifier()',
- input: 'c = function(v){ g.apply("circ_modifier",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( [ [ $("catStrings").getString("staff.cat.copy_editor.field.unset_or_null"), "<HACK:KLUDGE:NULL>" ] ].concat( util.functional.map_list( g.data.list.circ_modifier, function(obj) { return [ obj, obj ]; } ).sort() ) ); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
+ render: 'fm.circ_modifier() == null ? $("catStrings").getString("staff.cat.copy_editor.field.unset_or_null") : $("commonStrings").getFormattedString("staff.circ_modifier.display",[fm.circ_modifier(),g.data.hash.ccm[fm.circ_modifier()].name(),g.data.hash.ccm[fm.circ_modifier()].description()])',
+ input: 'c = function(v){ g.apply("circ_modifier",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( [ [ $("catStrings").getString("staff.cat.copy_editor.field.unset_or_null"), "<HACK:KLUDGE:NULL>" ] ].concat( util.functional.map_list( g.data.list.ccm, function(obj) { return [ $("commonStrings").getFormattedString("staff.circ_modifier.display",[obj.code(),obj.name(),obj.description()]), obj.code() ]; } ).sort() ) ); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
}
],
],
Modified: trunk/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js 2010-09-12 18:33:30 UTC (rev 17613)
+++ trunk/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js 2010-09-12 18:43:38 UTC (rev 17614)
@@ -168,7 +168,8 @@
set("circ_as_type", details.copy.circ_as_type());
set("copy_circ_lib" , typeof details.copy.circ_lib() == 'object' ? details.copy.circ_lib().shortname() : data.hash.aou[ details.copy.circ_lib() ].shortname());
set_tooltip("copy_circ_lib" , typeof details.copy.circ_lib() == 'object' ? details.copy.circ_lib().name() : data.hash.aou[ details.copy.circ_lib() ].name());
- set("circ_modifier", details.copy.circ_modifier());
+ var cm = details.copy.circ_modifier();
+ set("circ_modifier", document.getElementById('commonStrings').getFormattedString('staff.circ_modifier.display',[cm,data.hash.ccm[cm].name(),data.hash.ccm[cm].description()]));
set("circulate", get_localized_bool( details.copy.circulate() ));
set("copy_number", details.copy.copy_number());
set("copy_create_date", util.date.formatted_date( details.copy.create_date(), '%{localized}' ));
Modified: trunk/Open-ILS/xul/staff_client/server/circ/pre_cat_fields.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/pre_cat_fields.xul 2010-09-12 18:33:30 UTC (rev 17613)
+++ trunk/Open-ILS/xul/staff_client/server/circ/pre_cat_fields.xul 2010-09-12 18:43:38 UTC (rev 17614)
@@ -56,7 +56,15 @@
JSAN.use('util.widgets'); JSAN.use('util.functional');
var x = util.widgets.make_menulist(
[ [ $("catStrings").getString("staff.cat.copy_editor.field.unset_or_null"), "<HACK:KLUDGE:NULL>" ] ].concat(
- util.functional.map_list( g.data.list.circ_modifier, function(obj) { return [ obj, obj ]; } ).sort()
+ util.functional.map_list(
+ g.data.list.ccm,
+ function(obj) {
+ return [
+ document.getElementById('commonStrings').getFormattedString('staff.circ_modifier.display',[obj.code(),obj.name(),obj.description()]),
+ obj.code()
+ ];
+ }
+ ).sort()
)
);
x.setAttribute('id','dummy_circ_modifier');
Modified: trunk/Open-ILS/xul/staff_client/server/circ/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/util.js 2010-09-12 18:33:30 UTC (rev 17613)
+++ trunk/Open-ILS/xul/staff_client/server/circ/util.js 2010-09-12 18:43:38 UTC (rev 17614)
@@ -875,7 +875,7 @@
'flex' : 1,
'primary' : false,
'hidden' : true,
- 'editable' : false, 'render' : function(my) { return my.acp.circ_modifier(); }
+ 'editable' : false, 'render' : function(my) { var cm = my.acp.circ_modifier(); return document.getElementById('commonStrings').getFormattedString('staff.circ_modifier.display',[cm,data.hash.ccm[cm].name(),data.hash.ccm[cm].description()]); }
},
{
'id' : 'status_changed_time',
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties 2010-09-12 18:33:30 UTC (rev 17613)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties 2010-09-12 18:43:38 UTC (rev 17614)
@@ -34,6 +34,7 @@
staff.acp_label_circ_as_type=Circulate As Type
staff.acp_label_circ_lib=Circulation Library
staff.acp_label_circ_modifier=Circulation Modifier
+staff.circ_modifier.display=%1$s : %2$s : %3$s
staff.acp_label_copy_number=Copy Number
staff.acp_label_deposit_amount=Deposit Amount
staff.acp_label_fine_level=Fine Level
Modified: trunk/Open-ILS/xul/staff_client/server/serial/batch_receive.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/serial/batch_receive.js 2010-09-12 18:33:30 UTC (rev 17613)
+++ trunk/Open-ILS/xul/staff_client/server/serial/batch_receive.js 2010-09-12 18:43:38 UTC (rev 17614)
@@ -182,8 +182,7 @@
dojo.create(
"menuitem", {
"value": mod.code(),
- /* XXX use format string */
- "label": mod.code()+" "+mod.name()
+ "label": document.getElementById('commonStrings').getFormattedString('staff.circ_modifier.display',[mod.code(),mod.name(),mod.description()])
}, menupopup, "last"
);
}
More information about the open-ils-commits
mailing list