Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -246,6 +246,11 @@ class Event extends Item implements Embeddable,
|
||||
* @brief RSVP statuses
|
||||
*/
|
||||
const RSVP_MAYBE = 2;
|
||||
|
||||
/**
|
||||
* @brief Left the event
|
||||
*/
|
||||
const RSVP_LEFT = 3;
|
||||
|
||||
/**
|
||||
* Columns needed to query for search result / stream view
|
||||
@@ -1878,6 +1883,19 @@ class Event extends Item implements Embeddable,
|
||||
$this->cover_photo = ( $values['event_cover_photo'] !== NULL ) ? (string) $values['event_cover_photo'] : NULL;
|
||||
|
||||
/* Set location */
|
||||
if( $values['event_location'] instanceof GeoLocation )
|
||||
{
|
||||
/* Make sure we have coordinates, we need to store them later */
|
||||
if( !$values['event_location']->lat or !$values['event_location']->long )
|
||||
{
|
||||
try
|
||||
{
|
||||
$values['event_location']->getLatLong();
|
||||
}
|
||||
catch( BadMethodCallException ){}
|
||||
}
|
||||
}
|
||||
|
||||
$this->location = ( $values['event_location'] !== NULL ) ? json_encode( $values['event_location'] ) : NULL;
|
||||
|
||||
if ( Settings::i()->calendar_venues_enabled )
|
||||
@@ -1914,15 +1932,8 @@ class Event extends Item implements Embeddable,
|
||||
|
||||
}
|
||||
|
||||
if ( isset( $this->venue ) or isset( $this->location ) )
|
||||
{
|
||||
$location = json_decode( ( isset( $this->venue ) ) ? $this->venue()->address : $this->location, true );
|
||||
$this->latitude = $location['lat'];
|
||||
$this->longitude = $location['long'];
|
||||
}
|
||||
|
||||
$this->online = $values['event_online'];
|
||||
$this->url = $values['event_url'];
|
||||
$this->url = $values['event_online'] ? $values['event_url'] : null;
|
||||
|
||||
/* Do we know the event type */
|
||||
if( $this->online and $values['event_url'] )
|
||||
@@ -1939,6 +1950,15 @@ class Event extends Item implements Embeddable,
|
||||
{
|
||||
$this->online_type = NULL;
|
||||
}
|
||||
|
||||
$this->location = null;
|
||||
}
|
||||
|
||||
if ( isset( $this->venue ) or isset( $this->location ) )
|
||||
{
|
||||
$location = json_decode( ( isset( $this->venue ) ) ? $this->venue()->address : $this->location, true );
|
||||
$this->latitude = $location['lat'];
|
||||
$this->longitude = $location['long'];
|
||||
}
|
||||
|
||||
/* Gallery album association */
|
||||
|
||||
Reference in new issue
Block a user