Skip to content

Commit

Permalink
Extend list of fields for updating of sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Jan 26, 2024
1 parent 6d5a666 commit 3f17c87
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
------------------------
- Fix #443: Fix email subject on invite/add users
- Fix #447: Global calendar header redesign
- Enh #440: Extend list of fields for updating of sequence

1.5.8 (January 19, 2024)
------------------------
Expand Down
26 changes: 18 additions & 8 deletions models/forms/CalendarEntryForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,17 +508,27 @@ public function save()

public function sequenceCheck()
{
if(!$this->original) {
if (!$this->original) {
return;
}

$incrementSequence = $this->original->getStartDateTime() != $this->entry->getStartDateTime();
$incrementSequence = $incrementSequence || $this->original->getEndDateTime() != $this->entry->getEndDateTime();
$incrementSequence = $incrementSequence || $this->original->getRrule() !== $this->entry->getRrule();
$incrementSequence = $incrementSequence || $this->original->getExdate() !== $this->entry->getExdate();
$incrementSequence = $incrementSequence || $this->original->getEventStatus() !== $this->entry->getEventStatus();

if($incrementSequence) {
if ($this->original->getTitle() !== $this->entry->getTitle() ||
$this->original->getDescription() !== $this->entry->getDescription() ||
$this->original->getStartDateTime() != $this->entry->getStartDateTime() ||
$this->original->getEndDateTime() != $this->entry->getEndDateTime() ||
$this->original->isAllDay() !== $this->entry->isAllDay() ||
$this->original->participation_mode !== $this->entry->participation_mode ||
$this->original->getColor() !== $this->entry->getColor() ||
$this->original->allow_decline !== $this->entry->allow_decline ||
$this->original->allow_maybe !== $this->entry->allow_maybe ||
$this->original->getTimezone() !== $this->entry->getTimezone() ||
$this->original->participant_info !== $this->entry->participant_info ||
$this->original->getEventStatus() !== $this->entry->getEventStatus() ||
$this->original->max_participants !== $this->entry->max_participants ||
$this->original->getRrule() !== $this->entry->getRrule() ||
$this->original->getExdate() !== $this->entry->getExdate() ||
$this->original->getLocation() !== $this->entry->getLocation()
) {
CalendarUtils::incrementSequence($this->entry);
$this->entry->saveEvent();
}
Expand Down

0 comments on commit 3f17c87

Please sign in to comment.