7 [% SET article_requests_view = 1 %]
8 [% SET biblionumber = biblio.biblionumber %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Koha › Circulation › Request article</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 [% Asset.css("css/datatables.css") | $raw %]
15 <body id="circ_request-article" class="circ">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'circ-search.inc' %]
19 <div id="breadcrumbs">
20 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
22 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
23 [% UNLESS blocking_error %]
25 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">[% biblio.title | html %]</a>
31 [% INCLUDE 'blocking_errors.inc' %]
32 <div class="main container-fluid">
34 <div class="col-sm-10 col-sm-push-2">
37 <h1>Request article from <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.id | uri %]">[% biblio.title | html %]</a></h1>
38 [% IF no_patrons_found %]
39 <div class="dialog alert">
40 <h3>Patron not found</h3>
41 <p>No patron with this name, please, try another</p>
44 <form id="article_request_patron_results" method="post">
46 <table id="table_borrowers">
58 [% FOREACH patron IN patrons %]
60 <td><input type="radio" name="patron_id" value="[% patron.borrowernumber | html %]"/></td>
61 <td>[% patron.surname | html %], [% patron.firstname | html %]</td>
62 <td>[% patron.cardnumber | html %]</td>
63 <td>[% patron.categorycode | html %]</td>
64 <td>[% patron.branchcode | html %]</td>
65 <td>[% patron.address | html %]</td>
70 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
71 <fieldset class="action"><input type="submit" value="Select" /></fieldset>
75 <form id="article_requests_patronsearch" action="request-article.pl" method="post">
76 <fieldset class="brief">
77 <label for="patron">Patron: </label>
78 <div class="hint">Enter patron card number or partial name:</div>
79 <input type="text" size="40" id="patron" class="focus" name="patron_cardnumber" />
80 <input type="submit" value="Search" />
81 <input type="hidden" name="biblionumber" value="[% biblio.id | html %]" />
85 [% IF biblio.can_article_request( patron ) %]
87 <form id="place-article-request" method="post" action="/cgi-bin/koha/circ/request-article.pl">
88 <input type="hidden" name="action" value="create" />
89 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber | html %]" />
90 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.id | html %]" />
92 <fieldset class="rows">
93 <legend>Place article request from [% biblio.title | html %] for [% patron.firstname | html %] [% patron.surname | html %] ( [% patron.cardnumber | html %] )</legend>
97 <label for="title">Title:</label>
98 <input type="text" name="title" id="title" size="50"/>
102 <label for="author">Author:</label>
103 <input type="text" name="author" id="author" size="50"/>
107 <label for="volume">Volume:</label>
108 <input type="text" name="volume" id="volume" size="50"/>
112 <label for="issue">Issue:</label>
113 <input type="text" name="issue" id="issue" size="50"/>
117 <label for="date">Date:</label>
118 <input type="text" name="date" id="date" size="50"/>
122 <label for="pages">Pages:</label>
123 <input type="text" name="pages" id="pages" size="50"/>
127 <label for="chapters">Chapters:</label>
128 <input type="text" name="chapters" id="chapters" size="50"/>
132 <label for="patron_notes">Patron notes:</label>
133 <input type="text" name="patron_notes" id="patron_notes" size="50"/>
137 <label for="branchcode">Pickup library:</label>
138 <select name="branchcode" id="branchcode">
139 [% FOREACH b IN Branches.all %]
140 [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
141 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
143 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
151 [% SET article_request_type = biblio.article_request_type( patron ) %]
152 [% IF article_request_type != 'bib_only' %]
153 <table id="current-requests-table" class="ar-table table table-bordered table-striped">
154 <caption>Select item:</caption>
160 <th>Home library</th>
167 [% FOREACH item IN biblio.items %]
168 [% IF item.can_article_request( patron ) %]
171 [% IF article_request_type == 'item_only' && !checked %]
172 [% SET checked = 1 %]
173 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" checked="checked" />
175 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" />
179 [% ItemTypes.GetDescription( item.itype ) | html %]
182 [% item.barcode | html %]
185 [% Branches.GetName( item.homebranch ) | html %]
188 [% item.itemcallnumber | html %]
191 [% item.enumchron | html %]
197 [% IF article_request_type != 'item_only' %]
200 <input type="radio" name="itemnumber" value="" checked="checked"/>
212 <input type="submit" class="btn btn-default" value="Place request" />
216 No article requests can be made for this record.
221 [% IF biblio.article_requests_current && !patron %]
222 <fieldset class="rows left" id="current-article-requests-fieldset">
223 <legend>Current article requests</legend>
225 <table id="current-article-requests-table">
236 <th>Patron notes</th>
239 <th>Pickup library</th>
243 [% FOREACH ar IN biblio.article_requests_current %]
245 <td>[% ar.created_on | $KohaDates %]</td>
246 <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% ar.borrowernumber | uri %]">[% ar.borrower.firstname | html %] [% ar.borrower.surname | html %]</a></td>
247 <td>[% ar.title | html %]</td>
248 <td>[% ar.author | html %]</td>
249 <td>[% ar.volume | html %]</td>
250 <td>[% ar.issue | html %]</td>
251 <td>[% ar.date | html %]</td>
252 <td>[% ar.pages | html %]</td>
253 <td>[% ar.chapters | html %]</td>
254 <td>[% ar.patron_notes | html %]</td>
257 <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber | uri %]&biblionumber=[% ar.biblionumber | uri %]">[% ar.item.barcode | html %]</a>
261 [% IF ar.status == 'PENDING' %]
263 [% ELSIF ar.status == 'PROCESSING' %]
265 [% ELSIF ar.status == 'COMPLETED' %]
267 [% ELSIF ar.status == 'CANCELED' %]
272 <i id="update-processing-[% ar.id | html %]" class="fa fa-cog fa-spin hidden"></i>
273 <select name="branchcode" id="branchcode-[% ar.id | html %]" class="ar-update-branchcode">
274 [% FOREACH b IN Branches.all %]
275 [% IF b.branchcode == ar.branchcode %]
276 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
278 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
284 <a title="Cancel article request" href="#" id="cancel-[% ar.id | html %]" class="ar-cancel-request">
285 <i id="cancel-processing-spinner-[% ar.id | html %]" class="fa fa-cog fa-spin hide"></i>
286 <i id="cancel-processing-[% ar.id | html %]" class="fa fa-times fa-lg" style="color:red"></i>
296 </div> <!-- /.col-sm-10.col-sm-push-2 -->
298 <div class="col-sm-2 col-sm-pull-10">
300 [% INCLUDE 'biblio-view-menu.inc' %]
302 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
303 </div> <!-- /.row -->
305 [% MACRO jsinclude BLOCK %]
306 [% INCLUDE 'datatables.inc' %]
309 $('#current-article-requests').ready(function() {
313 $(document).ready(function() {
314 if ( $( "#patron" ).size() ){
315 $( "#patron" ).autocomplete({
316 source: "/cgi-bin/koha/circ/ysearch.pl",
318 select: function( event, ui ) {
319 $( "#patron" ).val( ui.item.cardnumber );
320 $( "#holds_patronsearch" ).submit();
324 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
325 return $( "<li></li>" )
326 .data( "ui-autocomplete-item", item )
327 .append( "<a>" + item.surname + ", " + item.firstname +
328 " (" + item.cardnumber + ") <small>" + item.address +
329 " " + item.city + " " + item.zipcode + " " +
330 item.country + "</small></a>" )
335 $( ".ar-update-branchcode" ).on('focus', function(){
336 previous_branchcode = this.value;
337 }).on('change', function(){
338 var branchcode = this.value;
339 var c = confirm(_("Are you sure you want to change the pickup library from %s to %s for this request?").format( previous_branchcode, branchcode ));
342 var id = this.id.split("branchcode-")[1];
343 $("#update-processing-" + id ).css({opacity: 0, visibility: "visible"}).animate({opacity: 1.0}, 200);
347 url: '/cgi-bin/koha/svc/article_request',
349 action: 'update_branchcode',
351 branchcode: branchcode,
353 success: function( data ) {
354 $("#update-processing-" + id ).css({opacity: 1.0, visibility: "visible"}).animate({opacity: 0}, 200);
360 this.value = previous_branchcode;
364 $(".ar-cancel-request").on("click", function(){
366 var notes = prompt(_("Reason for cancellation:"));
368 if ( notes != null ) {
369 var id = this.id.split("cancel-")[1];
370 $("#cancel-processing-" + id ).hide('slow');
371 $("#cancel-processing-spinner-" + id ).show('slow');
375 url: '/cgi-bin/koha/svc/article_request',
381 success: function( data ) {
382 a.parents('tr').hide('slow');
392 [% INCLUDE 'intranet-bottom.inc' %]