|
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 73-79
Link Here
|
| 73 |
|
78 |
|
| 74 |
<div class="main container-fluid starthidden"> |
79 |
<div class="main container-fluid starthidden"> |
| 75 |
<div class="row"> |
80 |
<div class="row"> |
| 76 |
<div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2"> |
81 |
<div class="col-md-10 col-md-offset-1 col-lg-10 col-lg-offset-1"> |
| 77 |
|
82 |
|
| 78 |
<h1>Article requests</h1> |
83 |
<h1>Article requests</h1> |
| 79 |
|
84 |
|
|
Lines 95-100
Link Here
|
| 95 |
|
100 |
|
| 96 |
<div id="article-request-tabs" class="toptabs"> |
101 |
<div id="article-request-tabs" class="toptabs"> |
| 97 |
<ul> |
102 |
<ul> |
|
|
103 |
<li> |
| 104 |
<a href="#article-requests-requested"> |
| 105 |
New (<span id="ar_requested_count">[% article_requests_requested.count | html %]</span>) |
| 106 |
</a> |
| 107 |
</li> |
| 108 |
|
| 98 |
<li> |
109 |
<li> |
| 99 |
<a href="#article-requests-pending"> |
110 |
<a href="#article-requests-pending"> |
| 100 |
Pending (<span id="ar_pending_count">[% article_requests_pending.count | html %]</span>) |
111 |
Pending (<span id="ar_pending_count">[% article_requests_pending.count | html %]</span>) |
|
Lines 108-113
Link Here
|
| 108 |
</li> |
119 |
</li> |
| 109 |
</ul> |
120 |
</ul> |
| 110 |
|
121 |
|
|
|
122 |
<div id="article-requests-requested"> |
| 123 |
<div class="article-requests-requested_table_controls"> |
| 124 |
<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> |
| 125 |
[% PROCESS actions menuid='article-menu-requested' id_arg=0 pull_right='' aria_menu='table_controls' %] |
| 126 |
</div> |
| 127 |
|
| 128 |
<table id="article-requests-requested-table"> |
| 129 |
<thead> |
| 130 |
<tr> |
| 131 |
<th/> |
| 132 |
<th class="ar-title">Title</th> |
| 133 |
<th class="ar-request">Requested article</th> |
| 134 |
<th class="ar-collection">Collection</th> |
| 135 |
<th class="ar-itemtype">Item type</th> |
| 136 |
<th class="ar-callnumber">Call number</th> |
| 137 |
<th class="ar-status">Status</th> |
| 138 |
<th class="ar-copynumber">Copy number</th> |
| 139 |
<th class="ar-enumchron">Enumeration</th> |
| 140 |
<th class="ar-barcode">Barcode</th> |
| 141 |
<th class="ar-patron">Patron</th> |
| 142 |
<th class="ar-date">Date</th> |
| 143 |
<th class="ar-actions noExport">Actions</th> |
| 144 |
</tr> |
| 145 |
</thead> |
| 146 |
|
| 147 |
<tbody> |
| 148 |
[% FOREACH ar IN article_requests_requested %] |
| 149 |
<tr class="ar-row ar-requested"> |
| 150 |
<td><input type="checkbox" reqid="[% ar.id | html %]"/></td> |
| 151 |
<td class="ar-title"> |
| 152 |
<p> |
| 153 |
<a class="title" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% ar.biblionumber | uri %]"> |
| 154 |
[% INCLUDE 'biblio-title.inc' biblio=ar.biblio %] |
| 155 |
</a> |
| 156 |
</p> |
| 157 |
|
| 158 |
<p> |
| 159 |
<div class="ar-biblionumber content_hidden">[% ar.biblionumber | html %]</div> |
| 160 |
<div class="ar-author">[% ar.biblio.author | html %]</div> |
| 161 |
<div class="ar-pubdata"> |
| 162 |
[% ar.biblio.biblioitem.publishercode | html %] |
| 163 |
|
| 164 |
[% IF ar.biblio.biblioitem.publicationyear %] |
| 165 |
[% ar.biblio.biblioitem.publicationyear | html %] |
| 166 |
[% ELSIF ar.biblio.copyrightdate %] |
| 167 |
[% ar.biblio.copyrightdate | html %] |
| 168 |
[% END %] |
| 169 |
|
| 170 |
[% IF ar.biblio.biblioitem.pages %] |
| 171 |
: [% ar.biblio.biblioitem.pages | html %] |
| 172 |
[% END %] |
| 173 |
|
| 174 |
[% r.biblio.biblioitem.size | html %] |
| 175 |
|
| 176 |
[% IF ar.biblio.biblioitem.isbn %] |
| 177 |
ISBN: [% ar.biblio.biblioitem.isbn | html %] |
| 178 |
[% END %] |
| 179 |
</div> |
| 180 |
</p> |
| 181 |
</td> |
| 182 |
<td class="ar-request"> |
| 183 |
[% IF ar.title %] <p><strong>Title:</strong> [% ar.title | html %] </p> [% END %] |
| 184 |
[% IF ar.author %] <p><strong>Author:</strong> [% ar.author | html %] </p> [% END %] |
| 185 |
[% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume | html %] </p> [% END %] |
| 186 |
[% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue | html %] </p> [% END %] |
| 187 |
[% IF ar.date %] <p><strong>Date:</strong> [% ar.date | html %] </p> [% END %] |
| 188 |
[% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages | html %] </p> [% END %] |
| 189 |
[% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters | html %] </p> [% END %] |
| 190 |
[% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes | html %] </p> [% END %] |
| 191 |
</td> |
| 192 |
<td class="ar-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %]</td> |
| 193 |
<td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td> |
| 194 |
<td class="ar-callnumber"> |
| 195 |
[% IF ar.item.location %] |
| 196 |
<em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %]</em> |
| 197 |
[% END %] |
| 198 |
|
| 199 |
[% ar.item.itemcallnumber | html %] |
| 200 |
</td> |
| 201 |
<td class="ar-status">[% PROCESS 'item_status' myitem = ar.item IF ar.item %]</td> |
| 202 |
<td class="ar-copynumber">[% ar.item.copynumber | html %]</td> |
| 203 |
<td class="ar-enumchron">[% ar.item.enumchron | html %]</td> |
| 204 |
<td class="ar-barcode">[% ar.item.barcode | html %]</td> |
| 205 |
<td class="ar-patron"> |
| 206 |
<p> |
| 207 |
<a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]"> |
| 208 |
[% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %]) |
| 209 |
</a> |
| 210 |
</p> |
| 211 |
|
| 212 |
<p>[% ar.borrower.phone | html %]</p> |
| 213 |
</td> |
| 214 |
<td class="ar-date"><span title="[% ar.created_on | html %]">[% ar.created_on | $KohaDates %]</span></td> |
| 215 |
<td class="ar-actions"> |
| 216 |
[% PROCESS actions menuid = "row" _ ar.id id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %] |
| 217 |
</td> |
| 218 |
</tr> |
| 219 |
[% END %] |
| 220 |
</tbody> |
| 221 |
</table> |
| 222 |
</div> |
| 223 |
|
| 111 |
<div id="article-requests-pending"> |
224 |
<div id="article-requests-pending"> |
| 112 |
<div class="article-requests-pending_table_controls"> |
225 |
<div class="article-requests-pending_table_controls"> |
| 113 |
<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> |
226 |
<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 317-329
Link Here
|
| 317 |
[% MACRO jsinclude BLOCK %] |
430 |
[% MACRO jsinclude BLOCK %] |
| 318 |
[% INCLUDE 'datatables.inc' %] |
431 |
[% INCLUDE 'datatables.inc' %] |
| 319 |
<script> |
432 |
<script> |
| 320 |
var active_tab = "#article-requests-pending"; |
433 |
var active_tab = "#article-requests-requested"; |
| 321 |
var last_cancel_reason, pending_datatable, processing_datatable, active_datatable; |
434 |
var last_cancel_reason, requested_datatable, pending_datatable, processing_datatable, active_datatable; |
| 322 |
$(document).ready(function() { |
435 |
$(document).ready(function() { |
| 323 |
$('#article-request-tabs').tabs({ |
436 |
$('#article-request-tabs').tabs({ |
| 324 |
activate: function( activate_event, activate_ui ) { |
437 |
activate: function( activate_event, activate_ui ) { |
| 325 |
active_tab = activate_ui.newPanel.selector; |
438 |
active_tab = activate_ui.newPanel.selector; |
| 326 |
if( active_tab == '#article-requests-pending' ) |
439 |
if( active_tab == '#article-requests-requested' ) |
|
|
440 |
active_datatable = requested_datatable; |
| 441 |
else if( active_tab == '#article-requests-pending' ) |
| 327 |
active_datatable = pending_datatable; |
442 |
active_datatable = pending_datatable; |
| 328 |
else active_datatable = processing_datatable; |
443 |
else active_datatable = processing_datatable; |
| 329 |
activateBatchActions( active_tab ); |
444 |
activateBatchActions( active_tab ); |
|
Lines 347-368
Link Here
|
| 347 |
}); |
462 |
}); |
| 348 |
$("a.ar-actions").on('click', function(e) { |
463 |
$("a.ar-actions").on('click', function(e) { |
| 349 |
// Hide menu option ? |
464 |
// Hide menu option ? |
| 350 |
if( $('#article-requests-processing-table').is(":visible") ) |
465 |
if( $('#article-requests-requested-table:visible,#article-requests-pending-table:visible').length ) |
| 351 |
$('a.ar-process-request').hide(); |
466 |
$('a.ar-process-request').show(); |
| 352 |
else $('a.ar-process-request').show(); |
467 |
else $('a.ar-process-request').hide(); |
|
|
468 |
|
| 469 |
if( $('#article-requests-requested-table').is(":visible") ) |
| 470 |
$('a.ar-open-request').show(); |
| 471 |
else $('a.ar-open-request').hide(); |
| 353 |
}); |
472 |
}); |
| 354 |
|
473 |
|
|
|
474 |
requested_datatable = $("#article-requests-requested-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
| 475 |
"aoColumnDefs": [ |
| 476 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
| 477 |
], |
| 478 |
})); |
| 355 |
pending_datatable = $("#article-requests-pending-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
479 |
pending_datatable = $("#article-requests-pending-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
| 356 |
"aoColumnDefs": [ |
480 |
"aoColumnDefs": [ |
| 357 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
481 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
| 358 |
], |
482 |
], |
| 359 |
})); |
483 |
})); |
| 360 |
active_datatable = pending_datatable; |
|
|
| 361 |
processing_datatable = $("#article-requests-processing-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
484 |
processing_datatable = $("#article-requests-processing-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
| 362 |
"aoColumnDefs": [ |
485 |
"aoColumnDefs": [ |
| 363 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
486 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
| 364 |
], |
487 |
], |
| 365 |
})); |
488 |
})); |
|
|
489 |
active_datatable = requested_datatable; |
| 366 |
activateBatchActions( active_tab ); |
490 |
activateBatchActions( active_tab ); |
| 367 |
$(".starthidden").show(); |
491 |
$(".starthidden").show(); |
| 368 |
}); |
492 |
}); |
|
Lines 422-429
Link Here
|
| 422 |
}); |
546 |
}); |
| 423 |
} |
547 |
} |
| 424 |
|
548 |
|
|
|
549 |
function Open( id, a ) { |
| 550 |
var table_row = a.closest('tr'); |
| 551 |
table_row.find('.ar-open-request').remove(); |
| 552 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
| 553 |
a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" class="spinner"/>').find('div.dropdown').hide(); |
| 554 |
$.ajax({ |
| 555 |
type: "POST", |
| 556 |
url: '/cgi-bin/koha/svc/article_request', |
| 557 |
data: { |
| 558 |
action: 'open', |
| 559 |
id: id, |
| 560 |
}, |
| 561 |
success: function( data ) { |
| 562 |
$("img.spinner").remove(); |
| 563 |
requested_datatable.row( table_row ).remove().draw(); |
| 564 |
pending_datatable.row.add( table_row ).draw(); |
| 565 |
UpdateTabCounts(); |
| 566 |
activateBatchActions( active_tab ); |
| 567 |
}, |
| 568 |
dataType: 'json' |
| 569 |
}); |
| 570 |
} |
| 571 |
|
| 425 |
function Process( id, a ) { |
572 |
function Process( id, a ) { |
| 426 |
var table_row = a.closest('tr'); |
573 |
var table_row = a.closest('tr'); |
|
|
574 |
var table = a.closest('table'); |
| 575 |
var orig_datatable = table.attr('id')==='article-requests-pending-table'?pending_datatable:requested_datatable; |
| 427 |
table_row.find('.ar-process-request').remove(); |
576 |
table_row.find('.ar-process-request').remove(); |
| 428 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
577 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
| 429 |
|
578 |
|
|
Lines 437-443
Link Here
|
| 437 |
}, |
586 |
}, |
| 438 |
success: function( data ) { |
587 |
success: function( data ) { |
| 439 |
$("img.spinner").remove(); |
588 |
$("img.spinner").remove(); |
| 440 |
pending_datatable.row( table_row ).remove().draw(); |
589 |
orig_datatable.row( table_row ).remove().draw(); |
| 441 |
processing_datatable.row.add( table_row ).draw(); |
590 |
processing_datatable.row.add( table_row ).draw(); |
| 442 |
UpdateTabCounts(); |
591 |
UpdateTabCounts(); |
| 443 |
activateBatchActions( active_tab ); |
592 |
activateBatchActions( active_tab ); |
|
Lines 465-470
Link Here
|
| 465 |
} |
614 |
} |
| 466 |
|
615 |
|
| 467 |
function UpdateTabCounts() { |
616 |
function UpdateTabCounts() { |
|
|
617 |
$("#ar_requested_count").html( requested_datatable.rows().count() ); |
| 468 |
$("#ar_pending_count").html( pending_datatable.rows().count() ); |
618 |
$("#ar_pending_count").html( pending_datatable.rows().count() ); |
| 469 |
$("#ar_processing_count").html( processing_datatable.rows().count() ); |
619 |
$("#ar_processing_count").html( processing_datatable.rows().count() ); |
| 470 |
} |
620 |
} |