4 [% USE AuthorisedValues %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha › Circulation › Article requests</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 <style type="text/css"> p { margin-top: 0; }</style>
13 <a class="btn btn-default btn-xs dropdown-toggle ar-actions" role="button" data-toggle="dropdown" href="#">
14 Actions <b class="caret"></b>
17 <ul class="dropdown-menu [% pull_right %]" role="menu" aria-labelledby="[% aria_menu %]">
19 <a class="ar-process-request" href="#" onclick="HandleMulti( Process, [% id_arg %], $(this) ); return false;">
20 <i class="fa fa-cog"></i>
24 <a class="ar-complete-request" href="#" onclick="HandleMulti( Complete, [% id_arg %], $(this) ); return false;">
25 <i class="fa fa-check-circle"></i>
29 <a class="ar-cancel-request" href="#" onclick="HandleMulti( Cancel, [% id_arg %], $(this) ); return false;">
30 <i class="fa fa-minus-circle"></i>
34 [% IF id_arg %][%# TODO: Does not work with multi-select %]
35 <a class="ar-print-request" href="#" onclick="HandleMulti( PrintSlip, [% id_arg %], $(this) ); return false;">
36 <i class="fa fa-print"></i>
44 <body id="circ_article-requests" class="circ">
45 [% INCLUDE 'header.inc' %]
46 [% INCLUDE 'cat-search.inc' %]
48 <div id="breadcrumbs">
49 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
51 <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
53 <a href="/cgi-bin/koha/circ/article-requests.pl">Article requests</a>
56 <div class="main container-fluid">
58 <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
60 <h1>Article requests</h1>
62 <form id="ar-branchcode-form" method="post">
63 <select name="branchcode" id="branchcode">
64 <option value="">All libraries</option>
65 [% FOREACH b IN Branches.all( only_from_group => 1 ) %]
66 [% IF b.branchcode == branchcode %]
67 <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
69 <option value="[% b.branchcode %]">[% b.branchname %]</option>
73 <button type="submit" class="btn btn-default btn-xs">
74 <i class="fa fa-refresh"></i> Update
78 <div id="article-request-tabs" class="toptabs">
81 <a href="#article-requests-pending">
82 Pending (<span id="ar_pending_count">[% article_requests_pending.count %]</span>)
87 <a href="#article-requests-processing">
88 Processing (<span id="ar_processing_count">[% article_requests_processing.count %]</span>)
93 <div id="article-requests-pending">
94 <table id="article-requests-pending-table">
98 <th class="ar-title">Title</th>
99 <th class="ar-request">Requested article</th>
100 <th class="ar-collection">Collection</th>
101 <th class="ar-itemtype">Item type</th>
102 <th class="ar-callnumber">Call number</th>
103 <th class="ar-copynumber">Copy number</th>
104 <th class="ar-enumchron">Enumeration</th>
105 <th class="ar-barcode">Barcode</th>
106 <th class="ar-patron">Patron</th>
107 <th class="ar-date">Date</th>
108 <th class="ar-actions">Actions</th>
113 <tr class="ar-pending-none">
115 There are no pending article requests at this time.
119 [% FOREACH ar IN article_requests_pending %]
120 <tr class="ar-row ar-pending">
121 <td><input type="checkbox" reqid="[% ar.id %]"/></td>
122 <td class="ar-title">
124 <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% ar.biblionumber %]">
125 <strong>[% ar.biblio.title | html %]</strong>
126 [% FOREACH s IN itemsloo.subtitle %] [% s %][% END %]
131 <div class="ar-biblionumber content_hidden">[% ar.biblionumber %]</div>
132 <div class="ar-author">[% ar.biblio.author %]</div>
133 <div class="ar-pubdata">
134 [% ar.biblio.biblioitem.publishercode %]
136 [% IF ar.biblio.biblioitem.publicationyear %]
137 [% ar.biblio.biblioitem.publicationyear %]
138 [% ELSIF ar.biblio.copyrightdate %]
139 [% ar.biblio.copyrightdate %]
142 [% IF ar.biblio.biblioitem.pages %]
143 : [% ar.biblio.biblioitem.pages %]
146 [% r.biblio.biblioitem.size %]
148 [% IF ar.biblio.biblioitem.isbn %]
149 ISBN: [% ar.biblio.biblioitem.isbn %]
154 <td class="ar-request">
155 [% IF ar.title %] <p><strong>Title:</strong> [% ar.title %] </p> [% END %]
156 [% IF ar.author %] <p><strong>Author:</strong> [% ar.author %] </p> [% END %]
157 [% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume %] </p> [% END %]
158 [% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue %] </p> [% END %]
159 [% IF ar.date %] <p><strong>Date:</strong> [% ar.date %] </p> [% END %]
160 [% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages %] </p> [% END %]
161 [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters %] </p> [% END %]
162 [% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes %] </p> [% END %]
164 <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) %]</td>
165 <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) %]</td>
166 <td class="ar-callnumber">
167 [% IF ar.item.location %]
168 <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) %]</em>
171 [% ar.item.itemcallnumber %]
173 <td class="ar-copynumber">[% ar.item.copynumber %]</td>
174 <td class="ar-enumchron">[% ar.item.enumchron %]</td>
175 <td class="ar-barcode">[% ar.item.barcode %]</td>
176 <td class="ar-patron">
178 <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber %]">
179 [% ar.borrower.surname %][% IF ar.borrower.firstname %], [% ar.borrower.firstname %][% END %] ([% ar.borrower.cardnumber %])
183 <p>[% ar.borrower.phone %]</p>
185 <td class="ar-date"><span title="[% ar.created_on %]">[% ar.created_on | $KohaDates %]</span></td>
186 <td class="ar-actions">
187 <div class="dropdown">
188 [% PROCESS actions id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %]
197 <div id="article-requests-processing">
198 <table id="article-requests-processing-table">
202 <th class="ar-title">Title</th>
203 <th class="ar-request">Requested article</th>
204 <th class="ar-collection">Collection</th>
205 <th class="ar-itemtype">Item type</th>
206 <th class="ar-callnumber">Call number</th>
207 <th class="ar-copynumber">Copy number</th>
208 <th class="ar-enumchron">Enumeration</th>
209 <th class="ar-barcode">Barcode</th>
210 <th class="ar-patron">Patron</th>
211 <th class="ar-date">Date</th>
212 <th class="ar-actions">Actions</th>
217 <tr class="ar-processing-none">
219 There are no article requests in processing at this time.
223 [% FOREACH ar IN article_requests_processing %]
224 <tr class="ar-row ar-processing">
225 <td><input type="checkbox" reqid="[% ar.id %]"/></td>
226 <td class="ar-title">
228 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% ar.biblionumber %]">
229 <strong>[% ar.biblio.title | html %]</strong>
230 [% FOREACH s IN itemsloo.subtitle %] [% s %][% END %]
235 <div class="ar-biblionumber content_hidden">[% ar.biblionumber %]</div>
236 <div class="ar-author">[% ar.biblio.author %]</div>
237 <div class="ar-pubdata">
238 [% ar.biblio.biblioitem.publishercode %]
240 [% IF ar.biblio.biblioitem.publicationyear %]
241 [% ar.biblio.biblioitem.publicationyear %]
242 [% ELSIF ar.biblio.copyrightdate %]
243 [% ar.biblio.copyrightdate %]
246 [% IF ar.biblio.biblioitem.pages %]
247 : [% ar.biblio.biblioitem.pages %]
250 [% r.biblio.biblioitem.size %]
252 [% IF ar.biblio.biblioitem.isbn %]
253 ISBN: [% ar.biblio.biblioitem.isbn %]
258 <td class="ar-request">
259 [% IF ar.title %] <p><strong>Title:</strong> [% ar.title %] </p> [% END %]
260 [% IF ar.author %] <p><strong>Author:</strong> [% ar.author %] </p> [% END %]
261 [% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume %] </p> [% END %]
262 [% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue %] </p> [% END %]
263 [% IF ar.date %] <p><strong>Date:</strong> [% ar.date %] </p> [% END %]
264 [% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages %] </p> [% END %]
265 [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters %] </p> [% END %]
266 [% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes %] </p> [% END %]
268 <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) %]</td>
269 <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) %]</td>
270 <td class="ar-callnumber">
271 [% IF ar.item.location %]
272 <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) %]</em>
275 [% ar.item.itemcallnumber %]
277 <td class="ar-copynumber">[% ar.item.copynumber %]</td>
278 <td class="ar-enumchron">[% ar.item.enumchron %]</td>
279 <td class="ar-barcode">[% ar.item.barcode %]</td>
280 <td class="ar-patron">
282 <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber %]">
283 [% ar.borrower.surname %][% IF ar.borrower.firstname %], [% ar.borrower.firstname %][% END %] ([% ar.borrower.cardnumber %])
287 <p>[% ar.borrower.phone %]</p>
289 <td class="ar-date"><span title="[% ar.created_on %]">[% ar.created_on | $KohaDates %]</span></td>
290 <td class="ar-actions">
291 <div class="dropdown">
292 [% PROCESS actions id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %]
301 <div class="table_controls row" id="table_controls">
302 <a href="#" class="SelectAll"><i class="fa fa-check"></i> Select all</a> <a href="#" class="ClearAll"><i class="fa fa-remove"></i> Clear all</a>
303 [% PROCESS actions id_arg=0 pull_right='' aria_menu='table_controls' %]
310 [% MACRO jsinclude BLOCK %]
311 <script type="text/javascript">
312 $(document).ready(function() {
313 $('#article-request-tabs').tabs();
315 [% IF article_requests_pending.count %]
316 $(".ar-pending-none").hide();
319 [% IF article_requests_processing.count %]
320 $(".ar-processing-none").hide();
323 $(".SelectAll").on("click", function(e) {
325 if( $('table#article-requests-pending-table').is(":visible") )
326 var table='article-requests-pending-table';
327 else table='article-requests-processing-table';
328 $("table#"+table+" input[type='checkbox']").prop('checked', true);
330 $(".ClearAll").on("click", function(e) {
332 if( $('table#article-requests-pending-table').is(":visible") )
333 var table='article-requests-pending-table';
334 else table='article-requests-processing-table';
335 $("table#"+table+" input[type='checkbox']").prop('checked', false);
337 $("a.ar-actions").on('click', function(e) {
338 // Hide menu option ?
339 if( $('table#article-requests-processing-table').is(":visible") )
340 $('a.ar-process-request').hide();
341 else $('a.ar-process-request').show();
345 function HandleMulti( fnHandler, id, a ) {
346 if( id !== 0 ) { fnHandler( id, a ); return; }
347 if( $('table#article-requests-pending-table').is(":visible") )
348 var table='article-requests-pending-table';
349 else table='article-requests-processing-table';
350 $("table#"+table+" input[type='checkbox']:checked").each(function() {
351 fnHandler( $(this).attr('reqid'), $(this).closest('tr').find('td.ar-actions div a') );
355 function PrintSlip(id, a) {
356 var link = 'article-request-slip.pl?id='+id;
357 window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
360 function Cancel( id, a ) {
361 notes = prompt(_("Reason for cancellation:"));
362 if ( notes == null ) {
366 a.closest('td').prepend('<img src="[% interface %]/[% theme %]/img/loading-small.gif"/>').find('div.dropdown').hide();
369 url: '/cgi-bin/koha/svc/article_request',
375 success: function( data ) {
376 a.closest('tr').remove();
383 function Process( id, a ) {
384 var table_row = a.closest('tr').clone();
385 table_row.find('.ar-process-request').remove();
386 table_row.find('input[type="checkbox"]').prop('checked', false);
388 a.closest('td').prepend('<img src="[% interface %]/[% theme %]/img/loading-small.gif"/>').find('div.dropdown').hide();
391 url: '/cgi-bin/koha/svc/article_request',
396 success: function( data ) {
397 a.closest('tr').remove();
398 $("#article-requests-processing-table").append( table_row );
399 $("#article-requests-processing-table .ar-processing-none").hide();
406 function Complete( id, a ) {
407 a.closest('td').prepend('<img src="[% interface %]/[% theme %]/img/loading-small.gif"/>').find('div.dropdown').hide();
410 url: '/cgi-bin/koha/svc/article_request',
415 success: function( data ) {
416 a.closest('tr').remove();
423 function UpdateTabCounts() {
424 var pending_count = $('#article-requests-pending-table tbody tr.ar-row').length;
425 $("#ar_pending_count").html( pending_count );
426 if ( pending_count == 0 ) $(".ar-pending-none").show();
428 var processing_count = $('#article-requests-processing-table tbody tr.ar-row').length;
429 $("#ar_processing_count").html( processing_count );
430 if ( processing_count == 0 ) $(".ar-processing-none").show();
435 [% INCLUDE 'intranet-bottom.inc' %]