diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index a0b7a6976..1cd140277 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -42,6 +42,7 @@ the use of new template variables in the EMS checkout template. See gotchas.txt for details. - fix: AssetExportHtml now handles periods in URLs more gracefully. + - fix: Calendar Event Details template now uses nice dateSpan variable 7.3.8 - Fixed a template variable rewriting problem with HTML::Template::Expr diff --git a/docs/upgrades/templates-7.3.9/calendarEventDetails.tmpl b/docs/upgrades/templates-7.3.9/calendarEventDetails.tmpl new file mode 100644 index 000000000..ae10b581a --- /dev/null +++ b/docs/upgrades/templates-7.3.9/calendarEventDetails.tmpl @@ -0,0 +1,208 @@ +#CalendarEvent000000001 + + + + + + + + + + + + + +
+ Day + Week + Month + Search + +
+ Edit + • Delete + • Print +
+
+
<< Previous Event
+
Next Event >>
+
+ Event Details +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
Event Title
+
+
+ +
+
+
Location
+
+
+ +
+
+
Description
+
+
+
+
Scheduled
+
+
+ +
+
+
Related Material
+
+
+
+
+
+~~~ + diff --git a/lib/WebGUI/Asset/Event.pm b/lib/WebGUI/Asset/Event.pm index ef041918f..1fb41c57b 100644 --- a/lib/WebGUI/Asset/Event.pm +++ b/lib/WebGUI/Asset/Event.pm @@ -131,24 +131,6 @@ sub definition { -#################################################################### - -=head2 canAdd - -Returns true if a user can add this asset. - -=cut - -sub canAdd { - my $self = shift; - my $session = shift; - - return $session->user->isInGroup($self->getParent->get("groupIdEventEdit")); -} - - - - #################################################################### @@ -190,6 +172,7 @@ sub generateRecurringEvents { my $self = shift; my $recur = shift; my $parent = $self->getParent; + my $session = $self->session; my $id; if ($recur) { @@ -221,12 +204,20 @@ sub generateRecurringEvents { for my $date (@dates) { my $dt = WebGUI::DateTime->new($self->session, $date." 00:00:00"); - ### TODO: Only generate if the recurId does not exist on this day $properties->{startDate} = $dt->strftime('%F'); $properties->{endDate} = $dt->clone->add(days => $duration_days)->strftime('%F'); - my $newEvent = $parent->addChild($properties); - $newEvent->requestAutoCommit; + # Only generate if the recurId does not exist on this day + my ($exists) + = $session->db->buildArray( + "select count(*) from Event where recurId=? and startDate=?", + [$properties->{recurId}, $properties->{startDate}], + ); + + if (!$exists) { + my $newEvent = $parent->addChild($properties); + $newEvent->requestAutoCommit; + } } return 1; diff --git a/lib/WebGUI/Asset/Wobject/Calendar.pm b/lib/WebGUI/Asset/Wobject/Calendar.pm index 3975e8824..b0f85e597 100644 --- a/lib/WebGUI/Asset/Wobject/Calendar.pm +++ b/lib/WebGUI/Asset/Wobject/Calendar.pm @@ -258,7 +258,7 @@ sub addChild { $self->session->errorHandler->security("add a ".$properties->{className}." to a ".$self->get("className")); return undef; } - + use Carp qw(cluck); use Data::Dumper; cluck Dumper $self; return $self->SUPER::addChild($properties, @other); }