Skip to content

Commit

Permalink
Calendar: When events are private but writable. Posting the event wit…
Browse files Browse the repository at this point in the history
…h CalDAV will not change the title or description
  • Loading branch information
dehart committed Dec 2, 2024
1 parent bbb6e14 commit cd110a2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Calendar: When events are private but writable. Posting the event with CalDAV will not change the title or description
- Files: Detail panel will change to folder when a different folder is selected in the tree.
- Core: Fixed checkbox custom field filter to match null values when client sends 'false'
- ldapauth: Create postfixadmin account if domain matches serverclient domain
Expand Down
22 changes: 14 additions & 8 deletions www/modules/calendar/model/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -1761,10 +1761,20 @@ public function importVObject(Sabre\VObject\Component $vobject, $attributes=arra
$uid = (string) $vobject->uid;
if(!empty($uid))
$this->uuid = $uid;

$this->name = (string) $vobject->summary;
if(empty($this->name))
$this->name = \GO::t("Unnamed");

if(!$this->isPrivate() || $this->user_id === go()->getUserId()) {
$this->name = (string)$vobject->summary;
if (empty($this->name))
$this->name = \GO::t("Unnamed");

if ($vobject->description)
$this->description = (string)$vobject->description;
} else if(!$this->isNew()) {
// the caldav client is posting the data with name and content removed.
// Put it back into the vobject for the vobject cache.
$vobject->summary = $this->name;
$vobject->description = $this->description;
}

$dtstart = $vobject->dtstart ? $vobject->dtstart->getDateTime() : new \DateTime();
$dtend = $vobject->dtend ? $vobject->dtend->getDateTime() : new \DateTime();
Expand Down Expand Up @@ -1807,10 +1817,6 @@ public function importVObject(Sabre\VObject\Component $vobject, $attributes=arra
}
if($this->end_time<=$this->start_time)
$this->end_time=$this->start_time+3600;


if($vobject->description)
$this->description = (string) $vobject->description;


if((string) $vobject->rrule != ""){
Expand Down

0 comments on commit cd110a2

Please sign in to comment.