Bugzilla – Attachment 128646 Details for
Bug 17748
Show due date in item search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17748: (follow-up) Fix sorting on new columns
Bug-17748-follow-up-Fix-sorting-on-new-columns.patch (text/plain), 3.51 KB, created by
PTFS Europe Sandboxes
on 2021-12-17 08:57:53 UTC
(
hide
)
Description:
Bug 17748: (follow-up) Fix sorting on new columns
Filename:
MIME Type:
Creator:
PTFS Europe Sandboxes
Created:
2021-12-17 08:57:53 UTC
Size:
3.51 KB
patch
obsolete
>From 5d357f80dde3c3d9cbb4187233052ab431536853 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 6 Dec 2021 19:34:09 +1300 >Subject: [PATCH] Bug 17748: (follow-up) Fix sorting on new columns > >Confirm tests in t/db_dependent/Items.t still pass. > >Signed-off-by: Christian <christian.stelzenmueller@bsz-bw.de> >--- > C4/Items.pm | 16 ++++++++++++---- > .../prog/en/modules/catalogue/itemsearch.tt | 4 ++-- > 2 files changed, 14 insertions(+), 6 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index b0dea91e25..cba5d9e711 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1451,6 +1451,7 @@ sub SearchItems { > LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber > LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber > LEFT JOIN biblio_metadata ON biblio_metadata.biblionumber = biblio.biblionumber >+ LEFT JOIN issues ON issues.itemnumber = items.itemnumber > WHERE 1 > }; > if (defined $where_str and $where_str ne '') { >@@ -1463,10 +1464,17 @@ sub SearchItems { > my @columns = Koha::Database->new()->schema()->resultset('Item')->result_source->columns; > push @columns, Koha::Database->new()->schema()->resultset('Biblio')->result_source->columns; > push @columns, Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns; >- my $sortby = (0 < grep {$params->{sortby} eq $_} @columns) >- ? $params->{sortby} : 'itemnumber'; >- my $sortorder = (uc($params->{sortorder}) eq 'ASC') ? 'ASC' : 'DESC'; >- $query .= qq{ ORDER BY $sortby $sortorder }; >+ push @columns, Koha::Database->new()->schema()->resultset('Issue')->result_source->columns; >+ >+ if ( $params->{sortby} eq 'availability' ) { >+ my $sortorder = (uc($params->{sortorder}) eq 'ASC') ? 'ASC' : 'DESC'; >+ $query .= qq{ ORDER BY onloan $sortorder, damaged $sortorder, withdrawn $sortorder, notforloan $sortorder, itemlost $sortorder }; >+ } else { >+ my $sortby = (0 < grep {$params->{sortby} eq $_} @columns) >+ ? $params->{sortby} : 'itemnumber'; >+ my $sortorder = (uc($params->{sortorder}) eq 'ASC') ? 'ASC' : 'DESC'; >+ $query .= qq{ ORDER BY $sortby $sortorder }; >+ } > > my $rows = $params->{rows}; > my @limit_args; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >index c4aa698c85..42e94c5e0c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >@@ -337,7 +337,7 @@ > + ' <th id="items_widthdrawn">' + _("Withdrawn status") + '</th>' > + ' <th id="items_checkouts">' + _("Checkouts") + '</th>' > + ' <th id="items_availability">' + _("Availability") + '</th>' >- + ' <th id="items_duedate">' + _("Due date") + '</th>' >+ + ' <th id="items_date_due">' + _("Due date") + '</th>' > + ' <th id=""></th>' > + ' </tr>' > var table = '' >@@ -495,7 +495,7 @@ > { 'sName': 'withdrawn' }, > { 'sName': 'issues' }, > { 'sName': 'availability' }, >- { 'sName': 'duedate' }, >+ { 'sName': 'date_due' }, > { 'sName': 'actions', 'bSortable': false } > ], > "sPaginationType": "full_numbers", >-- >2.30.2
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 17748
:
116353
|
119341
|
128332
|
128333
|
128582
|
128583
|
128584
|
128591
|
128638
|
128645
|
128646
|
128647
|
129623
|
129624
|
129625
|
130154
|
130845
|
130846
|
130847
|
130848
|
130849
|
131051
|
132016
|
132201