Do not extend recurrent for events in the trash. Do not extend them in the clipboard either, since it'll either make a mess in the clipboard or pop them up on the calendar automatically. Fixes bug #11995
This commit is contained in:
parent
b911f05125
commit
a083737ab3
3 changed files with 41 additions and 2 deletions
|
|
@ -15,6 +15,7 @@
|
||||||
- fixed #12012: WebGUI Account system does not present login to visitors for proper redirect
|
- fixed #12012: WebGUI Account system does not present login to visitors for proper redirect
|
||||||
- fixed #12015: Thingy: Custom 'File' form fields get deleted upon save
|
- fixed #12015: Thingy: Custom 'File' form fields get deleted upon save
|
||||||
- fixed #11994: recurring calendar entries
|
- fixed #11994: recurring calendar entries
|
||||||
|
- fixed #11995: recurring calendar entries in trash
|
||||||
|
|
||||||
7.10.6
|
7.10.6
|
||||||
- fixed #11974: Toolbar icons unclickable in Webkit using HTML5
|
- fixed #11974: Toolbar icons unclickable in Webkit using HTML5
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,11 @@ sub processRecurrence {
|
||||||
$self->session->log->warn("Unable to instanciate event with assetId $eventId");
|
$self->session->log->warn("Unable to instanciate event with assetId $eventId");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
##Ignore assets in the trash. Same with assets in the clipboard since they would not be
|
||||||
|
##put into the clipboard.
|
||||||
|
if ($event->get('state') ne 'published') {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
my $recur = $event->getRecurrence;
|
my $recur = $event->getRecurrence;
|
||||||
|
|
||||||
my $versionTag = WebGUI::VersionTag->create($self->session, {name => 'Extend Calendar Recurrence for assetId '.$event->getId, });
|
my $versionTag = WebGUI::VersionTag->create($self->session, {name => 'Extend Calendar Recurrence for assetId '.$event->getId, });
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,26 @@ my $event = $calendar->addChild(
|
||||||
}, undef, undef, {skipAutoCommitWorkflows => 1, }
|
}, undef, undef, {skipAutoCommitWorkflows => 1, }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
my $trashed_event = $calendar->addChild(
|
||||||
|
{ className => 'WebGUI::Asset::Event',
|
||||||
|
startDate => $one_year_ago,
|
||||||
|
endDate => $one_year_ago,
|
||||||
|
}, undef, undef, {skipAutoCommitWorkflows => 1, }
|
||||||
|
);
|
||||||
|
$trashed_event->trash;
|
||||||
|
|
||||||
|
my $clipped_event = $calendar->addChild(
|
||||||
|
{ className => 'WebGUI::Asset::Event',
|
||||||
|
startDate => $one_year_ago,
|
||||||
|
endDate => $one_year_ago,
|
||||||
|
}, undef, undef, {skipAutoCommitWorkflows => 1, }
|
||||||
|
);
|
||||||
|
$clipped_event->cut;
|
||||||
|
|
||||||
$tag->commit;
|
$tag->commit;
|
||||||
$calendar = $calendar->cloneFromDb;
|
foreach my $asset($calendar, $event, $clipped_event, $trashed_event) {
|
||||||
$event = $event->cloneFromDb;
|
$asset = $asset->cloneFromDb;
|
||||||
|
}
|
||||||
|
|
||||||
my $recurId = $event->setRecurrence(
|
my $recurId = $event->setRecurrence(
|
||||||
{ recurType => 'monthDay',
|
{ recurType => 'monthDay',
|
||||||
|
|
@ -53,6 +70,22 @@ my $recurId = $event->setRecurrence(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$trashed_event->setRecurrence(
|
||||||
|
{ recurType => 'monthDay',
|
||||||
|
every => 2,
|
||||||
|
startDate => $trashed_event->get('startDate'),
|
||||||
|
dayNumber => $eventStartDate->day,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
$clipped_event->setRecurrence(
|
||||||
|
{ recurType => 'monthDay',
|
||||||
|
every => 2,
|
||||||
|
startDate => $clipped_event->get('startDate'),
|
||||||
|
dayNumber => $eventStartDate->day,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
my $workflow = WebGUI::Workflow->create(
|
my $workflow = WebGUI::Workflow->create(
|
||||||
$session, {
|
$session, {
|
||||||
enabled => 1,
|
enabled => 1,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue