Bugzilla – Attachment 183837 Details for
Bug 38079
Add ability to choose sorting for holdings table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38079: Add ability to choose sorting for holdings tables on details page
Bug-38079-Add-ability-to-choose-sorting-for-holdin.patch (text/plain), 4.16 KB, created by
Owen Leonard
on 2025-07-07 12:50:02 UTC
(
hide
)
Description:
Bug 38079: Add ability to choose sorting for holdings tables on details page
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-07-07 12:50:02 UTC
Size:
4.16 KB
patch
obsolete
>From 96d6a1d1d9c004377faff8a0ba70a4d2f3ed6d2f Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 7 Jul 2025 12:46:39 +0000 >Subject: [PATCH] Bug 38079: Add ability to choose sorting for holdings tables > on details page > >This patch adds a new option 'default' to the sorting options in tables >settings > >We need this so that we can add the option to define sorting, without >setting a new default as the holdings table currently uses >'search_ordered' for a specific sorting when no sorting is provided > >To test: > 1 - Add many items to a record, with various values > 2 - View the holdings tab on details, note the order > 3 - Apply patch, restart_all, reload > 4 - Confirm order not changed > 5 - Click 'Configure' > 6 - Scroll to holdings table > 7 - Change page size and save (noting sort is set to default) > 8 - Reload and confirm the order has not changed > 9 - Now change the sorting in the table settings >10 - Reload and confirm the sorting is saved >--- > admin/columns_settings.yml | 1 + > .../intranet-tmpl/prog/en/modules/admin/columns_settings.tt | 1 + > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 3 ++- > koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue | 3 ++- > 4 files changed, 6 insertions(+), 2 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 21e8e8a6186..427eb4b3895 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -446,6 +446,7 @@ modules: > holdings_table: > default_display_length: 20 > default_save_state: 0 >+ default_sort_order: default > columns: > - > columnname: checkbox >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt >index 9260d32d6d2..f8ffb28a12d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt >@@ -144,6 +144,7 @@ > <p> > Default sort order: > <select name="[% pagename | html %]|[% tablename | html %]_default_sort_order"> >+ <option value="default">Default (none)</option> > [% FOR column IN tables.$pagename.$tablename.columns %] > [% IF table_settings.default_sort_order == loop.count - 1 %] > <option value="[% loop.count - 1 %]" selected="selected">[% column.columnname | html %]</option> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index bdfe317ddaa..6abab38d49b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -1440,7 +1440,8 @@ function update_search_description( > } > if ( > table_settings.hasOwnProperty("default_sort_order") && >- table_settings["default_sort_order"] != null >+ table_settings["default_sort_order"] != null && >+ table_settings["default_sort_order"] != "default" > ) { > settings["order"] = [ > [table_settings["default_sort_order"], "asc"], >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue >index 1d923c198c3..b6011fd2a50 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue >@@ -46,7 +46,8 @@ export default { > } > if ( > this.table_settings.hasOwnProperty("default_sort_order") && >- this.table_settings.default_sort_order != null >+ this.table_settings.default_sort_order != null && >+ this.table_settings.default_sort_order != "default" > ) { > this.options.order = [ > [this.table_settings.default_sort_order, "asc"], >-- >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 38079
:
172365
| 183837