Fix Calendar copy behavior. By default, duplicate will only copy

the Calendar.  duplicateBranch must be called to copy it _and_ its
children.
This commit is contained in:
Colin Kuskie 2008-12-03 00:02:01 +00:00
parent 943e220508
commit a71e494d34
2 changed files with 3 additions and 28 deletions

View file

@ -21,6 +21,9 @@
- fixed #4209: i18n in Rich edit in Dutch breaks
- fixed #9196: Shelf lacks pagination
- fixed #4208: EMS badges with Admin security visible to all
- fixed Calendar copy behavior. In the Asset toolbar, Copy Just this Asset
was broken. This has been fixed. As a side effect, in the Asset Manager
the default behavior is to copy ONLY the Calendar, and none of the events.
7.6.4
- Survey now will show progress and time limit.

View file

@ -459,34 +459,6 @@ sub createSubscriptionGroup {
#----------------------------------------------------------------------------
=head2 duplicate ( )
Duplicates an Event Calendar. Duplicates all the events in this Event Calendar.
=cut
sub duplicate {
my $self = shift;
# Superclass duplicates the calendar
my $newCalendar = $self->SUPER::duplicate(@_);
# Duplicate the events in this calendar
my $events = $self->getLineage(["descendants"], {
returnObjects => 1,
includeOnlyClasses => ['WebGUI::Asset::Event'],
});
for my $event (@{ $events }) {
my %eventProperties = %{ $event->get() };
$newCalendar->addChild(\%eventProperties);
}
return $newCalendar;
}
#----------------------------------------------------------------------------
=head2 getEditForm
Adds an additional tab for feeds.