Bugzilla – Attachment 191021 Details for
Bug 40906
Update the "New SQL from mana" interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40906: Dropdown sort button in mana import UI
Bug-40906-Dropdown-sort-button-in-mana-import-UI.patch (text/plain), 4.86 KB, created by
elias.lorgnier@biblibre.com
on 2026-01-08 08:46:48 UTC
(
hide
)
Description:
Bug 40906: Dropdown sort button in mana import UI
Filename:
MIME Type:
Creator:
elias.lorgnier@biblibre.com
Created:
2026-01-08 08:46:48 UTC
Size:
4.86 KB
patch
obsolete
>From 85e8ee7ff7471025e094118ee5067e3afbdd7aa9 Mon Sep 17 00:00:00 2001 >From: elias <elias.lorgnier@biblibre.com> >Date: Fri, 12 Dec 2025 09:31:29 +0000 >Subject: [PATCH] Bug 40906: Dropdown sort button in mana import UI > >Using the datatable "collection" button, i added a dropdown menu to the datatable, making it possible to sort results, so no feature are lost in the patch. >--- > koha-tmpl/intranet-tmpl/prog/css/reports.css | 1 - > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 4 ++ > koha-tmpl/intranet-tmpl/prog/js/mana.js | 53 ++++++++++++++++++- > 3 files changed, 56 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/reports.css b/koha-tmpl/intranet-tmpl/prog/css/reports.css >index 09016f6be40..3263a22ff7d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/reports.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/reports.css >@@ -92,7 +92,6 @@ del { > > .report-description { > height:5rem; >- word-wrap: break-word; > } > > #mana_results_datatable .w-40 { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 6ebe226e186..7c82c2ecdfb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -1462,6 +1462,10 @@ function update_search_description( > > settings["buttons"] = _dt_buttons({ settings, table_settings }); > >+ if (options.buttons) { >+ settings["buttons"].push(options.buttons); >+ } >+ > if (add_filters) { > settings["orderCellsTop"] = true; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/js/mana.js b/koha-tmpl/intranet-tmpl/prog/js/mana.js >index 98fe2054a26..2f39cf2fee2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/mana.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/mana.js >@@ -171,9 +171,13 @@ $(document).ready(function () { > var dataSet = { > _page: Math.floor(start / length) + 1, > _per_page: length, >- _order_by: "", > }; > >+ if (data.order[0]) { >+ dataSet._order_by = >+ data.columns[data.order[0].column].data + ":" + data.order[0].dir; >+ } >+ > //This is why the kohaTables data function is overwritten, to allow passing the search query as a string. > if (data.search) { > dataSet.q = data.search.value; >@@ -215,6 +219,53 @@ $(document).ready(function () { > { data: "nbofusers" }, > { data: "lastimport" }, > ], >+ dom: '<"dt-info"i><"top pager"<"table_entries"lp><"table_controls"fB>>tr<"bottom pager"ip>', >+ buttons: [ >+ { >+ extend: "collection", >+ text: '<i class="fa-solid fa-arrow-down-short-wide" style="margin-right: 5px;"></i>Sort by', >+ attr: {id: 'sort-by-button'}, >+ align: 'button-right', >+ buttons: [ >+ { >+ text: __("Name (A-Z)"), >+ action: function (e, dt, node, config) { >+ dt.order([1, "asc"]).draw(); >+ $(".dt-button-background").trigger("click"); >+ }, >+ }, >+ { >+ text: __("Name (Z-A)"), >+ action: function (e, dt, node, config) { >+ dt.order([1, "desc"]).draw(); >+ $(".dt-button-background").trigger("click"); >+ }, >+ }, >+ { >+ text: __("Date (from newest)"), >+ action: function (e, dt, node, config) { >+ dt.order([4, "desc"]).draw(); >+ $(".dt-button-background").trigger("click"); >+ }, >+ }, >+ { >+ text: __("Date (from oldest)"), >+ action: function (e, dt, node, config) { >+ dt.order([4, "asc"]).draw(); >+ $(".dt-button-background").trigger("click"); >+ }, >+ }, >+ { >+ text: __('Popularity'), >+ action: function (e, dt, node, config) { >+ dt.order([3, "desc"]).draw(); >+ $(".dt-button-background").trigger("click"); >+ }, >+ }, >+ >+ ], >+ }, >+ ], > }); > > let thead = $("#mana_results_datatable thead"); >-- >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 40906
:
190148
|
190396
|
190544
|
190545
|
190660
|
190661
|
190662
|
191020
|
191021
|
192018
|
192019
|
192098
|
192099