Bugzilla – Attachment 44943 Details for
Bug 14870
Delete C4/Dates.pm from System
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14969: (followup) Remove stray C4::Dates
Bug-14969-followup-Remove-stray-C4Dates.patch (text/plain), 5.04 KB, created by
Marc Véron
on 2015-11-18 08:22:28 UTC
(
hide
)
Description:
Bug 14969: (followup) Remove stray C4::Dates
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-11-18 08:22:28 UTC
Size:
5.04 KB
patch
obsolete
>From ef8eafc74e33aa108042da0ee8a3aab559891031 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Wed, 18 Nov 2015 08:57:27 +0100 >Subject: [PATCH] Bug 14969: (followup) Remove stray C4::Dates > >(See comment #23) > >This patch removes stray C4::Dates (date_fromat...) from >C4/Items.pm >C4/Log.pm >C4/Serials.pm >serials/acqui-search-result.pl >t/DateUtils.t >t/db_dependent/Items/GetItemsForInventory.t >tools/koha-news.pl > >Some of them were inside comments etc. > >To test: >- git grep 'C4::Dates' should give no result >- git grep 'format_d' should give no result > Exception: in one cron job there exists an own sub format_date, and occurences not > related to C4::Dates >- Search for regressions > >http://bugs.koha-community.org/show_bug.cgi?id=14870 >--- > C4/Items.pm | 2 +- > C4/Log.pm | 2 +- > C4/Serials.pm | 2 +- > serials/acqui-search-result.pl | 6 +++--- > t/DateUtils.t | 2 -- > t/db_dependent/Items/GetItemsForInventory.t | 2 +- > tools/koha-news.pl | 1 - > 7 files changed, 7 insertions(+), 10 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index c8078b0..a7db6ef 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1101,7 +1101,7 @@ sub GetItemsForInventory { > } > > if ($datelastseen) { >- $datelastseen = format_date_in_iso($datelastseen); >+ $datelastseen = output_pref({ str => $datelastseen, dateformat => 'iso', dateonly => 1 }); > push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)'; > push @bind_params, $datelastseen; > } >diff --git a/C4/Log.pm b/C4/Log.pm >index d6926c0..c18794e 100644 >--- a/C4/Log.pm >+++ b/C4/Log.pm >@@ -194,7 +194,7 @@ sub displaylog { > while (my $data = $sth->fetchrow_hashref){ > $data->{hilighted} = ($hilighted>0); > $data->{info} =~ s/\n/<br\/>/g; >- $data->{day} = format_date($data->{timestamp}); >+ $data->{day} = output_pref({ str => $data->{timestamp} }); > push @results, $data; > $count++; > $hilighted = -$hilighted; >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 37e7c16..c001f90 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -863,7 +863,7 @@ $subscription is a hashref containing all the attributes of the table > 'subscription'. > $pattern is a hashref containing all the attributes of the table > 'subscription_numberpatterns'. >-$planneddate is a C4::Dates object. >+$planneddate is a date sting in iso format. > This function get the next issue for the subscription given on input arg > > =cut >diff --git a/serials/acqui-search-result.pl b/serials/acqui-search-result.pl >index 6e4d944..4be4d84 100755 >--- a/serials/acqui-search-result.pl >+++ b/serials/acqui-search-result.pl >@@ -47,7 +47,7 @@ use C4::Biblio; > use C4::Output; > use CGI qw ( -utf8 ); > use C4::Acquisition qw( SearchOrders ); >-use C4::Dates qw/format_date/; >+use Koha::DateUtils; > > use Koha::Acquisition::Bookseller; > >@@ -79,8 +79,8 @@ for my $s (@suppliers) { > basketno => $ord->{'basketno'}, > total => $ord->{'count(*)'}, > authorisedby => $ord->{'authorisedby'}, >- creationdate => format_date($ord->{'creationdate'}), >- closedate => format_date($ord->{'closedate'}), >+ creationdate => output_pref( { str => $ord->{'creationdate'} } ), >+ closedate => output_pref( { str => $ord->{'closedate'} } ), > }; > } > push @{$loop_suppliers}, { >diff --git a/t/DateUtils.t b/t/DateUtils.t >index ca60372..92f8777 100755 >--- a/t/DateUtils.t >+++ b/t/DateUtils.t >@@ -91,8 +91,6 @@ cmp_ok( $new_dt->ymd(), 'eq', $testdate_iso, 'sql returns correct date' ); > $new_dt = dt_from_string( $dt, 'iso' ); > isa_ok( $new_dt, 'DateTime', 'Passed a DateTime dt_from_string returns it' ); > >-# C4::Dates allowed 00th of the month >- > my $ymd = '2012-01-01'; > my $dt0 = dt_from_string( '00/01/2012', 'metric' ); > isa_ok( $dt0, 'DateTime', >diff --git a/t/db_dependent/Items/GetItemsForInventory.t b/t/db_dependent/Items/GetItemsForInventory.t >index 3a0a4d3..7d6df0a 100755 >--- a/t/db_dependent/Items/GetItemsForInventory.t >+++ b/t/db_dependent/Items/GetItemsForInventory.t >@@ -91,7 +91,7 @@ sub OldWay { > } > > if ($datelastseen) { >- $datelastseen = format_date_in_iso($datelastseen); >+ $datelastseen = output_pref({ str => $datelastseen, dateformat => 'iso', dateonly => 1 }); > push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)'; > push @bind_params, $datelastseen; > } >diff --git a/tools/koha-news.pl b/tools/koha-news.pl >index 5599e79..9af1640 100755 >--- a/tools/koha-news.pl >+++ b/tools/koha-news.pl >@@ -150,7 +150,6 @@ else { > > foreach my $new ( @$opac_news ) { > next unless $new->{'expirationdate'}; >- #$new->{'expirationdate'}=format_date_in_iso($new->{'expirationdate'}); > my @date = split (/-/,$new->{'expirationdate'}); > if ($date[0]*$date[1]*$date[2]>0 && Date_to_Days( @date ) < Date_to_Days(&Today) ){ > $new->{'expired'} = 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 14870
:
44595
|
44612
|
44613
|
44623
|
44625
|
44626
|
44943
|
44944
|
44954
|
44997
|
44998
|
44999
|
45000
|
45001
|
45002
|
45003
|
45004
|
45005
|
45006
|
45007
|
45008
|
45009
|
45010
|
45011
|
45012
|
45013
|
45014
|
45015