Skip to content

Commit

Permalink
Item13005: depend on latest MetaDataPlugin >= 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Aug 28, 2014
1 parent 0919831 commit 37bd71d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 17 deletions.
9 changes: 9 additions & 0 deletions .gitignore
@@ -0,0 +1,9 @@
*.gz
*.swp
ICalPlugin.md5
ICalPlugin.sha1
ICalPlugin.tgz
ICalPlugin.txt
ICalPlugin.zip
ICalPlugin_installer
ICalPlugin_installer.pl
6 changes: 3 additions & 3 deletions data/Sandbox/ICalHolidayListDemo.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="autosave" date="1356288713" format="1.1" version="83"}%
%META:TOPICINFO{author="ProjectContributor" comment="reprev" date="1397816602" format="1.1" version="1"}%
%META:TOPICPARENT{name="WebHome"}%
---+!! %TOPIC%

Expand Down Expand Up @@ -43,9 +43,9 @@

%INCLUDE{"%SYSTEMWEB%.EventTopic" section="init"}%

%META:FILEATTACHMENT{name="events.ics" attachment="events.ics" attr="" comment="" date="1336488720" size="1345" user="ProjectContributor" version="1"}%
%META:PREFERENCE{name="NATSKIN_SIDEBAR" title="NATSKIN_SIDEBAR" type="Local" value="off"}%
%META:FILEATTACHMENT{name="events.ics" attr="" autoattached="1" comment="" date="1336647548" path="events.ics" size="3417" user="ProjectContributor" version="1"}%
%META:EVENT{name="id1" EndDate="10 Mar 2012" Interval="" Month="" MonthDay="" Recurrence="weekly" StartDate="6 Mar 2012" Summary="" TopicTitle="CeBIT" WeekDay="tu, we, th, fr, sa" YearDay=""}%
%META:EVENT{name="id2" EndDate="17 Mar 2012" Interval="" Month="" MonthDay="" Recurrence="daily" StartDate="6 Mar 2012" Summary="" TopicTitle="Test from Foswiki" WeekDay="" YearDay=""}%
%META:EVENT{name="id3" EndDate="" Interval="" Month="" MonthDay="" Recurrence="none" StartDate="26 Apr 2012" Summary="" TopicTitle="Noch ein Gedicht" WeekDay="" YearDay=""}%
%META:EVENT{name="id4" EndDate="" Interval="" Month="" MonthDay="" Recurrence="weekly" StartDate="" Summary="" TopicTitle="weekly test" WeekDay="mo" YearDay=""}%
%META:PREFERENCE{name="NATSKIN_SIDEBAR" title="NATSKIN_SIDEBAR" type="Local" value="off"}%
5 changes: 3 additions & 2 deletions data/System/ICalPlugin.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="autosave" date="1356278772" format="1.1" version="6"}%
%META:TOPICINFO{author="ProjectContributor" comment="autosave" date="1356278772" format="1.1" version="1"}%
---+!! %TOPIC%
%SHORTDESCRIPTION%

Expand Down Expand Up @@ -164,11 +164,12 @@ Finally, the standard foswiki escape variables are expanded:
-->

| Author(s): | Michael Daum|
| Copyright: | © 2011-2013 Michael Daum http://michaeldaumconsulting.com |
| Copyright: | © 2011-2014 Michael Daum http://michaeldaumconsulting.com |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 28 Aug 2014 | depend on !MetaDataPlugin >= 4.0 |
| 07 Nov 2013 | fixed use of deprecated perl syntax in foreach loops |
| 21 Jun 2012 | fixed unintended redirect after save when accessing a view restricted data form |
| 08 May 2012 | fixed processing of weekly recurrences without a <nop>StartDate |
Expand Down
17 changes: 9 additions & 8 deletions lib/Foswiki/Plugins/ICalPlugin.pm
@@ -1,6 +1,6 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# ICalPlugin is Copyright (C) 2011-2013 Michael Daum http://michaeldaumconsulting.com
# ICalPlugin is Copyright (C) 2011-2014 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -20,8 +20,8 @@ use warnings;

use Foswiki::Func ();

our $VERSION = '1.14';
our $RELEASE = '1.14';
our $VERSION = '1.20';
our $RELEASE = '1.20';
our $SHORTDESCRIPTION = 'Access ical data in wikiapps';
our $NO_PREFS_IN_TOPIC = 1;
our $core;
Expand All @@ -47,14 +47,15 @@ sub initPlugin {
require Foswiki::Plugins::MetaDataPlugin;

Foswiki::Plugins::MetaDataPlugin::registerDeleteHandler(
'EVENT',
sub {
my ($web, $topic, $record) = @_;
my ($web, $topic, $key, $record) = @_;

my $core = getCore();
my $event = $core->getEventFromMetaData($web, $topic, $record);
if ($key eq 'EVENT') {
my $core = getCore();
my $event = $core->getEventFromMetaData($web, $topic, $record);

return $core->updateCalendar(undef, [$event]);
return $core->updateCalendar(undef, [$event]);
}
}
);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Foswiki/Plugins/ICalPlugin/Core.pm
@@ -1,6 +1,6 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# ICalPlugin is Copyright (C) 2011-2013 Michael Daum http://michaeldaumconsulting.com
# ICalPlugin is Copyright (C) 2011-2014 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -31,11 +31,11 @@ use Error qw(:try);
use Foswiki::Contrib::JSCalendarContrib ();
#use Data::Dumper ();

use constant DEBUG => 0; # toggle me
use constant TRACE => 0; # toggle me

###############################################################################
sub writeDebug {
print STDERR "ICalPlugin::Core - $_[0]\n" if DEBUG;
print STDERR "ICalPlugin::Core - $_[0]\n" if TRACE;
}

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Plugins/ICalPlugin/DEPENDENCIES
Expand Up @@ -2,4 +2,4 @@ DateTime,>=0,cpan,Required
DateTime::Format::ICal,>=0,cpan,Required
Data::ICal,>=0,cpan,Required
DateTime::Set,>=0,cpan,Required
Foswiki::Plugins::MetaDataPlugin,>=1.1,perl,Optional
Foswiki::Plugins::MetaDataPlugin,>=4.0,perl,Optional

0 comments on commit 37bd71d

Please sign in to comment.