5 [% SET article_requests_view = 1 %]
6 [% SET biblionumber = biblio.biblionumber %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha › Circulation › Request article</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
13 <body id="circ_request-article" class="circ">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'circ-search.inc' %]
17 <div id="breadcrumbs">
18 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
20 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
22 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">[% biblio.title | html %]</a>
27 <div id="doc3" class="yui-t2">
32 <h1>Request article from <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.id %]">[% biblio.title | html %]</a></h1>
33 [% IF no_patrons_found %]
34 <div class="dialog alert">
35 <h3>Patron not found</h3>
36 <p>No patron with this name, please, try another</p>
39 <form id="article_request_patron_results" method="post">
41 <table id="table_borrowers">
53 [% FOREACH patron IN patrons %]
55 <td><input type="radio" name="patron_id" value="[% patron.borrowernumber %]"/></td>
56 <td>[% patron.surname %], [% patron.firstname %]</td>
57 <td>[% patron.cardnumber %]</td>
58 <td>[% patron.categorycode %]</td>
59 <td>[% patron.branchcode %]</td>
60 <td>[% patron.address %]</td>
65 <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
66 <fieldset class="action"><input type="submit" value="Select" /></fieldset>
70 <form id="article_requests_patronsearch" action="request-article.pl" method="post">
71 <fieldset class="brief">
72 <label for="patron">Patron: </label>
73 <div class="hint">Enter patron card number or partial name:</div>
74 <input type="text" size="40" id="patron" class="focus" name="patron_cardnumber" />
75 <input type="submit" value="Search" />
76 <input type="hidden" name="biblionumber" value="[% biblio.id %]" />
80 [% IF biblio.can_article_request( patron ) %]
82 <form id="place-article-request" method="post" action="/cgi-bin/koha/circ/request-article.pl">
83 <input type="hidden" name="action" value="create" />
84 <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber %]" />
85 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.id %]" />
87 <fieldset class="rows">
88 <legend>Place article request from [% biblio.title %] for [% patron.firstname %] [% patron.surname %] ( [% patron.cardnumber %] )</legend>
92 <label for="title">Title:</label>
93 <input type="text" name="title" id="title" size="50"/>
97 <label for="author">Author:</label>
98 <input type="text" name="author" id="author" size="50"/>
102 <label for="volume">Volume:</label>
103 <input type="text" name="volume" id="volume" size="50"/>
107 <label for="issue">Issue:</label>
108 <input type="text" name="issue" id="issue" size="50"/>
112 <label for="date">Date:</label>
113 <input type="text" name="date" id="date" size="50"/>
117 <label for="pages">Pages:</label>
118 <input type="text" name="pages" id="pages" size="50"/>
122 <label for="chapters">Chapters:</label>
123 <input type="text" name="chapters" id="chapters" size="50"/>
127 <label for="patron_notes">Patron notes:</label>
128 <input type="text" name="patron_notes" id="patron_notes" size="50"/>
132 <label for="branchcode">Pickup library:</label>
133 <select name="branchcode" id="branchcode">
134 [% FOREACH b IN Branches.all %]
135 [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
136 <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
138 <option value="[% b.branchcode %]">[% b.branchname %]</option>
146 [% SET article_request_type = biblio.article_request_type( patron ) %]
147 [% IF article_request_type != 'bib_only' %]
148 <table id="current-requests-table" class="ar-table table table-bordered table-striped">
149 <caption>Select item:</caption>
155 <th>Home library</th>
162 [% FOREACH item IN biblio.items %]
163 [% IF item.can_article_request( patron ) %]
166 [% IF article_request_type == 'item_only' && !checked %]
167 [% SET checked = 1 %]
168 <input type="radio" name="itemnumber" value="[% item.itemnumber %]" checked="checked" />
170 <input type="radio" name="itemnumber" value="[% item.itemnumber %]" />
174 [% ItemTypes.GetDescription( item.itype ) %]
180 [% Branches.GetName( item.homebranch ) %]
183 [% item.itemcallnumber %]
192 [% IF article_request_type != 'item_only' %]
195 <input type="radio" name="itemnumber" value="" checked="checked"/>
207 <input type="submit" class="btn btn-default" value="Place request" />
211 No article requests can be made for this record.
216 [% IF biblio.article_requests_current && !patron %]
217 <fieldset class="rows left" id="current-article-requests-fieldset">
218 <legend>Current article requests</legend>
220 <table id="current-article-requests-table">
231 <th>Patron notes</th>
234 <th>Pickup library</th>
238 [% FOREACH ar IN biblio.article_requests_current %]
240 <td>[% ar.created_on | $KohaDates %]</td>
241 <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% ar.borrowernumber %]">[% ar.borrower.firstname %] [% ar.borrower.surname %]</a></td>
242 <td>[% ar.title %]</td>
243 <td>[% ar.author %]</td>
244 <td>[% ar.volume %]</td>
245 <td>[% ar.issue %]</td>
246 <td>[% ar.date %]</td>
247 <td>[% ar.pages %]</td>
248 <td>[% ar.chapters %]</td>
249 <td>[% ar.patron_notes %]</td>
252 <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber %]&biblionumber=[% ar.biblionumber %]">[% ar.item.barcode %]</a>
256 [% IF ar.status == 'PENDING' %]
258 [% ELSIF ar.status == 'PROCESSING' %]
260 [% ELSIF ar.status == 'COMPLETED' %]
262 [% ELSIF ar.status == 'CANCELED' %]
267 <i id="update-processing-[% ar.id %]" class="fa fa-cog fa-spin hidden"></i>
268 <select name="branchcode" id="branchcode-[% ar.id %]" class="ar-update-branchcode">
269 [% FOREACH b IN Branches.all %]
270 [% IF b.branchcode == ar.branchcode %]
271 <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
273 <option value="[% b.branchcode %]">[% b.branchname %]</option>
279 <a title="Cancel article request" href="#" id="cancel-[% ar.id %]" class="ar-cancel-request">
280 <i id="cancel-processing-spinner-[% ar.id %]" class="fa fa-cog fa-spin hide"></i>
281 <i id="cancel-processing-[% ar.id %]" class="fa fa-times fa-lg" style="color:red"></i>
293 [% INCLUDE 'biblio-view-menu.inc' %]
298 [% MACRO jsinclude BLOCK %]
299 [% INCLUDE 'datatables.inc' %]
301 <script type="text/javascript">
302 $('#current-article-requests').ready(function() {
306 $(document).ready(function() {
307 $( "#patron" ).autocomplete({
308 source: "/cgi-bin/koha/circ/ysearch.pl",
310 select: function( event, ui ) {
311 $( "#patron" ).val( ui.item.cardnumber );
312 $( "#holds_patronsearch" ).submit();
316 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
317 return $( "<li></li>" )
318 .data( "ui-autocomplete-item", item )
319 .append( "<a>" + item.surname + ", " + item.firstname +
320 " (" + item.cardnumber + ") <small>" + item.address +
321 " " + item.city + " " + item.zipcode + " " +
322 item.country + "</small></a>" )
326 $( ".ar-update-branchcode" ).on('focus', function(){
327 previous_branchcode = this.value;
328 }).on('change', function(){
329 var branchcode = this.value;
330 var c = confirm(_("Are you sure you want to change the pickup library from %s to %s for this request?").format( previous_branchcode, branchcode ));
333 var id = this.id.split("branchcode-")[1];
334 $("#update-processing-" + id ).css({opacity: 0, visibility: "visible"}).animate({opacity: 1.0}, 200);
338 url: '/cgi-bin/koha/svc/article_request',
340 action: 'update_branchcode',
342 branchcode: branchcode,
344 success: function( data ) {
345 $("#update-processing-" + id ).css({opacity: 1.0, visibility: "visible"}).animate({opacity: 0}, 200);
351 this.value = previous_branchcode;
355 $(".ar-cancel-request").on("click", function(){
357 var notes = prompt(_("Reason for cancellation:"));
359 if ( notes != null ) {
360 var id = this.id.split("cancel-")[1];
361 $("#cancel-processing-" + id ).hide('slow');
362 $("#cancel-processing-spinner-" + id ).show('slow');
366 url: '/cgi-bin/koha/svc/article_request',
372 success: function( data ) {
373 a.parents('tr').hide('slow');
383 [% INCLUDE 'intranet-bottom.inc' %]