Bugzilla – Attachment 105322 Details for
Bug 25553
Edit item date sort does not sort correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25553: Make date columns sortable on the edit items table
Bug-25553-Make-date-columns-sortable-on-the-edit-i.patch (text/plain), 3.42 KB, created by
Jonathan Druart
on 2020-05-25 08:12:04 UTC
(
hide
)
Description:
Bug 25553: Make date columns sortable on the edit items table
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-05-25 08:12:04 UTC
Size:
3.42 KB
patch
obsolete
>From a6a430f93647aa412586c8a3793d8d551012d48e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 22 May 2020 11:02:39 +0200 >Subject: [PATCH] Bug 25553: Make date columns sortable on the edit items table > >When editing items, the table at the top contain several columns that >have date values, but they cannot be sorted by dates correctly. > >Test plan: >Have several items with different dates in columns that contain dates, >like items.dateaccessioned, items.datelastseen) >Sort the column and confirm that with this patch the lines are sorted >correctly >--- > cataloguing/additem.pl | 2 +- > .../prog/en/modules/cataloguing/additem.tt | 14 ++++++++++++-- > 2 files changed, 13 insertions(+), 3 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index b0ce8b58c5..130ff0a3f2 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -872,7 +872,7 @@ for my $row ( @big_array ) { > { > my ( undef, $subfield ) = GetMarcFromKohaField($kohafield); > next unless $key eq $subfield; >- $item_field->{field} = output_pref( { str => $row->{$key}, dateonly => 1 } ); >+ $item_field->{datatype} = 'date'; > } > > push @item_fields, $item_field; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >index 463edf4e08..f8fff0ddd1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -1,6 +1,7 @@ > [% USE raw %] > [% USE Asset %] > [% USE Koha %] >+[% USE KohaDates %] > [% USE ColumnsSettings %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Cataloging › [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %]) › Items</title> >@@ -45,6 +46,7 @@ > > <div id="cataloguing_additem_itemlist"> > [% IF ( item_loop ) %] >+ [% SET date_fields = [ 'dateaccessioned', 'onloan', 'datelastseen', 'datelastborrowed', 'replacementpricedate' ] %] > <div> > <table id="itemst"> > <thead> >@@ -52,7 +54,11 @@ > <th> </th> > [% FOREACH item_header IN item_header_loop %] > [% IF item_header.column_name %] >- <th data-colname="[% item_header.column_name | html %]"> >+ [% IF date_fields.grep(item_header.column_name).size %] >+ <th class="title-string" data-colname="[% item_header.column_name | html %]"> >+ [% ELSE %] >+ <th data-colname="[% item_header.column_name | html %]"> >+ [% END %] > [% ELSE %] > <th> > [% END %] >@@ -106,7 +112,11 @@ > </td> > [% END %] > [% FOREACH item_valu IN item_loo.item_value %] >- <td>[% item_valu.field | html %]</td> >+ [% IF item_valu.datatype == 'date' %] >+ <td><span title="[% item_valu.field | html %]">[% item_valu.field | $KohaDates %]</span></td> >+ [% ELSE %] >+ <td>[% item_valu.field | html %]</td> >+ [% END %] > [% END %] > </tr> > [% END %] >-- >2.20.1
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 25553
:
105252
|
105322
|
105332
|
106086