Bug 27846: circ folder
[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 <nav aria-label="Breadcrumb" class="breadcrumb">
18     <ol>
19         <li>
20             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
21         </li>
22         <li>
23             <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
24         </li>
25         <li>
26             <a href="#" aria-current="page">
27                 Renew
28             </a>
29         </li>
30     </ol>
31 </nav>
32
33 <div class="main container-fluid">
34     <div class="row">
35         <div class="col-sm-12">
36             <main>
37                 <div class="row">
38
39                 [% IF Koha.Preference('CircSidebar') %]
40                     <div class="col-sm-10 col-sm-push-2">
41                 [% ELSE %]
42                     <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
43                 [% END %]
44
45                 [% IF error %]
46                     <div class="dialog alert">
47                         <h3>Cannot renew:</h3>
48
49                             [% IF error == "no_item" %]
50
51                                 <p>No item matches this barcode</p>
52
53                             [% ELSIF error == "no_checkout" %]
54
55                                 <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>
56
57                             [% ELSIF error == "too_many" %]
58
59                                 <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>
60
61                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
62                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
63                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
64                                         <input type="hidden" name="override_limit" value="1" />
65                                         <button type="submit" class="approve"><i class="fa fa-check"></i> Override limit and renew</button>
66                                     </form>
67                                 [% END %]
68
69                             [% ELSIF error == "too_unseen" %]
70
71                                 <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>
72
73                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
74                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
75                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
76                                         <input type="hidden" name="override_limit" value="1" />
77                                         <button type="submit" class="approve"><i class="fa fa-check"></i> Override limit and renew</button>
78                                     </form>
79                                 [% END %]
80
81                             [% ELSIF error == "too_soon" %]
82
83                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% item.barcode | html %] ) cannot be renewed before [% soonestrenewdate | $KohaDates %]. </p>
84
85                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
86                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
87                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
88                                         <input type="hidden" name="override_limit" value="1" />
89                                         <button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
90                                     </form>
91                                 [% END %]
92
93                             [% ELSIF error == "auto_too_soon" %]
94
95                                 <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>
96
97                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
98                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
99                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
100                                         <input type="hidden" name="override_limit" value="1" />
101                                         <button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
102                                     </form>
103                                 [% END %]
104
105                             [% ELSIF error == "auto_too_late" %]
106
107                                 <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>
108
109                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
110                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
111                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
112                                         <input type="hidden" name="override_limit" value="1" />
113                                         <input type="submit" class="approve" value="Override and renew" />
114                                     </form>
115                                 [% END %]
116
117                             [% ELSIF error == "auto_account_expired" %]
118
119                                 <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>
120
121                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
122                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
123                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
124                                         <input type="hidden" name="override_limit" value="1" />
125                                         <input type="submit" class="approve" value="Override and renew" />
126                                     </form>
127                                 [% END %]
128
129                             [% ELSIF error == "auto_renew" or error == "auto_too_much_oweing" %]
130
131                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal. </p>
132
133                                 [% IF Koha.Preference('AllowRenewalLimitOverride') %]
134                                     <form method="post" action="/cgi-bin/koha/circ/renew.pl">
135                                         <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
136                                         <input type="hidden" name="override_limit" value="1" />
137                                         <button type="submit" class="approve"><i class="fa fa-check"></i> Override limit and renew</button>
138                                     </form>
139                                 [% END %]
140
141                             [% ELSIF error == "on_reserve" %]
142
143                                 <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% item.barcode | html %] ): This item is on hold for another patron.</p>
144
145                                 <form method="post" action="/cgi-bin/koha/circ/renew.pl">
146                                     <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
147                                     <input type="hidden" name="override_limit" value="1" />
148                                     <input type="hidden" name="override_holds" value="1" />
149                                     <div>
150                                         <label for="renewonholdduedate">Renewal due date:</label> <input type="text" size="12" id="renewonholdduedate" name="renewonholdduedate" value="" />
151                                     </div>
152                                     <button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
153                                 </form>
154
155                             [% ELSIF error == "patron_restricted" %]
156
157                                 <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>
158
159                             [% ELSIF error == "item_denied_renewal" %]
160
161                                 <p>Item is not allowed renewal.</p>
162
163                             [% ELSIF error == "onsite_checkout" %]
164                                 <p>Item cannot be renewed because it's an onsite checkout</p>
165
166                             [% ELSE %]
167
168                                 [% error | html %]
169
170                             [% END %]
171
172                                 <form method="get" action="/cgi-bin/koha/circ/renew.pl">
173                                     <input type="hidden" name="hard_due_date" value="[% hard_due_date | html %]" />
174                                     <button type="submit" class="deny"><i class="fa fa-times"></i> Continue without renewing</button>
175                                 </form>
176                     </div>
177                 [% END %]
178
179                 [% IF date_due %]
180                     <div class="dialog message">
181                         <h3>Item renewed:</h3>
182                         <p>
183                             [% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %]
184                             ( <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> )
185                             renewed for
186                             [% borrower.firstname | html %] [% borrower.surname | html %] ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | uri %]"> [% borrower.cardnumber | html %] </a> )
187                             now due on [% date_due | $KohaDates %]
188                         </p>
189                     </div>
190                 [% END %]
191
192             [% UNLESS error %]
193                 <form method="post" action="/cgi-bin/koha/circ/renew.pl" autocomplete="off" >
194
195                     <fieldset>
196                         <h2>Renew</h2>
197
198                         [% IF Koha.Preference('UnseenRenewals') %]
199                             <div class="renew_formfield">
200                                 <div>
201                                     <label for="barcode" class="hint">Enter item barcode: </label>
202                                 </div>
203                                 <input name="barcode" id="barcode" size="14" class="barcode focus" type="text" />
204                             </div>
205                             <div class="renew_formfield">
206                                 <label for="unseen" class="hint">Record renewal as unseen if appropriate: </label>
207                                 <input value="1" name="unseen" id="unseen" type="checkbox" />
208                             </div>
209                         [% ELSE %]
210                             <div>
211                                 <label for="barcode" class="hint">Enter item barcode: </label>
212                             </div>
213
214                             <input name="barcode" id="barcode" size="14" class="barcode focus" type="text" />
215
216                         [% END %]
217                         <button type="submit" class="btn btn-default">Submit</button>
218
219                         <div class="circ-settings show">
220                             <div class="date-select" id="renew_date_override_fields">
221                                 <div><label for="hard_due_date" class="hint">Renewal due date [% INCLUDE 'date-format.inc' %]:</label></div>
222                                 <input type="text" size="20" id="hard_due_date" name="hard_due_date" value="[% hard_due_date | $KohaDates with_hours => 1 %]" />
223                                 <button type="button" class="action btn btn-default btn-xs" id="cleardate" name="cleardate">Clear</button>
224                             </div> <!-- /.date-select -->
225                         </div>
226                     </fieldset>
227
228
229                 </form>
230             [% END %]
231
232                     [% IF Koha.Preference('CircSidebar') %]
233                             </div> <!-- /.col-sm-10.col-sm-push-2 -->
234                             <div class="col-sm-2 col-sm-pull-10">
235                                 <aside>
236                                     [% INCLUDE 'circ-nav.inc' %]
237                                 </aside>
238                             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
239                         </div> <!-- /.row -->
240                     [% END %]
241
242             </main>
243         </div> <!-- /.col-sm-12 -->
244     </div> <!-- /.row -->
245
246 [% MACRO jsinclude BLOCK %]
247     [% INCLUDE 'calendar.inc' %]
248     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
249     [% INCLUDE 'timepicker.inc' %]
250     [% IF error %]
251         <script>
252             $( document ).ready(function() {
253                 removeFocus();
254             });
255         </script>
256     [% END %]
257     <script>
258         $( document ).ready(function() {
259             $("#renewonholdduedate").datetimepicker({
260                 onClose: function(dateText, inst) {
261                     validate_date(dateText, inst);
262                 },
263                 minDate: 1, // require that renewal date is after today
264                 hour: 23,
265                 minute: 59
266             }).on('change', function(e) {
267                 if ( ! is_valid_date( $(this).val() ) ) {$(this).val('');}
268             });
269
270             [% IF Koha.Preference('SpecifyDueDate') %]
271                 $("#hard_due_date").datetimepicker({
272                     onClose: function(dateText, inst) {
273                         validate_date(dateText, inst);
274                     },
275                     hour: 23,
276                     minute: 59
277                 }).on("change", function(e, value) {
278                     if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
279                 });
280                 $("#cleardate").on("click",function(e){
281                     e.preventDefault();
282                     this.form.hard_due_date.value = '';
283                     this.form.barcode.focus();
284                 });
285             [% END %]
286
287         });
288     </script>
289 [% END %]
290
291 [% INCLUDE 'intranet-bottom.inc' %]