Bugzilla – Attachment 31809 Details for
Bug 11672
Untranslatable report areas in step 1 of Guided Reports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11672: Untranslatable dropdown on Guided Reports and dictionary
Bug-11672-Untranslatable-dropdown-on-Guided-Report.patch (text/plain), 11.66 KB, created by
Jonathan Druart
on 2014-09-22 13:21:03 UTC
(
hide
)
Description:
Bug 11672: Untranslatable dropdown on Guided Reports and dictionary
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-09-22 13:21:03 UTC
Size:
11.66 KB
patch
obsolete
>From 72e1eba0ff422743b28e8a0f6045ad9b46bd43a3 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >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 <oleonard@myacpl.org> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > 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 -%] >+ > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> › <a href="/cgi-bin/koha/reports/guided_reports.pl">Guided reports wizard</a> > [% IF ( new_dictionary ) %] › <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> › <strong>Name the new definition</strong> > [% ELSIF ( step_2 ) %] › <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> › <strong>Step 2: Choose the area </strong> >@@ -36,21 +46,22 @@ > <h2>Current terms</h2> > <form action="/cgi-bin/koha/reports/dictionary.pl" method="post"> > <input type="hidden" name="phase" value="View Dictionary" /> >- [% IF ( areas ) %] >- Filter by area <select name="area"> >- <option value="">All</option> >- [% FOREACH area IN areas %] >- [% IF ( area.selected ) %] >- <option value="[% area.id %]" selected="selected" >[% area.name %]</option> >- [% ELSE %] >- <option value="[% area.id %]">[% area.name %]</option> >- [% END %] >- [% END %] >- </select> >- <input name="submit" value="Go" type="submit" /> >- </form> >- <br /> >- [% END %] >+ [% IF ( areas ) %] >+ Filter by area >+ <select name="area"> >+ <option value="">All</option> >+ [% FOREACH area IN areas %] >+ [%- IF ( area.selected ) -%] >+ <option value="[% area.id %]" selected="selected">[%- PROCESS area_name area=area.id -%]</option> >+ [%- ELSE -%] >+ <option value="[% area.id %]">[%- PROCESS area_name area=area.id -%]</option> >+ [%- END -%] >+ [% END %] >+ </select> >+ <input name="submit" value="Go" type="submit" /> >+ [% END %] >+ </form> >+ <br /> > <table border="1" cellspacing="0" cellpadding="5"> > <tr> > <th>Name</th> >@@ -99,24 +110,27 @@ > </form> > [% END %] > >-[% IF ( step_2 ) %] >+[%- IF ( step_2 ) -%] > <h3>Add new definition</h3> > <form action="/cgi-bin/koha/reports/dictionary.pl" method="post"> >-<fieldset class="rows"> >-<legend>Step 2 of 5: Choose the area</legend> >-<ol><li><input type="hidden" name="phase" value="New Term step 3" /> >-<input type="hidden" name="definition_name" value="[% definition_name %]" /> >-<input type="hidden" name="definition_description" value="[% definition_description %]" /> >-<label for="area">Select table </label><select name="area" id="area"> >-[% FOREACH area IN areas %] >-<option value="[% area.id %]">[% area.name %]</option> >-[% END %] >-</select></li> >-</ol> >-</fieldset> >-<fieldset class="action"><input name="submit" value="Next" type="submit" /></fieldset> >+ <fieldset class="rows"> >+ <legend>Step 2 of 5: Choose the area</legend> >+ <ol> >+ <li> >+ <input type="hidden" name="phase" value="New Term step 3" /> >+ <input type="hidden" name="definition_name" value="[% definition_name %]" /> >+ <input type="hidden" name="definition_description" value="[% definition_description %]" /> >+ <label for="area">Select table </label><select name="area" id="area"> >+ [%- FOREACH area IN areas -%] >+ <option value="[%- area.id -%]">[%- PROCESS area_name area=area.id -%]</option> >+ [%- END -%] >+ </select> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="action"><input name="submit" value="Next" type="submit" /></fieldset> > </form> >-[% END %] >+[%- END -%] > > [% IF ( step_3 ) %] > <h3>Add new definition</h3> >@@ -227,33 +241,34 @@ > <h3>Add new definition</h3> > > <fieldset class="rows"> >-<legend>Step 5 of 5: Confirm details</legend> >-<ol><li> >-<span class="label">Name:</span> >-[% definition_name %] >-</li> >-<li> >-<span class="label">Description:</span> >-[% definition_description %] >-</li> >-<li> >-<span class="label">Area:</span> >-[% areaname %] >-</li> >-<li> >-<span class="label">Data:</span> >-<table> >-<tr> >-<th>Columns</th> >-<th>Values</th> >-</tr> >-[% FOREACH criteria_loo IN criteria_loop %] >-<tr> >-<td>[% criteria_loo.name %]</td> >-<td>[% criteria_loo.value %]</td> >-</tr> >-[% END %] >-</table></li></ol> </fieldset> >+ <legend>Step 5 of 5: Confirm details</legend> >+ <ol> >+ <li> >+ <span class="label">Name:</span>[%- definition_name -%] >+ </li> >+ <li> >+ <span class="label">Description:</span>[%- definition_description -%] >+ </li> >+ <li> >+ <span class="label">Area:</span>[%- PROCESS area_name area=area -%] >+ </li> >+ <li> >+ <span class="label">Data:</span> >+ <table> >+ <tr> >+ <th>Columns</th> >+ <th>Values</th> >+ </tr> >+ [%- FOREACH criteria_loo IN criteria_loop -%] >+ <tr> >+ <td>[%- criteria_loo.name -%]</td> >+ <td>[%- criteria_loo.value -%]</td> >+ </tr> >+ [%- END -%] >+ </table> >+ </li> >+ </ol> >+</fieldset> > > <fieldset class="action"><input type="hidden" name="sql" value="[% query %]" /> > <input type="hidden" name="phase" value="New Term step 6" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >index 05c6acb..447a5f2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >@@ -1,4 +1,15 @@ > [% USE KohaDates %] >+ >+[%- BLOCK area_name -%] >+ [%- SWITCH area -%] >+ [%- CASE 'CIRC' -%]Circulation >+ [%- CASE 'CAT' -%]Catalog >+ [%- CASE 'PAT' -%]Patrons >+ [%- CASE 'ACQ' -%]Acquisitions >+ [%- CASE 'ACC' -%]Accounts >+ [%- END -%] >+[%- END -%] >+ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Reports › Guided reports wizard > [% IF ( saved1 ) %]› Saved reports >@@ -403,11 +414,15 @@ canned reports and writing custom SQL reports.</p> > <form action="/cgi-bin/koha/reports/guided_reports.pl"> > <fieldset class="rows"> > <legend>Step 1 of 6: Choose a module to report on,[% IF (usecache) %] Set cache expiry, [% END %] and Choose report visibility </legend> >-<ol><li><label for="area">Choose: </label><select name="area" id="area"> >-[% FOREACH area IN areas %] >-<option value="[% area.id %]">[% area.name %]</option> >-[% END %] >-</select></li> >+<ol> >+ <li> >+ <label for="area">Choose: </label> >+ <select name="area" id="area"> >+ [%- FOREACH area IN areas -%] >+ <option value="[% area %]">[%- PROCESS area_name area=area -%]</option> >+ [%- END -%] >+ </select> >+ </li> > [% IF (public) %] > <li><label for="public">Report is public:</label><select id="public" name="public"> <option value="0">No (default)</option> <option value="1" selected="selected">Yes</option> </select></li> > [% ELSE %] >diff --git a/reports/dictionary.pl b/reports/dictionary.pl >index 0ab6f24..f3e08d0 100755 >--- a/reports/dictionary.pl >+++ b/reports/dictionary.pl >@@ -55,7 +55,7 @@ if ($phase eq 'View Dictionary'){ > # view the dictionary we use to set up abstract variables such as all borrowers over fifty who live in a certain town > my $definitions = get_from_dictionary($area); > $template->param( >- 'areas'=> areas(), >+ 'areas' => areas( $area ), > 'start_dictionary' => 1, > 'definitions' => $definitions, > ); >@@ -70,7 +70,7 @@ elsif ( $phase eq 'New Term step 2' ) { > # Choosing the area > $template->param( > 'step_2' => 1, >- 'areas' => areas(), >+ 'areas' => areas( $area ), > 'definition_name' => $definition_name, > 'definition_description' => $definition_description, > ); >@@ -172,11 +172,9 @@ elsif ( $phase eq 'New Term step 5' ) { > $query_criteria .= " AND $crit <= '$value'"; > } > } >- my %report_areas = map @$_, get_report_areas(); > $template->param( > 'step_5' => 1, > 'area' => $area, >- 'areaname' => $report_areas{$area}, > 'definition_name' => $definition_name, > 'definition_description' => $definition_description, > 'query' => $query_criteria, >@@ -208,14 +206,17 @@ if (!$no_html){ > } > > sub areas { >+ >+ my $selected = shift; >+ > my $areas = get_report_areas(); > my @a; >- foreach (@$areas) { >+ foreach my $area ( @$areas ) { > push @a, { >- id => $_->[0], >- name => $_->[1], >- selected => ($_->[0] eq $area), >+ id => $area, >+ selected => ( $area eq $selected ) > }; > } >+ > return \@a; > } >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index ad72b44..9fe7387 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -87,12 +87,11 @@ if ( !$phase ) { > elsif ( $phase eq 'Build new' ) { > # build a new report > $template->param( 'build1' => 1 ); >- my $areas = get_report_areas(); > $template->param( >- 'areas' => [map { id => $_->[0], name => $_->[1] }, @$areas], >- 'usecache' => $usecache, >+ 'areas' => get_report_areas(), >+ 'usecache' => $usecache, > 'cache_expiry' => 300, >- 'public' => '0', >+ 'public' => '0', > ); > } elsif ( $phase eq 'Use saved' ) { > >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11672
:
27955
|
31125
|
31126
|
31187
|
31188
|
31189
|
31190
|
31808
| 31809 |
31810