Bug 41578: Tidy kohaTable - serials/subscription-detail.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2026-01-08 14:50:01 +01:00 committed by Lucas Gass
parent f31a271b95
commit cd80b1b57c
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 13 additions and 8 deletions

View File

@ -454,6 +454,13 @@
[% Asset.js("js/mana.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
<script>
var table_settings = [% TablesSettings.GetTableSettings( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
const has_orders = [% orders_grouped.size ? 1 : 0 | html %];
const print_routing_list_issue = "[% print_routing_list_issue | uri %]";
</script>
<script>
// the english words used in display purposes
var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose hemisphere:"),_("Northern"),_("Southern",
@ -461,11 +468,10 @@
$(document).ready(function() {
$("#renewsub").click(function(){
popup("[% subscriptionid | html %]");
popup(subscriptionid);
return false;
})
var table_settings = [% TablesSettings.GetTableSettings( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
var table = $("#orders").kohaTable(
{
columnDefs: [
@ -479,7 +485,7 @@
table_settings
);
[% IF orders_grouped.size %]
if (has_orders){
$(table).treetable({
expandable: true,
initialState: 'expanded',
@ -494,8 +500,7 @@
e.preventDefault();
$(table).treetable('collapseAll');
});
[% END %]
}
let table_dt = table.DataTable();
$("#hide_received_orders").click(function(e){
@ -508,10 +513,10 @@
});
$("#show_all_orders").click();
[% IF print_routing_list_issue %]
var myurl = "/cgi-bin/koha/serials/routing-preview.pl?op=print&subscriptionid=[% subscriptionid | uri %]&issue=[% print_routing_list_issue | uri %]";
if (print_routing_list_issue){
var myurl = `/cgi-bin/koha/serials/routing-preview.pl?op=print&subscriptionid=${subscriptionid}&issue=${print_routing_list_issue}";
window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
[% END %]
}
});