|
Lines 523-528
Link Here
|
| 523 |
|
523 |
|
| 524 |
[% MACRO jsinclude BLOCK %] |
524 |
[% MACRO jsinclude BLOCK %] |
| 525 |
[% INCLUDE 'datatables.inc' %] |
525 |
[% INCLUDE 'datatables.inc' %] |
|
|
526 |
<script> |
| 527 |
let requested_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'article-requests', 'article-requests-requested-table', 'json' ) | $raw %] |
| 528 |
let pending_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'article-requests', 'article-requests-pending-table', 'json' ) | $raw %] |
| 529 |
let processing_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'article-requests', 'article-requests-processing-table', 'json' ) | $raw %] |
| 530 |
|
| 531 |
const interface = "[% interface | html %]"; |
| 532 |
const theme = "[% theme | html %]"; |
| 533 |
</script> |
| 534 |
|
| 526 |
<script> |
535 |
<script> |
| 527 |
var active_tab = "#article-requests-requested_panel"; |
536 |
var active_tab = "#article-requests-requested_panel"; |
| 528 |
var last_cancel_reason, requested_datatable, pending_datatable, processing_datatable, active_datatable, requested_dt, pending_dt, processing_dt; |
537 |
var last_cancel_reason, requested_datatable, pending_datatable, processing_datatable, active_datatable, requested_dt, pending_dt, processing_dt; |
|
Lines 575-584
Link Here
|
| 575 |
if( link.length > 0 ) link[0].focus(); |
584 |
if( link.length > 0 ) link[0].focus(); |
| 576 |
}); |
585 |
}); |
| 577 |
|
586 |
|
| 578 |
let requested_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'article-requests', 'article-requests-requested-table', 'json' ) | $raw %] |
|
|
| 579 |
let pending_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'article-requests', 'article-requests-pending-table', 'json' ) | $raw %] |
| 580 |
let processing_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'article-requests', 'article-requests-processing-table', 'json' ) | $raw %] |
| 581 |
|
| 582 |
requested_datatable = $("#article-requests-requested-table").kohaTable({}, requested_table_settings); |
587 |
requested_datatable = $("#article-requests-requested-table").kohaTable({}, requested_table_settings); |
| 583 |
requested_dt = requested_datatable.DataTable(); |
588 |
requested_dt = requested_datatable.DataTable(); |
| 584 |
|
589 |
|
|
Lines 644-650
Link Here
|
| 644 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
649 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
| 645 |
|
650 |
|
| 646 |
|
651 |
|
| 647 |
a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif"/>').find('div.dropdown').hide(); |
652 |
a.closest('td').prepend('<img src="' + interface + '/' + theme + '/img/spinner-small.gif"/>').find('div.dropdown').hide(); |
| 648 |
$.ajax({ |
653 |
$.ajax({ |
| 649 |
type: "DELETE", |
654 |
type: "DELETE", |
| 650 |
url: '/api/v1/article_requests/'+id+query, |
655 |
url: '/api/v1/article_requests/'+id+query, |
|
Lines 686-692
Link Here
|
| 686 |
var table = a.closest('table'); |
691 |
var table = a.closest('table'); |
| 687 |
var orig_dt = table.attr('id')==='article-requests-pending-table'?pending_dt:requested_dt; |
692 |
var orig_dt = table.attr('id')==='article-requests-pending-table'?pending_dt:requested_dt; |
| 688 |
|
693 |
|
| 689 |
a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" class="spinner"/>').find('div.dropdown').hide(); |
694 |
a.closest('td').prepend('<img src="' + interface + '/' + theme + '/img/spinner-small.gif" class="spinner"/>').find('div.dropdown').hide(); |
| 690 |
|
695 |
|
| 691 |
const client = APIClient.article_request; |
696 |
const client = APIClient.article_request; |
| 692 |
await client.articleRequests.process(id).then( |
697 |
await client.articleRequests.process(id).then( |
|
Lines 716-722
Link Here
|
| 716 |
alert( _("Please fill URL before completing request.") ); |
721 |
alert( _("Please fill URL before completing request.") ); |
| 717 |
return; |
722 |
return; |
| 718 |
} |
723 |
} |
| 719 |
a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif"/>').find('div.dropdown').hide(); |
724 |
a.closest('td').prepend('<img src="' + interface + '/' + theme + '/img/spinner-small.gif"/>').find('div.dropdown').hide(); |
| 720 |
const client = APIClient.article_request; |
725 |
const client = APIClient.article_request; |
| 721 |
await client.articleRequests.complete(id).then( |
726 |
await client.articleRequests.complete(id).then( |
| 722 |
success => { |
727 |
success => { |
|
Lines 739-745
Link Here
|
| 739 |
var table_row = a.closest('tr'); |
744 |
var table_row = a.closest('tr'); |
| 740 |
table_row.find('.ar-set-pending-request').remove(); |
745 |
table_row.find('.ar-set-pending-request').remove(); |
| 741 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
746 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
| 742 |
a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" class="spinner"/>').find('div.dropdown').hide(); |
747 |
a.closest('td').prepend('<img src="' + interface + '/' + theme + '/img/spinner-small.gif" class="spinner"/>').find('div.dropdown').hide(); |
| 743 |
const client = APIClient.article_request; |
748 |
const client = APIClient.article_request; |
| 744 |
await client.articleRequests.pending(id).then( |
749 |
await client.articleRequests.pending(id).then( |
| 745 |
success => { |
750 |
success => { |
| 746 |
- |
|
|