Bugzilla – Attachment 191424 Details for
Bug 38122
Cannot sort holdings table by status
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38122: Add the ability to group holdings by status
Bug-38122-Add-the-ability-to-group-holdings-by-sta.patch (text/plain), 2.56 KB, created by
Ayoub Glizi-Vicioso
on 2026-01-14 15:34:15 UTC
(
hide
)
Description:
Bug 38122: Add the ability to group holdings by status
Filename:
MIME Type:
Creator:
Ayoub Glizi-Vicioso
Created:
2026-01-14 15:34:15 UTC
Size:
2.56 KB
patch
obsolete
>From 25a8641519e2335d41bd99eb40a8528dc84d1f9e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 4 Jul 2025 12:07:35 +0200 >Subject: [PATCH] Bug 38122: Add the ability to group holdings by status > >This is a quite ugly solution, but that may answer end-user needs. > >It add the option the group items by status on the bibliographic record >detail page. > >However it will have VERY bad impact on performances for record with a >lot of items, as we are going to determine the status of each items of >the record. >--- > .../tables/items/catalogue_detail.inc | 28 +++++++++++++++++++ > 1 file changed, 28 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >index 65743a2f0e..8d602d288c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >@@ -316,6 +316,25 @@ > } > }); > >+ let group_by_status_values = { >+ holdings: false, >+ otherholdings: false, >+ }; >+ $(".GroupByStatus").on("click",function(e){ >+ e.preventDefault(); >+ let tab_id = $(this).data("tab"); >+ let was_grouped = group_by_status_values[tab_id]; >+ group_by_status_values[tab_id] = !was_grouped; >+ >+ build_items_table(tab_id, true, { destroy: true }, build_items_table_drawncallback ); >+ >+ if ( was_grouped ) { >+ $(this).html('<i class="fa fa-object-group"></i> Group by status</button>'); >+ } else { >+ $(this).html('<i class="fa fa-object-ungroup"></i> Ungroup by status</button>'); >+ } >+ }); >+ > function build_items_table (tab_id, add_filters, dt_options, drawcallback) { > > let table_dt; >@@ -367,6 +386,15 @@ > return $("#" + tab_id + "_status select").val(); > }; > >+ let offset = 2; >+ [% UNLESS Koha.Preference('LocalCoverImages') %]offset--;[% END %] >+ let filters_options = { >+ [offset] : () => all_item_types, >+ [offset+1] : () => all_libraries, >+ [offset+2] : () => all_libraries, >+ [offset+7] : () => all_statuses, >+ }; >+ > let group_by_status = function(){ > if ( group_by_status_values[tab_id] ) { > return 'group_by_status=1'; >-- >2.52.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 38122
:
183789
|
184550
|
187227
|
187410
|
191419
|
191420
|
191421
|
191423
|
191424
|
191425
|
191426
|
191529
|
191530
|
191531
|
191532
|
192992
|
192993
|
192994
|
192995
|
193149
|
193150
|
193151
|
193152
|
193153