Bug 7532 - remove dependency on Date::ICal
authorRobin Sheat <robin@catalyst.net.nz>
Sun, 12 Feb 2012 03:36:34 +0000 (16:36 +1300)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 17 Feb 2012 10:49:05 +0000 (11:49 +0100)
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 <jcamins@cpbibliography.com>
C4/Installer/PerlDependencies.pm
INSTALL.fedora7
debian/control
install_misc/debian.packages
install_misc/install_koha_on_fresh_debian
install_misc/ubuntu.packages
install_misc/ubuntu_maverick.packages
opac/opac-ics.pl

index 939ed10..0a888a8 100644 (file)
@@ -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;
index 6694eb7..5e5f0d4 100644 (file)
@@ -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
index ec8a751..877f3af 100644 (file)
@@ -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,
index 8c33960..6be4daa 100644 (file)
@@ -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
index 6ff1e14..d4b313b 100644 (file)
@@ -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
index 93a0844..f211769 100644 (file)
@@ -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
index fe04038..9b806bb 100644 (file)
@@ -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
index 5a8512a..337a939 100755 (executable)
@@ -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);
 }