Bug 26819: (QA follow-up) Fix branchtransfers.tt
[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>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( <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> ) is not checked out to a patron.</p>
42
43                             [% ELSIF error == "too_many" %]
44
45                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% 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_unseen" %]
56
57                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio %] ( [% item.barcode | html %] ) has been renewed the maximum number of consecutive times without being seen by the library )</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 limit and renew</button>
64                                     </form>
65                                 [% END %]
66
67                             [% ELSIF error == "too_soon" %]
68
69                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% item.barcode | html %] ) 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_soon" %]
80
81                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal and cannot be renewed before [% soonestrenewdate | $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                                         <button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
88                                     </form>
89                                 [% END %]
90
91                             [% ELSIF error == "auto_too_late" %]
92
93                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal and cannot be renewed anymore since [% latestautorenewdate | $KohaDates %]. </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_account_expired" %]
104
105                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal and cannot be renewed because the patron's account is expired</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                                         <input type="submit" class="approve" value="Override and renew" />
112                                     </form>
113                                 [% END %]
114
115                             [% ELSIF error == "auto_renew" or error == "auto_too_much_oweing" %]
116
117                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal. </p>
118
119                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
120                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
121                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
122                                         <input type="hidden" name="override_limit" value="1" />
123                                         <button type="submit" class="approve"><i class="fa fa-check"></i> Override limit and renew</button>
124                                     </form>
125                                 [% END %]
126
127                             [% ELSIF error == "on_reserve" %]
128
129                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% item.barcode | html %] ): This item is on hold for another patron.</p>
130
131                                 <form method="post" action="/cgi-bin/koha/circ/renew.pl">
132                                     <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
133                                     <input type="hidden" name="override_limit" value="1" />
134                                     <input type="hidden" name="override_holds" value="1" />
135                                     <div>
136                                         <label for="renewonholdduedate">Renewal due date:</label> <input type="text" size="12" id="renewonholdduedate" name="renewonholdduedate" value="" />
137                                     </div>
138                                     <button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
139                                 </form>
140
141                             [% ELSIF error == "patron_restricted" %]
142
143                                 <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>
144
145                             [% ELSIF error == "item_denied_renewal" %]
146
147                                 <p>Item is not allowed renewal.</p>
148
149                             [% ELSIF error == "onsite_checkout" %]
150                                 <p>Item cannot be renewed because it's an onsite checkout</p>
151
152                             [% ELSE %]
153
154                                 [% error | html %]
155
156                             [% END %]
157
158                                 <form method="get" action="/cgi-bin/koha/circ/renew.pl">
159                                     <input type="hidden" name="hard_due_date" value="[% hard_due_date | html %]" />
160                                     <button type="submit" class="deny"><i class="fa fa-times"></i> Continue without renewing</button>
161                                 </form>
162                     </div>
163                 [% END %]
164
165                 [% IF date_due %]
166                     <div class="dialog message">
167                         <h3>Item renewed:</h3>
168                         <p>
169                             [% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %]
170                             ( <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> )
171                             renewed for
172                             [% borrower.firstname | html %] [% borrower.surname | html %] ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | uri %]"> [% borrower.cardnumber | html %] </a> )
173                             now due on [% date_due | $KohaDates %]
174                         </p>
175                     </div>
176                 [% END %]
177
178             [% UNLESS error %]
179                 <form method="post" action="/cgi-bin/koha/circ/renew.pl" autocomplete="off" >
180
181                     <fieldset>
182                         <h2>Renew</h2>
183
184                         [% IF Koha.Preference('UnseenRenewals') %]
185                             <div class="renew_formfield">
186                                 <div>
187                                     <label for="barcode" class="hint">Enter item barcode: </label>
188                                 </div>
189                                 <input name="barcode" id="barcode" size="14" class="barcode focus" type="text" />
190                             </div>
191                             <div class="renew_formfield">
192                                 <label for="unseen" class="hint">Record renewal as unseen if appropriate: </label>
193                                 <input value="1" name="unseen" id="unseen" type="checkbox" />
194                             </div>
195                         [% ELSE %]
196                             <div>
197                                 <label for="barcode" class="hint">Enter item barcode: </label>
198                             </div>
199
200                             <input name="barcode" id="barcode" size="14" class="barcode focus" type="text" />
201
202                         [% END %]
203                         <button type="submit" class="btn btn-default">Submit</button>
204
205                         <div class="circ-settings show">
206                             <div class="date-select" id="renew_date_override_fields">
207                                 <div><label for="hard_due_date" class="hint">Renewal due date [% INCLUDE 'date-format.inc' %]:</label></div>
208                                 <input type="text" size="20" id="hard_due_date" name="hard_due_date" value="[% hard_due_date | $KohaDates with_hours => 1 %]" />
209                                 <button type="button" class="action btn btn-default btn-xs" id="cleardate" name="cleardate">Clear</button>
210                             </div> <!-- /.date-select -->
211                         </div>
212                     </fieldset>
213
214
215                 </form>
216             [% END %]
217
218                     [% IF Koha.Preference('CircSidebar') %]
219                             </div> <!-- /.col-sm-10.col-sm-push-2 -->
220                             <div class="col-sm-2 col-sm-pull-10">
221                                 <aside>
222                                     [% INCLUDE 'circ-nav.inc' %]
223                                 </aside>
224                             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
225                         </div> <!-- /.row -->
226                     [% END %]
227
228             </main>
229         </div> <!-- /.col-sm-12 -->
230     </div> <!-- /.row -->
231
232 [% MACRO jsinclude BLOCK %]
233     [% INCLUDE 'calendar.inc' %]
234     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
235     [% INCLUDE 'timepicker.inc' %]
236     [% IF error %]
237         <script>
238             $( document ).ready(function() {
239                 removeFocus();
240             });
241         </script>
242     [% END %]
243     <script>
244         $( document ).ready(function() {
245             $("#renewonholdduedate").datetimepicker({
246                 onClose: function(dateText, inst) {
247                     validate_date(dateText, inst);
248                 },
249                 minDate: 1, // require that renewal date is after today
250                 hour: 23,
251                 minute: 59
252             }).on('change', function(e) {
253                 if ( ! is_valid_date( $(this).val() ) ) {$(this).val('');}
254             });
255
256             [% IF Koha.Preference('SpecifyDueDate') %]
257                 $("#hard_due_date").datetimepicker({
258                     onClose: function(dateText, inst) {
259                         validate_date(dateText, inst);
260                     },
261                     hour: 23,
262                     minute: 59
263                 }).on("change", function(e, value) {
264                     if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
265                 });
266                 $("#cleardate").on("click",function(e){
267                     e.preventDefault();
268                     this.form.hard_due_date.value = '';
269                     this.form.barcode.focus();
270                 });
271             [% END %]
272
273         });
274     </script>
275 [% END %]
276
277 [% INCLUDE 'intranet-bottom.inc' %]