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="format">Format:</label>
148 <select name="format" id="format">
149 <option value="PHOTOCOPY">Photocopy</option>
150 <option value="SCAN">Digital scan</option>
155 <label for="branchcode">Pickup library:</label>
156 <select name="branchcode" id="branchcode">
157 [% FOREACH b IN Branches.all %]
158 [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
159 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
161 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
169 [% SET article_request_type = biblio.article_request_type( patron ) %]
170 [% IF article_request_type != 'bib_only' %]
171 <table id="current-requests-table" class="ar-table table table-bordered table-striped">
172 <caption>Select item:</caption>
178 <th>Home library</th>
185 [% FOREACH item IN biblio.items %]
186 [% IF item.can_article_request( patron ) %]
189 [% IF article_request_type == 'item_only' && !checked %]
190 [% SET checked = 1 %]
191 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" checked="checked" />
193 <input type="radio" name="itemnumber" value="[% item.itemnumber | html %]" />
197 [% ItemTypes.GetDescription( item.itype ) | html %]
200 [% item.barcode | html %]
203 [% Branches.GetName( item.homebranch ) | html %]
206 [% item.itemcallnumber | html %]
209 [% item.enumchron | html %]
215 [% IF article_request_type != 'item_only' %]
218 <input type="radio" name="itemnumber" value="" checked="checked"/>
230 <input type="submit" class="btn btn-default" value="Place request" />
234 No article requests can be made for this record.
239 [% IF biblio.article_requests_current && !patron %]
240 <fieldset class="rows left" id="current-article-requests-fieldset">
241 <legend>Current article requests</legend>
243 <table id="current-article-requests-table">
254 <th>Patron notes</th>
258 <th>Pickup library</th>
262 [% FOREACH ar IN biblio.article_requests_current %]
264 <td>[% ar.created_on | $KohaDates %]</td>
265 <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% ar.borrowernumber | uri %]">[% ar.borrower.firstname | html %] [% ar.borrower.surname | html %]</a></td>
266 <td>[% ar.title | html %]</td>
267 <td>[% ar.author | html %]</td>
268 <td>[% ar.volume | html %]</td>
269 <td>[% ar.issue | html %]</td>
270 <td>[% ar.date | html %]</td>
271 <td>[% ar.pages | html %]</td>
272 <td>[% ar.chapters | html %]</td>
273 <td>[% ar.patron_notes | html %]</td>
274 <td>[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
277 <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber | uri %]&biblionumber=[% ar.biblionumber | uri %]">[% ar.item.barcode | html %]</a>
281 [% IF ar.status == 'PENDING' %]
283 [% ELSIF ar.status == 'PROCESSING' %]
285 [% ELSIF ar.status == 'COMPLETED' %]
287 [% ELSIF ar.status == 'CANCELED' %]
292 <i id="update-processing-[% ar.id | html %]" class="fa fa-cog fa-spin hidden"></i>
293 <select name="branchcode" id="branchcode-[% ar.id | html %]" class="ar-update-branchcode">
294 [% FOREACH b IN Branches.all %]
295 [% IF b.branchcode == ar.branchcode %]
296 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
298 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
304 <a title="Cancel article request" href="#" id="cancel-[% ar.id | html %]" class="ar-cancel-request">
305 <i id="cancel-processing-spinner-[% ar.id | html %]" class="fa fa-cog fa-spin hide"></i>
306 <i id="cancel-processing-[% ar.id | html %]" class="fa fa-times fa-lg" style="color:red"></i>
316 </div> <!-- /.col-sm-10.col-sm-push-2 -->
318 <div class="col-sm-2 col-sm-pull-10">
320 [% INCLUDE 'biblio-view-menu.inc' %]
322 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
323 </div> <!-- /.row -->
325 [% MACRO jsinclude BLOCK %]
326 [% INCLUDE 'datatables.inc' %]
329 $('#current-article-requests').ready(function() {
333 $(document).ready(function() {
334 if ( $( "#patron" ).size() ){
335 $( "#patron" ).autocomplete({
336 source: "/cgi-bin/koha/circ/ysearch.pl",
338 select: function( event, ui ) {
339 $( "#patron" ).val( ui.item.cardnumber );
340 $( "#holds_patronsearch" ).submit();
344 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
345 return $( "<li></li>" )
346 .data( "ui-autocomplete-item", item )
349 + ( item.surname ? item.surname.escapeHtml() : "" )
351 + ( item.firstname ? item.firstname.escapeHtml() : "" )
352 + " (" + ( item.cardnumber ? item.cardnumber.escapeHtml() : "" ) + ")"
355 + ( item.address ? item.address.escapeHtml() : "" )
357 + ( item.city ? item.city.escapeHtml() : "" )
359 + ( item.zipcode ? item.zipcode.escapeHtml() : "" )
361 + ( item.country ? item.country.escapeHtml() : "" )
368 $( ".ar-update-branchcode" ).on('focus', function(){
369 previous_branchcode = this.value;
370 }).on('change', function(){
371 var branchcode = this.value;
372 var c = confirm(_("Are you sure you want to change the pickup library from %s to %s for this request?").format( previous_branchcode, branchcode ));
375 var id = this.id.split("branchcode-")[1];
376 $("#update-processing-" + id ).css({opacity: 0, visibility: "visible"}).animate({opacity: 1.0}, 200);
380 url: '/cgi-bin/koha/svc/article_request',
382 action: 'update_branchcode',
384 branchcode: branchcode,
386 success: function( data ) {
387 $("#update-processing-" + id ).css({opacity: 1.0, visibility: "visible"}).animate({opacity: 0}, 200);
393 this.value = previous_branchcode;
397 $(".ar-cancel-request").on("click", function(){
399 var notes = prompt(_("Reason for cancellation:"));
401 if ( notes != null ) {
402 var id = this.id.split("cancel-")[1];
403 $("#cancel-processing-" + id ).hide('slow');
404 $("#cancel-processing-spinner-" + id ).show('slow');
408 url: '/cgi-bin/koha/svc/article_request',
414 success: function( data ) {
415 a.parents('tr').hide('slow');
422 // Initialize format(s)
423 var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') %]";
424 if( !supported_formats.match(/PHOTOCOPY/) )
425 $('#format option[value="PHOTOCOPY"]').remove();
426 if( !supported_formats.match(/SCAN/) )
427 $('#format option[value="SCAN"]').remove();
429 if( $('#format option').length > 1 ) {
430 // Select first listed format
431 var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, '');
432 $('#format option[value="'+first_format+'"]').attr('selected', true);
438 [% INCLUDE 'intranet-bottom.inc' %]