Bugzilla – Attachment 187651 Details for
Bug 40982
Basket: Orders table — "Modify" and "Cancel order" columns missing or displayed incorrectly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40982: Basket: Fix cached visibility for Modify/Cancel order columns
Bug-40982-Basket-Fix-cached-visibility-for-ModifyC.patch (text/plain), 3.14 KB, created by
Slava Shishkin
on 2025-10-09 11:37:16 UTC
(
hide
)
Description:
Bug 40982: Basket: Fix cached visibility for Modify/Cancel order columns
Filename:
MIME Type:
Creator:
Slava Shishkin
Created:
2025-10-09 11:37:16 UTC
Size:
3.14 KB
patch
obsolete
>From 12cbbef8712f0a246b8a026010d7781bb2bfa8c2 Mon Sep 17 00:00:00 2001 >From: Slava Shishkin <slavashishkin@gmail.com> >Date: Thu, 9 Oct 2025 14:36:27 +0300 >Subject: [PATCH] Bug 40982: Basket: Fix cached visibility for Modify/Cancel > order columns >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Testing notes (using KTD) > >Note: before starting, set CancelOrdersInClosedBaskets = Allow. >/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=CancelOrdersInClosedBaskets > >Add an order to a basket: >1. Acquisitions â Search vendors â Search >2. Click the vendor name >3. In the Baskets column, click the link >4. Select a basket (or create a new one) >5. Add at least one order >6. In the open basket, verify that the Modify and Cancel order columns are absent. >7. Close the basket (youâll return to the vendorâs basket list). Open the same closed basket and verify that the Cancel order column is absent, even though it should be present (because CancelOrdersInClosedBaskets = Allow). >8. Apply the patch and repeat steps 1â7. >9. At step 6 (open basket), the Modify and Cancel order columns are displayed. >10. At step 7 (closed basket), the Cancel order column is visible according to the CancelOrdersInClosedBaskets setting. >--- > .../prog/en/modules/acqui/basket.tt | 26 +++++++++++++++++++ > 1 file changed, 26 insertions(+) > >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 d9b27c670c3..a51f97e5536 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -1260,6 +1260,32 @@ > table_settings.columns.find(c => c.columnname == 'cancel').is_hidden = 0; > [% END %] > >+ // Sync cached visibility of Modify (21) and Cancel (22) with TT logic >+ (function () { >+ var modifyVisible = [% IF active && !closedate %]true[% ELSE %]false[% END %]; >+ var cancelVisible = [% IF !closedate || Koha.Preference('CancelOrdersInClosedBaskets') %]true[% ELSE %]false[% END %]; >+ >+ for (var i = 0; i < localStorage.length; i++) { >+ var key = localStorage.key(i); >+ if (!key || key.indexOf('DataTables_acqui_basket_orders') !== 0) continue; >+ >+ try { >+ var stRaw = localStorage.getItem(key); >+ if (!stRaw) continue; >+ var st = JSON.parse(stRaw); >+ if (!st || !Array.isArray(st.columns) || st.columns.length < 23) continue; >+ >+ // enforce visibility on last two columns (21, 22) >+ if (st.columns[21]) st.columns[21].visible = modifyVisible; >+ if (st.columns[22]) st.columns[22].visible = cancelVisible; >+ >+ localStorage.setItem(key, JSON.stringify(st)); >+ } catch (_e) { >+ } >+ } >+ })(); >+ >+ > $("#orders").kohaTable({ > bKohaColumnsUseNames: true, > pagingType: "full", >-- >2.51.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 40982
:
187651
|
187711
|
187712
|
187724
|
187726
|
187735
|
187736
|
187737
|
187738