Bugzilla – Attachment 186184 Details for
Bug 40753
DT's SaveState not working on the orders table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40753: Fix DT's SaveState on the orders table
Bug-40753-Fix-DTs-SaveState-on-the-orders-table.patch (text/plain), 11.18 KB, created by
David Nind
on 2025-09-04 23:02:50 UTC
(
hide
)
Description:
Bug 40753: Fix DT's SaveState on the orders table
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-09-04 23:02:50 UTC
Size:
11.18 KB
patch
obsolete
>From 0eb06aaa51c6a71e2f066a9fc1469347ce316a5e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 25 Jul 2025 10:27:27 +0200 >Subject: [PATCH] Bug 40753: Fix DT's SaveState on the orders table > >We build the the orders table depending on some conditions (sysprefs or if the >basket is closed/opened). >DataTables cannot correctly restore the state because the number of columns >stored in localStorage is different than the one we have one the table. > >Test plan: >Open and close a basket >Confirm that the table is correctly displayed (no extra columns) > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../prog/en/modules/acqui/basket.tt | 102 +++++++++--------- > 1 file changed, 53 insertions(+), 49 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >index 2176e79959..d9b27c670c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -563,35 +563,29 @@ > <table id="orders"> > <thead> > <tr> >- <th>No.</th> >- <th>[% tp('noun', 'Order') | html %]</th> >- <th>RRP tax exc.</th> >- <th>Actual cost tax exc.</th> >- <th>Budgeted cost tax exc.</th> >- <th>RRP tax inc.</th> >- <th>Actual cost tax inc.</th> >- <th>Budgeted cost tax inc.</th> >- <th>Replacement price</th> >- <th>Qty.</th> >- <th>Total tax exc. ([% currency | html %])</th> >- <th>Total tax inc. ([% currency | html %])</th> >- <th>GST %</th> >- <th>GST</th> >- <th>Fund</th> >- <th>Estimated delivery date</th> >- <th>Statistic 1</th> >- <th>Statistic 2</th> >- <th>Invoice</th> >- [% IF Koha.Preference('EDIFACT') && ediaccount %] >- <th>Supplier report</th> >- [% END %] >- <th class="no-sort no-export">Place hold</th> >- [% IF ( active && !closedate ) %] >- <th class="no-sort no-export">Modify</th> >- [% END %] >- [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %] >- <th class="no-sort no-export">Cancel order</th> >- [% END %] >+ <th data-colname="order_line">No.</th> >+ <th data-colname="order_information">[% tp('noun', 'Order') | html %]</th> >+ <th data-colname="recommended_retail_price_tax_excluded">RRP tax exc.</th> >+ <th data-colname="actual_cost_tax_excluded">Actual cost tax exc.</th> >+ <th data-colname="budgeted_cost_price_tax_included">Budgeted cost tax exc.</th> >+ <th data-colname="recommended_retail_price_tax_included">RRP tax inc.</th> >+ <th data-colname="actual_cost_tax_included">Actual cost tax inc.</th> >+ <th data-colname="budgeted_cost_tax_included">Budgeted cost tax inc.</th> >+ <th data-colname="replacement_price">Replacement price</th> >+ <th data-colname="quantity">Qty.</th> >+ <th data-colname="total_tax_excluded">Total tax exc. ([% currency | html %])</th> >+ <th data-colname="total_tax_included">Total tax inc. ([% currency | html %])</th> >+ <th data-colname="goods_and_services_tax_percentage">GST %</th> >+ <th data-colname="goods_and_services_tax">GST</th> >+ <th data-colname="fund">Fund</th> >+ <th data-colname="estimated_delivery_date">Estimated delivery date</th> >+ <th data-colname="statistic1">Statistic 1</th> >+ <th data-colname="statistic2">Statistic 2</th> >+ <th data-colname="invoice">Invoice</th> >+ <th data-colname="supplier_report">Supplier report</th> >+ <th data-colname="place_hold" class="no-sort no-export">Place hold</th> >+ <th data-colname="modify" class="no-sort no-export">Modify</th> >+ <th data-colname="cancel" class="no-sort no-export">Cancel order</th> > </tr> > </thead> > <tfoot> >@@ -616,16 +610,10 @@ > <th> </th> > <th> </th> > <th> </th> >- [% IF Koha.Preference('EDIFACT') && ediaccount %] >- <th> </th> >- [% END %] > <th> </th> >- [% IF ( active && !closedate ) %] >- <th> </th> >- [% END %] >- [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %] >- <th> </th> >- [% END %] >+ <th> </th> >+ <th> </th> >+ <th> </th> > </tr> > [% END %] > <tr> >@@ -648,16 +636,10 @@ > <th> </th> > <th> </th> > <th> </th> >- [% IF Koha.Preference('EDIFACT') && ediaccount %] >- <th> </th> >- [% END %] > <th> </th> >- [% IF ( active && !closedate ) %] >- <th> </th> >- [% END %] >- [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %] >- <th> </th> >- [% END %] >+ <th> </th> >+ <th> </th> >+ <th> </th> > </tr> > </tfoot> > <tbody> >@@ -801,6 +783,8 @@ > > [% IF Koha.Preference('EDIFACT') && ediaccount %] > <td>[% books_loo.suppliers_report | html %]</td> >+ [% ELSE %] >+ <td></td> > [% END %] > <td> > [% IF ( books_loo.biblionumber && CAN_user_reserveforothers_place_holds ) %] >@@ -828,6 +812,8 @@ > > > [% END %] > </td> >+ [% ELSE %] >+ <td></td> > [% END %] > [% IF ( !closedate || Koha.Preference('CancelOrdersInClosedBaskets') ) %] > <td> >@@ -864,6 +850,8 @@ > [% END %] > [% END %] > </td> >+ [% ELSE %] >+ <td></td> > [% END %] > </tr> > [% END %] >@@ -1254,10 +1242,26 @@ > $(document).ready(function() { > var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'basket', 'orders', 'json' ) | $raw %]; > [% IF !(Koha.Preference('EDIFACT') && ediaccount) %] >- // FIXME This cannot work correctly without bKohaColumnsUseNames >- table_settings['columns'].splice(18, 1); >+ table_settings.columns.find(c => c.columnname == 'supplier_report').is_hidden = 1; >+ table_settings.columns.find(c => c.columnname == 'supplier_report').cannot_be_toggled = 1; >+ [% ELSE %] >+ table_settings.columns.find(c => c.columnname == 'supplier_report').is_hidden = 0; >+ [% END %] >+ [% IF ( active && !closedate ) %] >+ table_settings.columns.find(c => c.columnname == 'modify').is_hidden = 1; >+ table_settings.columns.find(c => c.columnname == 'modify').cannot_be_toggled = 1; >+ [% ELSE %] >+ table_settings.columns.find(c => c.columnname == 'modify').is_hidden = 0; >+ [% END %] >+ [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %] >+ table_settings.columns.find(c => c.columnname == 'cancel').is_hidden = 1; >+ table_settings.columns.find(c => c.columnname == 'modify').cannot_be_toggled = 1; >+ [% ELSE %] >+ table_settings.columns.find(c => c.columnname == 'cancel').is_hidden = 0; > [% END %] >+ > $("#orders").kohaTable({ >+ bKohaColumnsUseNames: true, > pagingType: "full", > autoWidth: false, > }, table_settings); >-- >2.39.5
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 40753
:
186140
|
186184
|
186239