7 [% SET article_requests_view = 1 %]
8 [% SET biblionumber = biblio.biblionumber %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Request article › Circulation › Koha</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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
21 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
24 [% IF blocking_error %]
26 <a href="#" aria-current="page">
32 [% INCLUDE 'biblio-title.inc' link = 1 %]
34 <a href="#" aria-current="page">
42 [% INCLUDE 'blocking_errors.inc' %]
43 <div class="main container-fluid">
45 <div class="col-sm-10 col-sm-push-2">
48 <h1>Request article from [% INCLUDE 'biblio-title.inc' link = 1 %]</h1>
49 [% IF no_patrons_found %]
50 <div class="dialog alert">
51 <h3>Patron not found</h3>
52 <p>No patron with this name, please, try another</p>
55 <form id="article_request_patron_results" method="post">
57 <table id="table_borrowers">
69 [% FOREACH patron IN patrons %]
71 <td><input type="radio" name="patron_id" value="[% patron.borrowernumber | html %]"/></td>
72 <td>[% patron.surname | html %], [% patron.firstname | html %]</td>
73 <td>[% patron.cardnumber | html %]</td>
74 <td>[% patron.categorycode | html %]</td>
75 <td>[% patron.branchcode | html %]</td>
76 <td>[% patron.address | html %]</td>
81 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
82 <fieldset class="action"><input type="submit" value="Select" /></fieldset>
86 <form id="article_requests_patronsearch" action="request-article.pl" method="post">
87 <fieldset class="brief">
88 <label for="patron">Patron: </label>
89 <div class="hint">Enter patron card number or partial name:</div>
90 <input type="text" size="40" id="patron" class="focus" name="patron_cardnumber" />
91 <input type="submit" value="Search" />
92 <input type="hidden" name="biblionumber" value="[% biblio.id | html %]" />
96 [% IF biblio.can_article_request( patron ) %]
98 <form id="place-article-request" method="post" action="/cgi-bin/koha/circ/request-article.pl">
99 <input type="hidden" name="action" value="create" />
100 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber | html %]" />
101 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.id | html %]" />
103 <fieldset class="rows">
104 <legend>Place article request from [% biblio.title | html %] for [% patron.firstname | html %] [% patron.surname | html %] ( [% patron.cardnumber | html %] )</legend>
107 <label for="title">Title:</label>
108 <input type="text" name="title" id="title" size="50"/>
112 <label for="author">Author:</label>
113 <input type="text" name="author" id="author" size="50"/>
117 <label for="volume">Volume:</label>
118 <input type="text" name="volume" id="volume" size="50"/>
122 <label for="issue">Issue:</label>
123 <input type="text" name="issue" id="issue" size="50"/>
127 <label for="date">Date:</label>
128 <input type="text" name="date" id="date" size="50"/>
132 <label for="pages">Pages:</label>
133 <input type="text" name="pages" id="pages" size="50"/>
137 <label for="chapters">Chapters:</label>
138 <input type="text" name="chapters" id="chapters" size="50"/>
142 <label for="patron_notes">Patron notes:</label>
143 <input type="text" name="patron_notes" id="patron_notes" size="50"/>
147 <label for="branchcode">Pickup library:</label>
148 <select name="branchcode" id="branchcode">
149 [% FOREACH b IN Branches.all %]
150 [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
151 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
153 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
161 [% SET article_request_type = biblio.article_request_type( patron ) %]
162 [% IF article_request_type != 'bib_only' %]
163 <table id="current-requests-table" class="ar-table table table-bordered table-striped">
164 <caption>Select item:</caption>
170 <th>Home library</th>
177 [% FOREACH item IN biblio.items %]
178 [% IF item.can_article_request( patron ) %]
181 [% IF article_request_type == 'item_only' && !checked %]
182 [% SET checked = 1 %]
183 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" checked="checked" />
185 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" />
189 [% ItemTypes.GetDescription( item.itype ) | html %]
192 [% item.barcode | html %]
195 [% Branches.GetName( item.homebranch ) | html %]
198 [% item.itemcallnumber | html %]
201 [% item.enumchron | html %]
207 [% IF article_request_type != 'item_only' %]
210 <input type="radio" name="itemnumber" value="" checked="checked"/>
222 <input type="submit" class="btn btn-default" value="Place request" />
226 No article requests can be made for this record.
231 [% IF biblio.article_requests_current && !patron %]
232 <fieldset class="rows left" id="current-article-requests-fieldset">
233 <legend>Current article requests</legend>
235 <table id="current-article-requests-table">
246 <th>Patron notes</th>
249 <th>Pickup library</th>
253 [% FOREACH ar IN biblio.article_requests_current %]
255 <td>[% ar.created_on | $KohaDates %]</td>
256 <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% ar.borrowernumber | uri %]">[% ar.borrower.firstname | html %] [% ar.borrower.surname | html %]</a></td>
257 <td>[% ar.title | html %]</td>
258 <td>[% ar.author | html %]</td>
259 <td>[% ar.volume | html %]</td>
260 <td>[% ar.issue | html %]</td>
261 <td>[% ar.date | html %]</td>
262 <td>[% ar.pages | html %]</td>
263 <td>[% ar.chapters | html %]</td>
264 <td>[% ar.patron_notes | html %]</td>
267 <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber | uri %]&biblionumber=[% ar.biblionumber | uri %]">[% ar.item.barcode | html %]</a>
271 [% IF ar.status == 'PENDING' %]
273 [% ELSIF ar.status == 'PROCESSING' %]
275 [% ELSIF ar.status == 'COMPLETED' %]
277 [% ELSIF ar.status == 'CANCELED' %]
282 <i id="update-processing-[% ar.id | html %]" class="fa fa-cog fa-spin hidden"></i>
283 <select name="branchcode" id="branchcode-[% ar.id | html %]" class="ar-update-branchcode">
284 [% FOREACH b IN Branches.all %]
285 [% IF b.branchcode == ar.branchcode %]
286 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
288 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
294 <a title="Cancel article request" href="#" id="cancel-[% ar.id | html %]" class="ar-cancel-request">
295 <i id="cancel-processing-spinner-[% ar.id | html %]" class="fa fa-cog fa-spin hide"></i>
296 <i id="cancel-processing-[% ar.id | html %]" class="fa fa-times fa-lg" style="color:red"></i>
306 </div> <!-- /.col-sm-10.col-sm-push-2 -->
308 <div class="col-sm-2 col-sm-pull-10">
310 [% INCLUDE 'biblio-view-menu.inc' %]
312 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
313 </div> <!-- /.row -->
315 [% MACRO jsinclude BLOCK %]
316 [% INCLUDE 'datatables.inc' %]
319 $('#current-article-requests').ready(function() {
323 $(document).ready(function() {
324 if ( $( "#patron" ).size() ){
325 $( "#patron" ).autocomplete({
326 source: "/cgi-bin/koha/circ/ysearch.pl",
328 select: function( event, ui ) {
329 $( "#patron" ).val( ui.item.cardnumber );
330 $( "#holds_patronsearch" ).submit();
334 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
335 return $( "<li></li>" )
336 .data( "ui-autocomplete-item", item )
339 + ( item.surname ? item.surname.escapeHtml() : "" )
341 + ( item.firstname ? item.firstname.escapeHtml() : "" )
342 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
345 + ( item.address ? item.address.escapeHtml() : "" )
347 + ( item.city ? item.city.escapeHtml() : "" )
349 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
351 + ( item.country ? item.country.escapeHtml() : "" )
358 $( ".ar-update-branchcode" ).on('focus', function(){
359 previous_branchcode = this.value;
360 }).on('change', function(){
361 var branchcode = this.value;
362 var c = confirm(_("Are you sure you want to change the pickup library from %s to %s for this request?").format( previous_branchcode, branchcode ));
365 var id = this.id.split("branchcode-")[1];
366 $("#update-processing-" + id ).css({opacity: 0, visibility: "visible"}).animate({opacity: 1.0}, 200);
370 url: '/cgi-bin/koha/svc/article_request',
372 action: 'update_branchcode',
374 branchcode: branchcode,
376 success: function( data ) {
377 $("#update-processing-" + id ).css({opacity: 1.0, visibility: "visible"}).animate({opacity: 0}, 200);
383 this.value = previous_branchcode;
387 $(".ar-cancel-request").on("click", function(){
389 var notes = prompt(_("Reason for cancellation:"));
391 if ( notes != null ) {
392 var id = this.id.split("cancel-")[1];
393 $("#cancel-processing-" + id ).hide('slow');
394 $("#cancel-processing-spinner-" + id ).show('slow');
398 url: '/cgi-bin/koha/svc/article_request',
404 success: function( data ) {
405 a.parents('tr').hide('slow');
415 [% INCLUDE 'intranet-bottom.inc' %]