6 [% SET article_requests_view = 1 %]
7 [% SET biblionumber = biblio.biblionumber %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha › Circulation › Request article</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% Asset.css("css/datatables.css") %]
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>
23 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">[% biblio.title | html %]</a>
28 <div id="doc3" class="yui-t2">
33 <h1>Request article from <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.id %]">[% biblio.title | html %]</a></h1>
34 [% IF no_patrons_found %]
35 <div class="dialog alert">
36 <h3>Patron not found</h3>
37 <p>No patron with this name, please, try another</p>
40 <form id="article_request_patron_results" method="post">
42 <table id="table_borrowers">
54 [% FOREACH patron IN patrons %]
56 <td><input type="radio" name="patron_id" value="[% patron.borrowernumber %]"/></td>
57 <td>[% patron.surname %], [% patron.firstname %]</td>
58 <td>[% patron.cardnumber %]</td>
59 <td>[% patron.categorycode %]</td>
60 <td>[% patron.branchcode %]</td>
61 <td>[% patron.address %]</td>
66 <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
67 <fieldset class="action"><input type="submit" value="Select" /></fieldset>
71 <form id="article_requests_patronsearch" action="request-article.pl" method="post">
72 <fieldset class="brief">
73 <label for="patron">Patron: </label>
74 <div class="hint">Enter patron card number or partial name:</div>
75 <input type="text" size="40" id="patron" class="focus" name="patron_cardnumber" />
76 <input type="submit" value="Search" />
77 <input type="hidden" name="biblionumber" value="[% biblio.id %]" />
81 [% IF biblio.can_article_request( patron ) %]
83 <form id="place-article-request" method="post" action="/cgi-bin/koha/circ/request-article.pl">
84 <input type="hidden" name="action" value="create" />
85 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber %]" />
86 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.id %]" />
88 <fieldset class="rows">
89 <legend>Place article request from [% biblio.title %] for [% patron.firstname %] [% patron.surname %] ( [% patron.cardnumber %] )</legend>
93 <label for="title">Title:</label>
94 <input type="text" name="title" id="title" size="50"/>
98 <label for="author">Author:</label>
99 <input type="text" name="author" id="author" size="50"/>
103 <label for="volume">Volume:</label>
104 <input type="text" name="volume" id="volume" size="50"/>
108 <label for="issue">Issue:</label>
109 <input type="text" name="issue" id="issue" size="50"/>
113 <label for="date">Date:</label>
114 <input type="text" name="date" id="date" size="50"/>
118 <label for="pages">Pages:</label>
119 <input type="text" name="pages" id="pages" size="50"/>
123 <label for="chapters">Chapters:</label>
124 <input type="text" name="chapters" id="chapters" size="50"/>
128 <label for="patron_notes">Patron notes:</label>
129 <input type="text" name="patron_notes" id="patron_notes" size="50"/>
133 <label for="branchcode">Pickup library:</label>
134 <select name="branchcode" id="branchcode">
135 [% FOREACH b IN Branches.all %]
136 [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
137 <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
139 <option value="[% b.branchcode %]">[% b.branchname %]</option>
147 [% SET article_request_type = biblio.article_request_type( patron ) %]
148 [% IF article_request_type != 'bib_only' %]
149 <table id="current-requests-table" class="ar-table table table-bordered table-striped">
150 <caption>Select item:</caption>
156 <th>Home library</th>
163 [% FOREACH item IN biblio.items %]
164 [% IF item.can_article_request( patron ) %]
167 [% IF article_request_type == 'item_only' && !checked %]
168 [% SET checked = 1 %]
169 <input type="radio" name="itemnumber" value="[% item.itemnumber %]" checked="checked" />
171 <input type="radio" name="itemnumber" value="[% item.itemnumber %]" />
175 [% ItemTypes.GetDescription( item.itype ) %]
181 [% Branches.GetName( item.homebranch ) %]
184 [% item.itemcallnumber %]
193 [% IF article_request_type != 'item_only' %]
196 <input type="radio" name="itemnumber" value="" checked="checked"/>
208 <input type="submit" class="btn btn-default" value="Place request" />
212 No article requests can be made for this record.
217 [% IF biblio.article_requests_current && !patron %]
218 <fieldset class="rows left" id="current-article-requests-fieldset">
219 <legend>Current article requests</legend>
221 <table id="current-article-requests-table">
232 <th>Patron notes</th>
235 <th>Pickup library</th>
239 [% FOREACH ar IN biblio.article_requests_current %]
241 <td>[% ar.created_on | $KohaDates %]</td>
242 <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% ar.borrowernumber %]">[% ar.borrower.firstname %] [% ar.borrower.surname %]</a></td>
243 <td>[% ar.title %]</td>
244 <td>[% ar.author %]</td>
245 <td>[% ar.volume %]</td>
246 <td>[% ar.issue %]</td>
247 <td>[% ar.date %]</td>
248 <td>[% ar.pages %]</td>
249 <td>[% ar.chapters %]</td>
250 <td>[% ar.patron_notes %]</td>
253 <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber %]&biblionumber=[% ar.biblionumber %]">[% ar.item.barcode %]</a>
257 [% IF ar.status == 'PENDING' %]
259 [% ELSIF ar.status == 'PROCESSING' %]
261 [% ELSIF ar.status == 'COMPLETED' %]
263 [% ELSIF ar.status == 'CANCELED' %]
268 <i id="update-processing-[% ar.id %]" class="fa fa-cog fa-spin hidden"></i>
269 <select name="branchcode" id="branchcode-[% ar.id %]" class="ar-update-branchcode">
270 [% FOREACH b IN Branches.all %]
271 [% IF b.branchcode == ar.branchcode %]
272 <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
274 <option value="[% b.branchcode %]">[% b.branchname %]</option>
280 <a title="Cancel article request" href="#" id="cancel-[% ar.id %]" class="ar-cancel-request">
281 <i id="cancel-processing-spinner-[% ar.id %]" class="fa fa-cog fa-spin hide"></i>
282 <i id="cancel-processing-[% ar.id %]" class="fa fa-times fa-lg" style="color:red"></i>
294 [% INCLUDE 'biblio-view-menu.inc' %]
299 [% MACRO jsinclude BLOCK %]
300 [% INCLUDE 'datatables.inc' %]
302 <script type="text/javascript">
303 $('#current-article-requests').ready(function() {
307 $(document).ready(function() {
308 [% UNLESS (patron ) %]
309 $( "#patron" ).autocomplete({
310 source: "/cgi-bin/koha/circ/ysearch.pl",
312 select: function( event, ui ) {
313 $( "#patron" ).val( ui.item.cardnumber );
314 $( "#holds_patronsearch" ).submit();
318 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
319 return $( "<li></li>" )
320 .data( "ui-autocomplete-item", item )
321 .append( "<a>" + item.surname + ", " + item.firstname +
322 " (" + item.cardnumber + ") <small>" + item.address +
323 " " + item.city + " " + item.zipcode + " " +
324 item.country + "</small></a>" )
329 $( ".ar-update-branchcode" ).on('focus', function(){
330 previous_branchcode = this.value;
331 }).on('change', function(){
332 var branchcode = this.value;
333 var c = confirm(_("Are you sure you want to change the pickup library from %s to %s for this request?").format( previous_branchcode, branchcode ));
336 var id = this.id.split("branchcode-")[1];
337 $("#update-processing-" + id ).css({opacity: 0, visibility: "visible"}).animate({opacity: 1.0}, 200);
341 url: '/cgi-bin/koha/svc/article_request',
343 action: 'update_branchcode',
345 branchcode: branchcode,
347 success: function( data ) {
348 $("#update-processing-" + id ).css({opacity: 1.0, visibility: "visible"}).animate({opacity: 0}, 200);
354 this.value = previous_branchcode;
358 $(".ar-cancel-request").on("click", function(){
360 var notes = prompt(_("Reason for cancellation:"));
362 if ( notes != null ) {
363 var id = this.id.split("cancel-")[1];
364 $("#cancel-processing-" + id ).hide('slow');
365 $("#cancel-processing-spinner-" + id ).show('slow');
369 url: '/cgi-bin/koha/svc/article_request',
375 success: function( data ) {
376 a.parents('tr').hide('slow');
386 [% INCLUDE 'intranet-bottom.inc' %]