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' %]
14 <body id="circ_request-article" class="circ">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'circ-search.inc' %]
18 <div id="breadcrumbs">
19 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
21 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
22 [% UNLESS blocking_error %]
24 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">[% INCLUDE 'biblio-title.inc' %]</a>
30 [% INCLUDE 'blocking_errors.inc' %]
31 <div class="main container-fluid">
33 <div class="col-sm-10 col-sm-push-2">
36 <h1>Request article from <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.id | uri %]">[% INCLUDE 'biblio-title.inc' %]</a></h1>
37 [% IF no_patrons_found %]
38 <div class="dialog alert">
39 <h3>Patron not found</h3>
40 <p>No patron with this name, please, try another</p>
43 <form id="article_request_patron_results" method="post">
45 <table id="table_borrowers">
57 [% FOREACH patron IN patrons %]
59 <td><input type="radio" name="patron_id" value="[% patron.borrowernumber | html %]"/></td>
60 <td>[% patron.surname | html %], [% patron.firstname | html %]</td>
61 <td>[% patron.cardnumber | html %]</td>
62 <td>[% patron.categorycode | html %]</td>
63 <td>[% patron.branchcode | html %]</td>
64 <td>[% patron.address | html %]</td>
69 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
70 <fieldset class="action"><input type="submit" value="Select" /></fieldset>
74 <form id="article_requests_patronsearch" action="request-article.pl" method="post">
75 <fieldset class="brief">
76 <label for="patron">Patron: </label>
77 <div class="hint">Enter patron card number or partial name:</div>
78 <input type="text" size="40" id="patron" class="focus" name="patron_cardnumber" />
79 <input type="submit" value="Search" />
80 <input type="hidden" name="biblionumber" value="[% biblio.id | html %]" />
84 [% IF biblio.can_article_request( patron ) %]
86 <form id="place-article-request" method="post" action="/cgi-bin/koha/circ/request-article.pl">
87 <input type="hidden" name="action" value="create" />
88 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber | html %]" />
89 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.id | html %]" />
91 <fieldset class="rows">
92 <legend>Place article request from [% biblio.title | html %] for [% patron.firstname | html %] [% patron.surname | html %] ( [% patron.cardnumber | html %] )</legend>
96 <label for="title">Title:</label>
97 <input type="text" name="title" id="title" size="50"/>
101 <label for="author">Author:</label>
102 <input type="text" name="author" id="author" size="50"/>
106 <label for="volume">Volume:</label>
107 <input type="text" name="volume" id="volume" size="50"/>
111 <label for="issue">Issue:</label>
112 <input type="text" name="issue" id="issue" size="50"/>
116 <label for="date">Date:</label>
117 <input type="text" name="date" id="date" size="50"/>
121 <label for="pages">Pages:</label>
122 <input type="text" name="pages" id="pages" size="50"/>
126 <label for="chapters">Chapters:</label>
127 <input type="text" name="chapters" id="chapters" size="50"/>
131 <label for="patron_notes">Patron notes:</label>
132 <input type="text" name="patron_notes" id="patron_notes" size="50"/>
136 <label for="branchcode">Pickup library:</label>
137 <select name="branchcode" id="branchcode">
138 [% FOREACH b IN Branches.all %]
139 [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
140 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
142 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
150 [% SET article_request_type = biblio.article_request_type( patron ) %]
151 [% IF article_request_type != 'bib_only' %]
152 <table id="current-requests-table" class="ar-table table table-bordered table-striped">
153 <caption>Select item:</caption>
159 <th>Home library</th>
166 [% FOREACH item IN biblio.items %]
167 [% IF item.can_article_request( patron ) %]
170 [% IF article_request_type == 'item_only' && !checked %]
171 [% SET checked = 1 %]
172 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" checked="checked" />
174 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" />
178 [% ItemTypes.GetDescription( item.itype ) | html %]
181 [% item.barcode | html %]
184 [% Branches.GetName( item.homebranch ) | html %]
187 [% item.itemcallnumber | html %]
190 [% item.enumchron | html %]
196 [% IF article_request_type != 'item_only' %]
199 <input type="radio" name="itemnumber" value="" checked="checked"/>
211 <input type="submit" class="btn btn-default" value="Place request" />
215 No article requests can be made for this record.
220 [% IF biblio.article_requests_current && !patron %]
221 <fieldset class="rows left" id="current-article-requests-fieldset">
222 <legend>Current article requests</legend>
224 <table id="current-article-requests-table">
235 <th>Patron notes</th>
238 <th>Pickup library</th>
242 [% FOREACH ar IN biblio.article_requests_current %]
244 <td>[% ar.created_on | $KohaDates %]</td>
245 <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% ar.borrowernumber | uri %]">[% ar.borrower.firstname | html %] [% ar.borrower.surname | html %]</a></td>
246 <td>[% ar.title | html %]</td>
247 <td>[% ar.author | html %]</td>
248 <td>[% ar.volume | html %]</td>
249 <td>[% ar.issue | html %]</td>
250 <td>[% ar.date | html %]</td>
251 <td>[% ar.pages | html %]</td>
252 <td>[% ar.chapters | html %]</td>
253 <td>[% ar.patron_notes | html %]</td>
256 <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber | uri %]&biblionumber=[% ar.biblionumber | uri %]">[% ar.item.barcode | html %]</a>
260 [% IF ar.status == 'PENDING' %]
262 [% ELSIF ar.status == 'PROCESSING' %]
264 [% ELSIF ar.status == 'COMPLETED' %]
266 [% ELSIF ar.status == 'CANCELED' %]
271 <i id="update-processing-[% ar.id | html %]" class="fa fa-cog fa-spin hidden"></i>
272 <select name="branchcode" id="branchcode-[% ar.id | html %]" class="ar-update-branchcode">
273 [% FOREACH b IN Branches.all %]
274 [% IF b.branchcode == ar.branchcode %]
275 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
277 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
283 <a title="Cancel article request" href="#" id="cancel-[% ar.id | html %]" class="ar-cancel-request">
284 <i id="cancel-processing-spinner-[% ar.id | html %]" class="fa fa-cog fa-spin hide"></i>
285 <i id="cancel-processing-[% ar.id | html %]" class="fa fa-times fa-lg" style="color:red"></i>
295 </div> <!-- /.col-sm-10.col-sm-push-2 -->
297 <div class="col-sm-2 col-sm-pull-10">
299 [% INCLUDE 'biblio-view-menu.inc' %]
301 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
302 </div> <!-- /.row -->
304 [% MACRO jsinclude BLOCK %]
305 [% INCLUDE 'datatables.inc' %]
308 $('#current-article-requests').ready(function() {
312 $(document).ready(function() {
313 if ( $( "#patron" ).size() ){
314 $( "#patron" ).autocomplete({
315 source: "/cgi-bin/koha/circ/ysearch.pl",
317 select: function( event, ui ) {
318 $( "#patron" ).val( ui.item.cardnumber );
319 $( "#holds_patronsearch" ).submit();
323 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
324 return $( "<li></li>" )
325 .data( "ui-autocomplete-item", item )
326 .append( "<a>" + item.surname + ", " + item.firstname +
327 " (" + item.cardnumber + ") <small>" + item.address +
328 " " + item.city + " " + item.zipcode + " " +
329 item.country + "</small></a>" )
334 $( ".ar-update-branchcode" ).on('focus', function(){
335 previous_branchcode = this.value;
336 }).on('change', function(){
337 var branchcode = this.value;
338 var c = confirm(_("Are you sure you want to change the pickup library from %s to %s for this request?").format( previous_branchcode, branchcode ));
341 var id = this.id.split("branchcode-")[1];
342 $("#update-processing-" + id ).css({opacity: 0, visibility: "visible"}).animate({opacity: 1.0}, 200);
346 url: '/cgi-bin/koha/svc/article_request',
348 action: 'update_branchcode',
350 branchcode: branchcode,
352 success: function( data ) {
353 $("#update-processing-" + id ).css({opacity: 1.0, visibility: "visible"}).animate({opacity: 0}, 200);
359 this.value = previous_branchcode;
363 $(".ar-cancel-request").on("click", function(){
365 var notes = prompt(_("Reason for cancellation:"));
367 if ( notes != null ) {
368 var id = this.id.split("cancel-")[1];
369 $("#cancel-processing-" + id ).hide('slow');
370 $("#cancel-processing-spinner-" + id ).show('slow');
374 url: '/cgi-bin/koha/svc/article_request',
380 success: function( data ) {
381 a.parents('tr').hide('slow');
391 [% INCLUDE 'intranet-bottom.inc' %]