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="dropdown">
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>
46 <body id="circ_article-requests" class="circ">
47 [% INCLUDE 'header.inc' %]
48 [% INCLUDE 'cat-search.inc' %]
50 <div id="breadcrumbs">
51 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
53 <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
55 <a href="/cgi-bin/koha/circ/article-requests.pl">Article requests</a>
58 <div class="main container-fluid">
60 <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
62 <h1>Article requests</h1>
64 <form id="ar-branchcode-form" method="post">
65 <select name="branchcode" id="branchcode">
66 <option value="">All libraries</option>
67 [% FOREACH b IN Branches.all( only_from_group => 1 ) %]
68 [% IF b.branchcode == branchcode %]
69 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
71 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
75 <button type="submit" class="btn btn-default btn-xs">
76 <i class="fa fa-refresh"></i> Update
80 <div id="article-request-tabs" class="toptabs">
83 <a href="#article-requests-pending">
84 Pending (<span id="ar_pending_count">[% article_requests_pending.count | html %]</span>)
89 <a href="#article-requests-processing">
90 Processing (<span id="ar_processing_count">[% article_requests_processing.count | html %]</span>)
95 <div id="article-requests-pending">
96 <div class="article-requests-pending_table_controls">
97 <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>
98 [% PROCESS actions menuid='article-menu-pending' id_arg=0 pull_right='' aria_menu='table_controls' %]
101 <table id="article-requests-pending-table">
105 <th class="ar-title">Title</th>
106 <th class="ar-request">Requested article</th>
107 <th class="ar-collection">Collection</th>
108 <th class="ar-itemtype">Item type</th>
109 <th class="ar-callnumber">Call number</th>
110 <th class="ar-copynumber">Copy number</th>
111 <th class="ar-enumchron">Enumeration</th>
112 <th class="ar-barcode">Barcode</th>
113 <th class="ar-patron">Patron</th>
114 <th class="ar-date">Date</th>
115 <th class="ar-actions">Actions</th>
120 <tr class="ar-pending-none">
122 There are no pending article requests at this time.
126 [% FOREACH ar IN article_requests_pending %]
127 <tr class="ar-row ar-pending">
128 <td><input type="checkbox" reqid="[% ar.id | html %]"/></td>
129 <td class="ar-title">
131 <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% ar.biblionumber | uri %]">
132 <strong>[% ar.biblio.title | html %]</strong>
133 [% FOREACH s IN itemsloo.subtitle %] [% s | html %][% END %]
138 <div class="ar-biblionumber content_hidden">[% ar.biblionumber | html %]</div>
139 <div class="ar-author">[% ar.biblio.author | html %]</div>
140 <div class="ar-pubdata">
141 [% ar.biblio.biblioitem.publishercode | html %]
143 [% IF ar.biblio.biblioitem.publicationyear %]
144 [% ar.biblio.biblioitem.publicationyear | html %]
145 [% ELSIF ar.biblio.copyrightdate %]
146 [% ar.biblio.copyrightdate | html %]
149 [% IF ar.biblio.biblioitem.pages %]
150 : [% ar.biblio.biblioitem.pages | html %]
153 [% r.biblio.biblioitem.size | html %]
155 [% IF ar.biblio.biblioitem.isbn %]
156 ISBN: [% ar.biblio.biblioitem.isbn | html %]
161 <td class="ar-request">
162 [% IF ar.title %] <p><strong>Title:</strong> [% ar.title | html %] </p> [% END %]
163 [% IF ar.author %] <p><strong>Author:</strong> [% ar.author | html %] </p> [% END %]
164 [% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume | html %] </p> [% END %]
165 [% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue | html %] </p> [% END %]
166 [% IF ar.date %] <p><strong>Date:</strong> [% ar.date | html %] </p> [% END %]
167 [% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages | html %] </p> [% END %]
168 [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters | html %] </p> [% END %]
169 [% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes | html %] </p> [% END %]
171 <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) | html %]</td>
172 <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
173 <td class="ar-callnumber">
174 [% IF ar.item.location %]
175 <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) | html %]</em>
178 [% ar.item.itemcallnumber | html %]
180 <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
181 <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
182 <td class="ar-barcode">[% ar.item.barcode | html %]</td>
183 <td class="ar-patron">
185 <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
186 [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %])
190 <p>[% ar.borrower.phone | html %]</p>
192 <td class="ar-date"><span title="[% ar.created_on | html %]">[% ar.created_on | $KohaDates %]</span></td>
193 <td class="ar-actions">
194 <div class="dropdown">
195 [% PROCESS actions menuid = "row" _ ar.id id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %]
204 <div id="article-requests-processing">
205 <div class="article-requests-processing_table_controls">
206 <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>
207 [% PROCESS actions menuid='article-menu-processing' id_arg=0 pull_right='' aria_menu='table_controls' %]
209 <table id="article-requests-processing-table">
213 <th class="ar-title">Title</th>
214 <th class="ar-request">Requested article</th>
215 <th class="ar-collection">Collection</th>
216 <th class="ar-itemtype">Item type</th>
217 <th class="ar-callnumber">Call number</th>
218 <th class="ar-copynumber">Copy number</th>
219 <th class="ar-enumchron">Enumeration</th>
220 <th class="ar-barcode">Barcode</th>
221 <th class="ar-patron">Patron</th>
222 <th class="ar-date">Date</th>
223 <th class="ar-actions">Actions</th>
228 <tr class="ar-processing-none">
230 There are no article requests in processing at this time.
234 [% FOREACH ar IN article_requests_processing %]
235 <tr class="ar-row ar-processing">
236 <td><input type="checkbox" reqid="[% ar.id | html %]"/></td>
237 <td class="ar-title">
239 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% ar.biblionumber | uri %]">
240 <strong>[% ar.biblio.title | html %]</strong>
241 [% FOREACH s IN itemsloo.subtitle %] [% s | html %][% END %]
246 <div class="ar-biblionumber content_hidden">[% ar.biblionumber | html %]</div>
247 <div class="ar-author">[% ar.biblio.author | html %]</div>
248 <div class="ar-pubdata">
249 [% ar.biblio.biblioitem.publishercode | html %]
251 [% IF ar.biblio.biblioitem.publicationyear %]
252 [% ar.biblio.biblioitem.publicationyear | html %]
253 [% ELSIF ar.biblio.copyrightdate %]
254 [% ar.biblio.copyrightdate | html %]
257 [% IF ar.biblio.biblioitem.pages %]
258 : [% ar.biblio.biblioitem.pages | html %]
261 [% r.biblio.biblioitem.size | html %]
263 [% IF ar.biblio.biblioitem.isbn %]
264 ISBN: [% ar.biblio.biblioitem.isbn | html %]
269 <td class="ar-request">
270 [% IF ar.title %] <p><strong>Title:</strong> [% ar.title | html %] </p> [% END %]
271 [% IF ar.author %] <p><strong>Author:</strong> [% ar.author | html %] </p> [% END %]
272 [% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume | html %] </p> [% END %]
273 [% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue | html %] </p> [% END %]
274 [% IF ar.date %] <p><strong>Date:</strong> [% ar.date | html %] </p> [% END %]
275 [% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages | html %] </p> [% END %]
276 [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters | html %] </p> [% END %]
277 [% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes | html %] </p> [% END %]
279 <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) | html %]</td>
280 <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
281 <td class="ar-callnumber">
282 [% IF ar.item.location %]
283 <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) | html %]</em>
286 [% ar.item.itemcallnumber | html %]
288 <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
289 <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
290 <td class="ar-barcode">[% ar.item.barcode | html %]</td>
291 <td class="ar-patron">
293 <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
294 [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %])
298 <p>[% ar.borrower.phone | html %]</p>
300 <td class="ar-date"><span title="[% ar.created_on | html %]">[% ar.created_on | $KohaDates %]</span></td>
301 <td class="ar-actions">
302 <div class="dropdown">
303 [% PROCESS actions menuid="table_" _ ar.id id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %]
317 [% MACRO jsinclude BLOCK %]
319 var active_table = "#article-requests-pending";
320 var last_cancel_reason;
321 $(document).ready(function() {
322 $('#article-request-tabs').tabs({
323 activate: function( activate_event, activate_ui ) {
324 active_table = activate_ui.newPanel.selector;
325 activateBatchActions( active_table );
327 create: function( create_event, create_ui ){
328 active_table = create_ui.panel.selector;
332 activateBatchActions( active_table );
334 [% IF article_requests_pending.count %]
335 $(".ar-pending-none").hide();
338 [% IF article_requests_processing.count %]
339 $(".ar-processing-none").hide();
342 $( "input:checkbox", active_table ).on("change", function(){
343 activateBatchActions( active_table );
346 $(".SelectAll").on("click", function(e) {
348 $( active_table + " input[type='checkbox']").prop('checked', true);
349 activateBatchActions( active_table );
351 $(".ClearAll").on("click", function(e) {
353 $( active_table + " input[type='checkbox']").prop('checked', false);
354 activateBatchActions( active_table );
356 $("a.ar-actions").on('click', function(e) {
357 // Hide menu option ?
358 if( $('#article-requests-processing-table').is(":visible") )
359 $('a.ar-process-request').hide();
360 else $('a.ar-process-request').show();
364 function activateBatchActions( active_table ){
365 // Check to see whether batch menu should be shown based on state of checkboxes
366 if ( $( "input:checkbox", active_table ).length > 0 ) {
367 // There are rows with checkboxes
368 $( "[class$='_table_controls']", active_table ).show();
369 if ( $( "input:checkbox:checked", active_table ).length > 0 ) {
370 $( "[id^='article-menu-']", active_table ).css("display","inline-block");
372 $( "[id^='article-menu-']", active_table ).hide();
375 // All rows have been removed
376 $("[class$='_table_controls']", active_table ).hide();
380 function HandleMulti( fnHandler, id, a ) {
381 last_cancel_reason = undefined;
382 if( id !== 0 ) { fnHandler( id, a ); return; }
383 $( active_table + " input[type='checkbox']:checked").each(function() {
384 fnHandler( $(this).attr('reqid'), $(this).closest('tr').find('td.ar-actions div a') );
388 function PrintSlip(id, a) {
389 var link = 'article-request-slip.pl?id='+id;
390 window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
393 function Cancel( id, a ) {
394 // last_cancel_reason: undefined means 'prompt for new reason'
395 // a null value indicates that prompt was cancelled
396 if( last_cancel_reason === undefined ) last_cancel_reason = prompt(_("Please specify the reason for cancelling selected item(s):"));
397 if ( last_cancel_reason === null ) {
401 a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif"/>').find('div.dropdown').hide();
404 url: '/cgi-bin/koha/svc/article_request',
408 notes: last_cancel_reason
410 success: function( data ) {
411 a.closest('tr').remove();
413 activateBatchActions( active_table );
419 function Process( id, a ) {
420 var table_row = a.closest('tr').clone();
421 table_row.find('.ar-process-request').remove();
422 table_row.find('input[type="checkbox"]').prop('checked', false);
424 a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif"/>').find('div.dropdown').hide();
427 url: '/cgi-bin/koha/svc/article_request',
432 success: function( data ) {
433 a.closest('tr').remove();
434 $("#article-requests-processing-table").append( table_row );
435 $("#article-requests-processing-table .ar-processing-none").hide();
437 activateBatchActions( active_table );
443 function Complete( id, a ) {
444 a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif"/>').find('div.dropdown').hide();
447 url: '/cgi-bin/koha/svc/article_request',
452 success: function( data ) {
453 a.closest('tr').remove();
455 activateBatchActions( active_table );
461 function UpdateTabCounts() {
462 var pending_count = $('#article-requests-pending-table tbody tr.ar-row').length;
463 $("#ar_pending_count").html( pending_count );
464 if ( pending_count == 0 ) $(".ar-pending-none").show();
466 var processing_count = $('#article-requests-processing-table tbody tr.ar-row').length;
467 $("#ar_processing_count").html( processing_count );
468 if ( processing_count == 0 ) $(".ar-processing-none").show();
473 [% INCLUDE 'intranet-bottom.inc' %]