Bug 14022: Does not reset the subscription length on editing a subscription
The subscription length is always set to the first/default value
('issues') when editing a subscription.
Even if you selected another value on creating/editing it, the form will
show you the first option.
Test plan:
1/ Add/Edit a subscription, select a subscription length different of
the first value (issues)
2/ Edit the subscription and confirm the value is kept
Bonus: issues, week and months become translatable.
Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
parent
40543e9c45
commit
9d7d645baf
|
|
@ -652,13 +652,31 @@ $(document).ready(function() {
|
|||
<li>
|
||||
<label for="subtype">Subscription length:</label>
|
||||
<select name="subtype" id="subtype">
|
||||
[% FOREACH subt IN subtype %]
|
||||
[% IF (subt.selected) %]
|
||||
<option value="[% subt.name %]" selected="selected">
|
||||
[% ELSE %]
|
||||
<option value="[% subt.name %]">
|
||||
[% FOREACH st IN subtypes %]
|
||||
[% SWITCH st %]
|
||||
[% CASE 'numberlength' %]
|
||||
[% IF st == subtype %]
|
||||
<option value="issues" selected="selected">
|
||||
[% ELSE %]
|
||||
<option value="issues">
|
||||
[% END %]
|
||||
issues
|
||||
[% CASE 'weeklength' %]
|
||||
[% IF st == subtype %]
|
||||
<option value="weeks" selected="selected">
|
||||
[% ELSE %]
|
||||
<option value="weeks">
|
||||
[% END %]
|
||||
weeks
|
||||
[% CASE 'monthlength' %]
|
||||
[% IF st == subtype %]
|
||||
<option value="months" selected="selected">
|
||||
[% ELSE %]
|
||||
<option value="months">
|
||||
[% END %]
|
||||
months
|
||||
[% CASE %][% st %]
|
||||
[% END %]
|
||||
[% subt.name %]
|
||||
</option>
|
||||
[% END %]
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -59,8 +59,6 @@ my ($template, $loggedinuser, $cookie)
|
|||
|
||||
|
||||
my $sub_on;
|
||||
my @subscription_types = (qw(issues weeks months));
|
||||
my @sub_type_data;
|
||||
|
||||
my $subs;
|
||||
our $firstissuedate;
|
||||
|
|
@ -164,17 +162,11 @@ if ($op eq 'addsubscription') {
|
|||
} elsif ($op eq 'modsubscription') {
|
||||
redirect_mod_subscription();
|
||||
} else {
|
||||
while (@subscription_types) {
|
||||
my $sub_type = shift @subscription_types;
|
||||
my %row = ( 'name' => $sub_type );
|
||||
if ( defined $sub_on and $sub_on eq $sub_type ) {
|
||||
$row{'selected'} = ' selected';
|
||||
} else {
|
||||
$row{'selected'} = '';
|
||||
}
|
||||
push( @sub_type_data, \%row );
|
||||
}
|
||||
$template->param(subtype => \@sub_type_data);
|
||||
|
||||
$template->param(
|
||||
subtypes => [ qw( numberlength weeklength monthlength ) ],
|
||||
subtype => $sub_on,
|
||||
);
|
||||
|
||||
if ( $op ne 'modsubscription' && $op ne 'dup' && $op ne 'modify' ) {
|
||||
my $letters = get_letter_loop();
|
||||
|
|
|
|||
Loading…
Reference in New Issue