Bug 13748: Acquisition wizard: some strings not translatable

This patch removes all instances of CGI::scrolling_list from
reports/acquisitions_stats.pl, which prevented proper translation

To test:
1) Install and enable a language (es-ES or de-DE are good choices)
2) On Acquisitons wizard, some pulldown labels are not translated
3) Apply the patch
4) Update and install again the language
5) Check labels are translated and all pulldown works

This does not solve the 'Collection code' problem,
is more strange

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, good improvement.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Bernardo Gonzalez Kriegel 2015-03-10 11:28:39 -03:00 committed by Tomas Cohen Arazi
parent f3e02d2496
commit a7d4d05a7c
2 changed files with 71 additions and 74 deletions

View File

@ -220,14 +220,28 @@
<td>Item type</td>
<td><input type="radio" name="Line" value="biblioitems.itemtype" /></td>
<td><input type="radio" name="Column" value="biblioitems.itemtype" /></td>
<td>[% CGIItemType %]</td>
<td>
<select name="Filter" size="1" id="itemtypes">
<option value="">All item types</option>
[% FOREACH value IN ItemTypes.values %]
<option value="[% value %]">[% ItemTypes.labels.$value %]</option>
[% END %]
</select>
</td>
</tr>
<tr>
<td>Fund</td>
<td><input type="radio" name="Line" value="aqbudgets.budget_code" /></td>
<td><input type="radio" name="Column" value="aqbudgets.budget_code" /></td>
<td>[% CGIBudget %]</td>
<td>
<select name="Filter" size="1" id="budget">
<option value="">All funds</option>
[% FOREACH value IN Budgets.values %]
<option value="[% value %]">[% Budgets.labels.$value %]</option>
[% END %]
</select>
</td>
</tr>
[% IF ( hassort1 ) %]
@ -235,7 +249,14 @@
<td>Sort1</td>
<td><input type="radio" name="Line" value="aqorders.sort1" /></td>
<td><input type="radio" name="Column" value="aqorders.sort1" /></td>
<td>[% CGISort1 %] </td>
<td>
<select name="Filter" size="1" id="sort1">
<option value="">All</option>
[% FOREACH value IN Sort1.values %]
<option value="[% value %]">[% Sort1.labels.$value %]</option>
[% END %]
</select>
</td>
</tr>
[% END %]
[% IF ( hassort2 ) %]
@ -243,7 +264,14 @@
<td>Sort2</td>
<td><input type="radio" name="Line" value="aqorders.sort2" /></td>
<td><input type="radio" name="Column" value="aqorders.sort2" /></td>
<td>[% CGISort2 %] </td>
<td>
<select name="Filter" size="1" id="sort2">
<option value="">All</option>
[% FOREACH value IN Sort2.values %]
<option value="[% value %]">[% Sort2.labels.$value %]</option>
[% END %]
</select>
</td>
</tr>
[% END %]
</tbody>
@ -281,7 +309,9 @@
<label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
<label class="inline" for="basename">Named: </label> <input type="text" name="basename" id="basename" value="Export" />
<label class="inline" for="MIME">Into an application</label>
[% CGIextChoice %]
<select name="MIME" id="MIME" size="1">
<option value="CSV">CSV</option>
</select>
<select name="sep" id="sep" size="1">
[% FOREACH value IN CGIsepChoice.values.sort() %]
[% IF ( value == CGIsepChoice.default ) %]

View File

@ -122,78 +122,58 @@ else {
$req = $dbh->prepare("SELECT DISTINCTROW itemtype,description FROM itemtypes ORDER BY description");
$req->execute;
my @select;
my %select;
push @select, "";
$select{''} = "All item types";
my @iselect;
my %iselect;
while ( my ( $value, $desc ) = $req->fetchrow ) {
push @select, $value;
$select{$value} = $desc;
push @iselect, $value;
$iselect{$value} = $desc;
}
my $CGIItemTypes = CGI::scrolling_list(
-name => 'Filter',
-id => 'itemtypes',
-values => \@select,
-labels => \%select,
-size => 1,
-multiple => 0
);
my $ItemTypes = {
values => \@iselect,
labels => \%iselect,
};
$req = $dbh->prepare("SELECT DISTINCTROW budget_code, budget_name FROM aqbudgets ORDER BY budget_name");
$req->execute;
undef @select;
undef %select;
push @select, "";
$select{''} = "All funds";
my @bselect;
my %bselect;
while ( my ( $value, $desc ) = $req->fetchrow ) {
push @select, $value;
$select{$value} = $desc;
push @bselect, $value;
$bselect{$value} = $desc;
}
my $CGIBudget = CGI::scrolling_list(
-name => 'Filter',
-id => 'budget',
-values => \@select,
-labels => \%select,
-size => 1,
-multiple => 0
);
my $Budgets = {
values => \@bselect,
labels => \%bselect,
};
$req =
$dbh->prepare(
"SELECT DISTINCTROW sort1 FROM aqorders WHERE sort1 IS NOT NULL ORDER BY sort1"
);
$req->execute;
undef @select;
undef %select;
push @select, "";
$select{''} = "All";
my @s1select;
my %s1select;
my $hassort1;
while ( my ($value) = $req->fetchrow ) {
if ($value) {
$hassort1 = 1;
push @select, $value;
$select{$value} = $value;
push @s1select, $value;
$s1select{$value} = $value;
}
}
my $CGISort1 = CGI::scrolling_list(
-name => 'Filter',
-id => 'sort1',
-values => \@select,
-labels => \%select,
-size => 1,
-multiple => 0
);
my $Sort1 = {
values => \@s1select,
labels => \%s1select,
};
$req =
$dbh->prepare(
"SELECT DISTINCTROW sort2 FROM aqorders WHERE sort2 IS NOT NULL ORDER BY sort2"
);
$req->execute;
undef @select;
undef %select;
push @select, "";
$select{''} = "All";
my @s2select;
my %s2select;
my $hassort2;
my $hglghtsort2;
@ -201,26 +181,14 @@ else {
if ($value) {
$hassort2 = 1;
$hglghtsort2 = !($hassort1);
push @select, $value;
$select{$value} = $value;
push @s2select, $value;
$s2select{$value} = $value;
}
}
my $CGISort2 = CGI::scrolling_list(
-name => 'Filter',
-id => 'sort2',
-values => \@select,
-labels => \%select,
-size => 1,
-multiple => 0
);
my $CGIextChoice = CGI::scrolling_list(
-name => 'MIME',
-id => 'MIME',
-values => ['CSV'], # FIXME translation
-size => 1,
-multiple => 0
);
my $Sort2 = {
values => \@s2select,
labels => \%s2select,
};
my $CGIsepChoice = GetDelimiterChoices;
@ -240,13 +208,12 @@ else {
$template->param(
booksellers => $booksellers,
CGIItemType => $CGIItemTypes,
CGIBudget => $CGIBudget,
ItemTypes => $ItemTypes,
Budgets => $Budgets,
hassort1 => $hassort1,
hassort2 => $hassort2,
CGISort1 => $CGISort1,
CGISort2 => $CGISort2,
CGIextChoice => $CGIextChoice,
Sort1 => $Sort1,
Sort2 => $Sort2,
CGIsepChoice => $CGIsepChoice,
branches => \@branches,
ccode_label => $ccode_label,