From 72e1eba0ff422743b28e8a0f6045ad9b46bd43a3 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Sun, 24 Aug 2014 02:11:50 -0300 Subject: [PATCH] Bug 11672: Untranslatable dropdown on Guided Reports and dictionary This patch removes hardcoded descriptions and sets them in the templates using the variable content as id. To test, create a new guided report and verify the 'module to report on' dropdown shows as usual [1]. Functionality shouldn't get changed. The patch also changes the dictionary pages where 'area' should be displayed/selectable with the same strings as the guided reports. Try all the possible disctionary pages. The last page when creating a dictionary now shows the 'area description' instead of the code. The same happens to the dictionary list once you have dictionaries saved. [1] The following texts get changed: Catalogue -> Catalog Acquisition -> Acquisitions Signed-off-by: Owen Leonard Signed-off-by: Jonathan Druart --- C4/Reports/Guided.pm | 6 +- .../prog/en/modules/reports/dictionary.tt | 129 ++++++++++++--------- .../en/modules/reports/guided_reports_start.tt | 25 +++- reports/dictionary.pl | 17 +-- reports/guided_reports.pl | 7 +- 5 files changed, 109 insertions(+), 75 deletions(-) diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm index a4c7c01..a8eb1d0 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -83,8 +83,12 @@ my $AREA_NAME_SQL_SNIPPET = "CASE report_area " . join (" ", map "WHEN '$_->[0]' THEN '$_->[1]'", @REPORT_AREA) . " END AS areaname"; + sub get_report_areas { - return \@REPORT_AREA + + my $report_areas = [ 'CIRC', 'CAT', 'PAT', 'ACQ', 'ACC' ]; + + return $report_areas; } my %table_areas = ( diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt index ee40dcf..7ca9c82 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt @@ -8,6 +8,16 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'circ-search.inc' %] +[%- BLOCK area_name -%] + [%- SWITCH area -%] + [%- CASE 'CIRC' -%]Circulation + [%- CASE 'CAT' -%]Catalog + [%- CASE 'PAT' -%]Patrons + [%- CASE 'ACQ' -%]Acquisitions + [%- CASE 'ACC' -%]Accounts + [%- END -%] +[%- END -%] +