From 70d95b515e491e5526c7276f0af03d51ff236d40 Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Sun, 12 Feb 2012 16:36:34 +1300 Subject: [PATCH] Bug 7532 - remove dependency on Date::ICal This removes the dependency on Date::ICal (which is largely unmaintained) and replaces it with DateTime::Format::ICal which can do the same job. It also updates all the docs and installation scripts to handle this change. Note that this causes a minor behaviour change: previously the generated times were converted to UTC, now they are left "floating" (that is, have no timezone attached) and so will appear as the local time when imported into a calendar. I don't anticipate this'll cause any issues however. Signed-off-by: Jared Camins-Esakov --- C4/Installer/PerlDependencies.pm | 10 +++--- INSTALL.fedora7 | 3 +- debian/control | 2 +- install_misc/debian.packages | 2 +- install_misc/install_koha_on_fresh_debian | 2 +- install_misc/ubuntu.packages | 2 +- install_misc/ubuntu_maverick.packages | 2 +- opac/opac-ics.pl | 39 ++++++++++++----------- 8 files changed, 32 insertions(+), 30 deletions(-) diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm index 939ed10741..0a888a8124 100644 --- a/C4/Installer/PerlDependencies.pm +++ b/C4/Installer/PerlDependencies.pm @@ -259,11 +259,6 @@ our $PERL_DEPS = { 'required' => '1', 'min_ver' => '5.43' }, - 'Date::ICal' => { - 'usage' => 'Core', - 'required' => '1', - 'min_ver' => '1.72' - }, 'MARC::Crosswalk::DublinCore' => { 'usage' => 'Core', 'required' => '1', @@ -484,6 +479,11 @@ our $PERL_DEPS = { 'required' => '1', 'min_ver' => '1.03', }, + 'DateTime::Format::ICal' => { + 'usage' => 'Core', + 'required' => '1', + 'min_ver' => '0.09', + }, }; 1; diff --git a/INSTALL.fedora7 b/INSTALL.fedora7 index 6694eb724a..5e5f0d48ad 100644 --- a/INSTALL.fedora7 +++ b/INSTALL.fedora7 @@ -746,6 +746,8 @@ Net::Z3950::ZOOM Net::LDAP::Filter HTML::Template::Pro Data::ICal +DateTime +DateTime::Format::ICal GD::Barcode::UPCE Algorithm::CheckDigits::M43_001 Biblio::EndnoteStyle @@ -753,7 +755,6 @@ Schedule::At Barcode::Code128 CGI::Session Class::Factory::Util -Date::ICal Date::Manip Lingua::Stem List::MoreUtils diff --git a/debian/control b/debian/control index ec8a7512af..877f3affc3 100644 --- a/debian/control +++ b/debian/control @@ -18,8 +18,8 @@ Build-Depends: libcgi-session-driver-memcached-perl, libclass-factory-util-perl, libdata-ical-perl, libdate-calc-perl, - libdate-ical-perl, libdate-manip-perl, + libdatetime-format-ical-perl, libdatetime-perl, libdbd-mysql-perl, libdbd-sqlite2-perl, diff --git a/install_misc/debian.packages b/install_misc/debian.packages index 8c339607f6..6be4daa61a 100644 --- a/install_misc/debian.packages +++ b/install_misc/debian.packages @@ -17,8 +17,8 @@ libcgi-session-serialize-yaml-perl install libclass-factory-util-perl install libdata-ical-perl install libdate-calc-perl install -libdate-ical-perl install libdate-manip-perl install +libdatetime-format-ical-perl install libdatetime-format-mail-perl install libdatetime-format-strptime-perl install libdatetime-format-w3cdtf-perl install diff --git a/install_misc/install_koha_on_fresh_debian b/install_misc/install_koha_on_fresh_debian index 6ff1e14a80..d4b313bc39 100644 --- a/install_misc/install_koha_on_fresh_debian +++ b/install_misc/install_koha_on_fresh_debian @@ -440,8 +440,8 @@ mysql-server libcgi-session-perl libdate-calc-perl libdate-manip-perl -libdate-ical-perl libdatetime-format-mail-perl +libdatetime-format-ical-perl liblingua-stem-perl libdatetime-format-strptime-perl libdatetime-format-w3cdtf-perl diff --git a/install_misc/ubuntu.packages b/install_misc/ubuntu.packages index 93a0844e9c..f211769fd5 100644 --- a/install_misc/ubuntu.packages +++ b/install_misc/ubuntu.packages @@ -56,9 +56,9 @@ libcgi-session-serialize-yaml-perl install libclass-factory-util-perl install libdata-ical-perl install libdate-calc-perl install -libdate-ical-perl install libdate-manip-perl install libdatetime-perl install +libdatetime-format-ical-perl install libdatetime-format-mail-perl install libdatetime-format-strptime-perl install libdatetime-format-w3cdtf-perl install diff --git a/install_misc/ubuntu_maverick.packages b/install_misc/ubuntu_maverick.packages index fe04038f3e..9b806bbdad 100644 --- a/install_misc/ubuntu_maverick.packages +++ b/install_misc/ubuntu_maverick.packages @@ -58,9 +58,9 @@ libcgi-session-serialize-yaml-perl install libclass-factory-util-perl install libdata-ical-perl install libdate-calc-perl install -libdate-ical-perl install libdate-manip-perl install libdatetime-perl install +libdatetime-format-ical-perl install libdatetime-format-mail-perl install libdatetime-format-strptime-perl install libdatetime-format-w3cdtf-perl install diff --git a/opac/opac-ics.pl b/opac/opac-ics.pl index 5a8512a24a..337a939a2b 100755 --- a/opac/opac-ics.pl +++ b/opac/opac-ics.pl @@ -25,7 +25,8 @@ use warnings; use CGI; use Data::ICal; use Data::ICal::Entry::Event; -use Date::ICal; +use DateTime; +use DateTime::Format::ICal; use Date::Calc qw (Parse_Date); use C4::Auth; @@ -60,28 +61,28 @@ foreach my $issue ( @$issues ) { my ($year,$month,$day)=Parse_Date($issue->{'date_due'}); ($year,$month,$day)=split /-|\/|\.|:/,$issue->{'date_due'} unless ($year && $month); # Decode_Date_EU2($string)) - my $datestart = Date::ICal->new( - day => $day, - month => $month, - year => $year, - hour => 9, - min => 0, - sec => 0 - )->ical; - my $dateend = Date::ICal->new( - day => $day, - month => $month, - year => $year, - hour => 10, - min => 0, - sec => 0 - )->ical; + my $datestart = DateTime->new( + day => $day, + month => $month, + year => $year, + hour => 9, + minute => 0, + second => 0 + ); + my $dateend = DateTime->new( + day => $day, + month => $month, + year => $year, + hour => 10, + minute => 0, + second => 0 + ); $vevent->add_properties( summary => "$issue->{'title'} Due", description => "Your copy of $issue->{'title'} barcode $issue->{'barcode'} is due back at the library today", - dtstart => $datestart, - dtend => $dateend, + dtstart => DateTime::Format::ICal->format_datetime($datestart), + dtend => DateTime::Format::ICal->format_datetime($dateend), ); $calendar->add_entry($vevent); } -- 2.39.5