Bugzilla – Attachment 44617 Details for
Bug 14969
Remove C4::Dates from serials/*.pl files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14969: (followup) Remove C4::Dates from C4/Serials.pm
Bug-14969-followup-Remove-C4Dates-from-C4Serialspm.patch (text/plain), 6.06 KB, created by
Marc Véron
on 2015-11-08 09:05:37 UTC
(
hide
)
Description:
Bug 14969: (followup) Remove C4::Dates from C4/Serials.pm
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-11-08 09:05:37 UTC
Size:
6.06 KB
patch
obsolete
>From 9d72b0d6bf4783cca842882aa38a23c365362b5a Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Sun, 8 Nov 2015 09:53:30 +0100 >Subject: [PATCH] Bug 14969: (followup) Remove C4::Dates from C4/Serials.pm > >This is a follow-up removing stray C4::Dates > >The patch removes C4::Dates from file C4/Serials.pm. > >To test: >- Go to Home > Serials >- Add, edit serials and routing lists with focus on date entry and display >- Verify that information for serials on item detail pages look fine in OPAC > and staff client as well >- Try to find regressions >--- > C4/Serials.pm | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 7e977df..ba8eb46 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -22,7 +22,6 @@ use Modern::Perl; > > use C4::Auth qw(haspermission); > use C4::Context; >-use C4::Dates qw(format_date format_date_in_iso); > use DateTime; > use Date::Calc qw(:all); > use POSIX qw(strftime); >@@ -32,6 +31,7 @@ use C4::Debug; > use C4::Serials::Frequency; > use C4::Serials::Numberpattern; > use Koha::AdditionalField; >+use Koha::DateUtils; > > use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); > >@@ -467,9 +467,9 @@ sub GetSubscriptionsFromBiblionumber { > $sth->execute($biblionumber); > my @res; > while ( my $subs = $sth->fetchrow_hashref ) { >- $subs->{startdate} = format_date( $subs->{startdate} ); >- $subs->{histstartdate} = format_date( $subs->{histstartdate} ); >- $subs->{histenddate} = format_date( $subs->{histenddate} ); >+ $subs->{startdate} = output_pref( { dt => dt_from_string( $subs->{startdate}), dateonly => 1 } ); >+ $subs->{histstartdate} = output_pref( { dt => dt_from_string( $subs->{startdate}), dateonly => 1 } ); >+ $subs->{histenddate} = output_pref( { dt => dt_from_string( $subs->{startdate}), dateonly => 1 } ); > $subs->{opacnote} =~ s/\n/\<br\/\>/g; > $subs->{missinglist} =~ s/\n/\<br\/\>/g; > $subs->{recievedlist} =~ s/\n/\<br\/\>/g; >@@ -480,7 +480,7 @@ sub GetSubscriptionsFromBiblionumber { > if ( $subs->{enddate} eq '0000-00-00' ) { > $subs->{enddate} = ''; > } else { >- $subs->{enddate} = format_date( $subs->{enddate} ); >+ $subs->{enddate} = output_pref( { dt => dt_from_string( $subs->{startdate}), dateonly => 1 } ); > } > $subs->{'abouttoexpire'} = abouttoexpire( $subs->{'subscriptionid'} ); > $subs->{'subscriptionexpired'} = HasSubscriptionExpired( $subs->{'subscriptionid'} ); >@@ -710,7 +710,7 @@ sub GetSerials { > $line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list > for my $datefield ( qw( planneddate publisheddate) ) { > if ($line->{$datefield} && $line->{$datefield}!~m/^00/) { >- $line->{$datefield} = format_date( $line->{$datefield}); >+ $line->{$datefield} = output_pref( { dt => dt_from_string( $line->{$datefield} ), dateonly => 1 } ); > } else { > $line->{$datefield} = q{}; > } >@@ -733,7 +733,7 @@ sub GetSerials { > $line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list > for my $datefield ( qw( planneddate publisheddate) ) { > if ($line->{$datefield} && $line->{$datefield}!~m/^00/) { >- $line->{$datefield} = format_date( $line->{$datefield}); >+ $line->{$datefield} = output_pref( { dt => dt_from_string( $line->{$datefield} ), dateonly => 1 } ); > } else { > $line->{$datefield} = q{}; > } >@@ -788,7 +788,7 @@ sub GetSerials2 { > $line->{$datefield} = q{}; > } > else { >- $line->{$datefield} = format_date( $line->{$datefield} ); >+ $line->{$datefield} = output_pref( { dt => dt_from_string( $line->{$datefield} ), dateonly => 1 } ); > } > } > push @serials, $line; >@@ -824,8 +824,8 @@ 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"} = format_date( $line->{"planneddate"} ); >- $line->{"publisheddate"} = format_date( $line->{"publisheddate"} ); >+ $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; > } > >@@ -1631,7 +1631,7 @@ sub ItemizeSerials { > $sth->execute( $data->{'biblionumber'} ); > my $biblioitem = $sth->fetchrow_hashref; > $biblioitem->{'volumedate'} = $data->{planneddate}; >- $biblioitem->{'volumeddesc'} = $data->{serialseq} . ' (' . format_date( $data->{'planneddate'} ) . ')'; >+ $biblioitem->{'volumeddesc'} = $data->{serialseq} . ' (' . output_pref( { dt => dt_from_string( $line->{"planneddate"} ), dateonly => 1 } ) . ')'; > $biblioitem->{'dewey'} = $info->{itemcallnumber}; > } > } >@@ -1983,11 +1983,11 @@ sub GetLateOrMissingIssues { > > if ($line->{planneddate} && $line->{planneddate} !~/^0+\-/) { > $line->{planneddateISO} = $line->{planneddate}; >- $line->{planneddate} = format_date( $line->{planneddate} ); >+ $line->{planneddate} = output_pref( { dt => dt_from_string( $line->{"planneddate"} ), dateonly => 1 } ); > } > if ($line->{claimdate} && $line->{claimdate} !~/^0+\-/) { > $line->{claimdateISO} = $line->{claimdate}; >- $line->{claimdate} = format_date( $line->{claimdate} ); >+ $line->{claimdate} = output_pref( { dt => dt_from_string( $line->{"claimdate"} ), dateonly => 1 } ); > } > $line->{"status".$line->{status}} = 1; > >-- >1.7.10.4
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 14969
:
43182
|
44441
|
44526
|
44527
|
44528
|
44549
|
44550
|
44617
|
44618
|
44694
|
44735
|
44763
|
44775
|
44794
|
44799
|
44930
|
44931