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 97-103
Link Here
|
97 |
|
102 |
|
98 |
<div class="main container-fluid starthidden"> |
103 |
<div class="main container-fluid starthidden"> |
99 |
<div class="row"> |
104 |
<div class="row"> |
100 |
<div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2"> |
105 |
<div class="col-md-10 col-md-offset-1 col-lg-10 col-lg-offset-1"> |
101 |
|
106 |
|
102 |
<h1>Article requests</h1> |
107 |
<h1>Article requests</h1> |
103 |
[% PROCESS urls_modal %] |
108 |
[% PROCESS urls_modal %] |
Lines 120-125
Link Here
|
120 |
|
125 |
|
121 |
<div id="article-request-tabs" class="toptabs"> |
126 |
<div id="article-request-tabs" class="toptabs"> |
122 |
<ul> |
127 |
<ul> |
|
|
128 |
<li> |
129 |
<a href="#article-requests-requested"> |
130 |
New (<span id="ar_requested_count">[% article_requests_requested.count | html %]</span>) |
131 |
</a> |
132 |
</li> |
133 |
|
123 |
<li> |
134 |
<li> |
124 |
<a href="#article-requests-pending"> |
135 |
<a href="#article-requests-pending"> |
125 |
Pending (<span id="ar_pending_count">[% article_requests_pending.count | html %]</span>) |
136 |
Pending (<span id="ar_pending_count">[% article_requests_pending.count | html %]</span>) |
Lines 133-138
Link Here
|
133 |
</li> |
144 |
</li> |
134 |
</ul> |
145 |
</ul> |
135 |
|
146 |
|
|
|
147 |
<div id="article-requests-requested"> |
148 |
<div class="article-requests-requested_table_controls"> |
149 |
<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> |
150 |
[% PROCESS actions menuid='article-menu-requested' id_arg=0 pull_right='' aria_menu='table_controls' %] |
151 |
</div> |
152 |
|
153 |
<table id="article-requests-requested-table"> |
154 |
<thead> |
155 |
<tr> |
156 |
<th/> |
157 |
<th class="ar-title">Title</th> |
158 |
<th class="ar-request">Requested article</th> |
159 |
<th class="ar-collection">Collection</th> |
160 |
<th class="ar-itemtype">Item type</th> |
161 |
<th class="ar-callnumber">Call number</th> |
162 |
<th class="ar-status">Status</th> |
163 |
<th class="ar-copynumber">Copy number</th> |
164 |
<th class="ar-enumchron">Enumeration</th> |
165 |
<th class="ar-barcode">Barcode</th> |
166 |
<th class="ar-patron">Patron</th> |
167 |
<th class="ar-date">Date</th> |
168 |
<th class="ar-actions noExport">Actions</th> |
169 |
</tr> |
170 |
</thead> |
171 |
|
172 |
<tbody> |
173 |
[% FOREACH ar IN article_requests_requested %] |
174 |
<tr class="ar-row ar-requested"> |
175 |
<td><input type="checkbox" reqid="[% ar.id | html %]"/></td> |
176 |
<td class="ar-title"> |
177 |
<p> |
178 |
<a class="title" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% ar.biblionumber | uri %]"> |
179 |
[% INCLUDE 'biblio-title.inc' biblio=ar.biblio %] |
180 |
</a> |
181 |
</p> |
182 |
|
183 |
<p> |
184 |
<div class="ar-biblionumber content_hidden">[% ar.biblionumber | html %]</div> |
185 |
<div class="ar-author">[% ar.biblio.author | html %]</div> |
186 |
<div class="ar-pubdata"> |
187 |
[% ar.biblio.biblioitem.publishercode | html %] |
188 |
|
189 |
[% IF ar.biblio.biblioitem.publicationyear %] |
190 |
[% ar.biblio.biblioitem.publicationyear | html %] |
191 |
[% ELSIF ar.biblio.copyrightdate %] |
192 |
[% ar.biblio.copyrightdate | html %] |
193 |
[% END %] |
194 |
|
195 |
[% IF ar.biblio.biblioitem.pages %] |
196 |
: [% ar.biblio.biblioitem.pages | html %] |
197 |
[% END %] |
198 |
|
199 |
[% r.biblio.biblioitem.size | html %] |
200 |
|
201 |
[% IF ar.biblio.biblioitem.isbn %] |
202 |
ISBN: [% ar.biblio.biblioitem.isbn | html %] |
203 |
[% END %] |
204 |
</div> |
205 |
</p> |
206 |
</td> |
207 |
<td class="ar-request"> |
208 |
[% IF ar.title %] <p><strong>Title:</strong> [% ar.title | html %] </p> [% END %] |
209 |
[% IF ar.author %] <p><strong>Author:</strong> [% ar.author | html %] </p> [% END %] |
210 |
[% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume | html %] </p> [% END %] |
211 |
[% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue | html %] </p> [% END %] |
212 |
[% IF ar.date %] <p><strong>Date:</strong> [% ar.date | html %] </p> [% END %] |
213 |
[% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages | html %] </p> [% END %] |
214 |
[% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters | html %] </p> [% END %] |
215 |
[% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes | html %] </p> [% END %] |
216 |
</td> |
217 |
<td class="ar-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %]</td> |
218 |
<td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td> |
219 |
<td class="ar-callnumber"> |
220 |
[% IF ar.item.location %] |
221 |
<em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %]</em> |
222 |
[% END %] |
223 |
|
224 |
[% ar.item.itemcallnumber | html %] |
225 |
</td> |
226 |
<td class="ar-status">[% PROCESS 'item_status' myitem = ar.item IF ar.item %]</td> |
227 |
<td class="ar-copynumber">[% ar.item.copynumber | html %]</td> |
228 |
<td class="ar-enumchron">[% ar.item.enumchron | html %]</td> |
229 |
<td class="ar-barcode">[% ar.item.barcode | html %]</td> |
230 |
<td class="ar-patron"> |
231 |
<p> |
232 |
<a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]"> |
233 |
[% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %]) |
234 |
</a> |
235 |
</p> |
236 |
|
237 |
<p>[% ar.borrower.phone | html %]</p> |
238 |
</td> |
239 |
<td class="ar-date"><span title="[% ar.created_on | html %]">[% ar.created_on | $KohaDates %]</span></td> |
240 |
<td class="ar-actions"> |
241 |
[% PROCESS actions menuid = "row" _ ar.id id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %] |
242 |
</td> |
243 |
</tr> |
244 |
[% END %] |
245 |
</tbody> |
246 |
</table> |
247 |
</div> |
248 |
|
136 |
<div id="article-requests-pending"> |
249 |
<div id="article-requests-pending"> |
137 |
<div class="article-requests-pending_table_controls"> |
250 |
<div class="article-requests-pending_table_controls"> |
138 |
<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> |
251 |
<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 350-362
Link Here
|
350 |
[% MACRO jsinclude BLOCK %] |
463 |
[% MACRO jsinclude BLOCK %] |
351 |
[% INCLUDE 'datatables.inc' %] |
464 |
[% INCLUDE 'datatables.inc' %] |
352 |
<script> |
465 |
<script> |
353 |
var active_tab = "#article-requests-pending"; |
466 |
var active_tab = "#article-requests-requested"; |
354 |
var last_cancel_reason, pending_datatable, processing_datatable, active_datatable; |
467 |
var last_cancel_reason, requested_datatable, pending_datatable, processing_datatable, active_datatable; |
355 |
$(document).ready(function() { |
468 |
$(document).ready(function() { |
356 |
$('#article-request-tabs').tabs({ |
469 |
$('#article-request-tabs').tabs({ |
357 |
activate: function( activate_event, activate_ui ) { |
470 |
activate: function( activate_event, activate_ui ) { |
358 |
active_tab = activate_ui.newPanel.selector; |
471 |
active_tab = activate_ui.newPanel.selector; |
359 |
if( active_tab == '#article-requests-pending' ) |
472 |
if( active_tab == '#article-requests-requested' ) |
|
|
473 |
active_datatable = requested_datatable; |
474 |
else if( active_tab == '#article-requests-pending' ) |
360 |
active_datatable = pending_datatable; |
475 |
active_datatable = pending_datatable; |
361 |
else active_datatable = processing_datatable; |
476 |
else active_datatable = processing_datatable; |
362 |
activateBatchActions( active_tab ); |
477 |
activateBatchActions( active_tab ); |
Lines 380-388
Link Here
|
380 |
}); |
495 |
}); |
381 |
$("a.ar-actions").on('click', function(e) { |
496 |
$("a.ar-actions").on('click', function(e) { |
382 |
// Hide menu option ? |
497 |
// Hide menu option ? |
383 |
if( $('#article-requests-processing-table').is(":visible") ) |
498 |
if( $('#article-requests-requested-table:visible,#article-requests-pending-table:visible').length ) |
384 |
$('a.ar-process-request').hide(); |
499 |
$('a.ar-process-request').show(); |
385 |
else $('a.ar-process-request').show(); |
500 |
else $('a.ar-process-request').hide(); |
|
|
501 |
|
502 |
if( $('#article-requests-requested-table').is(":visible") ) |
503 |
$('a.ar-open-request').show(); |
504 |
else $('a.ar-open-request').hide(); |
386 |
}); |
505 |
}); |
387 |
|
506 |
|
388 |
$('#myModal').on("shown.bs.modal", function () { |
507 |
$('#myModal').on("shown.bs.modal", function () { |
Lines 398-414
Link Here
|
398 |
SaveURLs( $('#myModal textarea').val() ); |
517 |
SaveURLs( $('#myModal textarea').val() ); |
399 |
}); |
518 |
}); |
400 |
|
519 |
|
|
|
520 |
requested_datatable = $("#article-requests-requested-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
521 |
"aoColumnDefs": [ |
522 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
523 |
], |
524 |
})); |
525 |
|
401 |
pending_datatable = $("#article-requests-pending-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
526 |
pending_datatable = $("#article-requests-pending-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
402 |
"aoColumnDefs": [ |
527 |
"aoColumnDefs": [ |
403 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
528 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
404 |
], |
529 |
], |
405 |
})); |
530 |
})); |
406 |
active_datatable = pending_datatable; |
|
|
407 |
processing_datatable = $("#article-requests-processing-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
531 |
processing_datatable = $("#article-requests-processing-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
408 |
"aoColumnDefs": [ |
532 |
"aoColumnDefs": [ |
409 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
533 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
410 |
], |
534 |
], |
411 |
})); |
535 |
})); |
|
|
536 |
active_datatable = requested_datatable; |
412 |
activateBatchActions( active_tab ); |
537 |
activateBatchActions( active_tab ); |
413 |
$(".starthidden").show(); |
538 |
$(".starthidden").show(); |
414 |
}); |
539 |
}); |
Lines 468-475
Link Here
|
468 |
}); |
593 |
}); |
469 |
} |
594 |
} |
470 |
|
595 |
|
|
|
596 |
function Open( id, a ) { |
597 |
var table_row = a.closest('tr'); |
598 |
table_row.find('.ar-open-request').remove(); |
599 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
600 |
a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" class="spinner"/>').find('div.dropdown').hide(); |
601 |
$.ajax({ |
602 |
type: "POST", |
603 |
url: '/cgi-bin/koha/svc/article_request', |
604 |
data: { |
605 |
action: 'open', |
606 |
id: id, |
607 |
}, |
608 |
success: function( data ) { |
609 |
$("img.spinner").remove(); |
610 |
requested_datatable.row( table_row ).remove().draw(); |
611 |
pending_datatable.row.add( table_row ).draw(); |
612 |
UpdateTabCounts(); |
613 |
activateBatchActions( active_tab ); |
614 |
}, |
615 |
dataType: 'json' |
616 |
}); |
617 |
} |
618 |
|
471 |
function Process( id, a ) { |
619 |
function Process( id, a ) { |
472 |
var table_row = a.closest('tr'); |
620 |
var table_row = a.closest('tr'); |
|
|
621 |
var table = a.closest('table'); |
622 |
var orig_datatable = table.attr('id')==='article-requests-pending-table'?pending_datatable:requested_datatable; |
473 |
table_row.find('.ar-process-request').remove(); |
623 |
table_row.find('.ar-process-request').remove(); |
474 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
624 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
475 |
|
625 |
|
Lines 483-489
Link Here
|
483 |
}, |
633 |
}, |
484 |
success: function( data ) { |
634 |
success: function( data ) { |
485 |
$("img.spinner").remove(); |
635 |
$("img.spinner").remove(); |
486 |
pending_datatable.row( table_row ).remove().draw(); |
636 |
orig_datatable.row( table_row ).remove().draw(); |
487 |
processing_datatable.row.add( table_row ).draw(); |
637 |
processing_datatable.row.add( table_row ).draw(); |
488 |
UpdateTabCounts(); |
638 |
UpdateTabCounts(); |
489 |
activateBatchActions( active_tab ); |
639 |
activateBatchActions( active_tab ); |
Lines 517-522
Link Here
|
517 |
} |
667 |
} |
518 |
|
668 |
|
519 |
function UpdateTabCounts() { |
669 |
function UpdateTabCounts() { |
|
|
670 |
$("#ar_requested_count").html( requested_datatable.rows().count() ); |
520 |
$("#ar_pending_count").html( pending_datatable.rows().count() ); |
671 |
$("#ar_pending_count").html( pending_datatable.rows().count() ); |
521 |
$("#ar_processing_count").html( processing_datatable.rows().count() ); |
672 |
$("#ar_processing_count").html( processing_datatable.rows().count() ); |
522 |
} |
673 |
} |