init III
This commit is contained in:
101
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm.pm
Normal file
101
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm.pm
Normal file
@@ -0,0 +1,101 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::Alarm;
|
||||
|
||||
use base qw/Data::ICal::Entry/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::Alarm - Abstract base class for alarms
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
L<Data::ICal::Entry::Alarm> is an abstract base class for the other type
|
||||
of supported by alarms:
|
||||
|
||||
=over
|
||||
|
||||
=item L<Data::ICal::Entry::Alarm::Audio>
|
||||
|
||||
=item L<Data::ICal::Entry::Alarm::Display>
|
||||
|
||||
=item L<Data::ICal::Entry::Alarm::Email>
|
||||
|
||||
=item L<Data::ICal::Entry::Alarm::Procedure>
|
||||
|
||||
=back
|
||||
|
||||
It is a subclass of L<Data::ICal::Entry> and accepts all of its methods.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 new
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = $class->SUPER::new(@_);
|
||||
die "Can't instantiate abstract base class Data::ICal::Entry::Alarm"
|
||||
if $class eq __PACKAGE__;
|
||||
return $self;
|
||||
}
|
||||
|
||||
=head2 ical_entry_type
|
||||
|
||||
Returns C<VALARM>, its iCalendar entry name.
|
||||
|
||||
=cut
|
||||
|
||||
sub ical_entry_type {'VALARM'}
|
||||
|
||||
=head2 optional_unique_properties
|
||||
|
||||
According to the iCalendar standard, the C<duration> and C<retreat>
|
||||
properties may be specified at most one time all types of alarms; if one
|
||||
is specified, the other one must be also, though this module does not
|
||||
enforce that restriction.
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_unique_properties {
|
||||
qw(
|
||||
duration repeat
|
||||
);
|
||||
}
|
||||
|
||||
=head2 mandatory_unique_properties
|
||||
|
||||
According to the iCalendar standard, the C<trigger> property must be
|
||||
specified exactly once for an all types of alarms; subclasses may have
|
||||
additional required properties.
|
||||
|
||||
In addition, the C<action> property must be specified exactly once, but
|
||||
all subclasses automatically set said property appropriately.
|
||||
|
||||
=cut
|
||||
|
||||
sub mandatory_unique_properties {
|
||||
qw(
|
||||
action trigger
|
||||
);
|
||||
}
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
76
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm/Audio.pm
Normal file
76
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm/Audio.pm
Normal file
@@ -0,0 +1,76 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::Alarm::Audio;
|
||||
|
||||
use base qw/Data::ICal::Entry::Alarm/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::Alarm::Audio - Represents an audio alarm in an iCalendar file
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $valarm = Data::ICal::Entry::Alarm::Audio->new();
|
||||
$valarm->add_properties(
|
||||
attach => [ "ftp://host.com/pub/sounds/bell-01.aud", { fmttype => "audio/basic" } ],
|
||||
# Dat*e*::ICal is not a typo here
|
||||
trigger => [ Date::ICal->new( epoch => ... )->ical, { value => 'DATE-TIME' } ],
|
||||
);
|
||||
|
||||
$vevent->add_entry($valarm);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A L<Data::ICal::Entry::Alarm::Audio> object represents an audio alarm
|
||||
attached to a todo item or event in an iCalendar file. (Note that the
|
||||
iCalendar RFC refers to entries as "components".) It is a subclass of
|
||||
L<Data::ICal::Entry::Alarm> and accepts all of its methods.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 new
|
||||
|
||||
Creates a new L<Data::ICal::Entry::Alarm::Audio> object; sets its
|
||||
C<ACTION> property to C<AUDIO>.
|
||||
|
||||
=cut
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = $class->SUPER::new(@_);
|
||||
$self->add_property( action => "AUDIO" );
|
||||
return $self;
|
||||
}
|
||||
|
||||
=head2 optional_unique_properties
|
||||
|
||||
In addition to C<duration> and C<repeat> (see
|
||||
L<Data::ICal::Entry::Alarm/optional_unique_properties>), audio alarms
|
||||
may specify a value for C<attach>.
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_unique_properties {
|
||||
return (
|
||||
shift->SUPER::optional_unique_properties,
|
||||
"attach",
|
||||
);
|
||||
}
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
77
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm/Display.pm
Normal file
77
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm/Display.pm
Normal file
@@ -0,0 +1,77 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::Alarm::Display;
|
||||
|
||||
use base qw/Data::ICal::Entry::Alarm/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::Alarm::Display - Represents a displayed alarm in an iCalendar file
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $valarm = Data::ICal::Entry::Alarm::Display->new();
|
||||
$valarm->add_properties(
|
||||
description => "Wake up!",
|
||||
# Dat*e*::ICal is not a typo here
|
||||
trigger => [ Date::ICal->new( epoch => ... )->ical, { value => 'DATE-TIME' } ],
|
||||
);
|
||||
|
||||
$vevent->add_entry($valarm);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A L<Data::ICal::Entry::Alarm::Display> object represents a alarm that
|
||||
displays a message which is attached to a todo item or event in an
|
||||
iCalendar file. (Note that the iCalendar RFC refers to entries as
|
||||
"components".) It is a subclass of L<Data::ICal::Entry::Alarm> and
|
||||
accepts all of its methods.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 new
|
||||
|
||||
Creates a new L<Data::ICal::Entry::Alarm::Display> object; sets its
|
||||
C<ACTION> property to C<DISPLAY>.
|
||||
|
||||
=cut
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = $class->SUPER::new(@_);
|
||||
$self->add_property( action => "DISPLAY" );
|
||||
return $self;
|
||||
}
|
||||
|
||||
=head2 mandatory_unique_properties
|
||||
|
||||
In addition to C<action> and C<trigger> (see
|
||||
L<Data::ICal::Entry::Alarm/mandatory_unique_properties>), displayed
|
||||
alarms must also specify a value for C<description>.
|
||||
|
||||
=cut
|
||||
|
||||
sub mandatory_unique_properties {
|
||||
return (
|
||||
shift->SUPER::mandatory_unique_properties,
|
||||
"description",
|
||||
);
|
||||
}
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
106
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm/Email.pm
Normal file
106
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm/Email.pm
Normal file
@@ -0,0 +1,106 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::Alarm::Email;
|
||||
|
||||
use base qw/Data::ICal::Entry::Alarm/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::Alarm::Email - Represents an emailed alarm in an iCalendar file
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $valarm = Data::ICal::Entry::Alarm::Audio->new();
|
||||
$valarm->add_properties(
|
||||
attach => [ "basic:ftp://host.com/pub/sounds/bell-01.aud", { fmttype => "audio/basic" } ],
|
||||
# Dat*e*::ICal is not a typo here
|
||||
trigger => [ Date::ICal->new( epoch => ... )->ical, { value => 'DATE-TIME' } ],
|
||||
);
|
||||
|
||||
$vevent->add_entry($valarm);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A L<Data::ICal::Entry::Alarm::Email> object represents an emailed
|
||||
alarm attached to a todo item or event in an iCalendar file. (Note
|
||||
that the iCalendar RFC refers to entries as "components".) It is a
|
||||
subclass of L<Data::ICal::Entry::Alarm> and accepts all of its methods.
|
||||
|
||||
The C<attendee> properties are intended as the recipient list of the
|
||||
email; the C<summary> as its subject; the C<description> as its body;
|
||||
and the C<attach> as its attachments.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 new
|
||||
|
||||
Creates a new L<Data::ICal::Entry::Alarm::Email> object; sets its
|
||||
C<ACTION> property to C<EMAIL>.
|
||||
|
||||
=cut
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = $class->SUPER::new(@_);
|
||||
$self->add_property( action => "EMAIL" );
|
||||
return $self;
|
||||
}
|
||||
|
||||
=head2 mandatory_unique_properties
|
||||
|
||||
In addition to C<action> and C<trigger> (see
|
||||
L<Data::ICal::Entry::Alarm/mandatory_unique_properties>), emailed alarms
|
||||
must also specify a value for C<description> and C<summary>.
|
||||
|
||||
=cut
|
||||
|
||||
sub mandatory_unique_properties {
|
||||
return (
|
||||
shift->SUPER::mandatory_unique_properties,
|
||||
"description", "summary",
|
||||
);
|
||||
}
|
||||
|
||||
=head2 mandatory_repeatable_properties
|
||||
|
||||
According to the iCalendar standard, the C<attendee> property must be
|
||||
specified at least once for an emailed alarm.
|
||||
|
||||
=cut
|
||||
|
||||
sub mandatory_repeatable_properties {
|
||||
qw(
|
||||
attendee
|
||||
);
|
||||
}
|
||||
|
||||
=head2 optional_repeatable_properties
|
||||
|
||||
According to the iCalendar standard, the C<attach> property may be
|
||||
specified any number of times for an emailed alarm.
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_repeatable_properties {
|
||||
qw(
|
||||
attach
|
||||
);
|
||||
}
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
63
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm/None.pm
Normal file
63
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm/None.pm
Normal file
@@ -0,0 +1,63 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::Alarm::None;
|
||||
|
||||
use base qw/Data::ICal::Entry::Alarm/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::Alarm::None - Represents an default no-op alarm
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $valarm = Data::ICal::Entry::Alarm::None->new();
|
||||
$vevent->add_entry($valarm);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A L<Data::ICal::Entry::Alarm::None> object represents a default alarm
|
||||
that does nothing; this is different from a lack of alarm, because
|
||||
clients may be expected to "override" any default alarm present in
|
||||
calendar data with the current value retrieved from the server. This
|
||||
class is a subclass of L<Data::ICal::Entry::Alarm> and accepts all of
|
||||
its methods.
|
||||
|
||||
This element is not included in the official iCal RFC, but is rather an
|
||||
unaccepted draft standard; see
|
||||
L<https://tools.ietf.org/html/draft-daboo-valarm-extensions-04#section-11>
|
||||
B<Its interoperability and support is thus limited.> This is alarm type
|
||||
is primarily used by Apple.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 new
|
||||
|
||||
Creates a new L<Data::ICal::Entry::Alarm::None> object; sets its
|
||||
C<ACTION> property to C<NONE>.
|
||||
|
||||
=cut
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = $class->SUPER::new(@_);
|
||||
$self->add_property( action => "NONE" );
|
||||
return $self;
|
||||
}
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
92
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm/Procedure.pm
Normal file
92
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm/Procedure.pm
Normal file
@@ -0,0 +1,92 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::Alarm::Procedure;
|
||||
|
||||
use base qw/Data::ICal::Entry::Alarm/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::Alarm::Procedure - Represents a procedure-call alarm in an iCalendar file
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $valarm = Data::ICal::Entry::Alarm::Procedure->new();
|
||||
$valarm->add_properties(
|
||||
attach => [ "ftp://host.com/novo-procs/felizano.exe", { fmttype => "application/binary" } ],
|
||||
# Dat*e*::ICal is not a typo here
|
||||
trigger => [ Date::ICal->new( epoch => ... )->ical, { value => 'DATE-TIME' } ],
|
||||
);
|
||||
|
||||
$vevent->add_entry($valarm);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A L<Data::ICal::Entry::Alarm::Procedure> object represents an alarm
|
||||
that calls a procedure (in some application-defined way), which is
|
||||
attached to a todo item or event in an iCalendar file. (Note that the
|
||||
iCalendar RFC refers to entries as "components".) It is a subclass of
|
||||
L<Data::ICal::Entry::Alarm> and accepts all of its methods.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 new
|
||||
|
||||
Creates a new L<Data::ICal::Entry::Alarm::Procedure> object; sets its
|
||||
C<ACTION> property to C<PROCEDURE>.
|
||||
|
||||
=cut
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = $class->SUPER::new(@_);
|
||||
$self->add_property( action => "PROCEDURE" );
|
||||
return $self;
|
||||
}
|
||||
|
||||
=head2 optional_unique_properties
|
||||
|
||||
In addition to C<duration> and C<repeat> (see
|
||||
L<Data::ICal::Entry::Alarm/optional_unique_properties>), procedure-call
|
||||
alarms may also specify a value for C<description>.
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_unique_properties {
|
||||
return (
|
||||
shift->SUPER::optional_unique_properties,
|
||||
"description",
|
||||
);
|
||||
}
|
||||
|
||||
=head2 mandatory_unique_properties
|
||||
|
||||
In addition to C<action> and C<trigger> (see
|
||||
L<Data::ICal::Entry::Alarm/mandatory_unique_properties>), procedure-call
|
||||
alarms must also specify a value for C<attach>.
|
||||
|
||||
=cut
|
||||
|
||||
sub mandatory_unique_properties {
|
||||
return (
|
||||
shift->SUPER::mandatory_unique_properties,
|
||||
"attach",
|
||||
);
|
||||
}
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
83
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm/URI.pm
Normal file
83
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Alarm/URI.pm
Normal file
@@ -0,0 +1,83 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::Alarm::URI;
|
||||
|
||||
use base qw/Data::ICal::Entry::Alarm/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::Alarm::URI - Represents notification via a custom URI
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $valarm = Data::ICal::Entry::Alarm::URI->new();
|
||||
$valarm->add_properties(
|
||||
uri => "sms:+15105550101?body=hello%20there",
|
||||
# Dat*e*::ICal is not a typo here
|
||||
trigger => [ Date::ICal->new( epoch => ... )->ical, { value => 'DATE-TIME' } ],
|
||||
);
|
||||
|
||||
$vevent->add_entry($valarm);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A L<Data::ICal::Entry::Alarm::URI> object represents an alarm that
|
||||
notifies via arbitrary URI which is attached to a todo item or event in
|
||||
an iCalendar file. (Note that the iCalendar RFC refers to entries as
|
||||
"components".) It is a subclass of L<Data::ICal::Entry::Alarm> and
|
||||
accepts all of its methods.
|
||||
|
||||
This element is not included in the official iCal RFC, but is rather an
|
||||
unaccepted draft standard; see
|
||||
L<https://tools.ietf.org/html/draft-daboo-valarm-extensions-04#section-6>
|
||||
B<Its interoperability and support is thus limited.> This is alarm type
|
||||
is primarily used by Apple.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 new
|
||||
|
||||
Creates a new L<Data::ICal::Entry::Alarm::Alarm> object; sets its
|
||||
C<ACTION> property to C<NONE>.
|
||||
|
||||
=cut
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = $class->SUPER::new(@_);
|
||||
$self->add_property( action => "URI" );
|
||||
return $self;
|
||||
}
|
||||
|
||||
=head2 mandatory_unique_properties
|
||||
|
||||
In addition to C<action> and C<trigger> (see
|
||||
L<Data::ICal::Entry::Alarm/mandatory_unique_properties>), uri alarms
|
||||
must also specify a value for C<uri>.
|
||||
|
||||
=cut
|
||||
|
||||
sub mandatory_unique_properties {
|
||||
return (
|
||||
shift->SUPER::mandatory_unique_properties,
|
||||
"uri",
|
||||
);
|
||||
}
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
163
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Event.pm
Normal file
163
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Event.pm
Normal file
@@ -0,0 +1,163 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::Event;
|
||||
|
||||
use base qw/Data::ICal::Entry/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::Event - Represents an event in an iCalendar file
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $vevent = Data::ICal::Entry::Event->new();
|
||||
$vevent->add_properties(
|
||||
summary => "my party",
|
||||
description => "I'll cry if I want to",
|
||||
# Dat*e*::ICal is not a typo here
|
||||
dtstart => Date::ICal->new( epoch => time )->ical,
|
||||
);
|
||||
|
||||
$calendar->add_entry($vevent);
|
||||
|
||||
$vevent->add_entry($alarm);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A L<Data::ICal::Entry::Event> object represents a single event in an
|
||||
iCalendar file. (Note that the iCalendar RFC refers to entries as
|
||||
"components".) It is a subclass of L<Data::ICal::Entry> and accepts
|
||||
all of its methods.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 ical_entry_type
|
||||
|
||||
Returns C<VEVENT>, its iCalendar entry name.
|
||||
|
||||
=cut
|
||||
|
||||
sub ical_entry_type {'VEVENT'}
|
||||
|
||||
=head2 mandatory_unique_properties
|
||||
|
||||
The C<uid> property is mandatory if C<rfc_strict> was passed to
|
||||
L<Data::ICal/new>.
|
||||
|
||||
=cut
|
||||
|
||||
sub mandatory_unique_properties {
|
||||
my $self = shift;
|
||||
return $self->rfc_strict ? ("uid") : ()
|
||||
}
|
||||
|
||||
=head2 optional_unique_properties
|
||||
|
||||
According to the iCalendar standard, the following properties may be
|
||||
specified at most one time for an event:
|
||||
|
||||
class created description dtstart geo
|
||||
last-modified location organizer priority
|
||||
dtstamp sequence status summary transp
|
||||
uid url recurrence-id
|
||||
|
||||
In addition, C<dtend> and C<duration> may be specified at most once
|
||||
each, but not both in the same entry (though this restriction is not
|
||||
enforced).
|
||||
|
||||
Or if C<< vcal10 => 1 >>:
|
||||
|
||||
class dcreated completed description dtstart dtend
|
||||
last-modified location rnum priority
|
||||
sequence status summary transp
|
||||
url uid
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_unique_properties {
|
||||
my $self = shift;
|
||||
my @ret = $self->rfc_strict ? () : ("uid");
|
||||
if (not $self->vcal10) {
|
||||
push @ret, qw(
|
||||
class created description dtstart geo
|
||||
last-modified location organizer priority
|
||||
dtstamp sequence status summary transp
|
||||
url recurrence-id
|
||||
|
||||
dtend duration
|
||||
);
|
||||
} else {
|
||||
push @ret, qw(
|
||||
class dcreated completed description dtstart dtend
|
||||
last-modified location rnum priority
|
||||
sequence status summary transp
|
||||
url
|
||||
);
|
||||
}
|
||||
return @ret;
|
||||
}
|
||||
|
||||
=head2 optional_repeatable_properties
|
||||
|
||||
According to the iCalendar standard, the following properties may be
|
||||
specified any number of times for an event:
|
||||
|
||||
attach attendee categories comment
|
||||
contact exdate exrule request-status related-to
|
||||
resources rdate rrule
|
||||
|
||||
Or if C<< vcal10 => 1 >>:
|
||||
|
||||
aalarm attach attendee categories
|
||||
dalarm exdate exrule malarm palarm related-to
|
||||
resources rdate rrule
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_repeatable_properties {
|
||||
my $self = shift;
|
||||
if (not $self->vcal10) {
|
||||
qw(
|
||||
attach attendee categories comment
|
||||
contact exdate exrule request-status related-to
|
||||
resources rdate rrule
|
||||
);
|
||||
} else {
|
||||
qw(
|
||||
aalarm attach attendee categories
|
||||
dalarm exdate exrule malarm palarm related-to
|
||||
resources rdate rrule
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
=over 4
|
||||
|
||||
=item L<Data::ICal::DateTime>
|
||||
|
||||
For date parsing and formatting, including denoting "all day" events,
|
||||
considering using this module. Because it's a "mix in", you can still
|
||||
use all the methods here as well as the new date handling methods it
|
||||
defines.
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
103
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/FreeBusy.pm
Normal file
103
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/FreeBusy.pm
Normal file
@@ -0,0 +1,103 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::FreeBusy;
|
||||
|
||||
use base qw/Data::ICal::Entry/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::FreeBusy - Represents blocks of free and busy time in an iCalendar file
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $vfreebusy = Data::ICal::Entry::FreeBusy->new();
|
||||
$vfreebusy->add_properties(
|
||||
organizer => 'MAILTO:jsmith@host.com',
|
||||
# Dat*e*::ICal is not a typo here
|
||||
freebusy => Date::ICal->new( epoch => ... )->ical . '/' . Date::ICal->new( epoch => ... )->ical,
|
||||
);
|
||||
|
||||
$calendar->add_entry($vfreebusy);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A L<Data::ICal::Entry::FreeBusy> object represents a request for
|
||||
information about free and busy time or a reponse to such a request,
|
||||
in an iCalendar file. (Note that the iCalendar RFC refers to entries
|
||||
as "components".) It is a subclass of L<Data::ICal::Entry> and
|
||||
accepts all of its methods.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 ical_entry_type
|
||||
|
||||
Returns C<VFREEBUSY>, its iCalendar entry name.
|
||||
|
||||
=cut
|
||||
|
||||
sub ical_entry_type {'VFREEBUSY'}
|
||||
|
||||
=head2 mandatory_unique_properties
|
||||
|
||||
The C<uid> property is mandatory if C<rfc_strict> was passed to
|
||||
L<Data::ICal/new>.
|
||||
|
||||
=cut
|
||||
|
||||
sub mandatory_unique_properties {
|
||||
my $self = shift;
|
||||
return $self->rfc_strict ? ("uid") : ()
|
||||
}
|
||||
|
||||
=head2 optional_unique_properties
|
||||
|
||||
According to the iCalendar standard, the following properties may be
|
||||
specified at most one time for a free/busy entry:
|
||||
|
||||
contact dtstart dtend duration dtstamp
|
||||
organizer uid url
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_unique_properties {
|
||||
my $self = shift;
|
||||
my @ret = qw(
|
||||
contact dtstart dtend duration dtstamp
|
||||
organizer url
|
||||
);
|
||||
push @ret, "uid" unless $self->rfc_strict;
|
||||
return @ret;
|
||||
}
|
||||
|
||||
=head2 optional_repeatable_properties
|
||||
|
||||
According to the iCalendar standard, the following properties may be
|
||||
specified any number of times for free/busy entry:
|
||||
|
||||
attendee comment freebusy request-status
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_repeatable_properties {
|
||||
qw(
|
||||
attendee comment freebusy request-status
|
||||
);
|
||||
}
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
109
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Journal.pm
Normal file
109
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Journal.pm
Normal file
@@ -0,0 +1,109 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::Journal;
|
||||
|
||||
use base qw/Data::ICal::Entry/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::Journal - Represents a journal entry in an iCalendar file
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $vjournal = Data::ICal::Entry::Journal->new();
|
||||
$vjournal->add_properties(
|
||||
summary => "Minutes of my party",
|
||||
description => "I cried because I wanted to.",
|
||||
# Dat*e*::ICal is not a typo here
|
||||
dtstart => Date::ICal->new( epoch => time )->ical,
|
||||
);
|
||||
|
||||
$calendar->add_entry($vjournal);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A L<Data::ICal::Entry::Journal> object represents a single journal
|
||||
entry in an iCalendar file. (Note that the iCalendar RFC refers to
|
||||
entries as "components".) It is a subclass of L<Data::ICal::Entry>
|
||||
and accepts all of its methods.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 ical_entry_type
|
||||
|
||||
Returns C<VJOURNAL>, its iCalendar entry name.
|
||||
|
||||
=cut
|
||||
|
||||
sub ical_entry_type {'VJOURNAL'}
|
||||
|
||||
=head2 mandatory_unique_properties
|
||||
|
||||
The C<uid> property is mandatory if C<rfc_strict> was passed to
|
||||
L<Data::ICal/new>.
|
||||
|
||||
=cut
|
||||
|
||||
sub mandatory_unique_properties {
|
||||
my $self = shift;
|
||||
return $self->rfc_strict ? ("uid") : ()
|
||||
}
|
||||
|
||||
=head2 optional_unique_properties
|
||||
|
||||
According to the iCalendar standard, the following properties may be
|
||||
specified at most one time for a journal entry:
|
||||
|
||||
class created description dtstart dtstamp
|
||||
last-modified organizer recurrence-id sequence status
|
||||
summary uid url
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_unique_properties {
|
||||
my $self = shift;
|
||||
my @ret = qw(
|
||||
class created description dtstart dtstamp
|
||||
last-modified organizer recurrence-id sequence status
|
||||
summary url
|
||||
);
|
||||
push @ret, "uid" unless $self->rfc_strict;
|
||||
return @ret;
|
||||
}
|
||||
|
||||
=head2 optional_repeatable_properties
|
||||
|
||||
According to the iCalendar standard, the following properties may be
|
||||
specified any number of times for a journal entry:
|
||||
|
||||
attach attendee categories comment
|
||||
contact exdate exrule related-to rdate
|
||||
rrule request-status
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_repeatable_properties {
|
||||
qw(
|
||||
attach attendee categories comment
|
||||
contact exdate exrule related-to rdate
|
||||
rrule request-status
|
||||
);
|
||||
}
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
89
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/TimeZone.pm
Normal file
89
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/TimeZone.pm
Normal file
@@ -0,0 +1,89 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::TimeZone;
|
||||
|
||||
use base qw/Data::ICal::Entry/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::TimeZone - Represents a time zone definition in an iCalendar file
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $vtimezone = Data::ICal::Entry::TimeZone->new();
|
||||
$vtimezone->add_properties(
|
||||
tzid => "US-Eastern",
|
||||
tzurl => "http://zones.stds_r_us.net/tz/US-Eastern"
|
||||
);
|
||||
|
||||
$vtimezone->add_entry($daylight); # daylight/ standard not yet implemented
|
||||
$vtimezone->add_entry($standard); # :-(
|
||||
|
||||
$calendar->add_entry($vtimezone);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A L<Data::ICal::Entry::TimeZone> object represents the declaration of
|
||||
a time zone in an iCalendar file. (Note that the iCalendar RFC refers
|
||||
to entries as "components".) It is a subclass of L<Data::ICal::Entry>
|
||||
and accepts all of its methods.
|
||||
|
||||
This module is not yet useful, because every time zone declaration
|
||||
needs to contain at least one C<STANDARD> or C<DAYLIGHT> component,
|
||||
and these have not yet been implemented.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 ical_entry_type
|
||||
|
||||
Returns C<VTIMEZONE>, its iCalendar entry name.
|
||||
|
||||
=cut
|
||||
|
||||
sub ical_entry_type {'VTIMEZONE'}
|
||||
|
||||
=head2 optional_unique_properties
|
||||
|
||||
According to the iCalendar standard, the following properties may be
|
||||
specified at most one time for a time zone declaration:
|
||||
|
||||
last-modified tzurl
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_unique_properties {
|
||||
qw(
|
||||
last-modified tzurl
|
||||
);
|
||||
}
|
||||
|
||||
=head2 mandatory_unique_properties
|
||||
|
||||
According to the iCalendar standard, the C<tzid> property must be
|
||||
specified exactly one time in a time zone declaration.
|
||||
|
||||
=cut
|
||||
|
||||
sub mandatory_unique_properties {
|
||||
qw(
|
||||
tzid
|
||||
);
|
||||
}
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
116
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/TimeZone/Daylight.pm
Normal file
116
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/TimeZone/Daylight.pm
Normal file
@@ -0,0 +1,116 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::TimeZone::Daylight;
|
||||
|
||||
use base qw/Data::ICal::Entry/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::TimeZone::Daylight - Represents a Daylight Time base offset from UTC for parent TimeZone
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A time zone is unambiguously defined by the set of time measurement
|
||||
rules determined by the governing body for a given geographic
|
||||
area. These rules describe at a minimum the base offset from UTC for
|
||||
the time zone, often referred to as the Standard Time offset. Many
|
||||
locations adjust their Standard Time forward or backward by one hour,
|
||||
in order to accommodate seasonal changes in number of daylight hours,
|
||||
often referred to as Daylight Saving Time. Some locations adjust their
|
||||
time by a fraction of an hour. Standard Time is also known as Winter
|
||||
Time. Daylight Saving Time is also known as Advanced Time, Summer
|
||||
Time, or Legal Time in certain countries. The following table shows
|
||||
the changes in time zone rules in effect for New York City starting
|
||||
from 1967. Each line represents a description or rule for a particular
|
||||
observance.
|
||||
|
||||
Effective Observance Rule
|
||||
|
||||
Date (Date/Time) Offset Abbreviation
|
||||
|
||||
1967-* last Sun in Oct, 02:00 -0500 EST
|
||||
|
||||
1967-1973 last Sun in Apr, 02:00 -0400 EDT
|
||||
|
||||
1974-1974 Jan 6, 02:00 -0400 EDT
|
||||
|
||||
1975-1975 Feb 23, 02:00 -0400 EDT
|
||||
|
||||
1976-1986 last Sun in Apr, 02:00 -0400 EDT
|
||||
|
||||
1987-* first Sun in Apr, 02:00 -0400 EDT
|
||||
|
||||
Note: The specification of a global time zone registry is not
|
||||
addressed by this document and is left for future study. However,
|
||||
implementers may find the Olson time zone database [TZ] a useful
|
||||
reference. It is an informal, public-domain collection of time zone
|
||||
information, which is currently being maintained by volunteer Internet
|
||||
participants, and is used in several operating systems. This database
|
||||
contains current and historical time zone information for a wide
|
||||
variety of locations around the globe; it provides a time zone
|
||||
identifier for every unique time zone rule set in actual use since
|
||||
1970, with historical data going back to the introduction of standard
|
||||
time.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 ical_entry_type
|
||||
|
||||
Returns C<DAYLIGHT>, its iCalendar entry name.
|
||||
|
||||
=cut
|
||||
|
||||
sub ical_entry_type {'DAYLIGHT'}
|
||||
|
||||
=head2 mandatory_unique_properties
|
||||
|
||||
According to the iCalendar standard, the following properties must be
|
||||
specified exactly one time in a daylight declaration:
|
||||
|
||||
dtstart tzoffsetto tzoffsetfrom
|
||||
|
||||
=cut
|
||||
|
||||
sub mandatory_unique_properties {
|
||||
qw(
|
||||
dtstart
|
||||
tzoffsetto
|
||||
tzoffsetfrom
|
||||
);
|
||||
}
|
||||
|
||||
=head2 optional_repeatable_properties
|
||||
|
||||
According to the iCalendar standard, the following properties may be
|
||||
specified any number of times for a daylight declaration:
|
||||
|
||||
comment rdate rrule tzname
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_repeatable_properties {
|
||||
qw(
|
||||
comment
|
||||
rdate
|
||||
rrule
|
||||
tzname
|
||||
);
|
||||
}
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
116
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/TimeZone/Standard.pm
Normal file
116
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/TimeZone/Standard.pm
Normal file
@@ -0,0 +1,116 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::TimeZone::Standard;
|
||||
|
||||
use base qw/Data::ICal::Entry/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::TimeZone::Standard - Represents a Standard Time base offset from UTC for parent TimeZone
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A time zone is unambiguously defined by the set of time measurement
|
||||
rules determined by the governing body for a given geographic
|
||||
area. These rules describe at a minimum the base offset from UTC for
|
||||
the time zone, often referred to as the Standard Time offset. Many
|
||||
locations adjust their Standard Time forward or backward by one hour,
|
||||
in order to accommodate seasonal changes in number of daylight hours,
|
||||
often referred to as Daylight Saving Time. Some locations adjust their
|
||||
time by a fraction of an hour. Standard Time is also known as Winter
|
||||
Time. Daylight Saving Time is also known as Advanced Time, Summer
|
||||
Time, or Legal Time in certain countries. The following table shows
|
||||
the changes in time zone rules in effect for New York City starting
|
||||
from 1967. Each line represents a description or rule for a particular
|
||||
observance.
|
||||
|
||||
Effective Observance Rule
|
||||
|
||||
Date (Date/Time) Offset Abbreviation
|
||||
|
||||
1967-* last Sun in Oct, 02:00 -0500 EST
|
||||
|
||||
1967-1973 last Sun in Apr, 02:00 -0400 EDT
|
||||
|
||||
1974-1974 Jan 6, 02:00 -0400 EDT
|
||||
|
||||
1975-1975 Feb 23, 02:00 -0400 EDT
|
||||
|
||||
1976-1986 last Sun in Apr, 02:00 -0400 EDT
|
||||
|
||||
1987-* first Sun in Apr, 02:00 -0400 EDT
|
||||
|
||||
Note: The specification of a global time zone registry is not
|
||||
addressed by this document and is left for future study. However,
|
||||
implementers may find the Olson time zone database [TZ] a useful
|
||||
reference. It is an informal, public-domain collection of time zone
|
||||
information, which is currently being maintained by volunteer Internet
|
||||
participants, and is used in several operating systems. This database
|
||||
contains current and historical time zone information for a wide
|
||||
variety of locations around the globe; it provides a time zone
|
||||
identifier for every unique time zone rule set in actual use since
|
||||
1970, with historical data going back to the introduction of standard
|
||||
time.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 ical_entry_type
|
||||
|
||||
Returns C<STANDARD>, its iCalendar entry name.
|
||||
|
||||
=cut
|
||||
|
||||
sub ical_entry_type {'STANDARD'}
|
||||
|
||||
=head2 mandatory_unique_properties
|
||||
|
||||
According to the iCalendar standard, the following properties must be
|
||||
specified exactly one time in a standard time declaration:
|
||||
|
||||
dtstart tzoffsetto tzoffsetfrom
|
||||
|
||||
=cut
|
||||
|
||||
sub mandatory_unique_properties {
|
||||
qw(
|
||||
dtstart
|
||||
tzoffsetto
|
||||
tzoffsetfrom
|
||||
);
|
||||
}
|
||||
|
||||
=head2 optional_repeatable_properties
|
||||
|
||||
According to the iCalendar standard, the following properties may be
|
||||
specified any number of times for a standard time declaration:
|
||||
|
||||
comment rdate rrule tzname
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_repeatable_properties {
|
||||
qw(
|
||||
comment
|
||||
rdate
|
||||
rrule
|
||||
tzname
|
||||
);
|
||||
}
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
150
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Todo.pm
Normal file
150
Perl OTRS/Kernel/cpan-lib/Data/ICal/Entry/Todo.pm
Normal file
@@ -0,0 +1,150 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Data::ICal::Entry::Todo;
|
||||
|
||||
use base qw/Data::ICal::Entry/;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Data::ICal::Entry::Todo - Represents a to-do entry in an iCalendar file
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $vtodo = Data::ICal::Entry::Todo->new();
|
||||
$vtodo->add_properties(
|
||||
summary => "go to sleep",
|
||||
status => 'INCOMPLETE',
|
||||
# Dat*e*::ICal is not a typo here
|
||||
dtstart => Date::ICal->new( epoch => time )->ical,
|
||||
);
|
||||
|
||||
$calendar->add_entry($vtodo);
|
||||
|
||||
$vtodo->add_entry($alarm);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A L<Data::ICal::Entry::Todo> object represents a single to-do entry in
|
||||
an iCalendar file. (Note that the iCalendar RFC refers to entries as
|
||||
"components".) It is a subclass of L<Data::ICal::Entry> and accepts
|
||||
all of its methods.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
=head2 ical_entry_type
|
||||
|
||||
Returns C<VTODO>, its iCalendar entry name.
|
||||
|
||||
=cut
|
||||
|
||||
sub ical_entry_type {'VTODO'}
|
||||
|
||||
=head2 mandatory_unique_properties
|
||||
|
||||
The C<uid> property is mandatory if C<rfc_strict> was passed to
|
||||
L<Data::ICal/new>.
|
||||
|
||||
=cut
|
||||
|
||||
sub mandatory_unique_properties {
|
||||
my $self = shift;
|
||||
return $self->rfc_strict ? ("uid") : ()
|
||||
}
|
||||
|
||||
=head2 optional_unique_properties
|
||||
|
||||
According to the iCalendar standard, the following properties may be
|
||||
specified at most one time for a to-do item:
|
||||
|
||||
class completed created description dtstamp
|
||||
dtstart geo last-modified location organizer
|
||||
percent-complete priority recurrence-id sequence status
|
||||
summary uid url
|
||||
|
||||
In addition, C<due> and C<duration> may be specified at most once
|
||||
each, but not both in the same entry (though this restriction is not
|
||||
enforced).
|
||||
|
||||
Or if C<< vcal10 => 1 >>:
|
||||
|
||||
class dcreated completed description dtstart due
|
||||
last-modified location rnum priority
|
||||
sequence status summary transp
|
||||
url uid
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_unique_properties {
|
||||
my $self = shift;
|
||||
my @ret = $self->rfc_strict ? () : ("uid");
|
||||
if (not $self->vcal10) {
|
||||
push @ret, qw(
|
||||
class completed created description dtstamp
|
||||
dtstart geo last-modified location organizer
|
||||
percent-complete priority recurrence-id sequence status
|
||||
summary uid url
|
||||
|
||||
due duration
|
||||
);
|
||||
} else {
|
||||
push @ret, qw(
|
||||
class dcreated completed description dtstart due
|
||||
last-modified location rnum priority
|
||||
sequence status summary transp
|
||||
url uid
|
||||
);
|
||||
}
|
||||
return @ret;
|
||||
}
|
||||
|
||||
=head2 optional_repeatable_properties
|
||||
|
||||
According to the iCalendar standard, the following properties may be
|
||||
specified any number of times for a to-do item:
|
||||
|
||||
attach attendee categories comment contact
|
||||
exdate exrule request-status related-to resources
|
||||
rdate rrule
|
||||
|
||||
Or if C<< vcal10 => 1 >>:
|
||||
|
||||
aalarm attach attendee categories
|
||||
dalarm exdate exrule malarm palarm related-to
|
||||
resources rdate rrule
|
||||
|
||||
=cut
|
||||
|
||||
sub optional_repeatable_properties {
|
||||
my $self = shift;
|
||||
if (not $self->vcal10) {
|
||||
qw(
|
||||
attach attendee categories comment contact
|
||||
exdate exrule request-status related-to resources
|
||||
rdate rrule
|
||||
);
|
||||
} else {
|
||||
qw(
|
||||
aalarm attach attendee categories
|
||||
dalarm exdate exrule malarm palarm related-to
|
||||
resources rdate rrule
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
|
||||
|
||||
=head1 LICENCE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
|
||||
|
||||
This module is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself. See L<perlartistic>.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
Reference in New Issue
Block a user