4 [% USE AuthorisedValues %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha › Circulation › Article requests</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 <style> p { margin-top: 0; } [id^="article-menu-"] { display: none; } [id^="article-menu-"]:before { content: "|"; }</style>
13 <div id="[% menuid | html %]" class="btn-group dropup">
14 <a class="btn btn-default btn-xs dropdown-toggle ar-actions" role="button" data-toggle="dropdown" href="#">
15 Actions <b class="caret"></b>
18 <ul class="dropdown-menu [% pull_right | html %]" role="menu" aria-labelledby="[% aria_menu | html %]">
20 <a class="ar-process-request" href="#" onclick="HandleMulti( Process, [% id_arg | html %], $(this) ); return false;">
21 <i class="fa fa-cog"></i>
25 <a class="ar-complete-request" href="#" onclick="HandleMulti( Complete, [% id_arg | html %], $(this) ); return false;">
26 <i class="fa fa-check-circle"></i>
30 <a class="ar-cancel-request" href="#" onclick="HandleMulti( Cancel, [% id_arg | html %], $(this) ); return false;">
31 <i class="fa fa-minus-circle"></i>
35 [% IF id_arg %][%# TODO: Does not work with multi-select %]
36 <a class="ar-print-request" href="#" onclick="HandleMulti( PrintSlip, [% id_arg | html %], $(this) ); return false;">
37 <i class="fa fa-print"></i>
45 [% BLOCK item_status %]
46 [% IF myitem.onloan %]<span>Checked out</span>
47 [% ELSIF myitem.holds({ found => ['W', 'T'] }).count > 0 %]<span>On hold</span>
48 [% ELSIF myitem.notforloan > 0 OR myitem.itemtype.notforloan %]<span>Not for loan</span>
49 [% ELSIF myitem.notforloan < 0 %]<span>On order</span>
53 <body id="circ_article-requests" class="circ">
54 [% INCLUDE 'header.inc' %]
55 [% INCLUDE 'cat-search.inc' %]
57 <div id="breadcrumbs">
58 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
60 <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
62 <a href="/cgi-bin/koha/circ/article-requests.pl">Article requests</a>
65 <div class="main container-fluid">
67 <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
69 <h1>Article requests</h1>
71 <form id="ar-branchcode-form" method="post">
72 <select name="branchcode" id="branchcode">
73 <option value="">All libraries</option>
74 [% FOREACH b IN Branches.all( only_from_group => 1 ) %]
75 [% IF b.branchcode == branchcode %]
76 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
78 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
82 <button type="submit" class="btn btn-default btn-xs">
83 <i class="fa fa-refresh"></i> Update
87 <div id="article-request-tabs" class="toptabs">
90 <a href="#article-requests-pending">
91 Pending (<span id="ar_pending_count">[% article_requests_pending.count | html %]</span>)
96 <a href="#article-requests-processing">
97 Processing (<span id="ar_processing_count">[% article_requests_processing.count | html %]</span>)
102 <div id="article-requests-pending">
103 <div class="article-requests-pending_table_controls">
104 <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>
105 [% PROCESS actions menuid='article-menu-pending' id_arg=0 pull_right='' aria_menu='table_controls' %]
108 <table id="article-requests-pending-table">
112 <th class="ar-title">Title</th>
113 <th class="ar-request">Requested article</th>
114 <th class="ar-collection">Collection</th>
115 <th class="ar-itemtype">Item type</th>
116 <th class="ar-callnumber">Call number</th>
117 <th class="ar-status">Status</th>
118 <th class="ar-copynumber">Copy number</th>
119 <th class="ar-enumchron">Enumeration</th>
120 <th class="ar-barcode">Barcode</th>
121 <th class="ar-patron">Patron</th>
122 <th class="ar-date">Date</th>
123 <th class="ar-actions">Actions</th>
128 <tr class="ar-pending-none">
130 There are no pending article requests at this time.
134 [% FOREACH ar IN article_requests_pending %]
135 <tr class="ar-row ar-pending">
136 <td><input type="checkbox" reqid="[% ar.id | html %]"/></td>
137 <td class="ar-title">
139 <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% ar.biblionumber | uri %]">
140 [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %]
145 <div class="ar-biblionumber content_hidden">[% ar.biblionumber | html %]</div>
146 <div class="ar-author">[% ar.biblio.author | html %]</div>
147 <div class="ar-pubdata">
148 [% ar.biblio.biblioitem.publishercode | html %]
150 [% IF ar.biblio.biblioitem.publicationyear %]
151 [% ar.biblio.biblioitem.publicationyear | html %]
152 [% ELSIF ar.biblio.copyrightdate %]
153 [% ar.biblio.copyrightdate | html %]
156 [% IF ar.biblio.biblioitem.pages %]
157 : [% ar.biblio.biblioitem.pages | html %]
160 [% r.biblio.biblioitem.size | html %]
162 [% IF ar.biblio.biblioitem.isbn %]
163 ISBN: [% ar.biblio.biblioitem.isbn | html %]
168 <td class="ar-request">
169 [% IF ar.title %] <p><strong>Title:</strong> [% ar.title | html %] </p> [% END %]
170 [% IF ar.author %] <p><strong>Author:</strong> [% ar.author | html %] </p> [% END %]
171 [% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume | html %] </p> [% END %]
172 [% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue | html %] </p> [% END %]
173 [% IF ar.date %] <p><strong>Date:</strong> [% ar.date | html %] </p> [% END %]
174 [% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages | html %] </p> [% END %]
175 [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters | html %] </p> [% END %]
176 [% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes | html %] </p> [% END %]
178 <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) | html %]</td>
179 <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
180 <td class="ar-callnumber">
181 [% IF ar.item.location %]
182 <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) | html %]</em>
185 [% ar.item.itemcallnumber | html %]
187 <td class="ar-status">[% PROCESS 'item_status' myitem = ar.item IF ar.item %]</td>
188 <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
189 <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
190 <td class="ar-barcode">[% ar.item.barcode | html %]</td>
191 <td class="ar-patron">
193 <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
194 [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %])
198 <p>[% ar.borrower.phone | html %]</p>
200 <td class="ar-date"><span title="[% ar.created_on | html %]">[% ar.created_on | $KohaDates %]</span></td>
201 <td class="ar-actions">
202 [% PROCESS actions menuid = "row" _ ar.id id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %]
210 <div id="article-requests-processing">
211 <div class="article-requests-processing_table_controls">
212 <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>
213 [% PROCESS actions menuid='article-menu-processing' id_arg=0 pull_right='' aria_menu='table_controls' %]
215 <table id="article-requests-processing-table">
219 <th class="ar-title">Title</th>
220 <th class="ar-request">Requested article</th>
221 <th class="ar-collection">Collection</th>
222 <th class="ar-itemtype">Item type</th>
223 <th class="ar-callnumber">Call number</th>
224 <th class="ar-status">Status</th>
225 <th class="ar-copynumber">Copy number</th>
226 <th class="ar-enumchron">Enumeration</th>
227 <th class="ar-barcode">Barcode</th>
228 <th class="ar-patron">Patron</th>
229 <th class="ar-date">Date</th>
230 <th class="ar-actions">Actions</th>
235 <tr class="ar-processing-none">
237 There are no article requests in processing at this time.
241 [% FOREACH ar IN article_requests_processing %]
242 <tr class="ar-row ar-processing">
243 <td><input type="checkbox" reqid="[% ar.id | html %]"/></td>
244 <td class="ar-title">
246 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% ar.biblionumber | uri %]">
247 [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %]
252 <div class="ar-biblionumber content_hidden">[% ar.biblionumber | html %]</div>
253 <div class="ar-author">[% ar.biblio.author | html %]</div>
254 <div class="ar-pubdata">
255 [% ar.biblio.biblioitem.publishercode | html %]
257 [% IF ar.biblio.biblioitem.publicationyear %]
258 [% ar.biblio.biblioitem.publicationyear | html %]
259 [% ELSIF ar.biblio.copyrightdate %]
260 [% ar.biblio.copyrightdate | html %]
263 [% IF ar.biblio.biblioitem.pages %]
264 : [% ar.biblio.biblioitem.pages | html %]
267 [% r.biblio.biblioitem.size | html %]
269 [% IF ar.biblio.biblioitem.isbn %]
270 ISBN: [% ar.biblio.biblioitem.isbn | html %]
275 <td class="ar-request">
276 [% IF ar.title %] <p><strong>Title:</strong> [% ar.title | html %] </p> [% END %]
277 [% IF ar.author %] <p><strong>Author:</strong> [% ar.author | html %] </p> [% END %]
278 [% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume | html %] </p> [% END %]
279 [% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue | html %] </p> [% END %]
280 [% IF ar.date %] <p><strong>Date:</strong> [% ar.date | html %] </p> [% END %]
281 [% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages | html %] </p> [% END %]
282 [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters | html %] </p> [% END %]
283 [% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes | html %] </p> [% END %]
285 <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) | html %]</td>
286 <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
287 <td class="ar-callnumber">
288 [% IF ar.item.location %]
289 <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) | html %]</em>
292 [% ar.item.itemcallnumber | html %]
294 <td class="ar-status">[% PROCESS 'item_status' myitem = ar.item IF ar.item %]</td>
295 <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
296 <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
297 <td class="ar-barcode">[% ar.item.barcode | html %]</td>
298 <td class="ar-patron">
300 <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
301 [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %])
305 <p>[% ar.borrower.phone | html %]</p>
307 <td class="ar-date"><span title="[% ar.created_on | html %]">[% ar.created_on | $KohaDates %]</span></td>
308 <td class="ar-actions">
309 [% PROCESS actions menuid="table_" _ ar.id id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %]
322 [% MACRO jsinclude BLOCK %]
324 var active_table = "#article-requests-pending";
325 var last_cancel_reason;
326 $(document).ready(function() {
327 $('#article-request-tabs').tabs({
328 activate: function( activate_event, activate_ui ) {
329 active_table = activate_ui.newPanel.selector;
330 activateBatchActions( active_table );
332 create: function( create_event, create_ui ){
333 active_table = create_ui.panel.selector;
337 activateBatchActions( active_table );
339 [% IF article_requests_pending.count %]
340 $(".ar-pending-none").hide();
343 [% IF article_requests_processing.count %]
344 $(".ar-processing-none").hide();
347 $( "input:checkbox", active_table ).on("change", function(){
348 activateBatchActions( active_table );
351 $(".SelectAll").on("click", function(e) {
353 $( active_table + " input[type='checkbox']").prop('checked', true);
354 activateBatchActions( active_table );
356 $(".ClearAll").on("click", function(e) {
358 $( active_table + " input[type='checkbox']").prop('checked', false);
359 activateBatchActions( active_table );
361 $("a.ar-actions").on('click', function(e) {
362 // Hide menu option ?
363 if( $('#article-requests-processing-table').is(":visible") )
364 $('a.ar-process-request').hide();
365 else $('a.ar-process-request').show();
369 function activateBatchActions( active_table ){
370 // Check to see whether batch menu should be shown based on state of checkboxes
371 if ( $( "input:checkbox", active_table ).length > 0 ) {
372 // There are rows with checkboxes
373 $( "[class$='_table_controls']", active_table ).show();
374 if ( $( "input:checkbox:checked", active_table ).length > 0 ) {
375 $( "[id^='article-menu-']", active_table ).css("display","inline-block");
377 $( "[id^='article-menu-']", active_table ).hide();
380 // All rows have been removed
381 $("[class$='_table_controls']", active_table ).hide();
385 function HandleMulti( fnHandler, id, a ) {
386 last_cancel_reason = undefined;
387 if( id !== 0 ) { fnHandler( id, a ); return; }
388 $( active_table + " input[type='checkbox']:checked").each(function() {
389 fnHandler( $(this).attr('reqid'), $(this).closest('tr').find('td.ar-actions div a') );
393 function PrintSlip(id, a) {
394 var link = 'article-request-slip.pl?id='+id;
395 window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
398 function Cancel( id, a ) {
399 // last_cancel_reason: undefined means 'prompt for new reason'
400 // a null value indicates that prompt was cancelled
401 if( last_cancel_reason === undefined ) last_cancel_reason = prompt(_("Please specify the reason for cancelling selected item(s):"));
402 if ( last_cancel_reason === null ) {
406 a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif"/>').find('div.dropdown').hide();
409 url: '/cgi-bin/koha/svc/article_request',
413 notes: last_cancel_reason
415 success: function( data ) {
416 a.closest('tr').remove();
418 activateBatchActions( active_table );
424 function Process( id, a ) {
425 var table_row = a.closest('tr').clone();
426 table_row.find('.ar-process-request').remove();
427 table_row.find('input[type="checkbox"]').prop('checked', false);
429 a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif"/>').find('div.dropdown').hide();
432 url: '/cgi-bin/koha/svc/article_request',
437 success: function( data ) {
438 a.closest('tr').remove();
439 $("#article-requests-processing-table").append( table_row );
440 $("#article-requests-processing-table .ar-processing-none").hide();
442 activateBatchActions( active_table );
448 function Complete( id, a ) {
449 a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif"/>').find('div.dropdown').hide();
452 url: '/cgi-bin/koha/svc/article_request',
457 success: function( data ) {
458 a.closest('tr').remove();
460 activateBatchActions( active_table );
466 function UpdateTabCounts() {
467 var pending_count = $('#article-requests-pending-table tbody tr.ar-row').length;
468 $("#ar_pending_count").html( pending_count );
469 if ( pending_count == 0 ) $(".ar-pending-none").show();
471 var processing_count = $('#article-requests-processing-table tbody tr.ar-row').length;
472 $("#ar_processing_count").html( processing_count );
473 if ( processing_count == 0 ) $(".ar-processing-none").show();
478 [% INCLUDE 'intranet-bottom.inc' %]