Bug 16112: (follow-up) Form style improvements, clear date
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / renew.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7
8 <title>Koha &rsaquo; Circulation &rsaquo; Renew [% title | html %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 </head>
11
12 <body id="circ_renew" class="circ">
13
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'circ-search.inc' %]
16
17 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Renew</div>
18
19 <div class="main container-fluid">
20     <div class="row">
21         <div class="col-sm-12">
22             <main>
23                 <div class="row">
24
25                 [% IF Koha.Preference('CircSidebar') %]
26                     <div class="col-sm-10 col-sm-push-2">
27                 [% ELSE %]
28                     <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
29                 [% END %]
30
31                 [% IF error %]
32                     <div class="dialog alert">
33                         <h3>Cannot renew:</h3>
34
35                             [% IF error == "no_item" %]
36
37                                 <p>No item matches this barcode</p>
38
39                             [% ELSIF error == "no_checkout" %]
40
41                                 <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblio.biblionumber | uri %]">[% INCLUDE 'biblio-title.inc' biblio=item.biblio %]</a> ( <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% item.itemnumber | html %]&amp;biblionumber=[% item.biblio.biblionumber | html %]&amp;bi=[% item.biblioitemnumber.biblioitemnumber | html %]#item[% item.itemnumber | html %]">[% item.barcode | html %]</a> ) is not checked out to a patron.</p>
42
43                             [% ELSIF error == "too_many" %]
44
45                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio %] ( [% item.barcode | html %] ) has been renewed the maximum number of times by [% borrower.firstname | html %] [% borrower.surname | html %] ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | uri %]"> [% borrower.cardnumber | html %] </a> )</p>
46
47                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
48                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
49                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
50                                         <input type="hidden" name="override_limit" value="1" />
51                                         <button type="submit" class="approve"><i class="fa fa-check"></i> Override limit and renew</button>
52                                     </form>
53                                 [% END %]
54
55                             [% ELSIF error == "too_soon" %]
56
57                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio %] ( [% item.barcode | html %] ) cannot be renewed before [% soonestrenewdate | $KohaDates %]. </p>
58
59                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
60                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
61                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
62                                         <input type="hidden" name="override_limit" value="1" />
63                                         <button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
64                                     </form>
65                                 [% END %]
66
67                             [% ELSIF error == "auto_too_soon" %]
68
69                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal and cannot be renewed before [% soonestrenewdate | $KohaDates %]. </p>
70
71                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
72                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
73                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
74                                         <input type="hidden" name="override_limit" value="1" />
75                                         <button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
76                                     </form>
77                                 [% END %]
78
79                             [% ELSIF error == "auto_too_late" %]
80
81                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal and cannot be renewed anymore since [% latestautorenewdate | $KohaDates %]. </p>
82
83                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
84                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
85                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
86                                         <input type="hidden" name="override_limit" value="1" />
87                                         <input type="submit" class="approve" value="Override and renew" />
88                                     </form>
89                                 [% END %]
90
91                             [% ELSIF error == "auto_account_expired" %]
92
93                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal and cannot be renewed because the patron's account is expired</p>
94
95                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
96                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
97                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
98                                         <input type="hidden" name="override_limit" value="1" />
99                                         <input type="submit" class="approve" value="Override and renew" />
100                                     </form>
101                                 [% END %]
102
103                             [% ELSIF error == "auto_renew" or error == "auto_too_much_oweing" %]
104
105                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal. </p>
106
107                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
108                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
109                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
110                                         <input type="hidden" name="override_limit" value="1" />
111                                         <button type="submit" class="approve"><i class="fa fa-check"></i> Override limit and renew</button>
112                                     </form>
113                                 [% END %]
114
115                             [% ELSIF error == "on_reserve" %]
116
117                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio %] ( [% item.barcode | html %] ): This item is on hold for another patron.</p>
118
119                                 <form method="post" action="/cgi-bin/koha/circ/renew.pl">
120                                     <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
121                                     <input type="hidden" name="override_limit" value="1" />
122                                     <input type="hidden" name="override_holds" value="1" />
123                                     <div>
124                                         <label for="renewonholdduedate">Renewal due date:</label> <input type="text" size="12" id="renewonholdduedate" name="renewonholdduedate" value="" />
125                                     </div>
126                                     <button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
127                                 </form>
128
129                             [% ELSIF error == "patron_restricted" %]
130
131                                 <p>[% borrower.firstname | html %] [% borrower.surname | html %] ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | uri %]"> [% borrower.cardnumber | html %] </a> ) is currently restricted.</p>
132
133                             [% ELSIF error == "item_denied_renewal" %]
134
135                                 <p>Item is not allowed renewal.</p>
136
137                             [% ELSIF error == "onsite_checkout" %]
138                                 <p>Item cannot be renewed because it's an onsite checkout</p>
139
140                             [% ELSE %]
141
142                                 [% error | html %]
143
144                             [% END %]
145
146                                 <form method="get" action="/cgi-bin/koha/circ/renew.pl">
147                                     <input type="hidden" name="hard_due_date" value="[% hard_due_date | html %]" />
148                                     <button type="submit" class="deny"><i class="fa fa-times"></i> Continue without renewing</button>
149                                 </form>
150                     </div>
151                 [% END %]
152
153                 [% IF date_due %]
154                     <div class="dialog message">
155                         <h3>Item renewed:</h3>
156                         <p>
157                             <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblio.biblionumber | uri %]">[% INCLUDE 'biblio-title.inc' biblio=item.biblio %]</a>
158                             ( <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% item.itemnumber | uri %]&amp;biblionumber=[% item.biblio.biblionumber | uri %]&amp;bi=[% item.biblioitemnumber.biblioitemnumber | uri %]#item[% item.itemnumber | uri %]">[% item.barcode | html %]</a> )
159                             renewed for
160                             [% borrower.firstname | html %] [% borrower.surname | html %] ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | uri %]"> [% borrower.cardnumber | html %] </a> )
161                             now due on [% date_due | $KohaDates %]
162                         </p>
163                     </div>
164                 [% END %]
165
166             [% UNLESS error %]
167                 <form method="post" action="/cgi-bin/koha/circ/renew.pl" autocomplete="off" >
168
169                     <fieldset>
170                         <h2>Renew</h2>
171
172                         <div>
173                             <label for="barcode" class="hint">Enter item barcode: </label>
174                         </div>
175
176                         <input name="barcode" id="barcode" size="14" class="barcode focus" type="text" />
177
178                         <button type="submit" class="btn btn-default">Submit</button>
179
180                         [% IF Koha.Preference('SpecifyDueDate') %]
181                             <div class="circ-settings show">
182                                 <div class="date-select" id="renew_date_override_fields">
183                                     <div><label for="hard_due_date" class="hint">Specify due date [% INCLUDE 'date-format.inc' %]:</label></div>
184                                     <input type="text" size="20" id="hard_due_date" name="hard_due_date" value="[% hard_due_date | $KohaDates with_hours => 1 %]" />
185                                     <button type="button" class="action btn btn-default btn-xs" id="cleardate" name="cleardate">Clear</button>
186                                 </div> <!-- /.date-select -->
187                             </div>
188                         [% END %]
189
190                     </fieldset>
191
192
193                 </form>
194             [% END %]
195
196                     [% IF Koha.Preference('CircSidebar') %]
197                             </div> <!-- /.col-sm-10.col-sm-push-2 -->
198                             <div class="col-sm-2 col-sm-pull-10">
199                                 <aside>
200                                     [% INCLUDE 'circ-nav.inc' %]
201                                 </aside>
202                             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
203                         </div> <!-- /.row -->
204                     [% END %]
205
206             </main>
207         </div> <!-- /.col-sm-12 -->
208     </div> <!-- /.row -->
209
210 [% MACRO jsinclude BLOCK %]
211     [% INCLUDE 'calendar.inc' %]
212     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
213     [% INCLUDE 'timepicker.inc' %]
214     [% IF error %]
215         <script>
216             $( document ).ready(function() {
217                 removeFocus();
218             });
219         </script>
220     [% END %]
221     <script>
222         $( document ).ready(function() {
223             $("#renewonholdduedate").datetimepicker({
224                 onClose: function(dateText, inst) {
225                     validate_date(dateText, inst);
226                 },
227                 minDate: 1, // require that renewal date is after today
228                 hour: 23,
229                 minute: 59
230             }).on('change', function(e) {
231                 if ( ! is_valid_date( $(this).val() ) ) {$(this).val('');}
232             });
233
234             [% IF Koha.Preference('SpecifyDueDate') %]
235                 $("#hard_due_date").datetimepicker({
236                     onClose: function(dateText, inst) {
237                         validate_date(dateText, inst);
238                     },
239                     hour: 23,
240                     minute: 59
241                 }).on("change", function(e, value) {
242                     if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
243                 });
244                 $("#cleardate").on("click",function(e){
245                     e.preventDefault();
246                     this.form.hard_due_date.value = '';
247                     this.form.barcode.focus();
248                 });
249             [% END %]
250
251         });
252     </script>
253 [% END %]
254
255 [% INCLUDE 'intranet-bottom.inc' %]