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 <p>[% error_message | html %]</p>
54 [% IF no_patrons_found %]
55 <div class="dialog alert">
56 <h3>Patron not found</h3>
57 <p>No patron with this name, please, try another</p>
60 <form id="article_request_patron_results" method="post">
62 <table id="table_borrowers">
74 [% FOREACH patron IN patrons %]
76 <td><input type="radio" name="patron_id" value="[% patron.borrowernumber | html %]"/></td>
77 <td>[% patron.surname | html %], [% patron.firstname | html %]</td>
78 <td>[% patron.cardnumber | html %]</td>
79 <td>[% patron.categorycode | html %]</td>
80 <td>[% patron.branchcode | html %]</td>
81 <td>[% patron.address | html %]</td>
86 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
87 <fieldset class="action"><input type="submit" value="Select" /></fieldset>
91 <form id="article_requests_patronsearch" action="request-article.pl" method="post">
92 <fieldset class="brief">
93 <label for="patron">Patron: </label>
94 <div class="hint">Enter patron card number or partial name:</div>
95 <input type="text" size="40" id="patron" class="focus" name="patron_cardnumber" />
96 <input type="submit" value="Search" />
97 <input type="hidden" name="biblionumber" value="[% biblio.id | html %]" />
101 [% IF biblio.can_article_request( patron ) %]
103 <form id="place-article-request" method="post" action="/cgi-bin/koha/circ/request-article.pl">
104 <input type="hidden" name="action" value="create" />
105 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber | html %]" />
106 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.id | html %]" />
108 <fieldset class="rows">
109 <legend>Place article request from [% biblio.title | html %] for [% patron.firstname | html %] [% patron.surname | html %] ( [% patron.cardnumber | html %] )</legend>
112 <label for="title">Title:</label>
113 <input type="text" name="title" id="title" size="50"/>
117 <label for="author">Author:</label>
118 <input type="text" name="author" id="author" size="50"/>
122 <label for="volume">Volume:</label>
123 <input type="text" name="volume" id="volume" size="50"/>
127 <label for="issue">Issue:</label>
128 <input type="text" name="issue" id="issue" size="50"/>
132 <label for="date">Date:</label>
133 <input type="text" name="date" id="date" size="50"/>
137 <label for="pages">Pages:</label>
138 <input type="text" name="pages" id="pages" size="50"/>
142 <label for="chapters">Chapters:</label>
143 <input type="text" name="chapters" id="chapters" size="50"/>
147 <label for="patron_notes">Patron notes:</label>
148 <input type="text" name="patron_notes" id="patron_notes" size="50"/>
152 <label for="format">Format:</label>
153 <select name="format" id="format">
154 <option value="PHOTOCOPY">Photocopy</option>
155 <option value="SCAN">Digital scan</option>
160 <label for="branchcode">Pickup library:</label>
161 <select name="branchcode" id="branchcode">
162 [% FOREACH b IN Branches.all %]
163 [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
164 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
166 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
174 [% SET article_request_type = biblio.article_request_type( patron ) %]
175 [% IF article_request_type != 'bib_only' %]
176 <table id="current-requests-table" class="ar-table table table-bordered table-striped">
177 <caption>Select item:</caption>
183 <th>Home library</th>
190 [% FOREACH item IN biblio.items %]
191 [% IF item.can_article_request( patron ) %]
194 [% IF article_request_type == 'item_only' && !checked %]
195 [% SET checked = 1 %]
196 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" checked="checked" />
198 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" />
202 [% ItemTypes.GetDescription( item.itype ) | html %]
205 [% item.barcode | html %]
208 [% Branches.GetName( item.homebranch ) | html %]
211 [% item.itemcallnumber | html %]
214 [% item.enumchron | html %]
220 [% IF article_request_type != 'item_only' %]
223 <input type="radio" name="itemnumber" value="" checked="checked"/>
235 <input type="submit" class="btn btn-default" value="Place request" />
239 No article requests can be made for this record.
244 [% IF biblio.article_requests_current && !patron %]
245 <fieldset class="rows left" id="current-article-requests-fieldset">
246 <legend>Current article requests</legend>
248 <table id="current-article-requests-table">
259 <th>Patron notes</th>
263 <th>Pickup library</th>
267 [% FOREACH ar IN biblio.article_requests_current %]
269 <td>[% ar.created_on | $KohaDates %]</td>
270 <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% ar.borrowernumber | uri %]">[% ar.borrower.firstname | html %] [% ar.borrower.surname | html %]</a></td>
271 <td>[% ar.title | html %]</td>
272 <td>[% ar.author | html %]</td>
273 <td>[% ar.volume | html %]</td>
274 <td>[% ar.issue | html %]</td>
275 <td>[% ar.date | html %]</td>
276 <td>[% ar.pages | html %]</td>
277 <td>[% ar.chapters | html %]</td>
278 <td>[% ar.patron_notes | html %]</td>
279 <td>[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
282 <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber | uri %]&biblionumber=[% ar.biblionumber | uri %]">[% ar.item.barcode | html %]</a>
286 [% IF ar.status == 'PENDING' %]
288 [% ELSIF ar.status == 'PROCESSING' %]
290 [% ELSIF ar.status == 'REQUESTED' %]
292 [% ELSIF ar.status == 'COMPLETED' %]
294 [% ELSIF ar.status == 'CANCELED' %]
299 <i id="update-processing-[% ar.id | html %]" class="fa fa-cog fa-spin hidden"></i>
300 <select name="branchcode" id="branchcode-[% ar.id | html %]" class="ar-update-branchcode">
301 [% FOREACH b IN Branches.all %]
302 [% IF b.branchcode == ar.branchcode %]
303 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
305 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
311 <a title="Cancel article request" href="#" id="cancel-[% ar.id | html %]" class="ar-cancel-request">
312 <i id="cancel-processing-spinner-[% ar.id | html %]" class="fa fa-cog fa-spin hide"></i>
313 <i id="cancel-processing-[% ar.id | html %]" class="fa fa-times fa-lg" style="color:red"></i>
323 </div> <!-- /.col-sm-10.col-sm-push-2 -->
325 <div class="col-sm-2 col-sm-pull-10">
327 [% INCLUDE 'biblio-view-menu.inc' %]
329 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
330 </div> <!-- /.row -->
332 [% MACRO jsinclude BLOCK %]
333 [% INCLUDE 'datatables.inc' %]
336 $('#current-article-requests').ready(function() {
340 $(document).ready(function() {
341 if ( $( "#patron" ).size() ){
342 $( "#patron" ).autocomplete({
343 source: "/cgi-bin/koha/circ/ysearch.pl",
345 select: function( event, ui ) {
346 $( "#patron" ).val( ui.item.cardnumber );
347 $( "#holds_patronsearch" ).submit();
351 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
352 return $( "<li></li>" )
353 .data( "ui-autocomplete-item", item )
356 + ( item.surname ? item.surname.escapeHtml() : "" )
358 + ( item.firstname ? item.firstname.escapeHtml() : "" )
359 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
362 + ( item.address ? item.address.escapeHtml() : "" )
364 + ( item.city ? item.city.escapeHtml() : "" )
366 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
368 + ( item.country ? item.country.escapeHtml() : "" )
375 $( ".ar-update-branchcode" ).on('focus', function(){
376 previous_branchcode = this.value;
377 }).on('change', function(){
378 var branchcode = this.value;
379 var c = confirm(_("Are you sure you want to change the pickup library from %s to %s for this request?").format( previous_branchcode, branchcode ));
382 var id = this.id.split("branchcode-")[1];
383 $("#update-processing-" + id ).css({opacity: 0, visibility: "visible"}).animate({opacity: 1.0}, 200);
387 url: '/cgi-bin/koha/svc/article_request',
389 action: 'update_branchcode',
391 branchcode: branchcode,
393 success: function( data ) {
394 $("#update-processing-" + id ).css({opacity: 1.0, visibility: "visible"}).animate({opacity: 0}, 200);
400 this.value = previous_branchcode;
404 $(".ar-cancel-request").on("click", function(){
406 var notes = prompt(_("Reason for cancellation:"));
408 if ( notes != null ) {
409 var id = this.id.split("cancel-")[1];
410 $("#cancel-processing-" + id ).hide('slow');
411 $("#cancel-processing-spinner-" + id ).show('slow');
415 url: '/cgi-bin/koha/svc/article_request',
421 success: function( data ) {
422 a.parents('tr').hide('slow');
429 // Initialize format(s)
430 var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') | $raw %]";
431 if( !supported_formats.match(/PHOTOCOPY/) )
432 $('#format option[value="PHOTOCOPY"]').remove();
433 if( !supported_formats.match(/SCAN/) )
434 $('#format option[value="SCAN"]').remove();
436 if( $('#format option').length > 1 ) {
437 // Select first listed format
438 var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, '');
439 $('#format option[value="'+first_format+'"]').attr('selected', true);
445 [% INCLUDE 'intranet-bottom.inc' %]