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>
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 [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %]
137 <div class="ar-biblionumber content_hidden">[% ar.biblionumber | html %]</div>
138 <div class="ar-author">[% ar.biblio.author | html %]</div>
139 <div class="ar-pubdata">
140 [% ar.biblio.biblioitem.publishercode | html %]
142 [% IF ar.biblio.biblioitem.publicationyear %]
143 [% ar.biblio.biblioitem.publicationyear | html %]
144 [% ELSIF ar.biblio.copyrightdate %]
145 [% ar.biblio.copyrightdate | html %]
148 [% IF ar.biblio.biblioitem.pages %]
149 : [% ar.biblio.biblioitem.pages | html %]
152 [% r.biblio.biblioitem.size | html %]
154 [% IF ar.biblio.biblioitem.isbn %]
155 ISBN: [% ar.biblio.biblioitem.isbn | html %]
160 <td class="ar-request">
161 [% IF ar.title %] <p><strong>Title:</strong> [% ar.title | html %] </p> [% END %]
162 [% IF ar.author %] <p><strong>Author:</strong> [% ar.author | html %] </p> [% END %]
163 [% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume | html %] </p> [% END %]
164 [% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue | html %] </p> [% END %]
165 [% IF ar.date %] <p><strong>Date:</strong> [% ar.date | html %] </p> [% END %]
166 [% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages | html %] </p> [% END %]
167 [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters | html %] </p> [% END %]
168 [% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes | html %] </p> [% END %]
170 <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) | html %]</td>
171 <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
172 <td class="ar-callnumber">
173 [% IF ar.item.location %]
174 <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) | html %]</em>
177 [% ar.item.itemcallnumber | html %]
179 <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
180 <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
181 <td class="ar-barcode">[% ar.item.barcode | html %]</td>
182 <td class="ar-patron">
184 <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
185 [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %])
189 <p>[% ar.borrower.phone | html %]</p>
191 <td class="ar-date"><span title="[% ar.created_on | html %]">[% ar.created_on | $KohaDates %]</span></td>
192 <td class="ar-actions">
193 <div class="dropdown">
194 [% PROCESS actions menuid = "row" _ ar.id id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %]
203 <div id="article-requests-processing">
204 <div class="article-requests-processing_table_controls">
205 <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>
206 [% PROCESS actions menuid='article-menu-processing' id_arg=0 pull_right='' aria_menu='table_controls' %]
208 <table id="article-requests-processing-table">
212 <th class="ar-title">Title</th>
213 <th class="ar-request">Requested article</th>
214 <th class="ar-collection">Collection</th>
215 <th class="ar-itemtype">Item type</th>
216 <th class="ar-callnumber">Call number</th>
217 <th class="ar-copynumber">Copy number</th>
218 <th class="ar-enumchron">Enumeration</th>
219 <th class="ar-barcode">Barcode</th>
220 <th class="ar-patron">Patron</th>
221 <th class="ar-date">Date</th>
222 <th class="ar-actions">Actions</th>
227 <tr class="ar-processing-none">
229 There are no article requests in processing at this time.
233 [% FOREACH ar IN article_requests_processing %]
234 <tr class="ar-row ar-processing">
235 <td><input type="checkbox" reqid="[% ar.id | html %]"/></td>
236 <td class="ar-title">
238 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% ar.biblionumber | uri %]">
239 [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %]
244 <div class="ar-biblionumber content_hidden">[% ar.biblionumber | html %]</div>
245 <div class="ar-author">[% ar.biblio.author | html %]</div>
246 <div class="ar-pubdata">
247 [% ar.biblio.biblioitem.publishercode | html %]
249 [% IF ar.biblio.biblioitem.publicationyear %]
250 [% ar.biblio.biblioitem.publicationyear | html %]
251 [% ELSIF ar.biblio.copyrightdate %]
252 [% ar.biblio.copyrightdate | html %]
255 [% IF ar.biblio.biblioitem.pages %]
256 : [% ar.biblio.biblioitem.pages | html %]
259 [% r.biblio.biblioitem.size | html %]
261 [% IF ar.biblio.biblioitem.isbn %]
262 ISBN: [% ar.biblio.biblioitem.isbn | html %]
267 <td class="ar-request">
268 [% IF ar.title %] <p><strong>Title:</strong> [% ar.title | html %] </p> [% END %]
269 [% IF ar.author %] <p><strong>Author:</strong> [% ar.author | html %] </p> [% END %]
270 [% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume | html %] </p> [% END %]
271 [% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue | html %] </p> [% END %]
272 [% IF ar.date %] <p><strong>Date:</strong> [% ar.date | html %] </p> [% END %]
273 [% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages | html %] </p> [% END %]
274 [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters | html %] </p> [% END %]
275 [% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes | html %] </p> [% END %]
277 <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) | html %]</td>
278 <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
279 <td class="ar-callnumber">
280 [% IF ar.item.location %]
281 <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) | html %]</em>
284 [% ar.item.itemcallnumber | html %]
286 <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
287 <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
288 <td class="ar-barcode">[% ar.item.barcode | html %]</td>
289 <td class="ar-patron">
291 <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
292 [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %])
296 <p>[% ar.borrower.phone | html %]</p>
298 <td class="ar-date"><span title="[% ar.created_on | html %]">[% ar.created_on | $KohaDates %]</span></td>
299 <td class="ar-actions">
300 <div class="dropdown">
301 [% PROCESS actions menuid="table_" _ ar.id id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %]
315 [% MACRO jsinclude BLOCK %]
317 var active_table = "#article-requests-pending";
318 var last_cancel_reason;
319 $(document).ready(function() {
320 $('#article-request-tabs').tabs({
321 activate: function( activate_event, activate_ui ) {
322 active_table = activate_ui.newPanel.selector;
323 activateBatchActions( active_table );
325 create: function( create_event, create_ui ){
326 active_table = create_ui.panel.selector;
330 activateBatchActions( active_table );
332 [% IF article_requests_pending.count %]
333 $(".ar-pending-none").hide();
336 [% IF article_requests_processing.count %]
337 $(".ar-processing-none").hide();
340 $( "input:checkbox", active_table ).on("change", function(){
341 activateBatchActions( active_table );
344 $(".SelectAll").on("click", function(e) {
346 $( active_table + " input[type='checkbox']").prop('checked', true);
347 activateBatchActions( active_table );
349 $(".ClearAll").on("click", function(e) {
351 $( active_table + " input[type='checkbox']").prop('checked', false);
352 activateBatchActions( active_table );
354 $("a.ar-actions").on('click', function(e) {
355 // Hide menu option ?
356 if( $('#article-requests-processing-table').is(":visible") )
357 $('a.ar-process-request').hide();
358 else $('a.ar-process-request').show();
362 function activateBatchActions( active_table ){
363 // Check to see whether batch menu should be shown based on state of checkboxes
364 if ( $( "input:checkbox", active_table ).length > 0 ) {
365 // There are rows with checkboxes
366 $( "[class$='_table_controls']", active_table ).show();
367 if ( $( "input:checkbox:checked", active_table ).length > 0 ) {
368 $( "[id^='article-menu-']", active_table ).css("display","inline-block");
370 $( "[id^='article-menu-']", active_table ).hide();
373 // All rows have been removed
374 $("[class$='_table_controls']", active_table ).hide();
378 function HandleMulti( fnHandler, id, a ) {
379 last_cancel_reason = undefined;
380 if( id !== 0 ) { fnHandler( id, a ); return; }
381 $( active_table + " input[type='checkbox']:checked").each(function() {
382 fnHandler( $(this).attr('reqid'), $(this).closest('tr').find('td.ar-actions div a') );
386 function PrintSlip(id, a) {
387 var link = 'article-request-slip.pl?id='+id;
388 window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
391 function Cancel( id, a ) {
392 // last_cancel_reason: undefined means 'prompt for new reason'
393 // a null value indicates that prompt was cancelled
394 if( last_cancel_reason === undefined ) last_cancel_reason = prompt(_("Please specify the reason for cancelling selected item(s):"));
395 if ( last_cancel_reason === null ) {
399 a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif"/>').find('div.dropdown').hide();
402 url: '/cgi-bin/koha/svc/article_request',
406 notes: last_cancel_reason
408 success: function( data ) {
409 a.closest('tr').remove();
411 activateBatchActions( active_table );
417 function Process( id, a ) {
418 var table_row = a.closest('tr').clone();
419 table_row.find('.ar-process-request').remove();
420 table_row.find('input[type="checkbox"]').prop('checked', false);
422 a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif"/>').find('div.dropdown').hide();
425 url: '/cgi-bin/koha/svc/article_request',
430 success: function( data ) {
431 a.closest('tr').remove();
432 $("#article-requests-processing-table").append( table_row );
433 $("#article-requests-processing-table .ar-processing-none").hide();
435 activateBatchActions( active_table );
441 function Complete( id, a ) {
442 a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif"/>').find('div.dropdown').hide();
445 url: '/cgi-bin/koha/svc/article_request',
450 success: function( data ) {
451 a.closest('tr').remove();
453 activateBatchActions( active_table );
459 function UpdateTabCounts() {
460 var pending_count = $('#article-requests-pending-table tbody tr.ar-row').length;
461 $("#ar_pending_count").html( pending_count );
462 if ( pending_count == 0 ) $(".ar-pending-none").show();
464 var processing_count = $('#article-requests-processing-table tbody tr.ar-row').length;
465 $("#ar_processing_count").html( processing_count );
466 if ( processing_count == 0 ) $(".ar-processing-none").show();
471 [% INCLUDE 'intranet-bottom.inc' %]