From 1cdf657c057a7a565016df28a17151a2f4fce134 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 17 May 2019 13:19:33 +0000 Subject: [PATCH] Bug 22932: GetLatestSerials should not return formatted date This patch updates GetLatestSerials in Serials.pm to remove date formatting. Formatting of dates should be done in the template using $KohaDates. To test, apply the patch and locate a bibliographic record in the staff client which has a subscription with issues. - On the bibliographic detail page for that record, view the "Subscriptions" tab. Dates in the table of recent issues should be formatted correctly. - View the details for the subscription in the Serials module. Create or edit a routing list for that serial. In the "Issue" dropdown the issue dates should be formatted correctly. - View the bibliographic detail page for the record in the OPAC. Open the "Subscriptions" tab. In the table of recent issues publication date and received date should be formatted correctly. The table should sort correctly on these dates. Note: Although opac-ISBDdetail.pl calls GetLatestSerials, as far as I can tell there is no serial-related output to update. The code appears to be unused. Signed-off-by: Maryse Simard Signed-off-by: Josef Moravec Signed-off-by: Nick Clemens --- C4/Serials.pm | 2 -- .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 4 ++-- .../intranet-tmpl/prog/en/modules/serials/routing.tt | 9 +++++++-- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 8069620be8..4eb23dfa9e 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -785,8 +785,6 @@ sub GetLatestSerials { my @serials; while ( my $line = $sth->fetchrow_hashref ) { $line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list - $line->{planneddate} = output_pref( { dt => dt_from_string( $line->{planneddate} ), dateonly => 1 } ); - $line->{publisheddate} = output_pref( { dt => dt_from_string( $line->{publisheddate} ), dateonly => 1 } ); push @serials, $line; } 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 6520134dc2..6af2687453 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -518,8 +518,8 @@ [% FOREACH latestserial IN subscription.latestserials %] [% latestserial.serialseq | html %] - [% latestserial.planneddate | html %] - [% latestserial.publisheddate | html %] + [% latestserial.planneddate | $KohaDates %] + [% latestserial.publisheddate | $KohaDates %] [% IF ( latestserial.status1 ) %]Expected[% END %] [% IF ( latestserial.status2 ) %]Arrived[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt index b93120fc61..317bfc4e05 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt @@ -1,3 +1,4 @@ +[% USE KohaDates %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Serials › [% title | html %] › [% IF ( op ) %]Create routing list[% ELSE %]Edit routing list[% END %] @@ -35,8 +36,12 @@
  1. [% issue | html %]
  2. diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index d17c6eec0d..d3e95f0097 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -853,8 +853,8 @@ [% FOREACH latestserial IN subscription.latestserials %] [% latestserial.serialseq | html %] - [% latestserial.publisheddate | html %] - [% latestserial.planneddate | html %] + [% latestserial.publisheddate | $KohaDates %] + [% latestserial.planneddate | $KohaDates %] [% IF (latestserial.status1 ) %]Expected[% END %] [% IF (latestserial.status2 ) %]Arrived[% END %] -- 2.39.5