From 34083b5ddeac98566b389269fc0e082eb1603414 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 6 Aug 2019 08:56:44 -0500 Subject: [PATCH] Bug 13420: Fallback to the previous behavior if published date is not used Signed-off-by: Martin Renvoize Signed-off-by: Josef Moravec Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson --- catalogue/detail.pl | 3 ++- .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 249a7417cb..0dfd0cca17 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -306,7 +306,7 @@ foreach my $item (@items) { $item->{'ccode'} = $collections->{$ccode} if ( defined( $ccode ) && defined($collections) && exists( $collections->{$ccode} ) ); my $copynumber = $item->{'copynumber'}; $item->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumber) && defined($copynumbers) && exists( $copynumbers->{$copynumber} ) ); - foreach (qw(ccode enumchron copynumber stocknumber itemnotes itemnotes_nonpublic uri)) { + foreach (qw(ccode enumchron copynumber stocknumber itemnotes itemnotes_nonpublic uri publisheddate)) { # Warning when removing GetItemsInfo - publisheddate (at least) is not part of the items table $itemfields{$_} = 1 if ( $item->{$_} ); } @@ -408,6 +408,7 @@ $template->param( itemdata_uri => $itemfields{uri}, itemdata_copynumber => $itemfields{copynumber}, itemdata_stocknumber => $itemfields{stocknumber}, + itemdata_publisheddate => $itemfields{publisheddate}, volinfo => $itemfields{enumchron}, itemdata_itemnotes => $itemfields{itemnotes}, itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic}, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 3d065050d5..dbc77be6c7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -229,7 +229,13 @@ Home library [% IF ( itemdata_ccode ) %]Collection[% END %] Call number - [% IF volinfo %]Serial enumeration / chronology[% END %] + [% IF volinfo %] + [% IF itemdate_publisheddate #If there is at least one published date, use it for sorting%] + Serial enumeration / chronology + [% ELSE %] + Serial enumeration / chronology + [% END %] + [% END %] Status Last seen Date accessioned @@ -272,7 +278,7 @@ [% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %] [% IF ( volinfo ) %] - + [% IF itemdate_publisheddate %][% END %] [% IF ( itemdata_enumchron ) %] [% IF item.enumchron && item.serialseq %] [% item.enumchron | html %] -- 2.39.5