Bugzilla – Attachment 69355 Details for
Bug 7046
subscription renewal period should be a pull down
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7046 - Added subscription length dropdown box
Bug-7046---Added-subscription-length-dropdown-box.patch (text/plain), 4.67 KB, created by
Alex Buckley
on 2017-11-27 02:34:49 UTC
(
hide
)
Description:
Bug 7046 - Added subscription length dropdown box
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-11-27 02:34:49 UTC
Size:
4.67 KB
patch
obsolete
>From 256593fecc0d5d355400a96313eaf9e00318cc22 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Mon, 27 Nov 2017 15:31:35 +1300 >Subject: [PATCH] Bug 7046 - Added subscription length dropdown box > >--- > C4/Serials.pm | 18 +++++++++++ > .../prog/en/modules/serials/subscription-renew.tt | 35 ++++++++++++++++++++-- > serials/subscription-renew.pl | 5 ++++ > 3 files changed, 55 insertions(+), 3 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 45bae8c..4fc7425 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -1495,6 +1495,24 @@ sub NewSubscription { > return $subscriptionid; > } > >+=head2 _get_sub_length >+my ($numberlength, $weeklength, $monthlength) = _get_sub_length( $subtype, $sublength ); >+ >+this function calculates the subscription length. >+ >+=cut >+ >+sub _get_sub_length { >+ my ($type, $length) = @_; >+ return >+ ( >+ $type eq 'issues' ? $length : 0, >+ $type eq 'weeks' ? $length : 0, >+ $type eq 'months' ? $length : 0, >+ ); >+} >+ >+ > =head2 ReNewSubscription > > ReNewSubscription($subscriptionid,$user,$startdate,$numberlength,$weeklength,$monthlength,$note) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt >index e7eb83d..96db6af 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt >@@ -32,9 +32,38 @@ > </li> > <li><fieldset> > <legend>Subscription length:</legend> >- <ol><li><label for="numberlength">Number of num:</label><input type="text" id="numberlength" name="numberlength" value="[% numberlength %]" /></li> >- <li><label for="weeklength">Number of weeks: </label><input type="text" id="weeklength" name="weeklength" value="[% weeklength %]" /></li> >- <li><label for="monthlength">Number of months: </label><input type="text" id="monthlength" name="monthlength" value="[% monthlength %]" /></li></ol></fieldset></li> >+ <select name="subtype" id="subtype"> >+ [% 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 %] >+ </option> >+ [% END %] >+ </select> >+ <input type="text" name="sublength" id="sublength" value="[% sublength %]" size="3" />(enter amount in numerals) >+ <input type="hidden" name="issuelengthcount"> >+ </li> > <li><label for="note">Note for the librarian that will manage your renewal request: </label> > <textarea name="note" id="note" rows="5" cols="50"></textarea></li></ol></fieldset> > <fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset> >diff --git a/serials/subscription-renew.pl b/serials/subscription-renew.pl >index bbbc8e5..e884a4a 100755 >--- a/serials/subscription-renew.pl >+++ b/serials/subscription-renew.pl >@@ -62,6 +62,10 @@ my $dbh = C4::Context->dbh; > my $mode = $query->param('mode') || q{}; > my $op = $query->param('op') || 'display'; > my $subscriptionid = $query->param('subscriptionid'); >+my $sublength = $query->param('sublength'); >+my $subtype = $query->param('subtype'); >+my ($numberlength, $weeklength, $monthlength) = C4::Serials->_get_sub_length( $subtype, $sublength ); >+ > my $done = 0; # for after form has been submitted > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { >@@ -93,6 +97,7 @@ my $newstartdate = output_pref( { str => $subscription->{enddate}, dateonly => 1 > or output_pref( { dt => dt_from_string, dateonly => 1 } ); > > $template->param( >+ subtypes => [ qw( numberlength weeklength monthlength ) ], > startdate => $newstartdate, > numberlength => $subscription->{numberlength}, > weeklength => $subscription->{weeklength}, >-- >2.1.4
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 7046
:
5938
|
5939
|
69355
|
69356
|
69408
|
81641
|
81642
|
102275
|
102276
|
102278
|
102425
|
102427
|
102428
|
102429
|
102430
|
102535
|
102536
|
102537
|
102538
|
102564