4 [% USE AuthorisedValues %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Article requests › Circulation › Koha</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 <style>p { margin-top: 0; } [id^="article-menu-"] { display: none; } [id^="article-menu-"]:before { content: "|"; } .starthidden { display:none; }</style>
15 <div id="[% menuid | html %]" class="btn-group dropup">
17 <a class="btn btn-default btn-xs dropdown-toggle ar-actions" role="button" data-toggle="dropdown" href="#">
18 Actions <b class="caret"></b>
21 <ul class="dropdown-menu [% pull_right | html %]" role="menu" aria-labelledby="[% aria_menu | html %]">
23 <a class="ar-set-pending-request" href="#" onclick="HandleMulti( SetPending, [% id_arg | html %], $(this) ); return false;">
24 <i class="fa fa-bars"></i>
25 Set request as pending
28 <a class="ar-process-request" href="#" onclick="HandleMulti( Process, [% id_arg | html %], $(this) ); return false;">
29 <i class="fa fa-cog"></i>
33 [% IF id_arg && format=='SCAN' %]
34 <a class="ar-edit-urls" href="#" onclick="HandleMulti( EditURLs, [% id_arg | html %], $(this) ); return false;">
35 <i class="fa fa-edit"></i>
40 <a class="ar-complete-request" href="#" onclick="HandleMulti( Complete, [% id_arg | html %], $(this) ); return false;">
41 <i class="fa fa-check-circle"></i>
45 <a class="ar-cancel-request" href="#" onclick="HandleMulti( Cancel, [% id_arg | html %], $(this) ); return false;">
46 <i class="fa fa-minus-circle"></i>
50 [% IF id_arg %][%# TODO: Does not work with multi-select %]
51 <a class="ar-print-request" href="#" onclick="HandleMulti( PrintSlip, [% id_arg | html %], $(this) ); return false;">
52 <i class="fa fa-print"></i>
61 [% BLOCK item_status %]
62 [% IF myitem.onloan %]<span>Checked out</span>
63 [% ELSIF myitem.holds({ found => ['W', 'T'] }).count > 0 %]<span>On hold</span>
64 [% ELSIF myitem.notforloan > 0 OR myitem.itemtype.notforloan %]<span>Not for loan</span>
65 [% ELSIF myitem.notforloan < 0 %]<span>On order</span>
68 [% BLOCK urls_modal %]
69 <div id="myModal" class="modal fade modal-lg" role="dialog">
70 <div class="modal-dialog">
71 <div class="modal-content">
72 <div class="modal-header">
73 <h4 class="modal-title">Edit URL(s)</h4>
75 <div class="modal-body">
76 <textarea id="urls" style="width:100%;"></textarea>
78 <div class="modal-footer">
79 <button type="button" class="btn btn-default" data-dismiss="modal">Save</button>
86 <body id="circ_article-requests" class="circ">
87 [% INCLUDE 'header.inc' %]
88 [% INCLUDE 'cat-search.inc' %]
91 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
94 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
97 <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
100 <a href="#" aria-current="page">Article requests</a>
105 <div class="main container-fluid starthidden">
107 <div class="col-md-10 col-md-offset-1 col-lg-10 col-lg-offset-1">
109 <h1>Article requests</h1>
110 [% PROCESS urls_modal %]
112 <form id="ar-branchcode-form" method="post">
113 <select name="branchcode" id="branchcode">
114 <option value="">All libraries</option>
115 [% FOREACH b IN Branches.all( only_from_group => 1 ) %]
116 [% IF b.branchcode == branchcode %]
117 <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
119 <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
123 <button type="submit" class="btn btn-default btn-xs">
124 <i class="fa fa-refresh"></i> Update
128 <div id="article-request-tabs" class="toptabs">
131 <a href="#article-requests-requested">
132 New (<span id="ar_requested_count">[% article_requests_requested.count | html %]</span>)
137 <a href="#article-requests-pending">
138 Pending (<span id="ar_pending_count">[% article_requests_pending.count | html %]</span>)
143 <a href="#article-requests-processing">
144 Processing (<span id="ar_processing_count">[% article_requests_processing.count | html %]</span>)
149 <div id="article-requests-requested">
150 <div class="article-requests-requested_table_controls">
151 <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>
152 [% PROCESS actions menuid='article-menu-requested' id_arg=0 pull_right='' aria_menu='table_controls' %]
155 <table id="article-requests-requested-table">
159 <th class="ar-title">Title</th>
160 <th class="ar-request">Requested article</th>
161 <th class="ar-collection">Collection</th>
162 <th class="ar-itemtype">Item type</th>
163 <th class="ar-callnumber">Call number</th>
164 <th class="ar-status">Status</th>
165 <th class="ar-copynumber">Copy number</th>
166 <th class="ar-enumchron">Enumeration</th>
167 <th class="ar-barcode">Barcode</th>
168 <th class="ar-format">Format</th>
169 <th class="ar-urls">URLs</th>
170 <th class="ar-patron">Patron</th>
171 <th class="ar-date">Date</th>
172 <th class="ar-actions noExport">Actions</th>
177 [% FOREACH ar IN article_requests_requested %]
178 <tr class="ar-row ar-requested">
179 <td><input type="checkbox" reqid="[% ar.id | html %]"/></td>
180 <td class="ar-title">
182 <a class="title" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% ar.biblionumber | uri %]">
183 [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %]
188 <div class="ar-biblionumber content_hidden">[% ar.biblionumber | html %]</div>
189 <div class="ar-author">[% ar.biblio.author | html %]</div>
190 <div class="ar-pubdata">
191 [% ar.biblio.biblioitem.publishercode | html %]
193 [% IF ar.biblio.biblioitem.publicationyear %]
194 [% ar.biblio.biblioitem.publicationyear | html %]
195 [% ELSIF ar.biblio.copyrightdate %]
196 [% ar.biblio.copyrightdate | html %]
199 [% IF ar.biblio.biblioitem.pages %]
200 : [% ar.biblio.biblioitem.pages | html %]
203 [% r.biblio.biblioitem.size | html %]
205 [% IF ar.biblio.biblioitem.isbn %]
206 ISBN: [% ar.biblio.biblioitem.isbn | html %]
211 <td class="ar-request">
212 [% IF ar.title %] <p><strong>Title:</strong> [% ar.title | html %] </p> [% END %]
213 [% IF ar.author %] <p><strong>Author:</strong> [% ar.author | html %] </p> [% END %]
214 [% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume | html %] </p> [% END %]
215 [% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue | html %] </p> [% END %]
216 [% IF ar.date %] <p><strong>Date:</strong> [% ar.date | html %] </p> [% END %]
217 [% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages | html %] </p> [% END %]
218 [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters | html %] </p> [% END %]
219 [% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes | html %] </p> [% END %]
221 <td class="ar-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %]</td>
222 <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
223 <td class="ar-callnumber">
224 [% IF ar.item.location %]
225 <em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %]</em>
228 [% ar.item.itemcallnumber | html %]
230 <td class="ar-status">[% PROCESS 'item_status' myitem = ar.item IF ar.item %]</td>
231 <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
232 <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
233 <td class="ar-barcode">[% ar.item.barcode | html %]</td>
234 <td class="ar-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
235 <td class="ar-urls">[% IF ar.format == 'SCAN' %]<span id="url_yesno_[% ar.id | html %]">[% IF ar.urls %]Yes[% ELSE %]No[% END%]</span><span id="url_[% ar.id | html %]" style="display:none;">[% ar.urls | url %]</span>[% END %]</td>
236 <td class="ar-patron">
238 <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
239 [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %])
243 <p>[% ar.borrower.phone | html %]</p>
245 <td class="ar-date"><span title="[% ar.created_on | html %]">[% ar.created_on | $KohaDates %]</span></td>
246 <td class="ar-actions">
247 [% PROCESS actions menuid = "row" _ ar.id id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %]
255 <div id="article-requests-pending">
256 <div class="article-requests-pending_table_controls">
257 <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>
258 [% PROCESS actions menuid='article-menu-pending' id_arg=0 pull_right='' aria_menu='table_controls' %]
261 <table id="article-requests-pending-table">
265 <th class="ar-title">Title</th>
266 <th class="ar-request">Requested article</th>
267 <th class="ar-collection">Collection</th>
268 <th class="ar-itemtype">Item type</th>
269 <th class="ar-callnumber">Call number</th>
270 <th class="ar-status">Status</th>
271 <th class="ar-copynumber">Copy number</th>
272 <th class="ar-enumchron">Enumeration</th>
273 <th class="ar-barcode">Barcode</th>
274 <th class="ar-format">Format</th>
275 <th class="ar-urls">URLs</th>
276 <th class="ar-patron">Patron</th>
277 <th class="ar-date">Date</th>
278 <th class="ar-actions noExport">Actions</th>
283 [% FOREACH ar IN article_requests_pending %]
284 <tr class="ar-row ar-pending">
285 <td><input type="checkbox" reqid="[% ar.id | html %]"/></td>
286 <td class="ar-title">
288 <a class="title" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% ar.biblionumber | uri %]">
289 [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %]
294 <div class="ar-biblionumber content_hidden">[% ar.biblionumber | html %]</div>
295 <div class="ar-author">[% ar.biblio.author | html %]</div>
296 <div class="ar-pubdata">
297 [% ar.biblio.biblioitem.publishercode | html %]
299 [% IF ar.biblio.biblioitem.publicationyear %]
300 [% ar.biblio.biblioitem.publicationyear | html %]
301 [% ELSIF ar.biblio.copyrightdate %]
302 [% ar.biblio.copyrightdate | html %]
305 [% IF ar.biblio.biblioitem.pages %]
306 : [% ar.biblio.biblioitem.pages | html %]
309 [% r.biblio.biblioitem.size | html %]
311 [% IF ar.biblio.biblioitem.isbn %]
312 ISBN: [% ar.biblio.biblioitem.isbn | html %]
317 <td class="ar-request">
318 [% IF ar.title %] <p><strong>Title:</strong> [% ar.title | html %] </p> [% END %]
319 [% IF ar.author %] <p><strong>Author:</strong> [% ar.author | html %] </p> [% END %]
320 [% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume | html %] </p> [% END %]
321 [% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue | html %] </p> [% END %]
322 [% IF ar.date %] <p><strong>Date:</strong> [% ar.date | html %] </p> [% END %]
323 [% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages | html %] </p> [% END %]
324 [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters | html %] </p> [% END %]
325 [% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes | html %] </p> [% END %]
327 <td class="ar-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %]</td>
328 <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
329 <td class="ar-callnumber">
330 [% IF ar.item.location %]
331 <em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %]</em>
334 [% ar.item.itemcallnumber | html %]
336 <td class="ar-status">[% PROCESS 'item_status' myitem = ar.item IF ar.item %]</td>
337 <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
338 <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
339 <td class="ar-barcode">[% ar.item.barcode | html %]</td>
340 <td class="ar-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
341 <td class="ar-urls">[% IF ar.format == 'SCAN' %]<span id="url_yesno_[% ar.id | html %]">[% IF ar.urls %]Yes[% ELSE %]No[% END%]</span><span id="url_[% ar.id | html %]" style="display:none;">[% ar.urls | url %]</span>[% END %]</td>
342 <td class="ar-patron">
344 <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
345 [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %])
349 <p>[% ar.borrower.phone | html %]</p>
351 <td class="ar-date" data-order="[% ar.created_on | html %]">[% ar.created_on | $KohaDates %]</td>
352 <td class="ar-actions">
353 [% PROCESS actions menuid = "row" _ ar.id id_arg=ar.id format=ar.format pull_right='pull-right' aria_menu='ar-actions' %]
361 <div id="article-requests-processing">
362 <div class="article-requests-processing_table_controls">
363 <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>
364 [% PROCESS actions menuid='article-menu-processing' id_arg=0 pull_right='' aria_menu='table_controls' %]
366 <table id="article-requests-processing-table">
370 <th class="ar-title">Title</th>
371 <th class="ar-request">Requested article</th>
372 <th class="ar-collection">Collection</th>
373 <th class="ar-itemtype">Item type</th>
374 <th class="ar-callnumber">Call number</th>
375 <th class="ar-status">Status</th>
376 <th class="ar-copynumber">Copy number</th>
377 <th class="ar-enumchron">Enumeration</th>
378 <th class="ar-barcode">Barcode</th>
379 <th class="ar-format">Format</th>
380 <th class="ar-urls">URLs</th>
381 <th class="ar-patron">Patron</th>
382 <th class="ar-date">Date</th>
383 <th class="ar-actions noExport">Actions</th>
388 [% FOREACH ar IN article_requests_processing %]
389 <tr class="ar-row ar-processing">
390 <td><input type="checkbox" reqid="[% ar.id | html %]"/></td>
391 <td class="ar-title">
393 [% INCLUDE 'biblio-title.inc' biblio=ar.biblio link = 1%]
397 <div class="ar-biblionumber content_hidden">[% ar.biblionumber | html %]</div>
398 <div class="ar-author">[% ar.biblio.author | html %]</div>
399 <div class="ar-pubdata">
400 [% ar.biblio.biblioitem.publishercode | html %]
402 [% IF ar.biblio.biblioitem.publicationyear %]
403 [% ar.biblio.biblioitem.publicationyear | html %]
404 [% ELSIF ar.biblio.copyrightdate %]
405 [% ar.biblio.copyrightdate | html %]
408 [% IF ar.biblio.biblioitem.pages %]
409 : [% ar.biblio.biblioitem.pages | html %]
412 [% r.biblio.biblioitem.size | html %]
414 [% IF ar.biblio.biblioitem.isbn %]
415 ISBN: [% ar.biblio.biblioitem.isbn | html %]
420 <td class="ar-request">
421 [% IF ar.title %] <p><strong>Title:</strong> [% ar.title | html %] </p> [% END %]
422 [% IF ar.author %] <p><strong>Author:</strong> [% ar.author | html %] </p> [% END %]
423 [% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume | html %] </p> [% END %]
424 [% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue | html %] </p> [% END %]
425 [% IF ar.date %] <p><strong>Date:</strong> [% ar.date | html %] </p> [% END %]
426 [% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages | html %] </p> [% END %]
427 [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters | html %] </p> [% END %]
428 [% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes | html %] </p> [% END %]
430 <td class="ar-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %]</td>
431 <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
432 <td class="ar-callnumber">
433 [% IF ar.item.location %]
434 <em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %]</em>
437 [% ar.item.itemcallnumber | html %]
439 <td class="ar-status">[% PROCESS 'item_status' myitem = ar.item IF ar.item %]</td>
440 <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
441 <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
442 <td class="ar-barcode">[% ar.item.barcode | html %]</td>
443 <td class="ar-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
444 <td class="ar-urls">[% IF ar.format == 'SCAN' %]<span id="url_yesno_[% ar.id | html %]">[% IF ar.urls %]Yes[% ELSE %]No[% END%]</span><span id="url_[% ar.id | html %]" style="display:none;">[% ar.urls | url %]</span>[% END %]</td>
445 <td class="ar-patron">
447 <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
448 [% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %])
452 <p>[% ar.borrower.phone | html %]</p>
454 <td class="ar-date" data-order="[% ar.created_on | html %]">[% ar.created_on | $KohaDates %]</td>
455 <td class="ar-actions">
456 [% PROCESS actions menuid="table_" _ ar.id id_arg=ar.id format=ar.format pull_right='pull-right' aria_menu='ar-actions' %]
469 [% MACRO jsinclude BLOCK %]
470 [% INCLUDE 'datatables.inc' %]
472 var active_tab = "#article-requests-requested";
473 var last_cancel_reason, requested_datatable, pending_datatable, processing_datatable, active_datatable;
474 $(document).ready(function() {
475 $('#article-request-tabs').tabs({
476 activate: function( activate_event, activate_ui ) {
477 active_tab = activate_ui.newPanel.selector;
478 if( active_tab == '#article-requests-requested' )
479 active_datatable = requested_datatable;
480 else if( active_tab == '#article-requests-pending' )
481 active_datatable = pending_datatable;
482 else active_datatable = processing_datatable;
483 activateBatchActions( active_tab );
488 $( "input:checkbox, #article-request-tabs" ).on("change", function(){
489 activateBatchActions( active_tab );
492 $(".SelectAll").on("click", function(e) {
494 $( active_tab + " input[type='checkbox']").prop('checked', true);
495 activateBatchActions( active_tab );
497 $(".ClearAll").on("click", function(e) {
499 $( active_tab + " input[type='checkbox']").prop('checked', false);
500 activateBatchActions( active_tab );
502 $("a.ar-actions").on('click', function(e) {
503 // Hide menu option ?
504 if( $('#article-requests-requested-table:visible,#article-requests-pending-table:visible').length )
505 $('a.ar-process-request').show();
506 else $('a.ar-process-request').hide();
508 if( $('#article-requests-requested-table').is(":visible") )
509 $('a.ar-set-pending-request').show();
510 else $('a.ar-set-pending-request').hide();
513 $('#myModal').on("shown.bs.modal", function () {
514 $('#myModal textarea').focus();
516 $('#myModal').on("hidden.bs.modal", function () {
517 // Set focus back to dropdown
518 var id = $('#myModal textarea').attr('ar_id');
519 var link = $('span#url_'+ id).parent().parent().find('td.ar-actions').find('div.dropdown a');
520 if( link.length > 0 ) link[0].focus();
522 $( '#myModal button' ).on("click", function () {
523 SaveURLs( $('#myModal textarea').val() );
526 requested_datatable = $("#article-requests-requested-table").DataTable($.extend(true, {}, dataTablesDefaults, {
528 { "aTargets": [0, -1], "bSortable": false, "bSearchable": false },
532 pending_datatable = $("#article-requests-pending-table").DataTable($.extend(true, {}, dataTablesDefaults, {
534 { "aTargets": [0, -1], "bSortable": false, "bSearchable": false },
537 processing_datatable = $("#article-requests-processing-table").DataTable($.extend(true, {}, dataTablesDefaults, {
539 { "aTargets": [0, -1], "bSortable": false, "bSearchable": false },
542 active_datatable = requested_datatable;
543 activateBatchActions( active_tab );
544 $(".starthidden").show();
547 function activateBatchActions( active_tab ){
548 // Check to see whether batch menu should be shown based on state of checkboxes
549 if ( $( "input:checkbox", active_tab ).length > 0 ) {
550 // There are rows with checkboxes
551 $( "[class$='_table_controls']", active_tab ).show();
552 if ( $( "input:checkbox:checked", active_tab ).length > 0 ) {
553 $( "[id^='article-menu-']", active_tab ).css("display","inline-block");
555 $( "[id^='article-menu-']", active_tab ).hide();
558 // All rows have been removed
559 $("[class$='_table_controls']", active_tab ).hide();
563 function HandleMulti( fnHandler, id, a ) {
564 last_cancel_reason = undefined;
565 if( id !== 0 ) { fnHandler( id, a ); return; }
566 $( active_tab + " input[type='checkbox']:checked").each(function() {
567 fnHandler( $(this).attr('reqid'), $(this).closest('tr').find('td.ar-actions div a') );
571 function PrintSlip(id, a) {
572 var link = 'article-request-slip.pl?id='+id;
573 window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
576 function Cancel( id, a ) {
577 // last_cancel_reason: undefined means 'prompt for new reason'
578 // a null value indicates that prompt was cancelled
579 if( last_cancel_reason === undefined ) last_cancel_reason = prompt(_("Please specify the reason for cancelling selected item(s):"));
580 if ( last_cancel_reason === null ) {
584 a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif"/>').find('div.dropdown').hide();
587 url: '/cgi-bin/koha/svc/article_request',
591 notes: last_cancel_reason
593 success: function( data ) {
594 active_datatable.row( a.closest('tr') ).remove().draw();
596 activateBatchActions( active_tab );
602 function SetPending( id, a ) {
603 var table_row = a.closest('tr');
604 table_row.find('.ar-set-pending-request').remove();
605 table_row.find('input[type="checkbox"]').prop('checked', false);
606 a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" class="spinner"/>').find('div.dropdown').hide();
609 url: '/cgi-bin/koha/svc/article_request',
614 success: function( data ) {
615 $("img.spinner").remove();
616 requested_datatable.row( table_row ).remove().draw();
617 pending_datatable.row.add( table_row ).draw();
619 activateBatchActions( active_tab );
625 function Process( id, a ) {
626 var table_row = a.closest('tr');
627 var table = a.closest('table');
628 var orig_datatable = table.attr('id')==='article-requests-pending-table'?pending_datatable:requested_datatable;
629 table_row.find('.ar-process-request').remove();
630 table_row.find('input[type="checkbox"]').prop('checked', false);
632 a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" class="spinner"/>').find('div.dropdown').hide();
635 url: '/cgi-bin/koha/svc/article_request',
640 success: function( data ) {
641 $("img.spinner").remove();
642 orig_datatable.row( table_row ).remove().draw();
643 processing_datatable.row.add( table_row ).draw();
645 activateBatchActions( active_tab );
651 function Complete( id, a ) {
652 // if it is a scan, check if urls field is filled
653 var urlspan = $('span#url_'+id);
654 if( urlspan.length>0 && urlspan.text() === '' ) {
655 alert( _("Please fill URL before completing request.") );
658 a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif"/>').find('div.dropdown').hide();
661 url: '/cgi-bin/koha/svc/article_request',
666 success: function( data ) {
667 active_datatable.row( a.closest('tr') ).remove().draw();
669 activateBatchActions( active_tab );
675 function UpdateTabCounts() {
676 $("#ar_requested_count").html( requested_datatable.rows().count() );
677 $("#ar_pending_count").html( pending_datatable.rows().count() );
678 $("#ar_processing_count").html( processing_datatable.rows().count() );
681 function EditURLs(id) {
682 var urls = $('span#url_'+ id).text();
683 $('#myModal textarea').val(urls);
684 $('#myModal textarea').attr('ar_id', id);
685 $('#myModal').modal('show');
688 function SaveURLs(newurl) {
689 var id = $('#myModal textarea').attr('ar_id');
690 $('span#url_'+ id).text(newurl);
692 $('span#url_yesno_'+id).text(_("Yes"));
694 $('span#url_yesno_'+id).text(_("No"));
698 url: '/cgi-bin/koha/svc/article_request',
699 data: { action: 'update_urls', id: id, urls: newurl },
701 error: function() { alert('Error: Saving URL failed!'); },
702 success: function(data) { if(!data.success) alert('Saving URL failed!'); },
708 [% INCLUDE 'intranet-bottom.inc' %]