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 error_message %]
50 <div class="dialog alert">
51 [% SWITCH error_message %]
52 [% CASE 'article_request_limit_reached' %]<p>Patron reached daily limit.</p>
53 [% CASE 'article_request_unhandled_exception' %]<p>An error has occurred. Check the logs.</p>
57 [% IF no_patrons_found %]
58 <div class="dialog alert">
59 <h3>Patron not found</h3>
60 <p>No patron with this name, please, try another</p>
63 <form id="article_request_patron_results" method="post">
65 <table id="table_borrowers">
77 [% FOREACH patron IN patrons %]
79 <td><input type="radio" name="patron_id" value="[% patron.borrowernumber | html %]"/></td>
80 <td>[% patron.surname | html %], [% patron.firstname | html %]</td>
81 <td>[% patron.cardnumber | html %]</td>
82 <td>[% patron.categorycode | html %]</td>
83 <td>[% patron.branchcode | html %]</td>
84 <td>[% patron.address | html %]</td>
89 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
90 <fieldset class="action"><input type="submit" value="Select" /></fieldset>
94 <form id="article_requests_patronsearch" action="request-article.pl" method="post">
95 <fieldset class="brief">
96 <label for="patron">Patron: </label>
97 <div class="hint">Enter patron card number or partial name:</div>
98 <input type="text" size="40" id="patron" class="focus" name="patron_cardnumber" />
99 <input type="submit" value="Search" />
100 <input type="hidden" name="biblionumber" value="[% biblio.id | html %]" />
104 [% IF biblio.can_article_request( patron ) %]
106 <form id="place-article-request" method="post" action="/cgi-bin/koha/circ/request-article.pl">
107 <input type="hidden" name="action" value="create" />
108 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber | html %]" />
109 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.id | html %]" />
111 <fieldset class="rows">
112 <legend>Place article request from [% biblio.title | html %] for [% patron.firstname | html %] [% patron.surname | html %] ( [% patron.cardnumber | html %] )</legend>
115 <label for="title">Title:</label>
116 <input type="text" name="title" id="title" size="50"/>
120 <label for="author">Author:</label>
121 <input type="text" name="author" id="author" size="50"/>
125 <label for="volume">Volume:</label>
126 <input type="text" name="volume" id="volume" size="50"/>
130 <label for="issue">Issue:</label>
131 <input type="text" name="issue" id="issue" size="50"/>
135 <label for="date">Date:</label>
136 <input type="text" name="date" id="date" size="50"/>
140 <label for="pages">Pages:</label>
141 <input type="text" name="pages" id="pages" size="50"/>
145 <label for="chapters">Chapters:</label>
146 <input type="text" name="chapters" id="chapters" size="50"/>
150 <label for="patron_notes">Patron notes:</label>
151 <input type="text" name="patron_notes" id="patron_notes" size="50"/>
155 <label for="format">Format:</label>
156 <select name="format" id="format">
157 <option value="PHOTOCOPY">Photocopy</option>
158 <option value="SCAN">Digital scan</option>
163 <label for="branchcode">Pickup library:</label>
164 <select name="branchcode" id="branchcode">
165 [% FOREACH b IN Branches.all %]
166 [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
167 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
169 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
177 [% SET article_request_type = biblio.article_request_type( patron ) %]
178 [% IF article_request_type != 'bib_only' %]
179 <table id="current-requests-table" class="ar-table table table-bordered table-striped">
180 <caption>Select item:</caption>
186 <th>Home library</th>
193 [% FOREACH item IN biblio.items %]
194 [% IF item.can_article_request( patron ) %]
197 [% IF article_request_type == 'item_only' && !checked %]
198 [% SET checked = 1 %]
199 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" checked="checked" />
201 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" />
205 [% ItemTypes.GetDescription( item.itype ) | html %]
208 [% item.barcode | html %]
211 [% Branches.GetName( item.homebranch ) | html %]
214 [% item.itemcallnumber | html %]
217 [% item.enumchron | html %]
223 [% IF article_request_type != 'item_only' %]
226 <input type="radio" name="itemnumber" value="" checked="checked"/>
238 <input type="submit" class="btn btn-default" value="Place request" />
242 No article requests can be made for this record.
247 [% IF biblio.article_requests_current && !patron %]
248 <fieldset class="rows left" id="current-article-requests-fieldset">
249 <legend>Current article requests</legend>
251 <table id="current-article-requests-table">
262 <th>Patron notes</th>
266 <th>Pickup library</th>
270 [% FOREACH ar IN biblio.article_requests_current %]
272 <td>[% ar.created_on | $KohaDates %]</td>
273 <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% ar.borrowernumber | uri %]">[% ar.borrower.firstname | html %] [% ar.borrower.surname | html %]</a></td>
274 <td>[% ar.title | html %]</td>
275 <td>[% ar.author | html %]</td>
276 <td>[% ar.volume | html %]</td>
277 <td>[% ar.issue | html %]</td>
278 <td>[% ar.date | html %]</td>
279 <td>[% ar.pages | html %]</td>
280 <td>[% ar.chapters | html %]</td>
281 <td>[% ar.patron_notes | html %]</td>
282 <td>[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
285 <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber | uri %]&biblionumber=[% ar.biblionumber | uri %]">[% ar.item.barcode | html %]</a>
289 [% IF ar.status == 'PENDING' %]
291 [% ELSIF ar.status == 'PROCESSING' %]
293 [% ELSIF ar.status == 'REQUESTED' %]
295 [% ELSIF ar.status == 'COMPLETED' %]
297 [% ELSIF ar.status == 'CANCELED' %]
302 <i id="update-processing-[% ar.id | html %]" class="fa fa-cog fa-spin hidden"></i>
303 <select name="branchcode" id="branchcode-[% ar.id | html %]" class="ar-update-branchcode">
304 [% FOREACH b IN Branches.all %]
305 [% IF b.branchcode == ar.branchcode %]
306 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
308 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
314 <a title="Cancel article request" href="#" id="cancel-[% ar.id | html %]" class="ar-cancel-request">
315 <i id="cancel-processing-spinner-[% ar.id | html %]" class="fa fa-cog fa-spin hide"></i>
316 <i id="cancel-processing-[% ar.id | html %]" class="fa fa-times fa-lg" style="color:red"></i>
326 </div> <!-- /.col-sm-10.col-sm-push-2 -->
328 <div class="col-sm-2 col-sm-pull-10">
330 [% INCLUDE 'biblio-view-menu.inc' %]
332 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
333 </div> <!-- /.row -->
335 [% MACRO jsinclude BLOCK %]
336 [% INCLUDE 'datatables.inc' %]
339 $('#current-article-requests').ready(function() {
343 $(document).ready(function() {
344 if ( $( "#patron" ).size() ){
345 $( "#patron" ).autocomplete({
346 source: "/cgi-bin/koha/circ/ysearch.pl",
348 select: function( event, ui ) {
349 $( "#patron" ).val( ui.item.cardnumber );
350 $( "#holds_patronsearch" ).submit();
354 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
355 return $( "<li></li>" )
356 .data( "ui-autocomplete-item", item )
359 + ( item.surname ? item.surname.escapeHtml() : "" )
361 + ( item.firstname ? item.firstname.escapeHtml() : "" )
362 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
365 + ( item.address ? item.address.escapeHtml() : "" )
367 + ( item.city ? item.city.escapeHtml() : "" )
369 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
371 + ( item.country ? item.country.escapeHtml() : "" )
378 $( ".ar-update-branchcode" ).on('focus', function(){
379 previous_branchcode = this.value;
380 }).on('change', function(){
381 var branchcode = this.value;
382 var c = confirm(_("Are you sure you want to change the pickup library from %s to %s for this request?").format( previous_branchcode, branchcode ));
385 var id = this.id.split("branchcode-")[1];
386 $("#update-processing-" + id ).css({opacity: 0, visibility: "visible"}).animate({opacity: 1.0}, 200);
390 url: '/cgi-bin/koha/svc/article_request',
392 action: 'update_branchcode',
394 branchcode: branchcode,
396 success: function( data ) {
397 $("#update-processing-" + id ).css({opacity: 1.0, visibility: "visible"}).animate({opacity: 0}, 200);
403 this.value = previous_branchcode;
407 $(".ar-cancel-request").on("click", function(){
409 var notes = prompt(_("Reason for cancellation:"));
411 if ( notes != null ) {
412 var id = this.id.split("cancel-")[1];
413 $("#cancel-processing-" + id ).hide('slow');
414 $("#cancel-processing-spinner-" + id ).show('slow');
418 url: '/cgi-bin/koha/svc/article_request',
424 success: function( data ) {
425 a.parents('tr').hide('slow');
432 // Initialize format(s)
433 var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') | $raw %]";
434 if( !supported_formats.match(/PHOTOCOPY/) )
435 $('#format option[value="PHOTOCOPY"]').remove();
436 if( !supported_formats.match(/SCAN/) )
437 $('#format option[value="SCAN"]').remove();
439 if( $('#format option').length > 1 ) {
440 // Select first listed format
441 var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, '');
442 $('#format option[value="'+first_format+'"]').attr('selected', true);
448 [% INCLUDE 'intranet-bottom.inc' %]