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-set-pending-request" href="#" onclick="HandleMulti( SetPending, [% 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-format">Format</th> |
167 |
<th class="ar-urls">URLs</th> |
168 |
<th class="ar-patron">Patron</th> |
169 |
<th class="ar-date">Date</th> |
170 |
<th class="ar-actions noExport">Actions</th> |
171 |
</tr> |
172 |
</thead> |
173 |
|
174 |
<tbody> |
175 |
[% FOREACH ar IN article_requests_requested %] |
176 |
<tr class="ar-row ar-requested"> |
177 |
<td><input type="checkbox" reqid="[% ar.id | html %]"/></td> |
178 |
<td class="ar-title"> |
179 |
<p> |
180 |
<a class="title" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% ar.biblionumber | uri %]"> |
181 |
[% INCLUDE 'biblio-title.inc' biblio=ar.biblio %] |
182 |
</a> |
183 |
</p> |
184 |
|
185 |
<p> |
186 |
<div class="ar-biblionumber content_hidden">[% ar.biblionumber | html %]</div> |
187 |
<div class="ar-author">[% ar.biblio.author | html %]</div> |
188 |
<div class="ar-pubdata"> |
189 |
[% ar.biblio.biblioitem.publishercode | html %] |
190 |
|
191 |
[% IF ar.biblio.biblioitem.publicationyear %] |
192 |
[% ar.biblio.biblioitem.publicationyear | html %] |
193 |
[% ELSIF ar.biblio.copyrightdate %] |
194 |
[% ar.biblio.copyrightdate | html %] |
195 |
[% END %] |
196 |
|
197 |
[% IF ar.biblio.biblioitem.pages %] |
198 |
: [% ar.biblio.biblioitem.pages | html %] |
199 |
[% END %] |
200 |
|
201 |
[% r.biblio.biblioitem.size | html %] |
202 |
|
203 |
[% IF ar.biblio.biblioitem.isbn %] |
204 |
ISBN: [% ar.biblio.biblioitem.isbn | html %] |
205 |
[% END %] |
206 |
</div> |
207 |
</p> |
208 |
</td> |
209 |
<td class="ar-request"> |
210 |
[% IF ar.title %] <p><strong>Title:</strong> [% ar.title | html %] </p> [% END %] |
211 |
[% IF ar.author %] <p><strong>Author:</strong> [% ar.author | html %] </p> [% END %] |
212 |
[% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume | html %] </p> [% END %] |
213 |
[% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue | html %] </p> [% END %] |
214 |
[% IF ar.date %] <p><strong>Date:</strong> [% ar.date | html %] </p> [% END %] |
215 |
[% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages | html %] </p> [% END %] |
216 |
[% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters | html %] </p> [% END %] |
217 |
[% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes | html %] </p> [% END %] |
218 |
</td> |
219 |
<td class="ar-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %]</td> |
220 |
<td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td> |
221 |
<td class="ar-callnumber"> |
222 |
[% IF ar.item.location %] |
223 |
<em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %]</em> |
224 |
[% END %] |
225 |
|
226 |
[% ar.item.itemcallnumber | html %] |
227 |
</td> |
228 |
<td class="ar-status">[% PROCESS 'item_status' myitem = ar.item IF ar.item %]</td> |
229 |
<td class="ar-copynumber">[% ar.item.copynumber | html %]</td> |
230 |
<td class="ar-enumchron">[% ar.item.enumchron | html %]</td> |
231 |
<td class="ar-barcode">[% ar.item.barcode | html %]</td> |
232 |
<td class="ar-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td> |
233 |
<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> |
234 |
<td class="ar-patron"> |
235 |
<p> |
236 |
<a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]"> |
237 |
[% ar.borrower.surname | html %][% IF ar.borrower.firstname %], [% ar.borrower.firstname | html %][% END %] ([% ar.borrower.cardnumber | html %]) |
238 |
</a> |
239 |
</p> |
240 |
|
241 |
<p>[% ar.borrower.phone | html %]</p> |
242 |
</td> |
243 |
<td class="ar-date"><span title="[% ar.created_on | html %]">[% ar.created_on | $KohaDates %]</span></td> |
244 |
<td class="ar-actions"> |
245 |
[% PROCESS actions menuid = "row" _ ar.id id_arg=ar.id pull_right='pull-right' aria_menu='ar-actions' %] |
246 |
</td> |
247 |
</tr> |
248 |
[% END %] |
249 |
</tbody> |
250 |
</table> |
251 |
</div> |
252 |
|
136 |
<div id="article-requests-pending"> |
253 |
<div id="article-requests-pending"> |
137 |
<div class="article-requests-pending_table_controls"> |
254 |
<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> |
255 |
<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 %] |
467 |
[% MACRO jsinclude BLOCK %] |
351 |
[% INCLUDE 'datatables.inc' %] |
468 |
[% INCLUDE 'datatables.inc' %] |
352 |
<script> |
469 |
<script> |
353 |
var active_tab = "#article-requests-pending"; |
470 |
var active_tab = "#article-requests-requested"; |
354 |
var last_cancel_reason, pending_datatable, processing_datatable, active_datatable; |
471 |
var last_cancel_reason, requested_datatable, pending_datatable, processing_datatable, active_datatable; |
355 |
$(document).ready(function() { |
472 |
$(document).ready(function() { |
356 |
$('#article-request-tabs').tabs({ |
473 |
$('#article-request-tabs').tabs({ |
357 |
activate: function( activate_event, activate_ui ) { |
474 |
activate: function( activate_event, activate_ui ) { |
358 |
active_tab = activate_ui.newPanel.selector; |
475 |
active_tab = activate_ui.newPanel.selector; |
359 |
if( active_tab == '#article-requests-pending' ) |
476 |
if( active_tab == '#article-requests-requested' ) |
|
|
477 |
active_datatable = requested_datatable; |
478 |
else if( active_tab == '#article-requests-pending' ) |
360 |
active_datatable = pending_datatable; |
479 |
active_datatable = pending_datatable; |
361 |
else active_datatable = processing_datatable; |
480 |
else active_datatable = processing_datatable; |
362 |
activateBatchActions( active_tab ); |
481 |
activateBatchActions( active_tab ); |
Lines 380-388
Link Here
|
380 |
}); |
499 |
}); |
381 |
$("a.ar-actions").on('click', function(e) { |
500 |
$("a.ar-actions").on('click', function(e) { |
382 |
// Hide menu option ? |
501 |
// Hide menu option ? |
383 |
if( $('#article-requests-processing-table').is(":visible") ) |
502 |
if( $('#article-requests-requested-table:visible,#article-requests-pending-table:visible').length ) |
384 |
$('a.ar-process-request').hide(); |
503 |
$('a.ar-process-request').show(); |
385 |
else $('a.ar-process-request').show(); |
504 |
else $('a.ar-process-request').hide(); |
|
|
505 |
|
506 |
if( $('#article-requests-requested-table').is(":visible") ) |
507 |
$('a.ar-set-pending-request').show(); |
508 |
else $('a.ar-set-pending-request').hide(); |
386 |
}); |
509 |
}); |
387 |
|
510 |
|
388 |
$('#myModal').on("shown.bs.modal", function () { |
511 |
$('#myModal').on("shown.bs.modal", function () { |
Lines 398-414
Link Here
|
398 |
SaveURLs( $('#myModal textarea').val() ); |
521 |
SaveURLs( $('#myModal textarea').val() ); |
399 |
}); |
522 |
}); |
400 |
|
523 |
|
|
|
524 |
requested_datatable = $("#article-requests-requested-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
525 |
"aoColumnDefs": [ |
526 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
527 |
], |
528 |
})); |
529 |
|
401 |
pending_datatable = $("#article-requests-pending-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
530 |
pending_datatable = $("#article-requests-pending-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
402 |
"aoColumnDefs": [ |
531 |
"aoColumnDefs": [ |
403 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
532 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
404 |
], |
533 |
], |
405 |
})); |
534 |
})); |
406 |
active_datatable = pending_datatable; |
|
|
407 |
processing_datatable = $("#article-requests-processing-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
535 |
processing_datatable = $("#article-requests-processing-table").DataTable($.extend(true, {}, dataTablesDefaults, { |
408 |
"aoColumnDefs": [ |
536 |
"aoColumnDefs": [ |
409 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
537 |
{ "aTargets": [0, -1], "bSortable": false, "bSearchable": false }, |
410 |
], |
538 |
], |
411 |
})); |
539 |
})); |
|
|
540 |
active_datatable = requested_datatable; |
412 |
activateBatchActions( active_tab ); |
541 |
activateBatchActions( active_tab ); |
413 |
$(".starthidden").show(); |
542 |
$(".starthidden").show(); |
414 |
}); |
543 |
}); |
Lines 468-475
Link Here
|
468 |
}); |
597 |
}); |
469 |
} |
598 |
} |
470 |
|
599 |
|
|
|
600 |
function SetPending( id, a ) { |
601 |
var table_row = a.closest('tr'); |
602 |
table_row.find('.ar-set-pending-request').remove(); |
603 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
604 |
a.closest('td').prepend('<img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" class="spinner"/>').find('div.dropdown').hide(); |
605 |
$.ajax({ |
606 |
type: "POST", |
607 |
url: '/cgi-bin/koha/svc/article_request', |
608 |
data: { |
609 |
action: 'open', |
610 |
id: id, |
611 |
}, |
612 |
success: function( data ) { |
613 |
$("img.spinner").remove(); |
614 |
requested_datatable.row( table_row ).remove().draw(); |
615 |
pending_datatable.row.add( table_row ).draw(); |
616 |
UpdateTabCounts(); |
617 |
activateBatchActions( active_tab ); |
618 |
}, |
619 |
dataType: 'json' |
620 |
}); |
621 |
} |
622 |
|
471 |
function Process( id, a ) { |
623 |
function Process( id, a ) { |
472 |
var table_row = a.closest('tr'); |
624 |
var table_row = a.closest('tr'); |
|
|
625 |
var table = a.closest('table'); |
626 |
var orig_datatable = table.attr('id')==='article-requests-pending-table'?pending_datatable:requested_datatable; |
473 |
table_row.find('.ar-process-request').remove(); |
627 |
table_row.find('.ar-process-request').remove(); |
474 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
628 |
table_row.find('input[type="checkbox"]').prop('checked', false); |
475 |
|
629 |
|
Lines 483-489
Link Here
|
483 |
}, |
637 |
}, |
484 |
success: function( data ) { |
638 |
success: function( data ) { |
485 |
$("img.spinner").remove(); |
639 |
$("img.spinner").remove(); |
486 |
pending_datatable.row( table_row ).remove().draw(); |
640 |
orig_datatable.row( table_row ).remove().draw(); |
487 |
processing_datatable.row.add( table_row ).draw(); |
641 |
processing_datatable.row.add( table_row ).draw(); |
488 |
UpdateTabCounts(); |
642 |
UpdateTabCounts(); |
489 |
activateBatchActions( active_tab ); |
643 |
activateBatchActions( active_tab ); |
Lines 517-522
Link Here
|
517 |
} |
671 |
} |
518 |
|
672 |
|
519 |
function UpdateTabCounts() { |
673 |
function UpdateTabCounts() { |
|
|
674 |
$("#ar_requested_count").html( requested_datatable.rows().count() ); |
520 |
$("#ar_pending_count").html( pending_datatable.rows().count() ); |
675 |
$("#ar_pending_count").html( pending_datatable.rows().count() ); |
521 |
$("#ar_processing_count").html( processing_datatable.rows().count() ); |
676 |
$("#ar_processing_count").html( processing_datatable.rows().count() ); |
522 |
} |
677 |
} |