From 9e9099d089b56de94f2c43c32fb616ff765b1500 Mon Sep 17 00:00:00 2001 From: miker Date: Sat, 14 Mar 2009 02:56:11 +0000 Subject: [PATCH] apply proper I18N-ification to new template builder functionality git-svn-id: svn://svn.open-ils.org/ILS/trunk@12516 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../web/js/dojo/openils/reports/nls/reports.js | 5 + Open-ILS/web/opac/locale/en-US/reports.dtd | 2 + Open-ILS/web/reports/xul/source-browse.js | 118 ++++++++++----------- Open-ILS/web/reports/xul/source-setup.js | 15 ++- Open-ILS/web/reports/xul/template_builder.xul | 4 +- 5 files changed, 79 insertions(+), 65 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/reports/nls/reports.js b/Open-ILS/web/js/dojo/openils/reports/nls/reports.js index 3f61b8492..f9b72e551 100644 --- a/Open-ILS/web/js/dojo/openils/reports/nls/reports.js +++ b/Open-ILS/web/js/dojo/openils/reports/nls/reports.js @@ -1,5 +1,10 @@ { "RPT_BUILDER_CONFIRM_SAVE": "Name : ${0}\nDescription: ${1}\nSave Template?", + + "LINK_NULLABLE_DEFAULT": "Default", + "LINK_NULLABLE_RIGHT": "Parent", + "LINK_NULLABLE_LEFT": "Child", + "LINK_NULLABLE_NONE": "None", "FILTERS_LABEL_EQUALS":"Equals", "FILTERS_LABEL_LIKE": "Contains Matching substring", diff --git a/Open-ILS/web/opac/locale/en-US/reports.dtd b/Open-ILS/web/opac/locale/en-US/reports.dtd index 72bd39ead..51baaf0e9 100644 --- a/Open-ILS/web/opac/locale/en-US/reports.dtd +++ b/Open-ILS/web/opac/locale/en-US/reports.dtd @@ -180,6 +180,8 @@ + + diff --git a/Open-ILS/web/reports/xul/source-browse.js b/Open-ILS/web/reports/xul/source-browse.js index df13f9508..4075dd1f7 100644 --- a/Open-ILS/web/reports/xul/source-browse.js +++ b/Open-ILS/web/reports/xul/source-browse.js @@ -66,7 +66,7 @@ function sourceTreeHandler (ev, dbl) { subtreeList.push( { name : name, - nullable : 'Default', + nullable : rpt_strings.LINK_NULLABLE_DEFAULT, idlclass : idlclass, map : map, key : key, @@ -77,67 +77,67 @@ function sourceTreeHandler (ev, dbl) { } ); - if ($('nullable-source-control').checked) { - if (reltype == 'has_a') { - subtreeList.push( - { name : name, - nullable : 'Parent', //rpt_strings.LINK_NULLABLE_RIGHT, - idlclass : idlclass, - map : map, - key : key, - join : 'right', - field : field.getAttribute('name'), - reltype : reltype, - link : link, - fullpath : fullpath + '>right' - } - ); + if ($('nullable-source-control').checked) { + if (reltype == 'has_a') { + subtreeList.push( + { name : name, + nullable : rpt_strings.LINK_NULLABLE_RIGHT, + idlclass : idlclass, + map : map, + key : key, + join : 'right', + field : field.getAttribute('name'), + reltype : reltype, + link : link, + fullpath : fullpath + '>right' + } + ); - subtreeList.push( - { name : name, - nullable : 'None', //rpt_strings.LINK_NULLABLE_NONE - idlclass : idlclass, - map : map, - key : key, - join : 'inner', - field : field.getAttribute('name'), - reltype : reltype, - link : link, - fullpath : fullpath + '>inner' - } - ); - - } else { - subtreeList.push( - { name : name, - nullable : 'Child', //rpt_strings.LINK_NULLABLE_LEFT, - idlclass : idlclass, - map : map, - key : key, - join : 'left', - field : field.getAttribute('name'), - reltype : reltype, - link : link, - fullpath : fullpath + '>left' - } - ); + subtreeList.push( + { name : name, + nullable : rpt_strings.LINK_NULLABLE_NONE, + idlclass : idlclass, + map : map, + key : key, + join : 'inner', + field : field.getAttribute('name'), + reltype : reltype, + link : link, + fullpath : fullpath + '>inner' + } + ); - subtreeList.push( - { name : name, - nullable : 'None', //rpt_strings.LINK_NULLABLE_NONE - idlclass : idlclass, - map : map, - key : key, - join : 'inner', - field : field.getAttribute('name'), - reltype : reltype, - link : link, - fullpath : fullpath + '>inner' - } - ); + } else{ + subtreeList.push( + { name : name, + nullable : rpt_strings.LINK_NULLABLE_LEFT, + idlclass : idlclass, + map : map, + key : key, + join : 'left', + field : field.getAttribute('name'), + reltype : reltype, + link : link, + fullpath : fullpath + '>left' + } + ); - } - } + subtreeList.push( + { name : name, + nullable : rpt_strings.LINK_NULLABLE_NONE, + idlclass : idlclass, + map : map, + key : key, + join : 'inner', + field : field.getAttribute('name'), + reltype : reltype, + link : link, + fullpath : fullpath + '>inner' + } + ); + + } + } } populateSourcesSubtree( item.lastChild, subtreeList ); diff --git a/Open-ILS/web/reports/xul/source-setup.js b/Open-ILS/web/reports/xul/source-setup.js index 8e902de0c..018e1019f 100644 --- a/Open-ILS/web/reports/xul/source-setup.js +++ b/Open-ILS/web/reports/xul/source-setup.js @@ -276,10 +276,17 @@ function populateDetailTree (tcNode, c, item) { var field_name = atom[1]; var join_type = field_name; - field_name = field_name.split(/>/)[0]; - join_type = join_type.split(/>/)[1]; - - if (join_type) _label += ' (' + join_type + ')'; + switch (join_type) { + case 'right': + _label += ' (' + rpt_strings.LINK_NULLABLE_RIGHT + ')'; + break; + case 'left': + _label += ' (' + rpt_strings.LINK_NULLABLE_LEFT + ')'; + break; + case 'inner': + _label += ' (' + rpt_strings.LINK_NULLABLE_NONE + ')'; + break; + } } path_label.push(_label); diff --git a/Open-ILS/web/reports/xul/template_builder.xul b/Open-ILS/web/reports/xul/template_builder.xul index 3ffd29712..688ea8e06 100644 --- a/Open-ILS/web/reports/xul/template_builder.xul +++ b/Open-ILS/web/reports/xul/template_builder.xul @@ -76,12 +76,12 @@ ondblclick="sourceTreeHandlerDblClick(event)" > - + - + -- 2.11.0