|
Lines 19-24
Link Here
|
| 19 |
|
19 |
|
| 20 |
<ul class="dropdown-menu [% pull_right | html %]" role="menu" aria-labelledby="[% aria_menu | html %]"> |
20 |
<ul class="dropdown-menu [% pull_right | html %]" role="menu" aria-labelledby="[% aria_menu | html %]"> |
| 21 |
<li> |
21 |
<li> |
|
|
22 |
<a class="ar-open-request" href="#" onclick="HandleMulti( Open, [% id_arg | html %], $(this) ); return false;"> |
| 23 |
<i class="fa fa-bars"></i> |
| 24 |
Set request as pending |
| 25 |
</a> |
| 26 |
|
| 22 |
<a class="ar-process-request" href="#" onclick="HandleMulti( Process, [% id_arg | html %], $(this) ); return false;"> |
27 |
<a class="ar-process-request" href="#" onclick="HandleMulti( Process, [% id_arg | html %], $(this) ); return false;"> |
| 23 |
<i class="fa fa-cog"></i> |
28 |
<i class="fa fa-cog"></i> |
| 24 |
Process request |
29 |
Process request |
|
Lines 88-93
Link Here
|
| 88 |
|
93 |
|
| 89 |
<div id="article-request-tabs" class="toptabs"> |
94 |
<div id="article-request-tabs" class="toptabs"> |
| 90 |
<ul> |
95 |
<ul> |
|
|
96 |
<li> |
| 97 |
<a href="#article-requests-requested"> |
| 98 |
Requested (<span id="ar_requested_count">[% article_requests_requested.count | html %]</span>) |
| 99 |
</a> |
| 100 |
</li> |
| 101 |
|
| 91 |
<li> |
102 |
<li> |
| 92 |
<a href="#article-requests-pending"> |
103 |
<a href="#article-requests-pending"> |
| 93 |
Pending (<span id="ar_pending_count">[% article_requests_pending.count | html %]</span>) |
104 |
Pending (<span id="ar_pending_count">[% article_requests_pending.count | html %]</span>) |
|
Lines 101-106
Link Here
|
| 101 |
</li> |
112 |
</li> |
| 102 |
</ul> |
113 |
</ul> |
| 103 |
|
114 |
|
|
|
115 |
<div id="article-requests-requested"> |
| 116 |
<div class="article-requests-requested_table_controls"> |
| 117 |
<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> |
| 118 |
[% PROCESS actions menuid='article-menu-requested' id_arg=0 pull_right='' aria_menu='table_controls' %] |
| 119 |
</div> |
| 120 |
|
| 121 |
<table id="article-requests-requested-table"> |
| 122 |
<thead> |
| 123 |
<tr> |
| 124 |
<th/> |
| 125 |
<th class="ar-title">Title</th> |
| 126 |
<th class="ar-request">Requested article</th> |
| 127 |
<th class="ar-collection">Collection</th> |
| 128 |
<th class="ar-itemtype">Item type</th> |
| 129 |
<th class="ar-callnumber">Call number</th> |
| 130 |
<th class="ar-status">Status</th> |
| 131 |
<th class="ar-copynumber">Copy number</th> |
| 132 |
<th class="ar-enumchron">Enumeration</th> |
| 133 |
<th class="ar-barcode">Barcode</th> |
| 134 |
<th class="ar-patron">Patron</th> |
| 135 |
<th class="ar-date">Date</th> |
| 136 |
<th class="ar-actions noExport">Actions</th> |
| 137 |
</tr> |
| 138 |
</thead> |
| 139 |
|
| 140 |
<tbody> |
| 141 |
[% FOREACH ar IN article_requests_requested %] |
| 142 |
<tr class="ar-row ar-requested"> |
| 143 |
<td><input type="checkbox" reqid="[% ar.id | html %]"/></td> |
| 144 |
<td class="ar-title"> |
| 145 |
<p> |
| 146 |
<a class="title" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% ar.biblionumber | uri %]"> |
| 147 |
[% INCLUDE 'biblio-title.inc' biblio=ar.biblio %] |
| 148 |
</a> |
| 149 |
</p> |
| 150 |
|
| 151 |
<p> |
| 152 |
<div class="ar-biblionumber content_hidden">[% ar.biblionumber | html %]</div> |
| 153 |
<div class="ar-author">[% ar.biblio.author | html %]</div> |
| 154 |
<div class="ar-pubdata"> |
| 155 |
[% ar.biblio.biblioitem.publishercode | html %] |
| 156 |
|
| 157 |
[% IF ar.biblio.biblioitem.publicationyear %] |
| 158 |
[% ar.biblio.biblioitem.publicationyear | html %] |
| 159 |
[% ELSIF ar.biblio.copyrightdate %] |
| 160 |
[% ar.biblio.copyrightdate | html %] |
| 161 |
[% END %] |
| 162 |
|
| 163 |
[% IF ar.biblio.biblioitem.pages %] |
| 164 |
: [% ar.biblio.biblioitem.pages | html %] |
| 165 |
[% END %] |
| 166 |
|
| 167 |
[% r.biblio.biblioitem.size | html %] |
| 168 |
|
| 169 |
[% IF ar.biblio.biblioitem.isbn %] |
| 170 |
ISBN: [% ar.biblio.biblioitem.isbn | html %] |
| 171 |
[% END %] |
| 172 |
</div> |
| 173 |
</p> |
| 174 |
</td> |
| 175 |
<td class="ar-request"> |
| 176 |
[% IF ar.title %] <p><strong>Title:</strong> [% ar.title | html %] </p> [% END %] |
| 177 |
[% IF ar.author %] <p><strong>Author:</strong> [% ar.author | html %] </p> [% END %] |
| 178 |
[% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume | html %] </p> [% END %] |
| 179 |
[% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue | html %] </p> [% END %] |
| 180 |
[% IF ar.date %] <p><strong>Date:</strong> [% ar.date | html %] </p> [% END %] |
| 181 |
[% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages | html %] </p> [% END %] |
| 182 |
[% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters | html %] </p> [% END %] |
| 183 |
[% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes | html %] </p> [% END %] |
| 184 |
</td> |
| 185 |
<td class="ar-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %]</td> |
| 186 |
<td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td> |
| 187 |
<td class="ar-callnumber"> |
| 188 |
[% IF ar.item.location %] |
| 189 |
<em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %]</em> |
| 190 |
[% END %] |
| 191 |
|
| 192 |
[% ar.item.itemcallnumber | html %] |
| 193 |
</td> |
| 194 |
<td class="ar-status">[% PROCESS 'item_status' myitem = ar.item IF ar.item %]</td> |
| 195 |
<td class="ar-copynumber">[% ar.item.copynumber | html %]</td> |
| 196 |
<td class="ar-enumchron">[% ar.item.enumchron | html %]</td> |
| 197 |
<td class="ar-barcode">[% ar.item.barcode | html %]</td> |
| 198 |
<td class="ar-patron"> |
| 199 |
<p> |
| 200 |
<a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]"> |
| 201 |
[% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %]) |
| 202 |
</a> |
| 203 |
</p> |
| 204 |
|
| 205 |
<p>[% ar.borrower.phone | html %]</p> |
| 206 |
</td> |
| 207 |
<td class="ar-date"><span title="[% ar.created_on | html %]">[% ar.created_on | $KohaDates %]</span></td> |
| 208 |
<td class="ar-actions"> |
| 209 |
[% PROCESS actions menuid = "row" _ ar.id id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %] |
| 210 |
</td> |
| 211 |
</tr> |
| 212 |
[% END %] |
| 213 |
</tbody> |
| 214 |
</table> |
| 215 |
</div> |
| 216 |
|
| 104 |
<div id="article-requests-pending"> |
217 |
<div id="article-requests-pending"> |
| 105 |
<div class="article-requests-pending_table_controls"> |
218 |
<div class="article-requests-pending_table_controls"> |
| 106 |
<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> |
219 |
<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> |
|
Lines 310-322
Link Here
|
| 310 |
[% MACRO jsinclude BLOCK %] |
423 |
[% MACRO jsinclude BLOCK %] |
| 311 |
[% INCLUDE 'datatables.inc' %] |
424 |
[% INCLUDE 'datatables.inc' %] |
| 312 |
<script> |
425 |
<script> |
| 313 |
var active_tab = "#article-requests-pending"; |
426 |
var active_tab = "#article-requests-requested"; |
| 314 |
var last_cancel_reason, pending_datatable, processing_datatable, active_datatable; |
427 |
var last_cancel_reason, requested_datatable, pending_datatable, processing_datatable, active_datatable; |
| 315 |
$(document).ready(function() { |
428 |
$(document).ready(function() { |
| 316 |
$('#article-request-tabs').tabs({ |
429 |
$('#article-request-tabs').tabs({ |
| 317 |
activate: function( activate_event, activate_ui ) { |
430 |
activate: function( activate_event, activate_ui ) { |
| 318 |
active_tab = activate_ui.newPanel.selector; |
431 |
active_tab = activate_ui.newPanel.selector; |
| 319 |
if( active_tab == '#article-requests-pending' ) |
432 |
if( active_tab == '#article-requests-requested' ) |
|
|
433 |
active_datatable = requested_datatable; |
| 434 |
else if( active_tab == '#article-requests-pending' ) |
| 320 |
active_datatable = pending_datatable; |
435 |
active_datatable = pending_datatable; |
| 321 |
else active_datatable = processing_datatable; |
436 |
else active_datatable = processing_datatable; |
| 322 |
activateBatchActions( active_tab ); |
437 |
activateBatchActions( active_tab ); |
|
Lines 340-361
Link Here
|
| 340 |
}); |
455 |
}); |
| 341 |
$("a.ar-actions").on('click', function(e) { |
456 |
$("a.ar-actions").on('click', function(e) { |
| 342 |
// Hide menu option ? |
457 |
// Hide menu option ? |
| 343 |
if( $('#article-requests-processing-table').is(":visible") ) |
458 |
if( $('#article-requests-pending-table').is(":visible") ) |
| 344 |
$('a.ar-process-request').hide(); |
459 |
$('a.ar-process-request').show(); |
| 345 |
else $('a.ar-process-request').show(); |
460 |
else $('a.ar-process-request').hide(); |
|
|
461 |
|
| 462 |
if( $('#article-requests-requested-table').is(":visible") ) |
| 463 |
$('a.ar-open-request').show(); |
| 464 |
else $('a.ar-open-request').hide(); |
| 346 |
}); |
465 |
}); |
| 347 |
|
466 |
|
|
|
467 |
requested_datatable = $("#article-requests-requested-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
| 468 |
"aoColumnDefs": [ |
| 469 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
| 470 |
], |
| 471 |
})); |
| 348 |
pending_datatable = $("#article-requests-pending-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
472 |
pending_datatable = $("#article-requests-pending-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
| 349 |
"aoColumnDefs": [ |
473 |
"aoColumnDefs": [ |
| 350 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
474 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
| 351 |
], |
475 |
], |
| 352 |
})); |
476 |
})); |
| 353 |
active_datatable = pending_datatable; |
|
|
| 354 |
processing_datatable = $("#article-requests-processing-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
477 |
processing_datatable = $("#article-requests-processing-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
| 355 |
"aoColumnDefs": [ |
478 |
"aoColumnDefs": [ |
| 356 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
479 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
| 357 |
], |
480 |
], |
| 358 |
})); |
481 |
})); |
|
|
482 |
active_datatable = requested_datatable; |
| 359 |
activateBatchActions( active_tab ); |
483 |
activateBatchActions( active_tab ); |
| 360 |
$(".starthidden").show(); |
484 |
$(".starthidden").show(); |
| 361 |
}); |
485 |
}); |
|
Lines 415-420
Link Here
|
| 415 |
}); |
539 |
}); |
| 416 |
} |
540 |
} |
| 417 |
|
541 |
|
|
|
542 |
function Open( id, a ) { |
| 543 |
var table_row = a.closest('tr'); |
| 544 |
table_row.find('.ar-open-request').remove(); |
| 545 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
| 546 |
a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" class="spinner"/>').find('div.dropdown').hide(); |
| 547 |
$.ajax({ |
| 548 |
type: "POST", |
| 549 |
url: '/cgi-bin/koha/svc/article_request', |
| 550 |
data: { |
| 551 |
action: 'open', |
| 552 |
id: id, |
| 553 |
}, |
| 554 |
success: function( data ) { |
| 555 |
$("img.spinner").remove(); |
| 556 |
requested_datatable.row( table_row ).remove().draw(); |
| 557 |
pending_datatable.row.add( table_row ).draw(); |
| 558 |
UpdateTabCounts(); |
| 559 |
activateBatchActions( active_tab ); |
| 560 |
}, |
| 561 |
dataType: 'json' |
| 562 |
}); |
| 563 |
} |
| 564 |
|
| 418 |
function Process( id, a ) { |
565 |
function Process( id, a ) { |
| 419 |
var table_row = a.closest('tr'); |
566 |
var table_row = a.closest('tr'); |
| 420 |
table_row.find('.ar-process-request').remove(); |
567 |
table_row.find('.ar-process-request').remove(); |
|
Lines 458-463
Link Here
|
| 458 |
} |
605 |
} |
| 459 |
|
606 |
|
| 460 |
function UpdateTabCounts() { |
607 |
function UpdateTabCounts() { |
|
|
608 |
$("#ar_requested_count").html( requested_datatable.rows().count() ); |
| 461 |
$("#ar_pending_count").html( pending_datatable.rows().count() ); |
609 |
$("#ar_pending_count").html( pending_datatable.rows().count() ); |
| 462 |
$("#ar_processing_count").html( processing_datatable.rows().count() ); |
610 |
$("#ar_processing_count").html( processing_datatable.rows().count() ); |
| 463 |
} |
611 |
} |