[open-ils-commits] r11087 - trunk/Open-ILS/web/reports
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Nov 6 17:32:29 EST 2008
Author: dbs
Date: 2008-11-06 17:32:25 -0500 (Thu, 06 Nov 2008)
New Revision: 11087
Modified:
trunk/Open-ILS/web/reports/oils_rpt_builder.js
trunk/Open-ILS/web/reports/oils_rpt_filters.js
trunk/Open-ILS/web/reports/oils_rpt_folder_window.js
trunk/Open-ILS/web/reports/oils_rpt_folders.js
trunk/Open-ILS/web/reports/oils_rpt_report_editor.js
trunk/Open-ILS/web/reports/oils_rpt_tforms.js
trunk/Open-ILS/web/reports/oils_rpt_widget.js
Log:
Merge Craig Ricciuto's patch for reports i18n (Dojo strings)
Modified: trunk/Open-ILS/web/reports/oils_rpt_builder.js
===================================================================
--- trunk/Open-ILS/web/reports/oils_rpt_builder.js 2008-11-06 22:31:46 UTC (rev 11086)
+++ trunk/Open-ILS/web/reports/oils_rpt_builder.js 2008-11-06 22:32:25 UTC (rev 11087)
@@ -1,7 +1,9 @@
/** initializes reports, some basid display settings,
* grabs and builds the IDL tree
*/
+dojo.requireLocalization("openils.reports", "reports");
+var rpt_strings = dojo.i18n.getLocalization("openils.reports", "reports");
var __dblclicks = {}; /* retain a cache of the selector value doubleclick event handlers */
function oilsInitReportBuilder() {
@@ -105,7 +107,7 @@
tmpl.folder(new CGI().param('folder'));
tmpl.data(js2JSON(oilsRpt.def));
- if(!confirm('Name : '+tmpl.name() + '\nDescription: ' + tmpl.description()+'\nSave Template?'))
+ if(!confirm(dojo.string.substitute( rpt_strings.RPT_BUILDER_CONFIRM_SAVE, [tmpl.name(), tmpl.description()] )) )
return;
debugFMObject(tmpl);
Modified: trunk/Open-ILS/web/reports/oils_rpt_filters.js
===================================================================
--- trunk/Open-ILS/web/reports/oils_rpt_filters.js 2008-11-06 22:31:46 UTC (rev 11086)
+++ trunk/Open-ILS/web/reports/oils_rpt_filters.js 2008-11-06 22:32:25 UTC (rev 11087)
@@ -1,67 +1,71 @@
+dojo.requireLocalization("openils.reports", "reports");
+
+var rpt_strings = dojo.i18n.getLocalization("openils.reports", "reports");
+
var OILS_RPT_FILTERS = {
'=' : {
- label : 'Equals',
+ label : rpt_strings.FILTERS_LABEL_EQUALS
},
'like' : {
- label : 'Contains Matching substring',
+ label : rpt_strings.FILTERS_LABEL_LIKE
},
ilike : {
- label : 'Contains Matching substring (ignore case)',
+ label : rpt_strings.FILTERS_LABEL_ILIKE
},
'>' : {
- label : 'Greater than',
- labels : { timestamp : 'After (Date/Time)' }
+ label : rpt_strings.FILTERS_LABEL_GREATER_THAN,
+ labels : { timestamp : rpt_strings.FILTERS_LABEL_GT_TIME }
},
'>=' : {
- label : 'Greater than or equal to',
- labels : { timestamp : 'On or After (Date/Time)' }
+ label : rpt_strings.FILTERS_LABEL_GT_EQUAL,
+ labels : { timestamp : rpt_strings.FILTERS_LABEL_GTE_TIME }
},
'<' : {
- label : 'Less than',
- labels : { timestamp : 'Before (Date/Time)' }
+ label : rpt_strings.FILTERS_LABEL_LESS_THAN,
+ labels : { timestamp : rpt_strings.FILTERS_LABEL_LT_TIME }
},
'<=' : {
- label : 'Less than or equal to',
- labels : { timestamp : 'On or Before (Date/Time)' }
+ label : rpt_strings.FILTERS_LABEL_LT_EQUAL,
+ labels : { timestamp : rpt_strings.FILTERS_LABEL_LSE_TIME }
},
'in' : {
- label : 'In list',
+ label : rpt_strings.FILTERS_LABEL_IN
},
'not in' : {
- label : 'Not in list',
+ label : rpt_strings.FILTERS_LABEL_NOT_IN
},
'between' : {
- label : 'Between',
+ label : rpt_strings.FILTERS_LABEL_BETWEEN
},
'not between' : {
- label : 'Not between',
+ label : rpt_strings.FILTERS_LABEL_NOT_BETWEEN
},
'is' : {
- label : 'Is NULL'
+ label : rpt_strings.FILTERS_LABEL_NULL
},
'is not' : {
- label : 'Is not NULL'
+ label : rpt_strings.FILTERS_LABEL_NOT_NULL
},
'is blank' : {
- label : 'Is NULL or Blank'
+ label : rpt_strings.FILTERS_LABEL_NULL_BLANK
},
'is not blank' : {
- label : 'Is not NULL or Blank'
+ label : rpt_strings.FILTERS_LABEL_NOT_NULL_BLANK
}
}
Modified: trunk/Open-ILS/web/reports/oils_rpt_folder_window.js
===================================================================
--- trunk/Open-ILS/web/reports/oils_rpt_folder_window.js 2008-11-06 22:31:46 UTC (rev 11086)
+++ trunk/Open-ILS/web/reports/oils_rpt_folder_window.js 2008-11-06 22:32:25 UTC (rev 11087)
@@ -1,3 +1,6 @@
+dojo.requireLocalization("openils.reports", "reports");
+
+var rpt_strings = dojo.i18n.getLocalization("openils.reports", "reports");
var OILS_TEMPLATE_INTERFACE = 'xul/template_builder.xul';
var OILS_LEGACY_TEMPLATE_INTERFACE = 'oils_rpt_builder.xhtml';
@@ -209,7 +212,7 @@
objs = objs.concat( this.fmTable2.getSelected() );
if( objs.length == 0 )
- return alert('Please select an item from the list');
+ return alert(rpt_strings.FOLDER_WINDOW_SELECT_ITEM);
var action = getSelectorVal(DOM.oils_rpt_folder_contents_action_selector);
var obj = this;
@@ -326,7 +329,7 @@
type,
DOM.oils_rpt_move_folder_picker,
'tree9807897',
- 'Change Folders',
+ rpt_strings.FOLDER_WINDOW_CHANGE_FOLDERS,
function(node) {
appendClear(DOM.oils_rpt_move_folder_selected, node.folder.name());
selectedFolder = node.folder.id();
@@ -368,7 +371,7 @@
_debug("launching report output view at URL: " + url);
if(isXUL())
xulG.new_tab('/xul/server/util/rbrowser.xul?url=' + url, /* this comes from urls.XUL_REMOTE_BROWSER */
- {tab_name:'Report Output: ' + r.name(), browser:true},
+ {tab_name: dojo.string.substitute( rpt_strings.FOLDER_WINDOW_REPORT_OUTPUT, [r.name] ), browser:true},
{no_xulG:false, show_nav_buttons:true, show_print_button:true});
else {
//goTo(url);
@@ -505,9 +508,9 @@
dest : obj.selector,
obj : res,
selectCol : true,
- selectColName : 'Select',
- selectAllName : 'All',
- selectNoneName : 'None'
+ selectColName : rpt_strings.FOLDER_WINDOW_COLNAME_SELECT,
+ selectAllName : rpt_strings.FOLDER_WINDOW_COLNAME_ALL,
+ selectNoneName : rpt_strings.FOLDER_WINDOW_COLNAME_NONE
}
);
}
@@ -570,9 +573,9 @@
dest : selector,
obj : [sched],
selectCol : true,
- selectColName : 'Select',
- selectAllName : 'All',
- selectNoneName : 'None'
+ selectColName : rpt_strings.FOLDER_WINDOW_COLNAME_SELECT,
+ selectAllName : rpt_strings.FOLDER_WINDOW_COLNAME_ALL,
+ selectNoneName : rpt_strings.FOLDER_WINDOW_COLNAME_NONE
}
);
Modified: trunk/Open-ILS/web/reports/oils_rpt_folders.js
===================================================================
--- trunk/Open-ILS/web/reports/oils_rpt_folders.js 2008-11-06 22:31:46 UTC (rev 11086)
+++ trunk/Open-ILS/web/reports/oils_rpt_folders.js 2008-11-06 22:32:25 UTC (rev 11087)
@@ -1,3 +1,7 @@
+dojo.requireLocalization("openils.reports", "reports");
+
+var rpt_strings = dojo.i18n.getLocalization("openils.reports", "reports");
+
var oilsRptFolderNodeCache = {};
oilsRptFolderNodeCache.template = {};
oilsRptFolderNodeCache.report = {};
@@ -46,12 +50,12 @@
'oilsRptTemplateFolderTree');
//'images/template-page.gif');
- oilsRptTemplateFolderTree.addNode(this.tId, -1, 'Templates',
+ oilsRptTemplateFolderTree.addNode(this.tId, -1, rpt_strings.FOLDERS_TEMPLATES,
function() {
unHideMe(DOM.oils_rpt_folder_table_alt_td);
unHideMe(DOM.oils_rpt_top_folder);
hideMe(DOM.oils_rpt_editor_div);
- appendClear(DOM.oils_rpt_top_folder_type,text('Template'));
+ appendClear(DOM.oils_rpt_top_folder_type,text(rpt_strings.FOLDERS_TEMPLATE));
hideMe(DOM.oils_rpt_folder_table_right_td);
DOM.oils_rpt_top_folder_create.onclick = function() {
obj.createTopFolder('template', orgsel);
@@ -66,13 +70,13 @@
//'images/report-page.gif');
- oilsRptReportFolderTree.addNode(this.rId, -1, 'Reports',
+ oilsRptReportFolderTree.addNode(this.rId, -1, rpt_strings.FOLDERS_REPORTS,
function() {
unHideMe(DOM.oils_rpt_folder_table_alt_td);
unHideMe(DOM.oils_rpt_top_folder);
hideMe(DOM.oils_rpt_editor_div);
hideMe(DOM.oils_rpt_folder_table_right_td);
- appendClear(DOM.oils_rpt_top_folder_type,text('Report'));
+ appendClear(DOM.oils_rpt_top_folder_type,text(rpt_strings.FOLDERS_REPORT));
DOM.oils_rpt_top_folder_create.onclick = function() {
obj.createTopFolder('report', orgsel);
}
@@ -87,13 +91,13 @@
'oilsRptOutputFolderTree');
//'images/output-page.gif');
- oilsRptOutputFolderTree.addNode(this.oId, -1, 'Output',
+ oilsRptOutputFolderTree.addNode(this.oId, -1, rpt_strings.FOLDERS_OUTPUT,
function() {
unHideMe(DOM.oils_rpt_folder_table_alt_td);
unHideMe(DOM.oils_rpt_top_folder);
hideMe(DOM.oils_rpt_editor_div);
hideMe(DOM.oils_rpt_folder_table_right_td);
- appendClear(DOM.oils_rpt_top_folder_type,text('Output'));
+ appendClear(DOM.oils_rpt_top_folder_type,text(rpt_strings.FOLDERS_OUTPUT));
DOM.oils_rpt_top_folder_create.onclick = function() {
obj.createTopFolder('output', orgsel);
}
@@ -107,7 +111,7 @@
'oilsRptSharedTemplateFolderTree');
//'images/template-page.gif');
- oilsRptSharedTemplateFolderTree.addNode(this.stId, -1, 'Templates')
+ oilsRptSharedTemplateFolderTree.addNode(this.stId, -1, rpt_strings.FOLDERS_TEMPLATES)
oilsRptSharedReportFolderTree =
@@ -116,7 +120,7 @@
'oilsRptSharedReportFolderTree');
//'images/report-page.gif');
- oilsRptSharedReportFolderTree.addNode(this.srId, -1, 'Reports')
+ oilsRptSharedReportFolderTree.addNode(this.srId, -1, rpt_strings.FOLDERS_REPORTS)
oilsRptSharedOutputFolderTree =
new SlimTree(
@@ -124,7 +128,7 @@
'oilsRptSharedOutputFolderTree');
//'images/output-page.gif');
- oilsRptSharedOutputFolderTree.addNode(this.soId, -1, 'Output')
+ oilsRptSharedOutputFolderTree.addNode(this.soId, -1, rpt_strings.FOLDERS_OUTPUT)
this.fetchFolders(auth);
}
Modified: trunk/Open-ILS/web/reports/oils_rpt_report_editor.js
===================================================================
--- trunk/Open-ILS/web/reports/oils_rpt_report_editor.js 2008-11-06 22:31:46 UTC (rev 11086)
+++ trunk/Open-ILS/web/reports/oils_rpt_report_editor.js 2008-11-06 22:32:25 UTC (rev 11087)
@@ -1,3 +1,7 @@
+dojo.requireLocalization("openils.reports", "reports");
+
+var rpt_strings = dojo.i18n.getLocalization("openils.reports", "reports");
+
oilsRptSetSubClass('oilsRptReportEditor', 'oilsRptObject');
var oilsRptReportEditorFolderTree;
@@ -76,7 +80,7 @@
'report',
DOM.oils_rpt_report_editor_dest_folder,
'oilsRptReportEditorFolderTree',
- 'Report Folders',
+ rpt_strings.REPORT_EDITOR_REPORT_FOLDERS,
function(node) {
appendClear(DOM.oils_rpt_report_editor_selected_folder, node.folder.name());
obj.selectedFolder = node; });
@@ -86,7 +90,7 @@
'output',
DOM.oils_rpt_output_dest_folder,
'oilsRptReportEditorOutputTree',
- 'Output Folders',
+ rpt_strings.REPORT_EDITOR_OUTPUT_FOLDERS,
function(node) {
appendClear(DOM.oils_rpt_output_selected_folder, node.folder.name());
obj.selectedOutputFolder = node; });
@@ -105,10 +109,10 @@
var report = new rr();
if(!this.selectedFolder)
- return alert('Please provide a report folder');
+ return alert(rpt_strings.REPORT_EDITOR_PROVIDE_FOLDER_ALERT);
if(!DOM.oils_rpt_report_editor_name.value)
- return alert('Please enter a report name');
+ return alert(rpt_strings.REPORT_EDITOR_ENTER_NAME_ALERT);
report.owner( USER.id() );
report.template( this.template.id() );
@@ -163,7 +167,7 @@
var dt = DOM.oils_rpt_param_editor_sched_start_date.value;
if(!dt || !dt.match(/^\d{4}-\d{2}-\d{2}$/) ) {
/* for now.. make this better in the future */
- alert('invalid start date - YYYY-MM-DD');
+ alert(rpt_strings.REPORT_EDITOR_INVALID_DATE_ALERT);
return;
}
var hour = getSelectorVal(DOM.oils_rpt_param_editor_sched_start_hour);
@@ -172,7 +176,7 @@
}
if(!this.selectedOutputFolder)
- return alert('Please provide an output folder');
+ return alert(rpt_strings.REPORT_EDITOR_PROVIDE_OUTPUT_ALERT);
var schedule = new rs();
schedule.folder(this.selectedOutputFolder.folder.id());
Modified: trunk/Open-ILS/web/reports/oils_rpt_tforms.js
===================================================================
--- trunk/Open-ILS/web/reports/oils_rpt_tforms.js 2008-11-06 22:31:46 UTC (rev 11086)
+++ trunk/Open-ILS/web/reports/oils_rpt_tforms.js 2008-11-06 22:32:25 UTC (rev 11087)
@@ -1,35 +1,39 @@
+dojo.requireLocalization("openils.reports", "reports");
+var rpt_strings = dojo.i18n.getLocalization("openils.reports", "reports");
+
+
var OILS_RPT_TRANSFORMS = {
Bare : {
- label : 'Raw Data'
+ label : rpt_strings.TFORMS_LABEL_RAW_DATA
},
first : {
- label : 'First Value'
+ label : rpt_strings.TFORMS_LABEL_FIRST
},
last : {
- label : 'Last Value'
+ label : rpt_strings.TFORMS_LABEL_LAST
},
count : {
aggregate : true,
- label : 'Count'
+ label : rpt_strings.TFORMS_LABEL_COUNT
},
count_distinct : {
aggregate : true,
- label : 'Count Distinct'
+ label : rpt_strings.TFORMS_LABEL_COUNT_DISTINCT
},
min : {
aggregate : true,
- label : 'Min'
+ label : rpt_strings.TFORMS_LABEL_MIN
},
max : {
aggregate : true,
- label : 'Max'
+ label : rpt_strings.TFORMS_LABEL_MAX
},
/* string transforms ------------------------- */
@@ -43,69 +47,69 @@
lower : {
datatype : [OILS_RPT_DTYPE_STRING, 'text'],
- label : 'Lower case'
+ label : rpt_strings.TFORMS_LABEL_LOWER
},
upper : {
datatype : [OILS_RPT_DTYPE_STRING, 'text'],
- label : 'Upper case'
+ label : rpt_strings.TFORMS_LABEL_UPPER
},
first5 : {
datatype : [OILS_RPT_DTYPE_STRING, 'text'],
- label : 'First 5 characters (for US ZIP code)'
+ label : rpt_strings.TFORMS_LABEL_FIRST5
},
first_word : {
datatype : [OILS_RPT_DTYPE_STRING, 'text'],
- label : 'First contiguous non-space string'
+ label : rpt_strings.TFORMS_LABEL_FIRST_WORD
},
/* timestamp transforms ----------------------- */
dow : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Day of Week',
+ label : rpt_strings.TFORMS_LABEL_DOW,
regex : /^[0-6]$/
},
dom : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Day of Month',
+ label : rpt_strings.TFORMS_LABEL_DOM,
regex : /^[0-9]{1,2}$/
},
doy : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Day of Year',
+ label : rpt_strings.TFORMS_LABEL_DOY,
regex : /^[0-9]{1,3}$/
},
woy : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Week of Year',
+ label : rpt_strings.TFORMS_LABEL_WOY,
regex : /^[0-9]{1,2}$/
},
moy : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Month of Year',
+ label : rpt_strings.TFORMS_LABEL_MOY,
regex : /^\d{1,2}$/
},
qoy : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Quarter of Year',
+ label : rpt_strings.TFORMS_LABEL_QOY,
regex : /^[1234]$/
},
hod : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Hour of day',
+ label : rpt_strings.TFORMS_LABEL_HOD,
regex : /^\d{1,2}$/
},
date : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Date',
+ label : rpt_strings.TFORMS_LABEL_DATE,
regex : /^\d{4}-\d{2}-\d{2}$/,
hint : 'YYYY-MM-DD',
cal_format : '%Y-%m-%d',
@@ -114,7 +118,7 @@
month_trunc : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Year + Month',
+ label : rpt_strings.TFORMS_LABEL_MONTH_TRUNC,
regex : /^\d{4}-\d{2}$/,
hint : 'YYYY-MM',
cal_format : '%Y-%m',
@@ -123,7 +127,7 @@
year_trunc : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Year',
+ label : rpt_strings.TFORMS_LABEL_YEAR_TRUNC,
regex : /^\d{4}$/,
hint : 'YYYY',
cal_format : '%Y',
@@ -132,7 +136,7 @@
hour_trunc : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Hour',
+ label : rpt_strings.TFORMS_LABEL_HOUR_TRUNC,
regex : /^\d{2}$/,
hint : 'HH',
cal_format : '%H',
@@ -141,49 +145,49 @@
day_name : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Day Name'
+ label : rpt_strings.TFORMS_LABEL_DAY_NAME
},
month_name : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Month Name'
+ label : rpt_strings.TFORMS_LABEL_MONTH_NAME
},
age : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Age'
+ label : rpt_strings.TFORMS_LABEL_AGE
},
months_ago : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Months ago'
+ label : rpt_strings.TFORMS_LABEL_MONTHS_AGO
},
quarters_ago : {
datatype : OILS_RPT_DTYPE_TIMESTAMP,
- label : 'Quarters ago'
+ label : rpt_strings.TFORMS_LABEL_QUARTERS_AGO
},
/* int / float transforms ----------------------------------- */
sum : {
datatype : [ OILS_RPT_DTYPE_INT, OILS_RPT_DTYPE_FLOAT ],
- label : 'Sum',
+ label : rpt_strings.TFORMS_LABEL_SUM,
aggregate : true
},
average : {
datatype : [ OILS_RPT_DTYPE_INT, OILS_RPT_DTYPE_FLOAT ],
- label : 'Average',
+ label : rpt_strings.TFORMS_LABEL_AVERAGE,
aggregate : true
},
round : {
datatype : [ OILS_RPT_DTYPE_INT, OILS_RPT_DTYPE_FLOAT ],
- label : 'Round',
+ label : rpt_strings.TFORMS_LABEL_ROUND,
},
'int' : {
datatype : OILS_RPT_DTYPE_FLOAT,
- label : 'Drop trailing decimals'
+ label : rpt_strings.TFORMS_LABEL_INT
}
}
Modified: trunk/Open-ILS/web/reports/oils_rpt_widget.js
===================================================================
--- trunk/Open-ILS/web/reports/oils_rpt_widget.js 2008-11-06 22:31:46 UTC (rev 11086)
+++ trunk/Open-ILS/web/reports/oils_rpt_widget.js 2008-11-06 22:32:25 UTC (rev 11087)
@@ -309,9 +309,9 @@
insertSelectorVal(this.count, -1, i, i);
//insertSelectorVal(this.type, -1, ' -- Select One -- ', '');
- insertSelectorVal(this.type, -1, 'Day(s)', 'days');
- insertSelectorVal(this.type, -1, 'Month(s)', 'months');
- insertSelectorVal(this.type, -1, 'Year(s)', 'years');
+ insertSelectorVal(this.type, -1, rpt_strings.WIDGET_DAYS, 'days');
+ insertSelectorVal(this.type, -1, rpt_strings.WIDGET_MONTHS, 'months');
+ insertSelectorVal(this.type, -1, rpt_strings.WIDGET_YEARS, 'years');
this.node.appendChild(this.count);
this.node.appendChild(this.type);
}
@@ -433,17 +433,17 @@
args.node = this.node;
this.selector = elem('select');
- insertSelectorVal(this.selector,-1,'Real Date',1);
- insertSelectorVal(this.selector,-1,'Relative Date',2);
+ insertSelectorVal(this.selector,-1,rpt_strings.WIDGET_REAL_DATE,1);
+ insertSelectorVal(this.selector,-1,rpt_strings.WIDGET_RELATIVE_DATE,2);
this.numberPicker =
new oilsRptNumberWidget({node:this.relSpan,size:90,start:1});
this.label = 'Day(s)';
- if(this.type == 'month') this.label = 'Month(s)';
- if(this.type == 'quarter') this.label = 'Quarter(s)';
- if(this.type == 'year') this.label = 'Year(s)';
- if(this.type == 'date') this.label = 'Day(s)';
+ if(this.type == 'month') this.label = rpt_strings.WIDGET_MONTHS;
+ if(this.type == 'quarter') this.label = rpt_strings.WIDGET_QUARTERS;
+ if(this.type == 'year') this.label = rpt_strings.WIDGET_YEARS;
+ if(this.type == 'date') this.label = rpt_strings.WIDGET_DAYS;
}
oilsRptTruncPicker.prototype.draw = function() {
More information about the open-ils-commits
mailing list