Bugzilla – Attachment 190545 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), 5.36 KB, created by
elias.lorgnier@biblibre.com
on 2025-12-16 13:53:07 UTC
(
hide
)
Description:
Bug 40906: Dropdown sort button in mana import UI
Filename:
MIME Type:
Creator:
elias.lorgnier@biblibre.com
Created:
2025-12-16 13:53:07 UTC
Size:
5.36 KB
patch
obsolete
>From 8238a6f1a39baff354c83a089d24d2ca175b59ea 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 | 8 +-- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 4 ++ > koha-tmpl/intranet-tmpl/prog/js/mana.js | 53 ++++++++++++++++++- > 3 files changed, 60 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/reports.css b/koha-tmpl/intranet-tmpl/prog/css/reports.css >index 893884e598e..3263a22ff7d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/reports.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/reports.css >@@ -21,7 +21,7 @@ del { > background-color: #ffe6e6; > } > >-#mana_results_datatable tbody { >+#mana_results_datatable tbody { > display:flex; > flex-wrap: wrap; > justify-content: center; >@@ -45,7 +45,7 @@ del { > } > > #mana_results_datatable td{ >- width: 100%; >+ width: 100%; > display: inline-block; > border: none; > background-color: transparent; >@@ -91,7 +91,7 @@ del { > } > > .report-description { >- height:5rem; >+ height:5rem; > } > > #mana_results_datatable .w-40 { >@@ -99,7 +99,7 @@ del { > } > > .report_info { >- color: #696969; >+ color: #696969; > text-align: right; > margin: 0 5px; > } >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