Bugzilla – Attachment 38209 Details for
Bug 14022
Subscription form resets 'subscription length' to issues on editing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 14022: Does not reset the subscription length on editing a subscription
PASSED-QA-Bug-14022-Does-not-reset-the-subscriptio.patch (text/plain), 5.27 KB, created by
Katrin Fischer
on 2015-04-20 19:46:03 UTC
(
hide
)
Description:
[PASSED QA] Bug 14022: Does not reset the subscription length on editing a subscription
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-04-20 19:46:03 UTC
Size:
5.27 KB
patch
obsolete
>From 2801f0e1a48c4cce8876ff8cfae5217614a4efdb Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 20 Apr 2015 16:59:05 +0200 >Subject: [PATCH] [PASSED QA] Bug 14022: Does not reset the subscription length > on editing a subscription >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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> >--- > .../prog/en/modules/serials/subscription-add.tt | 30 +++++++++++++++++----- > serials/subscription-add.pl | 18 ++++--------- > 2 files changed, 29 insertions(+), 19 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >index 8401968..6bfe8d4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >@@ -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> >diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl >index 39d79b7..ce6f91d 100755 >--- a/serials/subscription-add.pl >+++ b/serials/subscription-add.pl >@@ -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(); >-- >1.9.1
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 14022
:
38197
|
38202
| 38209