Bugzilla – Attachment 191160 Details for
Bug 41578
Tidy kohaTable block - serials
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41578: serials - auto tidy
678f7d4.patch (text/plain), 16.55 KB, created by
Jonathan Druart
on 2026-01-09 14:52:44 UTC
(
hide
)
Description:
Bug 41578: serials - auto tidy
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-01-09 14:52:44 UTC
Size:
16.55 KB
patch
obsolete
>From 678f7d4d23b64aa56c672f2f02e5fde5863728c5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 9 Jan 2026 13:16:15 +0100 >Subject: [PATCH] Bug 41578: serials - auto tidy > >--- > .../prog/en/modules/serials/claims.tt | 8 ++- > .../en/modules/serials/serials-collection.tt | 39 +++++------ > .../prog/en/modules/serials/serials-search.tt | 61 +++++++++------- > .../en/modules/serials/subscription-detail.tt | 2 - > .../serials/subscription-numberpatterns.tt | 70 ++++++++++++------- > 5 files changed, 102 insertions(+), 78 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt >index b3b36b66b61..956685edf27 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt >@@ -221,7 +221,6 @@ > var table_settings = [% TablesSettings.GetTableSettings( "serials", "claims", "claimst", "json" ) | $raw %]; > const vendor_id = "[% supplierid | html %]"; > </script> >- > <script> > var sTable; > $(document).ready(function () { >@@ -231,8 +230,11 @@ > autowidth: false, > order: [[7, "asc"]], > paging: false, >- orderCellsTop: true >- }, table_settings, 1); >+ orderCellsTop: true, >+ }, >+ table_settings, >+ 1 >+ ); > > // Checkboxes : Select All / None > $("span.checkall").html('<input type="checkbox" name="CheckAll"> ' + _("Check all") + "</input>"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >index 3bfef055e2c..797f9a49c12 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >@@ -345,9 +345,9 @@ > function deleteIssues(subscriptionid) { > var serialschecked = $("form[name='edition'] input[name='serialid']:checked"); > if (serialschecked.length > 0) { >- var location = 'serials-collection.pl?subscriptionid='+subscriptionid+'&op=delete_confirm'; >- for (i=0; i < serialschecked.length; i++) { >- location += '&serialid=' + serialschecked[i].value; >+ var location = "serials-collection.pl?subscriptionid=" + subscriptionid + "&op=delete_confirm"; >+ for (i = 0; i < serialschecked.length; i++) { >+ location += "&serialid=" + serialschecked[i].value; > } > document.location = location; > } else { >@@ -355,8 +355,8 @@ > } > } > >- $(document).ready(function() { >- if( $("#subscription_years .tab-pane.active").length < 1 ){ >+ $(document).ready(function () { >+ if ($("#subscription_years .tab-pane.active").length < 1) { > $("#subscription_years a:first").tab("show"); > } > $(".subscription-year-table").kohaTable({ >@@ -368,42 +368,42 @@ > searching: false, > }); > >- $(".CheckAll").on("click", function(e){ >+ $(".CheckAll").on("click", function (e) { > e.preventDefault(); > var years = $(this).data("year"); >- $("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", true ); >+ $("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", true); > }); > >- $(".CheckNone").on("click", function(e){ >+ $(".CheckNone").on("click", function (e) { > e.preventDefault(); > var years = $(this).data("year"); >- $("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", false ); >+ $("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", false); > }); > >- $(".generatenext").on("click", function(e){ >+ $(".generatenext").on("click", function (e) { > e.preventDefault(); > var subscriptionid = $(this).data("subscriptionid"); >- generateNext( subscriptionid ); >+ generateNext(subscriptionid); > }); > >- $(".subscription_renew").on("click", function(e){ >+ $(".subscription_renew").on("click", function (e) { > e.preventDefault(); > var subscriptionid = $(this).data("subscriptionid"); >- popup( subscriptionid ); >+ popup(subscriptionid); > }); > >- $(".print_list").on("click", function(e){ >+ $(".print_list").on("click", function (e) { > e.preventDefault(); > var url = $(this).attr("href"); >- window.open( url,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes'); >+ window.open(url, "PrintSlip", "width=500,height=500,toolbar=no,scrollbars=yes"); > }); > >- $('#multi_receiving').on('show', function () { >- $(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML); >+ $("#multi_receiving").on("show", function () { >+ $(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML); > }); > >- $("form[name='edition']").on('submit', function(e){ >- if ( $(this).find("input[name='serialid']:checked").size() == 0 ) { >+ $("form[name='edition']").on("submit", function (e) { >+ if ($(this).find("input[name='serialid']:checked").size() == 0) { > e.preventDefault(); > alert(_("You must select at least one serial to edit")); > return 0; >@@ -412,7 +412,6 @@ > }); > }); > </script> >- > <script> > $(document).ready(function() { > $(".delete-issues").on("click", function(e){ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >index df1c7a060f9..257c5fe7020 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >@@ -287,75 +287,82 @@ > </script> > [% Asset.js("js/serials-toolbar.js") | $raw %] > <script> >- function itemSelectionBuildEditLink( tab ) { >+ function itemSelectionBuildEditLink(tab) { > var subscription_ids = new Array(); >- $( "input:checkbox." + tab + ":checked" ).each(function() { >- subscription_ids.push( $(this).val() ); >+ $("input:checkbox." + tab + ":checked").each(function () { >+ subscription_ids.push($(this).val()); > }); > > if (subscription_ids.length > 0) { > var url = edit_action_link; >- url += '&subscriptionid=' + subscription_ids.join('&subscriptionid='); >+ url += "&subscriptionid=" + subscription_ids.join("&subscriptionid="); > location.href = url; > } else { > return false; > } > } > >- function enableCheckboxActions( tab ){ >+ function enableCheckboxActions(tab) { > // Enable/disable controls if checkboxes are checked > var checked_count = $("input:checkbox." + tab + ":checked").length; >- if( checked_count > 0 ){ >- $(".itemselection_actions." + tab ).show(); >+ if (checked_count > 0) { >+ $(".itemselection_actions." + tab).show(); > } else { >- $(".itemselection_actions." + tab ).hide(); >+ $(".itemselection_actions." + tab).hide(); > } > } > >- $(document).ready(function() { >- var osrlt = $("#opened_panel table").kohaTable({ >- pagingType: "full", >- order: [[2, "asc"]], >- }, null, true); >+ $(document).ready(function () { >+ var osrlt = $("#opened_panel table").kohaTable( >+ { >+ pagingType: "full", >+ order: [[2, "asc"]], >+ }, >+ null, >+ true >+ ); > >- var csrlt = $("#closed_panel table").kohaTable({ >- // FIXME sort function of additional_fields! >- order: [[2, "asc"]], >- pagingType: "full", >- }, null, true); >+ var csrlt = $("#closed_panel table").kohaTable( >+ { >+ // FIXME sort function of additional_fields! >+ order: [[2, "asc"]], >+ pagingType: "full", >+ }, >+ null, >+ true >+ ); > > var manarlt = $("#mana_results_datatable").kohaTable({ > pagingType: "full", > }); > >- $("#reopensub").click(function(){ >+ $("#reopensub").click(function () { > return confirm(_("Are you sure you want to reopen this subscription?")); > }); > >- $('.select-all, .clear-all').on('click', function(e) { >+ $(".select-all, .clear-all").on("click", function (e) { > e.preventDefault(); > var tab = $(this).data("tab"); >- var checkboxes = $("input:checkbox." + tab ); >- checkboxes.prop('checked', $(this).hasClass('select-all')).change(); >+ var checkboxes = $("input:checkbox." + tab); >+ checkboxes.prop("checked", $(this).hasClass("select-all")).change(); > enableCheckboxActions(tab); > }); > > enableCheckboxActions("opened"); > enableCheckboxActions("closed"); > >- $("input[name='subscriptionid'][type='checkbox']").change(function() { >+ $("input[name='subscriptionid'][type='checkbox']").change(function () { > var tab = $(this).attr("class"); >- enableCheckboxActions( tab ); >+ enableCheckboxActions(tab); > }); > >- $(".itemselection_action_modify").on("click", function(e){ >+ $(".itemselection_action_modify").on("click", function (e) { > e.preventDefault(); > var tab = $(this).data("tab"); >- itemSelectionBuildEditLink( tab ); >+ itemSelectionBuildEditLink(tab); > }); > }); > </script> >- > [% IF ( mana ) %] > <script> > $(document).ready(function() { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >index 75d9c547559..2304ff57bcf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >@@ -454,13 +454,11 @@ > [% 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", >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt >index 2f3100bae0e..5623f08292b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt >@@ -337,36 +337,56 @@ > var firstacquidate = $("#firstacquidate").val(); > var error = 0; > var error_msg = ""; >- if(frequencyid == undefined || frequencyid == "") { >+ if (frequencyid == undefined || frequencyid == "") { > error_msg += _("- Frequency is not defined") + "\n"; >- error ++; >+ error++; > } >- if(firstacquidate == undefined || firstacquidate == "") { >+ if (firstacquidate == undefined || firstacquidate == "") { > error_msg += _("- First publication date is not defined") + "\n"; >- error ++; >+ error++; > } > >- if(error){ >- alert(_("Cannot test prediction pattern for the following reason(s):") + "\n\n" >- + error_msg); >+ if (error) { >+ alert(_("Cannot test prediction pattern for the following reason(s):") + "\n\n" + error_msg); > return false; > } > > var ajaxData = { >- 'custompattern': true, >+ custompattern: true, > }; > var ajaxParams = [ >- 'firstacquidate', 'subtype', 'sublength', 'frequency', 'numberingmethod', >- 'lastvalue1', 'lastvalue2', 'lastvalue3', 'add1', 'add2', 'add3', >- 'every1', 'every2', 'every3', 'innerloop1', 'innerloop2', 'innerloop3', >- 'setto1', 'setto2', 'setto3', 'numbering1', 'numbering2', 'numbering3', >- 'whenmorethan1', 'whenmorethan2', 'whenmorethan3', 'locale' >+ "firstacquidate", >+ "subtype", >+ "sublength", >+ "frequency", >+ "numberingmethod", >+ "lastvalue1", >+ "lastvalue2", >+ "lastvalue3", >+ "add1", >+ "add2", >+ "add3", >+ "every1", >+ "every2", >+ "every3", >+ "innerloop1", >+ "innerloop2", >+ "innerloop3", >+ "setto1", >+ "setto2", >+ "setto3", >+ "numbering1", >+ "numbering2", >+ "numbering3", >+ "whenmorethan1", >+ "whenmorethan2", >+ "whenmorethan3", >+ "locale", > ]; >- for(i in ajaxParams) { >+ for (i in ajaxParams) { > var param = ajaxParams[i]; >- var value = $("#"+param).val(); >- if(value.length > 0) >- ajaxData[param] = value; >+ var value = $("#" + param).val(); >+ if (value.length > 0) ajaxData[param] = value; > } > > $.ajax({ >@@ -374,14 +394,13 @@ > data: ajaxData, > async: false, > dataType: "text", >- success: function(data) { >+ success: function (data) { > $("#predictionpattern").html(data); >- } >+ }, > }); > } > </script> > [% END %] >- > <script> > function show_blocking_subs() { > $("#blocking_subs").show(); >@@ -391,21 +410,20 @@ > return confirm(_("Are you sure you want to delete this numbering pattern?")); > } > >- $(document).ready(function(){ >- >+ $(document).ready(function () { > $("#numberpatternst").kohaTable({ > pagingType: "full", > }); > >- $(".delete_pattern").on("click",function(){ >+ $(".delete_pattern").on("click", function () { > return confirmDelete(); > }); >- $("#show_blocking_subs").on("click",function(e){ >+ $("#show_blocking_subs").on("click", function (e) { > e.preventDefault(); > $("#blocking_subs").show(); > }); >- $("#test_pattern").on("click",function(){ >- testPattern(); >+ $("#test_pattern").on("click", function () { >+ testPattern(); > }); > }); > </script> >-- >2.43.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41578
:
191155
|
191156
|
191157
|
191158
|
191159
| 191160