make event dates federate

This commit is contained in:
Hannes Mannerheim 2015-10-09 16:00:33 +02:00
parent 5a2d760177
commit 827dffb94c
3 changed files with 19 additions and 7 deletions

View File

@ -145,14 +145,26 @@ class EventPlugin extends MicroAppPlugin
throw new Exception(_m('Wrong type for object.')); throw new Exception(_m('Wrong type for object.'));
} }
$dtstart = $happeningObj->element->getElementsByTagName('dtstart');
if($dtstart->length == 0) {
// TRANS: Exception thrown when has no start date
throw new Exception(_m('No start date for event.'));
}
$dtend = $happeningObj->element->getElementsByTagName('dtend');
if($dtend->length == 0) {
// TRANS: Exception thrown when has no end date
throw new Exception(_m('No end date for event.'));
}
$notice = null; $notice = null;
switch ($activity->verb) { switch ($activity->verb) {
case ActivityVerb::POST: case ActivityVerb::POST:
// FIXME: get startTime, endTime, location and URL // FIXME: get startTime, endTime, location and URL
$notice = Happening::saveNew($actor, $notice = Happening::saveNew($actor,
$start_time, $dtstart->item(0)->nodeValue,
$end_time, $dtend->item(0)->nodeValue,
$happeningObj->title, $happeningObj->title,
null, null,
$happeningObj->summary, $happeningObj->summary,

View File

@ -220,8 +220,8 @@ class NeweventAction extends Action
$profile = $this->user->getProfile(); $profile = $this->user->getProfile();
$saved = Happening::saveNew($profile, $saved = Happening::saveNew($profile,
$this->startTime, common_sql_date($this->startTime),
$this->endTime, common_sql_date($this->endTime),
$this->title, $this->title,
$this->location, $this->location,
$this->description, $this->description,

View File

@ -116,8 +116,8 @@ class Happening extends Managed_DataObject
$ev->id = UUID::gen(); $ev->id = UUID::gen();
$ev->profile_id = $profile->id; $ev->profile_id = $profile->id;
$ev->start_time = common_sql_date($start_time); $ev->start_time = $start_time;
$ev->end_time = common_sql_date($end_time); $ev->end_time = $end_time;
$ev->title = $title; $ev->title = $title;
$ev->location = $location; $ev->location = $location;
$ev->description = $description; $ev->description = $description;