Bug 7046: Implemented subscription renewal dropdown sub length element
authorAlex Buckley <alexbuckley@catalyst.net.nz>
Mon, 27 Nov 2017 02:31:35 +0000 (15:31 +1300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 8 Apr 2020 10:48:03 +0000 (11:48 +0100)
commitd132c10bfcff87b117ff454bb431fdbd1f08c92c
treebb1c6ac6f422487a8361d517884629bdf7852f37
parente925568a3067e77173f4d21f476b28f8aa068571
Bug 7046: Implemented subscription renewal dropdown sub length element

To make this work I moved the _get_sub_length function from
subscription-add.pl to C4/Serials.pm so that the subscription-renew.pl
script could also call it to store the sublength for the appropriate
field of the subscriptions database table.

Test plan:
1. Create a subscription and notice that there is a dropdown box for sub
   length containing the values: issues, weeks, months
2. Renew the subscription and notice that there are 3 input text boxes:
   'number of num', 'number of weeks' and 'number of months'
3. Input a 'Number of weeks' value of 2
4. Query the subscription database table and notice that the value of 2
   has been stored in the weeklength field for the subscription record you
   just renewed
5. Apply the patch
6. Renew the subscription and notice that there is now a sublength
   dropdown box containing issues, weeks and months
7. Set the month value to 3
8. Query the database and notice that 3 was stored in the monthlength
   field for the subscription record
9. Create a new subscription and select the sub length values of issues
   and 3
10. Query the database and notice that the numberlength field for the
   subscription you just created is set to 3 showing that the sublength
   dropbox is still working for creating a new subscription

Sponsored-By: Catalyst IT
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Serials.pm
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt
serials/subscription-add.pl
serials/subscription-renew.pl
t/db_dependent/Serials/ReNewSubscription.t