Bug 7046: Preselect dropdown option and prefill input
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / subscription-renew.tt
1 [% SET footerjs = 1 %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 [% IF subscription %]
4 <title>Koha &rsaquo; Serials subscription renew #[% subscription.subscriptionid | html %]</title>
5 [% ELSE %]
6 <title>Koha &rsaquo; Serials subscription renew</title>
7 [% END %]
8 [% INCLUDE 'doc-head-close.inc' %]
9 </head>
10
11 <body id="ser_subscription-renew" class="ser">
12     <div class="container-fluid">
13
14 [% INCLUDE 'blocking_errors.inc' %]
15
16 [% IF op == 'renew' OR op =='multi_renew' %]
17     [% IF op == 'renew' %]
18         <span>Subscription renewed.<span>
19     [% ELSE %]
20         <span>Subscriptions renewed.<span>
21     [% END %]
22
23     <div id="closewindow">
24         <a class="btn btn-default btn-default close" href="#">Close</a>
25     </div>
26 [% ELSE %]
27
28 <form name="f" action="/cgi-bin/koha/serials/subscription-renew.pl" method="post">
29                 <input type="hidden" name="op" value="renew" />
30                 <input type="hidden" name="subscriptionid" value="[% subscription.subscriptionid | html %]" />
31                 <fieldset class="rows"><legend>Subscription renewal for [% subscription.bibliotitle | html %]</legend>
32         <ol>
33             <li>
34                 <label for="startdate">Start date: </label>
35                 <input type="text" size="10" id="startdate" name="startdate" value="[% startdate | html %]" class="datepicker"/>
36                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
37             </li>
38     <li>
39     <label>Subscription length:</label>
40     <select name="subtype" id="subtype">
41         [% FOREACH st IN [['numberlength', 'issues'], ['weeklength', 'weeks'], ['monthlength', 'months']] %]
42             [% SET subtype = st.0 %]
43             [% SET value = st.1 %]
44             [% IF subscription.$subtype %]
45                 <option value="[% value %]" selected="selected">
46             [% ELSE %]
47                 <option value="[% value %]">
48             [% END %]
49             [% SWITCH subtype %]
50                 [% CASE 'numberlength'%]issues
51                 [% CASE 'weeklength'  %]weeks
52                 [% CASE 'monthlength' %]months
53             [% END %]
54             </option>
55         [% END %]
56     </select>
57     <input type="text" name="sublength" id="sublength" size="3" value="[% subscription.numberlength || subscription.weeklength || subscription.monthlength %]" />(enter amount in numerals)
58     <input type="hidden" name="issuelengthcount">
59     </li>
60
61     <li><label for="branchcode">Library:</label>
62     <select name="branchcode" id="branchcode" style="width: 20em;">
63         [% UNLESS ( Independentbranches ) %]
64             <option value="">None</option>
65         [% END %]
66         [% IF CAN_user_serials_superserials %]
67             [% FOREACH library IN libraries %]
68                 <option value="[% library.branchcode | html %]"> [% library.branchname | html %] </option>
69             [% END %]
70         [% END %]
71     </select> (select a library)
72     </li>
73
74     <li><label for="note">Note for the librarian that will manage your renewal request: </label>
75                 <textarea name="note" id="note" rows="5" cols="50"></textarea></li></ol></fieldset>
76                 <fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset>
77 </form>
78 [% END %]
79
80 [% MACRO jsinclude BLOCK %]
81     [% INCLUDE 'calendar.inc' %]
82     <script type="text/javascript">
83         $(document).ready(function(){
84             $(".close").on("click", function(e){
85                 e.preventDefault();
86                 window.opener.location.reload(false);
87                 self.close();
88             });
89         });
90     </script>
91 [% END %]
92
93 [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]