Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -145,7 +145,7 @@ class _Application extends \IPS\Application
|
||||
|
||||
foreach ( \IPS\calendar\Event::retrieveEvents( $_today, $endDate, NULL, NULL, FALSE, $member ) as $event )
|
||||
{
|
||||
$document->addItem( $event->title, $event->url(), $event->content, $event->nextOccurrence( $_today, 'startDate' ), $event->id );
|
||||
$document->addItem( $event->title, $event->url(), $event->content, \IPS\DateTime::ts( $event->saved ), $event->id );
|
||||
}
|
||||
|
||||
/* @note application/rss+xml is not a registered IANA mime-type so we need to stick with text/xml for RSS */
|
||||
|
||||
@@ -29,9 +29,12 @@ class _calendars extends \IPS\Node\Api\NodeController
|
||||
protected $class = 'IPS\calendar\Calendar';
|
||||
|
||||
/**
|
||||
* GET /calendar/calendar
|
||||
* GET /calendar/calendars
|
||||
* Get list of calendars
|
||||
*
|
||||
* @apiparam int page Page number
|
||||
* @apiparam int perPage Number of results per page - defaults to 25
|
||||
* @note For requests using an OAuth Access Token for a particular member, only calendars the authorized user can view will be included
|
||||
* @return \IPS\Api\PaginatedResponse<IPS\calendar\Calendar>
|
||||
*/
|
||||
public function GETindex()
|
||||
@@ -41,23 +44,30 @@ class _calendars extends \IPS\Node\Api\NodeController
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /calendar/calendar/{id}
|
||||
* GET /calendar/calendars/{id}
|
||||
* Get specific calendar
|
||||
*
|
||||
* @param int $id ID Number
|
||||
*
|
||||
* @return \IPS\Api\PaginatedResponse<IPS\calendar\Calendar>
|
||||
* @throws 1L364/1 INVALID_ID The calendar does not exist or the authorized user does not have permission to view it
|
||||
* @return \IPS\calendar\Calendar
|
||||
*/
|
||||
public function GETitem( $id )
|
||||
{
|
||||
/* Return */
|
||||
return $this->_view( $id );
|
||||
try
|
||||
{
|
||||
return $this->_view( $id );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_ID', '1L364/1', 404 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /calendar/calendar
|
||||
* POST /calendar/calendars
|
||||
* Create a calendar
|
||||
*
|
||||
* @apiclientonly
|
||||
* @reqapiparam string title The calendar title
|
||||
* @apiparam string color The calendar color (Hexadecimal)
|
||||
* @apiparam int approve_events 0|1 Events must be approved?
|
||||
@@ -65,18 +75,18 @@ class _calendars extends \IPS\Node\Api\NodeController
|
||||
* @apiparam int approve_comments 0|1 Comments must be approved
|
||||
* @apiparam int allow_reviews 0|1 Allow reviews
|
||||
* @apiparam int approve_reviews 0|1 Reviews must be approved
|
||||
*
|
||||
* @return \IPS\calendar\Calendar
|
||||
*/
|
||||
public function POSTindex()
|
||||
{
|
||||
return $this->_create();
|
||||
return new \IPS\Api\Response( 201, $this->_create()->apiOutput( $this->member ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /calendar/calendar/{id}
|
||||
* POST /calendar/calendars/{id}
|
||||
* Edit a calendar
|
||||
*
|
||||
* @apiclientonly
|
||||
* @reqapiparam string title The calendar title
|
||||
* @apiparam string color The calendar color (Hexadecimal)
|
||||
* @apiparam int approve_events 0|1 Events must be approved?
|
||||
@@ -84,22 +94,21 @@ class _calendars extends \IPS\Node\Api\NodeController
|
||||
* @apiparam int approve_comments 0|1 Comments must be approved
|
||||
* @apiparam int allow_reviews 0|1 Allow reviews
|
||||
* @apiparam int approve_reviews 0|1 Reviews must be approved
|
||||
*
|
||||
* @return \IPS\calendar\Calendar
|
||||
*/
|
||||
public function POSTitem( $id )
|
||||
{
|
||||
$class = static::$class;
|
||||
$class = $this->class;
|
||||
$calendar = $class::load( $id );
|
||||
$calendar = $this->_createOrUpdate( $calendar );
|
||||
|
||||
return $calendar;
|
||||
return new \IPS\Api\Response( 201, $this->_createOrUpdate( $calendar )->apiOutput( $this->member ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* DELETE /calendar/calendar/{id}
|
||||
* DELETE /calendar/calendars/{id}
|
||||
* Delete a calendar
|
||||
*
|
||||
* @apiclientonly
|
||||
* @param int $id ID Number
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@@ -32,6 +32,7 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
* GET /calendar/comments
|
||||
* Get list of comments
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, only comments the authorized user can view will be included
|
||||
* @apiparam string calendars Comma-delimited list of calendar IDs
|
||||
* @apiparam string authors Comma-delimited list of member IDs - if provided, only topics started by those members are returned
|
||||
* @apiparam int locked If 1, only comments from events which are locked are returned, if 0 only unlocked
|
||||
@@ -40,6 +41,7 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
* @apiparam string sortBy What to sort by. Can be 'date', 'title' or leave unspecified for ID
|
||||
* @apiparam string sortDir Sort direction. Can be 'asc' or 'desc' - defaults to 'asc'
|
||||
* @apiparam int page Page number
|
||||
* @apiparam int perPage Number of results per page - defaults to 25
|
||||
* @return \IPS\Api\PaginatedResponse<IPS\calendar\Event\Comment>
|
||||
*/
|
||||
public function GETindex()
|
||||
@@ -52,14 +54,24 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
* View information about a specific comment
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @throws 2L297/1 INVALID_ID The comment ID does not exist
|
||||
* @throws 2L297/1 INVALID_ID The comment ID does not exist or the authorized user does not have permission to view it
|
||||
* @return \IPS\calendar\Event\Comment
|
||||
*/
|
||||
public function GETitem( $id )
|
||||
{
|
||||
try
|
||||
{
|
||||
return new \IPS\Api\Response( 200, \IPS\calendar\Event\Comment::load( $id )->apiOutput() );
|
||||
$class = $this->class;
|
||||
if ( $this->member )
|
||||
{
|
||||
$object = $class::loadAndCheckPerms( $id, $this->member );
|
||||
}
|
||||
else
|
||||
{
|
||||
$object = $class::load( $id );
|
||||
}
|
||||
|
||||
return new \IPS\Api\Response( 200, $object->apiOutput( $this->member ) );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
@@ -71,21 +83,23 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
* POST /calendar/comments
|
||||
* Create a comment
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, hidden will only be honoured if the authentictaed user has permission to hide content).
|
||||
* @reqapiparam int event The ID number of the event the comment is for
|
||||
* @reqapiparam int author The ID number of the member making the comment (0 for guest)
|
||||
* @reqapiparam int author The ID number of the member making the comment (0 for guest). Required for requests made using an API Key or the Client Credentials Grant Type. For requests using an OAuth Access Token for a particular member, that member will always be the author
|
||||
* @apiparam string author_name If author is 0, the guest name that should be used
|
||||
* @reqapiparam string content The comment content as HTML (e.g. "<p>This is a comment.</p>")
|
||||
* @apiparam datetime date The date/time that should be used for the comment date. If not provided, will use the current date/time
|
||||
* @apiparam string ip_address The IP address that should be stored for the comment. If not provided, will use the IP address from the API request
|
||||
* @reqapiparam string content The comment content as HTML (e.g. "<p>This is a comment.</p>"). Will be sanatized for requests using an OAuth Access Token for a particular member; will be saved unaltered for requests made using an API Key or the Client Credentials Grant Type.
|
||||
* @apiparam datetime date The date/time that should be used for the comment date. If not provided, will use the current date/time. Ignored for requests using an OAuth Access Token for a particular member
|
||||
* @apiparam string ip_address The IP address that should be stored for the comment. If not provided, will use the IP address from the API request. Ignored for requests using an OAuth Access Token for a particular member
|
||||
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
|
||||
* @throws 2L297/3 INVALID_ID The comment ID does not exist
|
||||
* @throws 1L297/4 NO_AUTHOR The author ID does not exist
|
||||
* @throws 1L297/5 NO_CONTENT No content was supplied
|
||||
* @throws 2L297/8 NO_PERMISSION The authorized user does not have permission to comment on that event
|
||||
* @return \IPS\calendar\Event\Comment
|
||||
*/
|
||||
public function POSTindex()
|
||||
{
|
||||
/* Get topic */
|
||||
/* Get event */
|
||||
try
|
||||
{
|
||||
$event = \IPS\calendar\Event::load( \IPS\Request::i()->event );
|
||||
@@ -96,18 +110,29 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
}
|
||||
|
||||
/* Get author */
|
||||
if ( \IPS\Request::i()->author )
|
||||
if ( $this->member )
|
||||
{
|
||||
$author = \IPS\Member::load( \IPS\Request::i()->author );
|
||||
if ( !$author->member_id )
|
||||
if ( !$event->canComment( $this->member ) )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1L297/4', 404 );
|
||||
throw new \IPS\Api\Exception( 'NO_PERMISSION', '2L297/8', 403 );
|
||||
}
|
||||
$author = $this->member;
|
||||
}
|
||||
else
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
$author->name = \IPS\Request::i()->author_name;
|
||||
if ( \IPS\Request::i()->author )
|
||||
{
|
||||
$author = \IPS\Member::load( \IPS\Request::i()->author );
|
||||
if ( !$author->member_id )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1L297/4', 404 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
$author->name = \IPS\Request::i()->author_name;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check we have a post */
|
||||
@@ -124,13 +149,15 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
* POST /calendar/comments/{id}
|
||||
* Edit a comment
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, hidden will only be honoured if the authentictaed user has permission to hide content).
|
||||
* @param int $id ID Number
|
||||
* @apiparam int author The ID number of the member making the comment (0 for guest)
|
||||
* @apiparam int author The ID number of the member making the comment (0 for guest). Ignored for requests using an OAuth Access Token for a particular member.
|
||||
* @apiparam string author_name If author is 0, the guest name that should be used
|
||||
* @apiparam string content The comment content as HTML (e.g. "<p>This is a comment.</p>")
|
||||
* @apiparam string content The comment content as HTML (e.g. "<p>This is a comment.</p>"). Will be sanatized for requests using an OAuth Access Token for a particular member; will be saved unaltered for requests made using an API Key or the Client Credentials Grant Type.
|
||||
* @apiparam int hidden 1/0 indicating if the topic should be hidden
|
||||
* @throws 2L297/6 INVALID_ID The comment ID does not exist
|
||||
* @throws 2L297/6 INVALID_ID The comment ID does not exist or the authorized user does not have permission to view it
|
||||
* @throws 1L297/7 NO_AUTHOR The author ID does not exist
|
||||
* @throws 2L297/9 NO_PERMISSION The authorized user does not have permission to edit the comment
|
||||
* @return \IPS\calendar\Event\Comment
|
||||
*/
|
||||
public function POSTitem( $id )
|
||||
@@ -139,6 +166,14 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
{
|
||||
/* Load */
|
||||
$comment = \IPS\calendar\Event\Comment::load( $id );
|
||||
if ( $this->member and !$comment->canView( $this->member ) )
|
||||
{
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
if ( $this->member and !$comment->canEdit( $this->member ) )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_PERMISSION', '2L297/9', 403 );
|
||||
}
|
||||
|
||||
/* Do it */
|
||||
try
|
||||
@@ -161,14 +196,21 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
* Deletes a comment
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @throws 2L297/2 INVALID_ID The comment ID does not exist
|
||||
* @throws 2L297/2 INVALID_ID The comment ID does not exist
|
||||
* @throws 2L297/A NO_PERMISSION The authorized user does not have permission to delete the comment
|
||||
* @return void
|
||||
*/
|
||||
public function DELETEitem( $id )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\calendar\Event\Comment::load( $id )->delete();
|
||||
$class = $this->class;
|
||||
$object = $class::load( $id );
|
||||
if ( $this->member and !$object->canDelete( $this->member ) )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_PERMISSION', '2L297/A', 403 );
|
||||
}
|
||||
$object->delete();
|
||||
|
||||
return new \IPS\Api\Response( 200, NULL );
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
* GET /calendar/events
|
||||
* Get list of events
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, only events the authorized user can view will be included
|
||||
* @apiparam string calendars Comma-delimited list of calendar IDs
|
||||
* @apiparam string authors Comma-delimited list of member IDs - if provided, only events started by those members are returned
|
||||
* @apiparam int locked If 1, only events which are locked are returned, if 0 only unlocked
|
||||
@@ -40,6 +41,7 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
* @apiparam string sortBy What to sort by. Can be 'date' for creation date, 'title' or leave unspecified for ID
|
||||
* @apiparam string sortDir Sort direction. Can be 'asc' or 'desc' - defaults to 'asc'
|
||||
* @apiparam int page Page number
|
||||
* @apiparam int perPage Number of results per page - defaults to 25
|
||||
* @return \IPS\Api\PaginatedResponse<IPS\calendar\Event>
|
||||
*/
|
||||
public function GETindex()
|
||||
@@ -56,7 +58,7 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
* View information about a specific event
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @throws 1F294/1 INVALID_ID The event ID does not exist
|
||||
* @throws 1F294/1 INVALID_ID The event ID does not exist or the authorized user does not have permission to view it
|
||||
* @return \IPS\calendar\Event
|
||||
*/
|
||||
public function GETitem( $id )
|
||||
@@ -75,10 +77,11 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
* POST /calendar/events
|
||||
* Create an event
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authentictaed user has permission to lock events).
|
||||
* @reqapiparam int calendar The ID number of the calendar the event should be created in
|
||||
* @reqapiparam int author The ID number of the member creating the event (0 for guest)
|
||||
* @apiparam int author The ID number of the member creating the event (0 for guest). Required for requests made using an API Key or the Client Credentials Grant Type. For requests using an OAuth Access Token for a particular member, that member will always be the author
|
||||
* @reqapiparam string title The event title
|
||||
* @reqapiparam string description The description as HTML (e.g. "<p>This is an event.</p>")
|
||||
* @reqapiparam string description The description as HTML (e.g. "<p>This is an event.</p>"). Will be sanatized for requests using an OAuth Access Token for a particular member; will be saved unaltered for requests made using an API Key or the Client Credentials Grant Type.
|
||||
* @reqapiparam datetime start The event start date/time
|
||||
* @apiparam datetime end The event end date/time
|
||||
* @apiparam string recurrence If this event recurs, the ICS recurrence definition
|
||||
@@ -87,8 +90,8 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
* @apiparam \IPS\GeoLocation location The location where the event is taking place
|
||||
* @apiparam string prefix Prefix tag
|
||||
* @apiparam string tags Comma-separated list of tags (do not include prefix)
|
||||
* @apiparam datetime date The date/time that should be used for the event/post post date. If not provided, will use the current date/time
|
||||
* @apiparam string ip_address The IP address that should be stored for the event/post. If not provided, will use the IP address from the API request
|
||||
* @apiparam datetime date The date/time that should be used for the event/post post date. If not provided, will use the current date/time. Ignored for requests using an OAuth Access Token for a particular member.
|
||||
* @apiparam string ip_address The IP address that should be stored for the event/post. If not provided, will use the IP address from the API request. Ignored for requests using an OAuth Access Token for a particular member.
|
||||
* @apiparam int locked 1/0 indicating if the event should be locked
|
||||
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
|
||||
* @apiparam int featured 1/0 indicating if the event should be featured
|
||||
@@ -98,6 +101,7 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
* @throws 1L296/9 NO_DESC No description was supplied
|
||||
* @throws 1L296/A INVALID_START The start date is invalid
|
||||
* @throws 1L296/B INVALID_END The end date is invalid
|
||||
* @throws 2L296/C NO_PERMISSION The authorized user does not have permission to create an event in that calendar
|
||||
* @return \IPS\calendar\Event
|
||||
*/
|
||||
public function POSTindex()
|
||||
@@ -113,17 +117,28 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
}
|
||||
|
||||
/* Get author */
|
||||
if ( \IPS\Request::i()->author )
|
||||
if ( $this->member )
|
||||
{
|
||||
$author = \IPS\Member::load( \IPS\Request::i()->author );
|
||||
if ( !$author->member_id )
|
||||
if ( !$calendar->can( 'add', $this->member ) )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1L296/7', 400 );
|
||||
throw new \IPS\Api\Exception( 'NO_PERMISSION', '2L296/C', 403 );
|
||||
}
|
||||
$author = $this->member;
|
||||
}
|
||||
else
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
if ( \IPS\Request::i()->author )
|
||||
{
|
||||
$author = \IPS\Member::load( \IPS\Request::i()->author );
|
||||
if ( !$author->member_id )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1L296/7', 400 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check we have a title and a description */
|
||||
@@ -158,17 +173,18 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
}
|
||||
|
||||
/* Do it */
|
||||
return new \IPS\Api\Response( 201, $this->_create( $calendar, $author )->apiOutput() );
|
||||
return new \IPS\Api\Response( 201, $this->_create( $calendar, $author )->apiOutput( $this->member ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /calendar/events/{id}
|
||||
* Edit an event
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authentictaed user has permission to lock topics).
|
||||
* @reqapiparam int calendar The ID number of the calendar the event should be created in
|
||||
* @reqapiparam int author The ID number of the member creating the event (0 for guest)
|
||||
* @reqapiparam int author The ID number of the member creating the event (0 for guest). Ignored for requests using an OAuth Access Token for a particular member.
|
||||
* @reqapiparam string title The event title
|
||||
* @reqapiparam string description The description as HTML (e.g. "<p>This is an event.</p>")
|
||||
* @reqapiparam string description The description as HTML (e.g. "<p>This is an event.</p>"). Will be sanatized for requests using an OAuth Access Token for a particular member; will be saved unaltered for requests made using an API Key or the Client Credentials Grant Type.
|
||||
* @reqapiparam datetime start The event start date/time
|
||||
* @apiparam datetime end The event end date/time
|
||||
* @apiparam string recurrence If this event recurs, the ICS recurrence definition
|
||||
@@ -177,16 +193,17 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
* @apiparam \IPS\GeoLocation location The location where the event is taking place
|
||||
* @apiparam string prefix Prefix tag
|
||||
* @apiparam string tags Comma-separated list of tags (do not include prefix)
|
||||
* @apiparam datetime date The date/time that should be used for the event/post post date. If not provided, will use the current date/time
|
||||
* @apiparam string ip_address The IP address that should be stored for the event/post. If not provided, will use the IP address from the API request
|
||||
* @apiparam datetime date The date/time that should be used for the event/post post date. If not provided, will use the current date/time. Ignored for requests using an OAuth Access Token for a particular member.
|
||||
* @apiparam string ip_address The IP address that should be stored for the event/post. If not provided, will use the IP address from the API request. Ignored for requests using an OAuth Access Token for a particular member.
|
||||
* @apiparam int locked 1/0 indicating if the event should be locked
|
||||
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
|
||||
* @apiparam int featured 1/0 indicating if the event should be featured
|
||||
* @throws 1L296/I INVALID_ID The event ID is invalid
|
||||
* @throws 1L296/D NO_CALENDAR The calendar ID does not exist
|
||||
* @throws 1L296/I INVALID_ID The event ID is invalid or the authorized user does not have permission to view it
|
||||
* @throws 1L296/D NO_CALENDAR The calendar ID does not exist or the authorized user does not have permission to post in it
|
||||
* @throws 1L296/E NO_AUTHOR The author ID does not exist
|
||||
* @throws 1L296/G INVALID_START The start date is invalid
|
||||
* @throws 1L296/H INVALID_END The end date is invalid
|
||||
* @throws 2L296/D NO_PERMISSION The authorized user does not have permission to edit the topic
|
||||
* @return \IPS\calendar\Event
|
||||
*/
|
||||
public function POSTitem( $id )
|
||||
@@ -194,13 +211,26 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
try
|
||||
{
|
||||
$event = \IPS\calendar\Event::load( $id );
|
||||
if ( $this->member and !$event->can( 'read', $this->member ) )
|
||||
{
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
if ( $this->member and !$event->canEdit( $this->member ) )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_PERMISSION', '2L296/D', 403 );
|
||||
}
|
||||
|
||||
/* New calendar */
|
||||
if ( isset( \IPS\Request::i()->calendar ) and \IPS\Request::i()->calendar != $event->forum_id )
|
||||
if ( isset( \IPS\Request::i()->calendar ) and \IPS\Request::i()->calendar != $event->calendar_id and ( !$this->member or $event->canMove( $this->member ) ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$newCalendar = \IPS\calendar\Calendar::load( \IPS\Request::i()->calendar );
|
||||
if ( $this->member and !$newCalendar->can( 'add', $this->member ) )
|
||||
{
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
|
||||
$event->move( $newCalendar );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
@@ -210,7 +240,7 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
}
|
||||
|
||||
/* New author */
|
||||
if ( isset( \IPS\Request::i()->author ) )
|
||||
if ( !$this->member and isset( \IPS\Request::i()->author ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -253,11 +283,11 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
}
|
||||
|
||||
/* Everything else */
|
||||
$this->_createOrUpdate( $event );
|
||||
$this->_createOrUpdate( $event, 'edit' );
|
||||
|
||||
/* Save and return */
|
||||
$event->save();
|
||||
return new \IPS\Api\Response( 200, $event->apiOutput() );
|
||||
return new \IPS\Api\Response( 200, $event->apiOutput( $this->member ) );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
@@ -273,7 +303,8 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
* @apiparam int hidden If 1, only comments which are hidden are returned, if 0 only not hidden
|
||||
* @apiparam string sortDir Sort direction. Can be 'asc' or 'desc' - defaults to 'asc'
|
||||
* @apiparam int page Page number
|
||||
* @throws 2L296/2 INVALID_ID The event ID does not exist
|
||||
* @apiparam int perPage Number of results per page - defaults to 25
|
||||
* @throws 2L296/2 INVALID_ID The event ID does not exist or the authorized user does not have permission to view it
|
||||
* @return \IPS\Api\PaginatedResponse<IPS\calendar\Event\Comment>
|
||||
*/
|
||||
public function GETitem_comments( $id )
|
||||
@@ -296,7 +327,8 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
* @apiparam int hidden If 1, only comments which are hidden are returned, if 0 only not hidden
|
||||
* @apiparam string sortDir Sort direction. Can be 'asc' or 'desc' - defaults to 'asc'
|
||||
* @apiparam int page Page number
|
||||
* @throws 2L296/3 INVALID_ID The event ID does not exist
|
||||
* @apiparam int perPage Number of results per page - defaults to 25
|
||||
* @throws 2L296/3 INVALID_ID The event ID does not exist or the authorized user does not have permission to view it
|
||||
* @return \IPS\Api\PaginatedResponse<IPS\calendar\Event\Review>
|
||||
*/
|
||||
public function GETitem_reviews( $id )
|
||||
@@ -316,7 +348,7 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
* Get RSVPs on an event
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @throws 2L296/3 INVALID_ID The event ID does not exist
|
||||
* @throws 2L296/3 INVALID_ID The event ID does not exist or the authorized user does not have permission to view it
|
||||
* @return array
|
||||
* @apiresponse [\IPS\Member] attending Members that have confirmed they are attending the event
|
||||
* @apiresponse [\IPS\Member] notAttending Members that have confirmed they are not attending the event
|
||||
@@ -327,16 +359,21 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
try
|
||||
{
|
||||
$event = \IPS\calendar\Event::load( $id );
|
||||
if ( $this->member and !$event->can( 'read', $this->member ) )
|
||||
{
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
|
||||
$attendees = $event->attendees();
|
||||
return new \IPS\Api\Response( 200, array(
|
||||
'attending' => array_values( array_map( function( $member ) {
|
||||
return $member->apiOutput();
|
||||
return $member->apiOutput( $this->member );
|
||||
}, $attendees[1] ) ),
|
||||
'notAttending' => array_values( array_map( function( $member ) {
|
||||
return $member->apiOutput();
|
||||
return $member->apiOutput( $this->member );
|
||||
}, $attendees[0] ) ),
|
||||
'maybeAttending' => array_values( array_map( function( $member ) {
|
||||
return $member->apiOutput();
|
||||
return $member->apiOutput( $this->member );
|
||||
}, $attendees[2] ) ),
|
||||
) );
|
||||
}
|
||||
@@ -350,10 +387,12 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
* PUT /calendar/events/{id}/rsvps/{member_id}
|
||||
* RSVP a member to an event
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, the member ID must be the authorized member's ID
|
||||
* @reqapiparam int response 0 = Not attending; 1 = attending; 2 = maybe attending
|
||||
* @param int $id Event ID NUmber
|
||||
* @param int $memberId Member ID NUmber
|
||||
* @throws 2L296/J INVALID_ID The event ID does not exist
|
||||
* @throws 2L296/K INVALID_MEMBER The member ID was not valid
|
||||
* @return void
|
||||
*/
|
||||
public function PUTitem_rsvps( $id, $memberId )
|
||||
@@ -363,6 +402,11 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
throw new \IPS\Api\Exception( 'INVALID_RESPONSE', '1L296/L', 400 );
|
||||
}
|
||||
|
||||
if ( $this->member and $memberId != $this->member->member_id )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_MEMBER', '2L296/K', 404 );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$event = \IPS\calendar\Event::load( $id );
|
||||
@@ -401,12 +445,19 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
* DELETE /calendar/events/{id}/rsvps/{member_id}
|
||||
* Remove a member from RSVP list
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, the member ID must be the authorized member's ID
|
||||
* @param int $id Event ID NUmber
|
||||
* @param int $memberId Member ID NUmber
|
||||
* @return void
|
||||
* @throws 2L296/K INVALID_MEMBER The member ID was not valid
|
||||
*/
|
||||
public function DELETEitem_rsvps( $id, $memberId )
|
||||
{
|
||||
if ( $this->member and $memberId != $this->member->member_id )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_MEMBER', '2L296/K', 404 );
|
||||
}
|
||||
|
||||
\IPS\Db::i()->delete( 'calendar_event_rsvp', array( 'rsvp_event_id=? AND rsvp_member_id=?', intval( $id ), intval( $memberId ) ) );
|
||||
return new \IPS\Api\Response( 200, NULL );
|
||||
}
|
||||
@@ -415,9 +466,10 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
* Create or update event
|
||||
*
|
||||
* @param \IPS\Content\Item $item The item
|
||||
* @param string $type add or edit
|
||||
* @return \IPS\Content\Item
|
||||
*/
|
||||
protected function _createOrUpdate( \IPS\Content\Item $item )
|
||||
protected function _createOrUpdate( \IPS\Content\Item $item, $type='add' )
|
||||
{
|
||||
/* Start/End date */
|
||||
$startDate = new \IPS\DateTime( \IPS\Request::i()->start );
|
||||
@@ -440,10 +492,15 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
}
|
||||
|
||||
/* Description */
|
||||
$item->content = \IPS\Request::i()->description;
|
||||
$descriptionContents = \IPS\Request::i()->description;
|
||||
if ( $this->member )
|
||||
{
|
||||
$descriptionContents = \IPS\Text\Parser::parseStatic( $descriptionContents, TRUE, NULL, $this->member, 'calendar_Calendar' );
|
||||
}
|
||||
$item->content = $descriptionContents;
|
||||
|
||||
/* RSVP */
|
||||
if ( isset( \IPS\Request::i()->rsvp ) )
|
||||
if ( isset( \IPS\Request::i()->rsvp ) and ( !$this->member or $item->container()->can( 'askrsvp', $this->member ) ) )
|
||||
{
|
||||
$item->rsvp = intval( \IPS\Request::i()->rsvp );
|
||||
if ( $item->rsvp and isset( \IPS\Request::i()->rsvpLimit ) and \IPS\Request::i()->rsvpLimit )
|
||||
@@ -475,7 +532,7 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
}
|
||||
|
||||
/* Pass up */
|
||||
return parent::_createOrUpdate( $item );
|
||||
return parent::_createOrUpdate( $item, $type );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -490,7 +547,13 @@ class _events extends \IPS\Content\Api\ItemController
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\calendar\Event::load( $id )->delete();
|
||||
$item = \IPS\calendar\Event::load( $id );
|
||||
if ( $this->member and !$item->canDelete( $this->member ) )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_PERMISSION', '2F294/B', 404 );
|
||||
}
|
||||
|
||||
$item->delete();
|
||||
|
||||
return new \IPS\Api\Response( 200, NULL );
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
* GET /calendar/reviews
|
||||
* Get list of reviews
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, only reviews the authorized user can view will be included
|
||||
* @apiparam string calendars Comma-delimited list of calendar IDs
|
||||
* @apiparam string authors Comma-delimited list of member IDs - if provided, only topics started by those members are returned
|
||||
* @apiparam int locked If 1, only reviews from events which are locked are returned, if 0 only unlocked
|
||||
@@ -40,6 +41,7 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
* @apiparam string sortBy What to sort by. Can be 'date', 'title' or leave unspecified for ID
|
||||
* @apiparam string sortDir Sort direction. Can be 'asc' or 'desc' - defaults to 'asc'
|
||||
* @apiparam int page Page number
|
||||
* @apiparam int perPage Number of results per page - defaults to 25
|
||||
* @return \IPS\Api\PaginatedResponse<IPS\calendar\Event\Review>
|
||||
*/
|
||||
public function GETindex()
|
||||
@@ -52,14 +54,24 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
* View information about a specific review
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @throws 2L298/1 INVALID_ID The review ID does not exist
|
||||
* @throws 2L298/1 INVALID_ID The review ID does not exist or the authorized user does not have permission to view it
|
||||
* @return \IPS\calendar\Event\Review
|
||||
*/
|
||||
public function GETitem( $id )
|
||||
{
|
||||
try
|
||||
{
|
||||
return new \IPS\Api\Response( 200, \IPS\calendar\Event\Review::load( $id )->apiOutput() );
|
||||
$class = $this->class;
|
||||
if ( $this->member )
|
||||
{
|
||||
$object = $class::loadAndCheckPerms( $id, $this->member );
|
||||
}
|
||||
else
|
||||
{
|
||||
$object = $class::load( $id );
|
||||
}
|
||||
|
||||
return new \IPS\Api\Response( 200, $object->apiOutput( $this->member ) );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
@@ -71,23 +83,25 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
* POST /calendar/reviews
|
||||
* Create a review
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, hidden will only be honoured if the authentictaed user has permission to hide content).
|
||||
* @reqapiparam int event The ID number of the event the review is for
|
||||
* @reqapiparam int author The ID number of the member making the review (0 for guest)
|
||||
* @reqapiparam int author The ID number of the member making the review (0 for guest). Required for requests made using an API Key or the Client Credentials Grant Type. For requests using an OAuth Access Token for a particular member, that member will always be the author
|
||||
* @apiparam string author_name If author is 0, the guest name that should be used
|
||||
* @reqapiparam string content The review content as HTML (e.g. "<p>This is a review.</p>")
|
||||
* @apiparam datetime date The date/time that should be used for the review date. If not provided, will use the current date/time
|
||||
* @apiparam string ip_address The IP address that should be stored for the review. If not provided, will use the IP address from the API request
|
||||
* @reqapiparam string content The review content as HTML (e.g. "<p>This is a review.</p>"). Will be sanatized for requests using an OAuth Access Token for a particular member; will be saved unaltered for requests made using an API Key or the Client Credentials Grant Type.
|
||||
* @apiparam datetime date The date/time that should be used for the review date. If not provided, will use the current date/time. Ignored for requests using an OAuth Access Token for a particular member
|
||||
* @apiparam string ip_address The IP address that should be stored for the review. If not provided, will use the IP address from the API request. Ignored for requests using an OAuth Access Token for a particular member
|
||||
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
|
||||
* @reqapiparam int rating Star rating
|
||||
* @throws 2L298/2 INVALID_ID The forum ID does not exist
|
||||
* @throws 1L298/3 NO_AUTHOR The author ID does not exist
|
||||
* @throws 1L298/4 NO_CONTENT No content was supplied
|
||||
* @throws 1L298/8 INVALID_RATING The rating is not a valid number up to the maximum rating
|
||||
* @throws 2L298/A NO_PERMISSION The authorized user does not have permission to review that event
|
||||
* @return \IPS\calendar\Event\Review
|
||||
*/
|
||||
public function POSTindex()
|
||||
{
|
||||
/* Get topic */
|
||||
/* Get event */
|
||||
try
|
||||
{
|
||||
$event = \IPS\calendar\Event::load( \IPS\Request::i()->event );
|
||||
@@ -98,18 +112,29 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
}
|
||||
|
||||
/* Get author */
|
||||
if ( \IPS\Request::i()->author )
|
||||
if ( $this->member )
|
||||
{
|
||||
$author = \IPS\Member::load( \IPS\Request::i()->author );
|
||||
if ( !$author->member_id )
|
||||
if ( !$event->canReview( $this->member ) )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1L298/3', 404 );
|
||||
throw new \IPS\Api\Exception( 'NO_PERMISSION', '2L298/A', 403 );
|
||||
}
|
||||
$author = $this->member;
|
||||
}
|
||||
else
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
$author->name = \IPS\Request::i()->author_name;
|
||||
if ( \IPS\Request::i()->author )
|
||||
{
|
||||
$author = \IPS\Member::load( \IPS\Request::i()->author );
|
||||
if ( !$author->member_id )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1L298/3', 404 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
$author->name = \IPS\Request::i()->author_name;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check we have a post */
|
||||
@@ -132,15 +157,17 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
* POST /calendar/reviews/{id}
|
||||
* Edit a review
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, hidden will only be honoured if the authentictaed user has permission to hide content).
|
||||
* @param int $id ID Number
|
||||
* @apiparam int author The ID number of the member making the review (0 for guest)
|
||||
* @apiparam int author The ID number of the member making the review (0 for guest). Ignored for requests using an OAuth Access Token for a particular member.
|
||||
* @apiparam string author_name If author is 0, the guest name that should be used
|
||||
* @apiparam string content The review content as HTML (e.g. "<p>This is a review.</p>")
|
||||
* @apiparam string content The review content as HTML (e.g. "<p>This is a review.</p>"). Will be sanatized for requests using an OAuth Access Token for a particular member; will be saved unaltered for requests made using an API Key or the Client Credentials Grant Type.
|
||||
* @apiparam int hidden 1/0 indicating if the topic should be hidden
|
||||
* @apiparam int rating Star rating
|
||||
* @throws 2L298/5 INVALID_ID The review ID does not exist
|
||||
* @throws 2L298/5 INVALID_ID The review ID does not exist or the authorized user does not have permission to view it
|
||||
* @throws 1L298/6 NO_AUTHOR The author ID does not exist
|
||||
* @throws 1L298/9 INVALID_RATING The rating is not a valid number up to the maximum rating
|
||||
* @throws 2L298/B NO_PERMISSION The authorized user does not have permission to edit the review
|
||||
* @return \IPS\calendar\Event\Review
|
||||
*/
|
||||
public function POSTitem( $id )
|
||||
@@ -149,6 +176,14 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
{
|
||||
/* Load */
|
||||
$comment = \IPS\calendar\Event\Review::load( $id );
|
||||
if ( $this->member and !$comment->canView( $this->member ) )
|
||||
{
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
if ( $this->member and !$comment->canEdit( $this->member ) )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_PERMISSION', '2L298/B', 403 );
|
||||
}
|
||||
|
||||
/* Check */
|
||||
if ( isset( \IPS\Request::i()->rating ) and !in_array( (int) \IPS\Request::i()->rating, range( 1, \IPS\Settings::i()->reviews_rating_out_of ) ) )
|
||||
@@ -176,14 +211,21 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
* Deletes a review
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @throws 2L298/7 INVALID_ID The review ID does not exist
|
||||
* @throws 2L298/7 INVALID_ID The review ID does not exist
|
||||
* @throws 2L298/C NO_PERMISSION The authorized user does not have permission to delete the comment
|
||||
* @return void
|
||||
*/
|
||||
public function DELETEitem( $id )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\calendar\Event\Review::load( $id )->delete();
|
||||
$class = $this->class;
|
||||
$object = $class::load( $id );
|
||||
if ( $this->member and !$object->canDelete( $this->member ) )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_PERMISSION', '2L298/C', 403 );
|
||||
}
|
||||
$object->delete();
|
||||
|
||||
return new \IPS\Api\Response( 200, NULL );
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
{$email->language->addToStack("go_to_this_x", FALSE, array( 'sprintf' => array( mb_strtolower( $email->language->addToStack( $content::$title, FALSE ) ) ) ) )}: {$content->url()}
|
||||
|
||||
-- {setting="board_name"}]]></template_content_plaintext></template><template><template_app>calendar</template_app><template_name>notification_new_content</template_name><template_content_html><![CDATA[
|
||||
-- {setting="board_name"}]]></template_content_plaintext><template_pinned>0</template_pinned></template><template><template_app>calendar</template_app><template_name>notification_new_content</template_name><template_content_html><![CDATA[
|
||||
{{if $content->author()->member_id}}
|
||||
{$email->language->addToStack("email_new_calevent", FALSE, array( 'sprintf' => array( $content->author()->url(), $content->author()->name, $content->indefiniteArticle( $email->language ), $content->url(), $content->mapped('title'), $content->fixedDateTimeDescription( $email->language ) ) ) )}
|
||||
{{else}}
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
{$email->language->addToStack("go_to_this_x", FALSE, array( 'sprintf' => array( mb_strtolower( $email->language->addToStack( $content::$title, FALSE ) ) ) ) )}: {$content->url()}
|
||||
|
||||
-- {setting="board_name"}]]></template_content_plaintext></template><template><template_app>calendar</template_app><template_name>digests__item</template_name><template_content_html><![CDATA[<tr style='border-bottom: 1px solid #eeeeee'>
|
||||
-- {setting="board_name"}]]></template_content_plaintext><template_pinned>0</template_pinned></template><template><template_app>calendar</template_app><template_name>digests__item</template_name><template_content_html><![CDATA[<tr style='border-bottom: 1px solid #eeeeee'>
|
||||
<td dir='{dir}' width='120' valign='top' align='center'>
|
||||
<table width='120' cellpadding='10' cellspacing='0' border='0' bgcolor='#fafafa'>
|
||||
<tr>
|
||||
@@ -181,7 +181,7 @@
|
||||
{{endif}}
|
||||
</td>
|
||||
</tr>]]></template_content_html><template_data>$event, $email</template_data><template_content_plaintext><![CDATA[{$email->language->addToStack("x_created_event_in", FALSE, array( 'sprintf' => array( $event->author()->name, $event->container()->_title ) ) )}: {$event->title} ({$event->url()})
|
||||
]]></template_content_plaintext></template><template><template_app>calendar</template_app><template_name>digests__comment</template_name><template_content_html><![CDATA[<tr style='border-bottom: 1px solid #eeeeee'>
|
||||
]]></template_content_plaintext><template_pinned>0</template_pinned></template><template><template_app>calendar</template_app><template_name>digests__comment</template_name><template_content_html><![CDATA[<tr style='border-bottom: 1px solid #eeeeee'>
|
||||
<td dir='{dir}' width='120' valign='top' align='center'>
|
||||
<table width='120' cellpadding='10' cellspacing='0' border='0' bgcolor='#fafafa'>
|
||||
<tr>
|
||||
@@ -222,4 +222,4 @@
|
||||
|
||||
</td>
|
||||
</tr>]]></template_content_html><template_data>$comment, $email</template_data><template_content_plaintext><![CDATA[{$email->language->addToStack("x_commented_event", FALSE, array( 'sprintf' => array( $comment->author()->name ) ) )}: {$comment->item()->name} ({$comment->url()})
|
||||
]]></template_content_plaintext></template></emails>
|
||||
]]></template_content_plaintext><template_pinned>0</template_pinned></template></emails>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<javascript app="calendar">
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.main.js" javascript_type="controller" javascript_version="102002" javascript_position="1000050"><![CDATA[/**
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.main.js" javascript_type="controller" javascript_version="103005" javascript_position="1000250"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -112,7 +112,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.monthView.js" javascript_type="controller" javascript_version="102002" javascript_position="1000050"><![CDATA[/**
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.monthView.js" javascript_type="controller" javascript_version="103005" javascript_position="1000250"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -254,7 +254,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.dates.js" javascript_type="controller" javascript_version="102002" javascript_position="1000100"><![CDATA[/**
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.dates.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -278,6 +278,7 @@
|
||||
|
||||
this.on( 'change', 'input, select', this.checkForSummaryChange );
|
||||
this.on( 'change', '#check_single_day, #check_all_day', this.toggleFields );
|
||||
this.on( 'change', '#check_no_end_time', this.toggleEndtimeFields );
|
||||
this.on( 'click', '#elRecurRemove', this.disableRecurring );
|
||||
this.on( 'change', 'input[name="event_dates[start_date]"]', this.setEndDateOnStartChange );
|
||||
this.on( 'change', '#event_end_date', this.setHasFocusedEventOnEndChange );
|
||||
@@ -372,6 +373,23 @@
|
||||
this._resizeEndGrid();
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggle the end time enabled/disabled status
|
||||
*
|
||||
* @param {event} e Event object
|
||||
* @returns {void}
|
||||
*/
|
||||
toggleEndtimeFields: function(e) {
|
||||
if( this.scope.find('#check_no_end_time').is(':checked') )
|
||||
{
|
||||
this.scope.find('#end_time').prop('disabled', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.scope.find('#end_time').prop('disabled', false);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Manual toggle functionality for the Single/All Day checkboxes
|
||||
*
|
||||
@@ -379,6 +397,8 @@
|
||||
* @returns {void}
|
||||
*/
|
||||
toggleFields: function (e) {
|
||||
this.toggleEndtimeFields();
|
||||
|
||||
var singleDay = this.scope.find('#check_single_day');
|
||||
var allDay = this.scope.find('#check_all_day');
|
||||
var self = this;
|
||||
@@ -388,7 +408,8 @@
|
||||
end_time_wrap: true,
|
||||
event_end_date_wrap: true,
|
||||
elDateGrid_arrow: true,
|
||||
elDateGrid_end: true
|
||||
elDateGrid_end: true,
|
||||
end_date_controls: true
|
||||
};
|
||||
|
||||
// Single day, not all day
|
||||
@@ -403,6 +424,13 @@
|
||||
} else if( !singleDay.is(':checked') && allDay.is(':checked') ){
|
||||
toggles.start_time_wrap = false;
|
||||
toggles.end_time_wrap = false;
|
||||
toggles.end_date_controls = false;
|
||||
}
|
||||
// Multiple days, not all day
|
||||
else
|
||||
{
|
||||
toggles.end_date_controls = false;
|
||||
this.scope.find('#end_time').prop('disabled', false);
|
||||
}
|
||||
|
||||
// Hide appropriate elements
|
||||
@@ -530,7 +558,14 @@
|
||||
var finalString = '';
|
||||
|
||||
if( singleDay.is(':checked') && !allDay.is(':checked') ){
|
||||
finalString = ips.getString( 'single_not_allday', { startDate: startDateString, startTime: startTime, endTime: endTime } );
|
||||
if( this.scope.find('#check_no_end_time').is(':checked') )
|
||||
{
|
||||
finalString = ips.getString( 'single_not_allday_noendtime', { startDate: startDateString, startTime: startTime } );
|
||||
}
|
||||
else
|
||||
{
|
||||
finalString = ips.getString( 'single_not_allday', { startDate: startDateString, startTime: startTime, endTime: endTime } );
|
||||
}
|
||||
} else if ( ( !singleDay.is(':checked') && !allDay.is(':checked') ) && endDateString && startTime && endTime ) {
|
||||
finalString = ips.getString( 'not_single_not_allday', { startDate: startDateString, endDate: endDateString, startTime: startTime, endTime: endTime } );
|
||||
} else if( !singleDay.is(':checked') && allDay.is(':checked') && endDateString ) {
|
||||
@@ -664,7 +699,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="controllers/venue" javascript_name="ips.venue.main.js" javascript_type="controller" javascript_version="102002" javascript_position="1000150"><![CDATA[/**
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="controllers/venue" javascript_name="ips.venue.main.js" javascript_type="controller" javascript_version="103005" javascript_position="1000200"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -776,7 +811,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.reminderButton.js" javascript_type="controller" javascript_version="102002" javascript_position="1000200"><![CDATA[/**
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.reminderButton.js" javascript_type="controller" javascript_version="103005" javascript_position="1000150"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -859,7 +894,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.reminderForm.js" javascript_type="controller" javascript_version="102002" javascript_position="1000200">/**
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.reminderForm.js" javascript_type="controller" javascript_version="103005" javascript_position="1000150">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -969,7 +1004,7 @@
|
||||
});
|
||||
}(jQuery, _));
|
||||
</file>
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="templates" javascript_name="ips.calendar.templates.js" javascript_type="framework" javascript_version="102002" javascript_position="1000250"><![CDATA[/**
|
||||
<file javascript_app="calendar" javascript_location="front" javascript_path="templates" javascript_name="ips.calendar.templates.js" javascript_type="framework" javascript_version="103005" javascript_position="1000050"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<language>
|
||||
<app key="calendar" version="102002">
|
||||
<app key="calendar" version="103005">
|
||||
<word key="__app_calendar" js="0">Calendar</word>
|
||||
<word key="frontnavigation_calendar" js="0">Calendar</word>
|
||||
<word key="__indefart_calendar_event_comment" js="0">a comment on a calendar event</word>
|
||||
@@ -64,7 +64,7 @@
|
||||
<word key="calendar_custom_df" js="0">Or specify a custom date format</word>
|
||||
<word key="calendar_date_format" js="0">Date format for events</word>
|
||||
<word key="calendar_date_format_custom" js="0">Custom date format</word>
|
||||
<word key="calendar_date_format_custom_desc" js="0"><![CDATA[You can use any <a href='http://php.net/strftime' target='_blank'>PHP strftime</a> options to specify a custom format for dates in calendar]]></word>
|
||||
<word key="calendar_date_format_custom_desc" js="0"><![CDATA[You can use any <a href='{external.php-strftime}' target='_blank'>PHP strftime</a> options to specify a custom format for dates in calendar]]></word>
|
||||
<word key="calendar_no_date_format" js="0">You must either choose a predefined date format or specify a custom date format</word>
|
||||
<word key="calendars" js="0">Calendars</word>
|
||||
<word key="calendars_sg" js="0">Calendar</word>
|
||||
@@ -95,7 +95,7 @@
|
||||
<word key="can_feature_calendar_event" js="0">Can feature events?</word>
|
||||
<word key="can_unfeature_calendar_event" js="0">Can unfeature events?</word>
|
||||
<word key="can_move_calendar_event" js="0">Can move events?</word>
|
||||
<word key="can_move_calendar_event_desc" js="0">Will be able to move events only between the calendars they have permission to moderate, not to any other calendar.</word>
|
||||
<word key="can_move_calendar_event_desc" js="0">Will be able to move events only between the calendars they can create new content within.</word>
|
||||
<word key="can_lock_calendar_event" js="0">Can lock events?</word>
|
||||
<word key="can_unlock_calendar_event" js="0">Can unlock events?</word>
|
||||
<word key="can_reply_to_locked_calendar_event" js="0">Can comment on locked events?</word>
|
||||
@@ -204,6 +204,7 @@
|
||||
<word key="event_rsvp_desc" js="0">Members who are allowed to RSVP for events will be asked to do so and will be able to see the list of members who have RSVP'd for this event. For recurring events, responses apply to all occurrences.</word>
|
||||
<word key="event_to" js="0">to</word>
|
||||
<word key="event_all_day" js="0">This is an all day event</word>
|
||||
<word key="no_end_time" js="0">There is no end time</word>
|
||||
<word key="event_repeat" js="0">Repeat</word>
|
||||
<word key="change_timezone" js="0">Change the time zone</word>
|
||||
<word key="event_timezone" js="0">Event Time Zone</word>
|
||||
@@ -432,6 +433,7 @@
|
||||
<word key="menu__calendar_calendars_venues" js="0">Venues</word>
|
||||
<word key="venues" js="0">Venues</word>
|
||||
<word key="venue_title" js="0">Venue Name</word>
|
||||
<word key="event_venue_name" js="0">Event Venue</word>
|
||||
<word key="event_venue" js="0">Venue</word>
|
||||
<word key="venues_not_listed" js="0">Venue not listed</word>
|
||||
<word key="venue_address" js="0">Address</word>
|
||||
@@ -467,6 +469,7 @@
|
||||
<word key="week_string" js="1">{{week}} {{days}}</word>
|
||||
<word key="doesnt_repeat" js="1">Doesn't repeat</word>
|
||||
<word key="single_not_allday" js="1"><![CDATA[On <strong>{{startDate}}</strong>, from <strong>{{startTime}}</strong> to <strong>{{endTime}}</strong>]]></word>
|
||||
<word key="single_not_allday_noendtime" js="1"><![CDATA[On <strong>{{startDate}}</strong>, at <strong>{{startTime}}</strong>]]></word>
|
||||
<word key="single_allday" js="1"><![CDATA[<strong>{{startDate}}</strong> (all day)]]></word>
|
||||
<word key="not_single_not_allday" js="1"><![CDATA[From <strong>{{startDate}}</strong> at <strong>{{startTime}}</strong> until <strong>{{endDate}}</strong> at <strong>{{endTime}}</strong>]]></word>
|
||||
<word key="not_single_allday" js="1"><![CDATA[From <strong>{{startDate}}</strong> to <strong>{{endDate}}</strong>]]></word>
|
||||
|
||||
@@ -181,7 +181,9 @@
|
||||
"cal_allow_reviews": "0",
|
||||
"cal_review_moderate": "0"
|
||||
}
|
||||
]
|
||||
],
|
||||
"comment": "",
|
||||
"reporting": "count"
|
||||
},
|
||||
"calendar_event_comments": {
|
||||
"name": "calendar_event_comments",
|
||||
@@ -392,7 +394,9 @@
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"comment": "",
|
||||
"reporting": "count"
|
||||
},
|
||||
"calendar_event_rsvp": {
|
||||
"name": "calendar_event_rsvp",
|
||||
@@ -498,8 +502,22 @@
|
||||
"columns": [
|
||||
"rsvp_member_id"
|
||||
]
|
||||
},
|
||||
"rsvp_search": {
|
||||
"type": "key",
|
||||
"name": "rsvp_search",
|
||||
"columns": [
|
||||
"rsvp_date",
|
||||
"rsvp_member_id"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"comment": "",
|
||||
"reporting": "count"
|
||||
},
|
||||
"calendar_events": {
|
||||
"name": "calendar_events",
|
||||
@@ -1111,10 +1129,26 @@
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
},
|
||||
"event_album": {
|
||||
"type": "key",
|
||||
"name": "event_album",
|
||||
"columns": [
|
||||
"event_album",
|
||||
"event_approved",
|
||||
"event_saved"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
},
|
||||
"collation": "utf8mb4_unicode_ci",
|
||||
"engine": "InnoDB"
|
||||
"engine": "InnoDB",
|
||||
"comment": "",
|
||||
"reporting": "count"
|
||||
},
|
||||
"calendar_import_feeds": {
|
||||
"name": "calendar_import_feeds",
|
||||
@@ -1291,7 +1325,9 @@
|
||||
"feed_last_run"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"comment": "",
|
||||
"reporting": "count"
|
||||
},
|
||||
"calendar_import_map": {
|
||||
"name": "calendar_import_map",
|
||||
@@ -1609,6 +1645,20 @@
|
||||
"unsigned": false,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
},
|
||||
"review_author_response": {
|
||||
"name": "review_author_response",
|
||||
"type": "MEDIUMTEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
@@ -1635,11 +1685,13 @@
|
||||
"review_mid": {
|
||||
"type": "key",
|
||||
"name": "review_mid",
|
||||
"length": [
|
||||
null
|
||||
],
|
||||
"columns": [
|
||||
"review_mid"
|
||||
"review_mid",
|
||||
"review_date"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null
|
||||
]
|
||||
},
|
||||
"review_ip": {
|
||||
@@ -1662,7 +1714,9 @@
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"comment": "",
|
||||
"reporting": "count"
|
||||
},
|
||||
"calendar_event_reminders": {
|
||||
"name": "calendar_event_reminders",
|
||||
@@ -1858,6 +1912,8 @@
|
||||
"venue_id"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"comment": "",
|
||||
"reporting": "count"
|
||||
}
|
||||
}
|
||||
@@ -1,38 +1,47 @@
|
||||
[
|
||||
{
|
||||
"key": "all_activity_calendar_streamitems",
|
||||
"default": "1"
|
||||
"default": "1",
|
||||
"report": "full"
|
||||
},
|
||||
{
|
||||
"key": "calendar_date_format",
|
||||
"default": "d_lm_y"
|
||||
"default": "d_lm_y",
|
||||
"report": "full"
|
||||
},
|
||||
{
|
||||
"key": "calendar_date_format_custom",
|
||||
"default": ""
|
||||
"default": "",
|
||||
"report": "bool"
|
||||
},
|
||||
{
|
||||
"key": "calendar_default_view",
|
||||
"default": "month"
|
||||
"default": "month",
|
||||
"report": "full"
|
||||
},
|
||||
{
|
||||
"key": "calendar_rss_feed",
|
||||
"default": "1"
|
||||
"default": "1",
|
||||
"report": "full"
|
||||
},
|
||||
{
|
||||
"key": "calendar_rss_feed_days",
|
||||
"default": "30"
|
||||
"default": "30",
|
||||
"report": "full"
|
||||
},
|
||||
{
|
||||
"key": "calendar_venues_enabled",
|
||||
"default": "0"
|
||||
"default": "0",
|
||||
"report": "full"
|
||||
},
|
||||
{
|
||||
"key": "ipb_calendar_mon",
|
||||
"default": "1"
|
||||
"default": "1",
|
||||
"report": "full"
|
||||
},
|
||||
{
|
||||
"key": "show_bday_calendar",
|
||||
"default": "1"
|
||||
"default": "1",
|
||||
"report": "full"
|
||||
}
|
||||
]
|
||||
@@ -167,13 +167,15 @@
|
||||
<h2 class='ipsType_reset ipsType_sectionTitle'>{lang="featured_events"}</h2>
|
||||
<div class='ipsPad'>
|
||||
<div class='ipsCarousel ipsClearfix' data-ipsCarousel>
|
||||
<ul class='cCalendarCarousel ipsClearfix' data-role="carouselItems">
|
||||
{{foreach $featured as $event}}
|
||||
<li class='ipsCarousel_item'>
|
||||
{template="eventBlock" app="calendar" group="view" params="$event, $date, true, false"}
|
||||
</li>
|
||||
{{endforeach}}
|
||||
</ul>
|
||||
<div class='ipsCarousel_inner'>
|
||||
<ul class='cCalendarCarousel ipsClearfix' data-role="carouselItems">
|
||||
{{foreach $featured as $event}}
|
||||
<li class='ipsCarousel_item'>
|
||||
{template="eventBlock" app="calendar" group="view" params="$event, $date, true, false"}
|
||||
</li>
|
||||
{{endforeach}}
|
||||
</ul>
|
||||
</div>
|
||||
<span class='ipsCarousel_shadow ipsCarousel_shadowLeft'></span>
|
||||
<span class='ipsCarousel_shadow ipsCarousel_shadowRight'></span>
|
||||
<a href='#' class='ipsCarousel_nav ipsHide' data-action='prev'><i class='fa fa-chevron-left'></i></a>
|
||||
@@ -219,7 +221,11 @@
|
||||
<ul class='ipsMenu ipsMenu_auto ipsHide' id='elCalendars_menu'>
|
||||
<li class='ipsMenu_item'><a href='{url="app=calendar&module=calendar&controller=view" seoTemplate="calendar"}'><span class='cCalendarIcon cEvents_style_blank'></span> {lang="all_calendars"}</a></li>
|
||||
{{foreach $calendars as $calendar}}
|
||||
<li class='ipsMenu_item'><a href='{$calendar->url()}'><span class='cCalendarIcon cEvents_style{$calendar->id}'></span> {$calendar->_title}</a></li>
|
||||
{{if $club = $calendar->club()}}
|
||||
<li class='ipsMenu_item'><a href='{$calendar->url()}'><span class='cCalendarIcon cEvents_style_blank'></span> {lang="club_node" sprintf="$club->name, $calendar->_title"}</a></li>
|
||||
{{else}}
|
||||
<li class='ipsMenu_item'><a href='{$calendar->url()}'><span class='cCalendarIcon cEvents_style{$calendar->id}'></span> {$calendar->_title}</a></li>
|
||||
{{endif}}
|
||||
{{endforeach}}
|
||||
</ul>
|
||||
<ul class='ipsMenu ipsMenu_auto ipsHide' id='elCalendarSettings_menu'>
|
||||
@@ -282,7 +288,7 @@
|
||||
<li class='cEvents_ranged'>
|
||||
<ul class='cEvents'>
|
||||
{{foreach $events[ $date->year . '-' . $date->mon . '-' . $k ]['ranged'] as $event }}
|
||||
<li class='cEvents_event cEvents_style{$event->calendar_id}{{if $event->nextOccurrence( \IPS\calendar\Date::getDate( $date->year, $date->mon, $k ), 'startDate' ) AND $event->nextOccurrence( \IPS\calendar\Date::getDate( $date->year, $date->mon, $k ), 'startDate' )->mysqlDatetime( FALSE ) == $date->year . '-' . $date->mon . '-' . $k }}{{$startDates[ $event->id ] = $date->year . '-' . $date->mon . '-' . $k;}} cEvents_first{{endif}}{{if $event->nextOccurrence( \IPS\calendar\Date::getDate( $date->year, $date->mon, $k ) ?: $event->nextOccurrence( \IPS\calendar\Date::getDate( $date->year, $date->mon, $k ), 'startDate' ), 'endDate' ) AND $event->nextOccurrence( \IPS\calendar\Date::getDate( $date->year, $date->mon, $k ) ?: $event->nextOccurrence( \IPS\calendar\Date::getDate( $date->year, $date->mon, $k ), 'startDate' ), 'endDate' )->mysqlDatetime( FALSE ) == $date->year . '-' . $date->mon . '-' . $k }} cEvents_last{{endif}}' data-eventID='{$event->id}'>
|
||||
<li class='cEvents_event cEvents_style{$event->calendar_id}{{if $event->nextOccurrence( \IPS\calendar\Date::getDate( $date->year, $date->mon, $k ), 'startDate' ) AND $event->nextOccurrence( \IPS\calendar\Date::getDate( $date->year, $date->mon, $k ), 'startDate' )->mysqlDatetime( FALSE, TRUE ) == $date->year . '-' . $date->mon . '-' . $k }}{{$startDates[ $event->id ] = $date->year . '-' . $date->mon . '-' . $k;}} cEvents_first{{endif}}{{if $event->nextOccurrence( \IPS\calendar\Date::getDate( $date->year, $date->mon, $k ) ?: $event->nextOccurrence( \IPS\calendar\Date::getDate( $date->year, $date->mon, $k ), 'startDate' ), 'endDate' ) AND $event->nextOccurrence( \IPS\calendar\Date::getDate( $date->year, $date->mon, $k ) ?: $event->nextOccurrence( \IPS\calendar\Date::getDate( $date->year, $date->mon, $k ), 'startDate' ), 'endDate' )->mysqlDatetime( FALSE, TRUE ) == $date->year . '-' . $date->mon . '-' . $k }} cEvents_last{{endif}}' data-eventID='{$event->id}'>
|
||||
<a href='{$event->url()}' data-ipsHover data-ipsHover-target='{$event->url('hovercard')->setQuerystring( 'sd', isset( $startDates[ $event->id ] ) ? $startDates[ $event->id ] : $date->year . '-' . $date->mon . '-' . $k )}' title='{$event->title}'>{{if !$event->all_day}}<span class='cEvents_time'>{$event->_start_date->localeTime( FALSE )}</span> {{endif}}{truncate="$event->title" length="15"}{{if $event->hidden() === 1}} <i class='fa fa-warning'></i>{{endif}}</a>
|
||||
</li>
|
||||
{{endforeach}}
|
||||
@@ -425,7 +431,7 @@
|
||||
<li class='cEvents_ranged'>
|
||||
<ul class='cEvents'>
|
||||
{{foreach $events[ $day->year . '-' . $day->mon . '-' . $day->mday ]['ranged'] as $event }}
|
||||
<li class='cEvents_event cEvents_style{$event->calendar_id}{{if $event->nextOccurrence( $day, 'startDate' ) AND $event->nextOccurrence( $day, 'startDate' )->mysqlDatetime( FALSE ) == $day->mysqlDatetime( FALSE ) }}{{$startDates[ $event->id ] = $day->mysqlDatetime( FALSE );}} cEvents_first{{endif}}{{if $event->nextOccurrence( $day ?: $event->nextOccurrence( $day, 'startDate' ), 'endDate' ) AND $event->nextOccurrence( $day ?: $event->nextOccurrence( $day, 'startDate' ), 'endDate' )->mysqlDatetime( FALSE ) == $day->mysqlDatetime( FALSE ) }} cEvents_last{{endif}}'>
|
||||
<li class='cEvents_event cEvents_style{$event->calendar_id}{{if $event->nextOccurrence( $day, 'startDate' ) AND $event->nextOccurrence( $day, 'startDate' )->mysqlDatetime( FALSE, TRUE ) == $day->mysqlDatetime( FALSE ) }}{{$startDates[ $event->id ] = $day->mysqlDatetime( FALSE );}} cEvents_first{{endif}}{{if $event->nextOccurrence( $day ?: $event->nextOccurrence( $day, 'startDate' ), 'endDate' ) AND $event->nextOccurrence( $day ?: $event->nextOccurrence( $day, 'startDate' ), 'endDate' )->mysqlDatetime( FALSE, TRUE ) == $day->mysqlDatetime( FALSE ) }} cEvents_last{{endif}}'>
|
||||
<a href='{$event->url()}' data-ipsHover data-ipsHover-target='{$event->url('hovercard')->setQuerystring( 'sd', isset( $startDates[ $event->id ] ) ? $startDates[ $event->id ] : $day->mysqlDatetime( FALSE ) )}'>{$event->title}{{if $event->hidden() === 1}} <i class='fa fa-warning'></i>{{endif}}</a>
|
||||
</li>
|
||||
{{endforeach}}
|
||||
@@ -459,7 +465,7 @@
|
||||
<template template_group="browse" template_name="calendarWrapper" template_data="$calendar, $calendars, $thisCalendar, $jump, $date, $featured, $downloadLinks" template_location="front" template_app="calendar"><![CDATA[
|
||||
{template="calendarHeader" group="browse" app="calendar" params="$calendars, $thisCalendar, $jump, $downloadLinks"}
|
||||
|
||||
<div data-controller='calendar.front.browse.main' class='ipsSpacer_top'>
|
||||
<div data-controller='calendar.front.browse.main' class='ipsSpacer_top ipsBox_alt'>
|
||||
{$calendar|raw}
|
||||
</div>
|
||||
|
||||
@@ -486,7 +492,7 @@
|
||||
{{foreach $collection as $input}}
|
||||
{{if $input instanceof \IPS\Helpers\Form\Date}}
|
||||
<li class='ipsFieldRow ipsFieldRow_fullWidth'>
|
||||
<input type="date" data-control="date" placeholder="{lang="jump_to_placeholder"}" name='{$input->name}' id='{$input->htmlId}' {{if $input->required === TRUE}}required{{endif}} value="{{if $input->defaultValue instanceof \IPS\DateTime}}{$input->defaultValue->format('Y-m-d')}{{endif}}">
|
||||
<input type="date" data-control="date" name='{$input->name}' id='{$input->htmlId}' {{if $input->required === TRUE}}required{{endif}} value="{{if $input->defaultValue instanceof \IPS\DateTime}}{$input->defaultValue->format('Y-m-d')}{{endif}}">
|
||||
</li>
|
||||
{{else}}
|
||||
{$input->rowHtml($form)|raw}
|
||||
@@ -525,35 +531,36 @@
|
||||
</div>]]></template>
|
||||
<template template_group="global" template_name="embedEvent" template_data="$item, $url, $image=NULL" template_location="front" template_app="calendar"><![CDATA[
|
||||
<div data-embedInfo-maxSize='500' class='ipsRichEmbed'>
|
||||
{template="embedHeader" group="embed" app="core" params="$item, \IPS\Member::loggedIn()->language()->addToStack( 'x_created_event_in', FALSE, array( 'sprintf' => array( $item->author()->name, $item->container()->_title ) ) ), $item->mapped('date')"}
|
||||
{template="embedHeader" group="embed" app="core" params="$item, \IPS\Member::loggedIn()->language()->addToStack( 'x_created_event_in', FALSE, array( 'sprintf' => array( $item->author()->name, $item->container()->_title ) ) ), $item->mapped('date'), $url"}
|
||||
|
||||
{{if $item->map( 500, 100 )}}
|
||||
<div class='ipsRichEmbed_masthead ipsType_center'>
|
||||
<a href='{$item->url()}' title='{$item->mapped('title')}'>
|
||||
<a href='{$url}' title='{$item->mapped('title')}'>
|
||||
{$item->map( 500, 100 )|raw}
|
||||
</a>
|
||||
</div>
|
||||
{{elseif $item->coverPhoto() && $item->coverPhoto()->file}}
|
||||
{{$photo = $item->coverPhoto()->file;}}
|
||||
<div class='ipsRichEmbed_masthead ipsRichEmbed_mastheadBg ipsType_center'>
|
||||
<a href='{$item->url()}' title='{$item->mapped('title')}' style='background-image: url( "{expression="str_replace( array( '(', ')' ), array( '\(', '\)' ), $photo->url )"}") '>
|
||||
<a href='{$url}' title='{$item->mapped('title')}' style='background-image: url( "{expression="str_replace( array( '(', ')' ), array( '\(', '\)' ), $photo->url )"}") '>
|
||||
<img src='{$photo->url}' alt='{$item->mapped('title')}' class='ipsHide'>
|
||||
</a>
|
||||
</div>
|
||||
{{endif}}
|
||||
<div class='ipsPad ipsClearfix'>
|
||||
<div class='ipsPad_double ipsClearfix'>
|
||||
<div class='ipsPhotoPanel ipsPhotoPanel_medium'>
|
||||
<span class='cCalendarEmbed_calendar ipsPos_left ipsType_blendLinks'>
|
||||
<a href='{$item->url()}'>
|
||||
<time datetime='{$item->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->mysqlDatetime()}' class='ipsCalendarDate'>
|
||||
<span class='ipsCalendarDate_month'>{$item->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->monthNameShort}</span>
|
||||
<span class='ipsCalendarDate_date'>{$item->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->mday}</span>
|
||||
<a href='{$url}'>
|
||||
{{$nextOccurrence = $item->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' ) ?: $event->lastOccurrence( 'startDate' );}}
|
||||
<time datetime='{$nextOccurrence->mysqlDatetime()}' class='ipsCalendarDate'>
|
||||
<span class='ipsCalendarDate_month'>{$nextOccurrence->monthNameShort}</span>
|
||||
<span class='ipsCalendarDate_date'>{$nextOccurrence->mday}</span>
|
||||
</time>
|
||||
</a>
|
||||
</span>
|
||||
<div>
|
||||
<p class='ipsRichEmbed_itemTitle ipsType_reset ipsTruncate ipsTruncate_line ipsType_blendLinks'>
|
||||
<a href='{$item->url()}'>{$item->mapped('title')}</a>
|
||||
<a href='{$url}'>{$item->mapped('title')}</a>
|
||||
</p>
|
||||
<div class='ipsType_reset ipsType_medium'>
|
||||
{{if $item->_end_date}}
|
||||
@@ -630,20 +637,20 @@
|
||||
</div>]]></template>
|
||||
<template template_group="global" template_name="embedEventComment" template_data="$comment, $item, $url" template_location="front" template_app="calendar"><![CDATA[
|
||||
<div data-embedInfo-maxSize='500' class='ipsRichEmbed'>
|
||||
{template="embedHeader" group="embed" app="core" params="$comment, \IPS\Member::loggedIn()->language()->addToStack( 'x_commented_event', FALSE, array( 'sprintf' => array( $comment->author()->name ) ) ), $comment->mapped('date')"}
|
||||
<div class='ipsPad'>
|
||||
{template="embedHeader" group="embed" app="core" params="$comment, \IPS\Member::loggedIn()->language()->addToStack( 'x_commented_event', FALSE, array( 'sprintf' => array( $comment->author()->name ) ) ), $comment->mapped('date'), $url"}
|
||||
<div class='ipsPad_double'>
|
||||
<div class='ipsRichEmbed_originalItem ipsAreaBackground_reset ipsSpacer_bottom ipsType_blendLinks'>
|
||||
<div>
|
||||
{{if $item->map( 500, 100 )}}
|
||||
<div class='ipsRichEmbed_masthead ipsRichEmbed_masthead_small ipsType_center'>
|
||||
<a href='{$item->url()}' title='{$item->mapped('title')}'>
|
||||
<a href='{$url}' title='{$item->mapped('title')}'>
|
||||
{$item->map( 500, 100 )|raw}
|
||||
</a>
|
||||
</div>
|
||||
{{elseif $item->coverPhoto() && $item->coverPhoto()->file}}
|
||||
{{$photo = $item->coverPhoto()->file;}}
|
||||
<div class='ipsRichEmbed_masthead ipsRichEmbed_masthead_small ipsRichEmbed_mastheadBg ipsType_center'>
|
||||
<a href='{$item->url()}' title='{$item->mapped('title')}' style='background-image: url( "{expression="str_replace( array( '(', ')' ), array( '\(', '\)' ), $photo->url )"}") '>
|
||||
<a href='{$url}' title='{$item->mapped('title')}' style='background-image: url( "{expression="str_replace( array( '(', ')' ), array( '\(', '\)' ), $photo->url )"}") '>
|
||||
<img src='{$photo->url}' alt='{$item->mapped('title')}' class='ipsHide'>
|
||||
</a>
|
||||
</div>
|
||||
@@ -651,10 +658,11 @@
|
||||
<div class='ipsPad'>
|
||||
<div class='ipsPhotoPanel ipsPhotoPanel_small'>
|
||||
<span class='cCalendarEmbed_calendar ipsPos_left ipsType_blendLinks'>
|
||||
<a href='{$item->url()}'>
|
||||
<time datetime='{$item->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->mysqlDatetime()}' class='ipsCalendarDate'>
|
||||
<span class='ipsCalendarDate_month'>{$item->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->monthNameShort}</span>
|
||||
<span class='ipsCalendarDate_date'>{$item->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->mday}</span>
|
||||
<a href='{$url}'>
|
||||
{{$nextOccurrence = $item->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' ) ?: $event->lastOccurrence( 'startDate' );}}
|
||||
<time datetime='{$nextOccurrence->mysqlDatetime()}' class='ipsCalendarDate'>
|
||||
<span class='ipsCalendarDate_month'>{$nextOccurrence->monthNameShort}</span>
|
||||
<span class='ipsCalendarDate_date'>{$nextOccurrence->mday}</span>
|
||||
</time>
|
||||
</a>
|
||||
</span>
|
||||
@@ -670,7 +678,7 @@
|
||||
{$comment->truncated(TRUE)|raw}
|
||||
</div>
|
||||
|
||||
{{if \IPS\IPS::classUsesTrait( $comment, 'IPS\Content\Reactable' ) and count( $comment->reactions() ) and settings.reputation_enabled}}
|
||||
{{if settings.reputation_enabled AND \IPS\IPS::classUsesTrait( $comment, 'IPS\Content\Reactable' ) AND count( $comment->reactions() )}}
|
||||
<ul class='ipsList_inline ipsSpacer_top ipsSpacer_half'>
|
||||
<li>
|
||||
{template="reactionOverview" app="core" group="global" params="$comment, TRUE, 'small'"}
|
||||
@@ -705,20 +713,20 @@
|
||||
{{endif}}]]></template>
|
||||
<template template_group="global" template_name="embedEventReview" template_data="$comment, $item, $url" template_location="front" template_app="calendar"><![CDATA[
|
||||
<div data-embedInfo-maxSize='500' class='ipsRichEmbed'>
|
||||
{template="embedHeader" group="embed" app="core" params="$comment, \IPS\Member::loggedIn()->language()->addToStack( 'x_reviewed_event', FALSE, array( 'sprintf' => array( $comment->author()->name ) ) ), $comment->mapped('date')"}
|
||||
<div class='ipsPad'>
|
||||
{template="embedHeader" group="embed" app="core" params="$comment, \IPS\Member::loggedIn()->language()->addToStack( 'x_reviewed_event', FALSE, array( 'sprintf' => array( $comment->author()->name ) ) ), $comment->mapped('date'), $url"}
|
||||
<div class='ipsPad_double'>
|
||||
<div class='ipsRichEmbed_originalItem ipsAreaBackground_reset ipsSpacer_bottom ipsType_blendLinks'>
|
||||
<div>
|
||||
{{if $item->map( 500, 100 )}}
|
||||
<div class='ipsRichEmbed_masthead ipsRichEmbed_masthead_small ipsType_center'>
|
||||
<a href='{$item->url()}' title='{$item->mapped('title')}'>
|
||||
<a href='{$url}' title='{$item->mapped('title')}'>
|
||||
{$item->map( 500, 100 )|raw}
|
||||
</a>
|
||||
</div>
|
||||
{{elseif $item->coverPhoto() && $item->coverPhoto()->file}}
|
||||
{{$photo = $item->coverPhoto()->file;}}
|
||||
<div class='ipsRichEmbed_masthead ipsRichEmbed_masthead_small ipsRichEmbed_mastheadBg ipsType_center'>
|
||||
<a href='{$item->url()}' title='{$item->mapped('title')}' style='background-image: url( "{expression="str_replace( array( '(', ')' ), array( '\(', '\)' ), $photo->url )"}") '>
|
||||
<a href='{$url}' title='{$item->mapped('title')}' style='background-image: url( "{expression="str_replace( array( '(', ')' ), array( '\(', '\)' ), $photo->url )"}") '>
|
||||
<img src='{$photo->url}' alt='{$item->mapped('title')}' class='ipsHide'>
|
||||
</a>
|
||||
</div>
|
||||
@@ -726,10 +734,11 @@
|
||||
<div class='ipsPad'>
|
||||
<div class='ipsPhotoPanel ipsPhotoPanel_small'>
|
||||
<span class='cCalendarEmbed_calendar ipsPos_left ipsType_blendLinks'>
|
||||
<a href='{$item->url()}'>
|
||||
<time datetime='{$item->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->mysqlDatetime()}' class='ipsCalendarDate'>
|
||||
<span class='ipsCalendarDate_month'>{$item->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->monthNameShort}</span>
|
||||
<span class='ipsCalendarDate_date'>{$item->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->mday}</span>
|
||||
<a href='{$url}'>
|
||||
{{$nextOccurrence = $item->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' ) ?: $event->lastOccurrence( 'startDate' );}}
|
||||
<time datetime='{$nextOccurrence->mysqlDatetime()}' class='ipsCalendarDate'>
|
||||
<span class='ipsCalendarDate_month'>{$nextOccurrence->monthNameShort}</span>
|
||||
<span class='ipsCalendarDate_date'>{$nextOccurrence->mday}</span>
|
||||
</time>
|
||||
</a>
|
||||
</span>
|
||||
@@ -750,7 +759,7 @@
|
||||
{$comment->truncated(TRUE)|raw}
|
||||
</div>
|
||||
|
||||
{{if \IPS\IPS::classUsesTrait( $comment, 'IPS\Content\Reactable' ) and count( $comment->reactions() ) and settings.reputation_enabled}}
|
||||
{{if settings.reputation_enabled AND \IPS\IPS::classUsesTrait( $comment, 'IPS\Content\Reactable' ) AND count( $comment->reactions() )}}
|
||||
<ul class='ipsList_inline ipsSpacer_top ipsSpacer_half'>
|
||||
<li>
|
||||
{template="reactionOverview" app="core" group="global" params="$comment, TRUE, 'small'"}
|
||||
@@ -869,7 +878,7 @@
|
||||
{{endif}}
|
||||
</div>
|
||||
<div class='ipsDataItem_main'>
|
||||
<h4 class='ipsDataItem_title ipsType_sectionHead ipsType_break'>
|
||||
<h4 class='ipsDataItem_title ipsType_sectionHead ipsContained_container'>
|
||||
{{if $row->mapped('locked')}}
|
||||
<i class="fa fa-lock"></i>
|
||||
{{endif}}
|
||||
@@ -889,7 +898,7 @@
|
||||
{{endif}}
|
||||
|
||||
{{if $row->prefix()}}
|
||||
{template="prefix" group="global" app="core" params="$row->prefix( TRUE ), $row->prefix()"}
|
||||
<span>{template="prefix" group="global" app="core" params="$row->prefix( TRUE ), $row->prefix()"}</span>
|
||||
{{endif}}
|
||||
|
||||
<span class='ipsType_break ipsContained'>
|
||||
@@ -924,11 +933,8 @@
|
||||
{{endif}}
|
||||
{{endif}}
|
||||
{{if count( $row->tags() )}}
|
||||
<ul class='ipsTags ipsList_inline'>
|
||||
{{foreach $row->tags() as $tag}}
|
||||
<li><a href="{url="app=core&module=search&controller=search&tags={$tag}" seoTemplate="tags"}">{$tag}</a></li>
|
||||
{{endforeach}}
|
||||
</ul>
|
||||
|
||||
{template="tags" group="global" app="core" params="$row->tags(), true, true"}
|
||||
{{endif}}
|
||||
</div>
|
||||
<div class='ipsDataItem_generic ipsDataItem_size8'>
|
||||
@@ -993,7 +999,7 @@
|
||||
{{endif}}
|
||||
{{if trim( $indexData['index_content'] ) !== ''}}
|
||||
<div class='ipsType_richText ipsType_break ipsType_medium ipsSpacer_top ipsSpacer_half' {{if !( \IPS\Dispatcher::i()->application->directory == 'core' and \IPS\Dispatcher::i()->module and \IPS\Dispatcher::i()->module->key == 'search' )}}data-ipsTruncate data-ipsTruncate-type='remove' data-ipsTruncate-size='3 lines' data-ipsTruncate-watch='false'{{else}}data-searchable data-findTerm{{endif}}>
|
||||
{$indexData['index_content']|raw}
|
||||
{expression="\IPS\Content\Search\Result::preDisplay( $indexData['index_content'] )" raw="true"}
|
||||
</div>
|
||||
{{endif}}
|
||||
</div>
|
||||
@@ -1029,7 +1035,7 @@
|
||||
|
||||
{{if trim( $indexData['index_content'] ) !== ''}}
|
||||
<div class='ipsSpacer_top ipsSpacer_half ipsType_richText ipsType_break ipsType_medium' {{if !( \IPS\Dispatcher::i()->application->directory == 'core' and \IPS\Dispatcher::i()->module and \IPS\Dispatcher::i()->module->key == 'search' )}}data-ipsTruncate data-ipsTruncate-type='remove' data-ipsTruncate-size='2 lines' data-ipsTruncate-watch='false'{{else}}data-searchable data-findTerm{{endif}}>
|
||||
{$indexData['index_content']|raw}
|
||||
{expression="\IPS\Content\Search\Result::preDisplay( $indexData['index_content'] )" raw="true"}
|
||||
</div>
|
||||
{{endif}}
|
||||
</div>
|
||||
@@ -1154,6 +1160,15 @@
|
||||
<i class='fa fa-clock-o'></i>
|
||||
<input name="event_dates[end_time]" id="end_time" type="time" size='12' class="ipsField_short" placeholder="{lang="_time_format_hhmm"}" step='60' min='00:00' value="{$value['end_time']}">
|
||||
</div>
|
||||
<br><br>
|
||||
<ul class='ipsList_inline' id='end_date_controls'>
|
||||
<li>
|
||||
<span class='ipsCustomInput'>
|
||||
<input type="checkbox" role="checkbox" name="event_dates[no_end_time]" {{if !$value['end_time']}}checked aria-checked='true'{{endif}} value="1" id="check_no_end_time">
|
||||
<span></span>
|
||||
</span> <label for='check_no_end_time'>{lang="no_end_time"}</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1269,14 +1284,14 @@
|
||||
</div>
|
||||
</div>]]></template>
|
||||
<template template_group="submit" template_name="submitForm" template_data="$id, $action, $elements, $hiddenValues, $actionButtons, $uploadField, $class=''" template_location="front" template_app="calendar"><![CDATA[
|
||||
<form accept-charset='utf-8' class="ipsForm {$class}" action="{$action}" method="post" {{if $uploadField}}enctype="multipart/form-data"{{endif}} data-ipsForm>
|
||||
<form accept-charset='utf-8' class="ipsForm {$class}" action="{$action}" method="post" {{if $uploadField}}enctype="multipart/form-data"{{endif}} data-ipsForm data-ipsFormSubmit>
|
||||
<input type="hidden" name="{$id}_submitted" value="1">
|
||||
{{foreach $hiddenValues as $k => $v}}
|
||||
<input type="hidden" name="{$k}" value="{$v}">
|
||||
{{endforeach}}
|
||||
{{if $uploadField}}
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="{$uploadField}">
|
||||
<input type="hidden" name="plupload" value="{expression="md5( uniqid() )"}">
|
||||
<input type="hidden" name="plupload" value="{expression="md5( mt_rand() )"}">
|
||||
{{endif}}
|
||||
|
||||
<div class='ipsBox'>
|
||||
@@ -1439,14 +1454,16 @@
|
||||
</ul>
|
||||
{{endif}}
|
||||
</div>]]></template>
|
||||
<template template_group="view" template_name="comments" template_data="$event" template_location="front" template_app="calendar"><![CDATA[<div class='' data-controller='core.front.core.commentFeed, core.front.core.ignoredComments' {{if settings.auto_polling_enabled}}data-autoPoll{{endif}} data-baseURL='{$event->url()}' {{if $event->isLastPage()}}data-lastPage{{endif}} data-feedID='event-{$event->id}' id='comments'>
|
||||
<template template_group="view" template_name="comments" template_data="$event" template_location="front" template_app="calendar"><![CDATA[
|
||||
<div class='' data-controller='core.front.core.commentFeed, core.front.core.ignoredComments' {{if settings.auto_polling_enabled}}data-autoPoll{{endif}} data-baseURL='{$event->url()}' {{if $event->isLastPage()}}data-lastPage{{endif}} data-feedID='event-{$event->id}' id='comments'>
|
||||
|
||||
{template="featuredComments" group="global" app="core" params="$event->featuredComments(), $event->url()->setQueryString('tab', 'comments')->setQueryString('recommended', 'comments')"}
|
||||
{template="commentMultimodHeader" app="core" group="global" params="$event, '#comments'"}
|
||||
{{if $event->commentPageCount() > 1}}
|
||||
{$event->commentPagination( array( 'tab' ) )|raw}
|
||||
<br><br>
|
||||
{{endif}}
|
||||
|
||||
{template="featuredComments" group="global" app="core" params="$event->featuredComments(), $event->url()->setQueryString('tab', 'comments')->setQueryString('recommended', 'comments')"}
|
||||
|
||||
<div data-role='commentFeed' data-controller='core.front.core.moderation'>
|
||||
{{if ( $comments = $event->comments( NULL, NULL, 'date', 'asc', NULL, NULL, NULL, NULL, FALSE, isset( \IPS\Request::i()->showDeleted ) ) and count( $comments ) )}}
|
||||
<form action="{$event->url()->csrf()->setQueryString( 'do', 'multimodComment' )}" method="post" data-ipsPageAction data-role='moderationTools'>
|
||||
@@ -1470,7 +1487,7 @@
|
||||
<hr class='ipsHr'>
|
||||
{$event->commentPagination( array( 'tab' ) )|raw}
|
||||
{{endif}}
|
||||
{{if $event->commentForm() || $event->locked() || \IPS\Member::loggedIn()->restrict_post || \IPS\Member::loggedIn()->members_bitoptions['unacknowledged_warnings']}}
|
||||
{{if $event->commentForm() || $event->locked() || \IPS\Member::loggedIn()->restrict_post || \IPS\Member::loggedIn()->members_bitoptions['unacknowledged_warnings'] || !\IPS\Member::loggedIn()->checkPostsPerDay()}}
|
||||
<a id='replyForm'></a>
|
||||
<div data-role='replyArea' class='ipsBox ipsBox_transparent ipsAreaBackground ipsPad {{if !$event->canComment()}}cTopicPostArea_noSize{{endif}} ipsSpacer_top'>
|
||||
{{if $event->commentForm()}}
|
||||
@@ -1485,6 +1502,8 @@
|
||||
{template="commentUnavailable" group="forms" location="front" app="core" params="'restricted_cannot_comment', \IPS\Member::loggedIn()->warnings(5,NULL,'rpa'), \IPS\Member::loggedIn()->restrict_post"}
|
||||
{{elseif \IPS\Member::loggedIn()->members_bitoptions['unacknowledged_warnings']}}
|
||||
{template="commentUnavailable" group="forms" location="front" app="core" params="'unacknowledged_warning_cannot_post', \IPS\Member::loggedIn()->warnings( 1, FALSE )"}
|
||||
{{elseif !\IPS\Member::loggedIn()->checkPostsPerDay()}}
|
||||
{template="commentUnavailable" group="forms" location="front" app="core" params="'member_exceeded_posts_per_day'"}
|
||||
{{endif}}
|
||||
{{endif}}
|
||||
</div>
|
||||
@@ -1548,7 +1567,7 @@
|
||||
</div>]]></template>
|
||||
<template template_group="view" template_name="eventBlock" template_data="$event, $date, $truncate=FALSE, $map=array( 300, 200 ), $revertToFirst=FALSE" template_location="front" template_app="calendar"><![CDATA[{{$coverPhoto = $event->coverPhoto();}}
|
||||
<div class='cCalendarBlock ipsAreaBackground_reset ipsBox'>
|
||||
<div class='ipsPageHead_special ipsCoverPhoto' data-controller='core.front.core.coverPhoto' data-coverOffset='{$coverPhoto->offset}'>
|
||||
<div class='ipsPageHead_special ipsCoverPhoto' data-controller='core.global.core.coverPhoto' data-coverOffset='{$coverPhoto->offset}'>
|
||||
{{if $coverPhoto->file}}
|
||||
<div class='ipsCoverPhoto_container'>
|
||||
<img src='{$coverPhoto->file->url}' class='ipsCoverPhoto_photo'>
|
||||
@@ -1643,6 +1662,14 @@
|
||||
{$event->map( 250, 150 )|raw}
|
||||
</div>
|
||||
{{endif}}
|
||||
{{if $event->venue}}
|
||||
<div class='ipsSpacer_bottom'>
|
||||
<h3 class='ipsType_minorHeading'>
|
||||
<strong>{lang="event_venue_name"}</strong>
|
||||
</h3>
|
||||
{lang="calendar_venue_{$event->venue()->id}" escape="true"}
|
||||
</div>
|
||||
{{endif}}
|
||||
{{if $address}}
|
||||
<h3 class='ipsType_minorHeading'>
|
||||
<strong>{lang="event_address"}</strong>
|
||||
@@ -1678,10 +1705,14 @@
|
||||
<ul class='ipsGrid ipsList_reset'>
|
||||
{{foreach $attendees[1] as $attendee}}
|
||||
<li class='ipsGrid_span3'>
|
||||
{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) ) }}
|
||||
<a href='{$attendee->url()}' title="{$attendee->name}" data-ipsTooltip>
|
||||
{{endif}}
|
||||
<img src='{$attendee->photo}' class='ipsUserPhoto ipsUserPhoto_mini' alt=''>
|
||||
<span class='ipsHide'>{$attendee->name}</span>
|
||||
{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) ) }}
|
||||
</a>
|
||||
{{endif}}
|
||||
</li>
|
||||
{{endforeach}}
|
||||
</ul>
|
||||
@@ -1697,10 +1728,14 @@
|
||||
<ul class='ipsGrid ipsList_reset'>
|
||||
{{foreach $attendees[2] as $attendee}}
|
||||
<li class='ipsGrid_span3'>
|
||||
{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) ) }}
|
||||
<a href='{$attendee->url()}' title="{$attendee->name}" data-ipsTooltip>
|
||||
{{endif}}
|
||||
<img src='{$attendee->photo}' class='ipsUserPhoto ipsUserPhoto_mini' alt=''>
|
||||
<span class='ipsHide'>{$attendee->name}</span>
|
||||
{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) ) }}
|
||||
</a>
|
||||
{{endif}}
|
||||
</li>
|
||||
{{endforeach}}
|
||||
</ul>
|
||||
@@ -1714,10 +1749,14 @@
|
||||
<ul class='ipsGrid ipsList_reset'>
|
||||
{{foreach $attendees[0] as $attendee}}
|
||||
<li class='ipsGrid_span3'>
|
||||
{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) ) }}
|
||||
<a href='{$attendee->url()}' title="{$attendee->name}" data-ipsTooltip>
|
||||
{{endif}}
|
||||
<img src='{$attendee->photo}' class='ipsUserPhoto ipsUserPhoto_mini' alt=''>
|
||||
<span class='ipsHide'>{$attendee->name}</span>
|
||||
{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) ) }}
|
||||
</a>
|
||||
{{endif}}
|
||||
</li>
|
||||
{{endforeach}}
|
||||
</ul>
|
||||
@@ -1736,7 +1775,7 @@
|
||||
{{endif}}]]></template>
|
||||
<template template_group="view" template_name="eventStreamBlock" template_data="$event, $date, $truncate=FALSE, $map=array( 300, 200 ), $revertToFirst=FALSE" template_location="front" template_app="calendar"><![CDATA[{{$coverPhoto = $event->coverPhoto();}}
|
||||
<div class='cCalendarBlock ipsAreaBackground_reset ipsBox ipsPad'>
|
||||
<div class='ipsPageHead_special ipsCoverPhoto' data-controller='core.front.core.coverPhoto' data-coverOffset='{$coverPhoto->offset}'>
|
||||
<div class='ipsPageHead_special ipsCoverPhoto' data-controller='core.global.core.coverPhoto' data-coverOffset='{$coverPhoto->offset}'>
|
||||
{{if $coverPhoto->file}}
|
||||
<div class='ipsCoverPhoto_container'>
|
||||
<img src='{$coverPhoto->file->url}' class='ipsCoverPhoto_photo'>
|
||||
@@ -1759,9 +1798,15 @@
|
||||
<br>
|
||||
<div class='eventStreamDate ipsPos_left'>
|
||||
<a href='{$event->url()}'>
|
||||
<time datetime='{$event->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->mysqlDatetime()}' class='ipsCalendarDate'>
|
||||
<span class='ipsCalendarDate_month'>{$event->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->monthNameShort}</span>
|
||||
<span class='ipsCalendarDate_date'>{$event->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->mday}</span>
|
||||
{{if $event->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )}}
|
||||
<time datetime='{$event->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->mysqlDatetime()}' class='ipsCalendarDate'>
|
||||
<span class='ipsCalendarDate_month'>{$event->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->monthNameShort}</span>
|
||||
<span class='ipsCalendarDate_date'>{$event->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' )->mday}</span>
|
||||
{{else}}
|
||||
<time datetime='{$event->lastOccurrence( 'startDate' )->mysqlDatetime()}{{if !$event->all_day}} {$event->lastOccurrence( 'startDate' )->mysqlDatetime( FALSE )} {{endif}}' class='ipsCalendarDate'>
|
||||
<span class='ipsCalendarDate_month'>{$event->lastOccurrence( 'startDate' )->monthNameShort}</span>
|
||||
<span class='ipsCalendarDate_date'>{$event->lastOccurrence( 'startDate' )->mday}</span>
|
||||
{{endif}}
|
||||
</time>
|
||||
</a>
|
||||
</div>
|
||||
@@ -1830,8 +1875,8 @@
|
||||
<input type="hidden" name="{$k}" value="{$v}">
|
||||
{{endforeach}}
|
||||
{{if $uploadField}}
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="{$uploadField}">
|
||||
<input type="hidden" name="plupload" value="{expression="md5( uniqid() )"}">
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="{$uploadField}">
|
||||
<input type="hidden" name="plupload" value="{expression="md5( mt_rand() )"}">
|
||||
{{endif}}
|
||||
<div class="ipsPad">
|
||||
<h2 class='ipsType_sectionHead'>{expression="\IPS\Output::i()->title"}</h2>
|
||||
@@ -1855,7 +1900,8 @@
|
||||
{$actionButtons[0]|raw} {{if isset( $actionButtons[1] )}}{$actionButtons[1]|raw}{{endif}}
|
||||
</div>
|
||||
</form>]]></template>
|
||||
<template template_group="view" template_name="reviews" template_data="$event" template_location="front" template_app="calendar"><![CDATA[<div data-controller='core.front.core.commentFeed' {{if settings.auto_polling_enabled}}data-autoPoll{{endif}} data-commentsType='reviews' data-baseURL='{$event->url()}' {{if $event->isLastPage('reviews')}}data-lastPage{{endif}} data-feedID='event-{$event->id}-reviews' id='reviews'>
|
||||
<template template_group="view" template_name="reviews" template_data="$event" template_location="front" template_app="calendar"><![CDATA[
|
||||
<div data-controller='core.front.core.commentFeed' {{if settings.auto_polling_enabled}}data-autoPoll{{endif}} data-commentsType='reviews' data-baseURL='{$event->url()}' {{if $event->isLastPage('reviews')}}data-lastPage{{endif}} data-feedID='event-{$event->id}-reviews' id='reviews'>
|
||||
{{if $event->reviewForm()}}
|
||||
{{if $event->locked()}}
|
||||
<strong class='ipsType_warning'><i class='fa fa-info-circle'></i> {lang="item_locked_can_review"}</strong>
|
||||
@@ -1881,6 +1927,7 @@
|
||||
{{if count( $event->reviews( NULL, NULL, NULL, 'desc', NULL, NULL, NULL, NULL, isset( \IPS\Request::i()->showDeleted ) ) )}}
|
||||
{{if !$event->hasReviewed()}}<hr class='ipsHr'>{{endif}}
|
||||
<div class="ipsClearfix ipsSpacer_bottom">
|
||||
{template="commentMultimodHeader" app="core" group="global" params="$event, '#reviews', 'review'"}
|
||||
{{if $event->reviewPageCount() > 1}}
|
||||
<div class="ipsPos_left ipsResponsive_noFloat">
|
||||
{$event->reviewPagination( array( 'tab', 'sort' ) )|raw}
|
||||
@@ -2120,14 +2167,14 @@
|
||||
</li>
|
||||
{{endif}}
|
||||
|
||||
{{if $event->canReport() }}
|
||||
{{if $event->canReportOrRevoke() === TRUE}}
|
||||
<li>
|
||||
<a href='{$event->url('report')}' data-ipsDialog data-ipsDialog-size='medium' data-ipsDialog-title="{lang="report_event"}" data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="report_submit_success"}" title="{lang="report_event"}" class='ipsButton ipsButton_link ipsButton_verySmall ipsButton_fullWidth'>{lang="report_event"}</a>
|
||||
</li>
|
||||
{{endif}}
|
||||
<li><a href='{$event->url('download')}' rel="noindex, nofollow" title='{lang="download_ical_title"}' class='ipsButton ipsButton_link ipsButton_verySmall ipsButton_fullWidth'>{lang="download_ical"}</a></li>
|
||||
{{if $event->venue() and $event->venue()->can( 'view' )}}
|
||||
<li><a href="{$event->venue()->url()}" class='ipsButton ipsButton_link ipsButton_verySmall ipsButton_fullWidth'>{lang="calendar_more_events_at_x" sprintf=" $event->venue()->_title"}</a></li>
|
||||
<li><a href="{$event->venue()->url()}" class='ipsButton ipsButton_link ipsButton_verySmall ipsButton_fullWidth'>{lang="calendar_more_events_at_x" sprintf="$event->venue()->_title"}</a></li>
|
||||
{{endif}}
|
||||
{{if $event->author() == \IPS\Member::loggedIn() and \IPS\calendar\Calendar::canOnAny('add')}}
|
||||
<li><a href='{url="app=calendar&module=calendar&controller=submit&do=copy&event_id={$event->id}"}' rel="noindex, nofollow" title='' class='ipsButton ipsButton_link ipsButton_verySmall ipsButton_fullWidth'>{lang="add_similar_event"}</a></li>
|
||||
@@ -2265,70 +2312,87 @@
|
||||
]]></template>
|
||||
<template template_group="widgets" template_name="upcomingEvents" template_data="$events, $today, $orientation='vertical'" template_location="front" template_app="calendar"><![CDATA[<h3 class='ipsType_reset ipsWidget_title'>{lang="block_upcomingEvents"}</h3>
|
||||
<div class='ipsWidget_inner'>
|
||||
{{if $orientation == 'vertical'}}
|
||||
|
||||
{{if $orientation == 'vertical'}}
|
||||
<div class='ipsPad_half'>
|
||||
{{endif}}
|
||||
{{if !empty( $events ) }}
|
||||
{{endif}}
|
||||
|
||||
{{if !empty( $events ) }}
|
||||
<ul class='ipsDataList ipsDataList_reducedSpacing'>
|
||||
{{foreach $events as $event}}
|
||||
|
||||
{{foreach $events as $event}}
|
||||
<li class='ipsDataItem ipsClearfix'>
|
||||
<div class='ipsDataItem_icon cCalendar_date_overlay'>
|
||||
{{if $event->nextOccurrence( $today, 'startDate' )}}
|
||||
<time datetime='{$event->nextOccurrence( $today, 'startDate' )->mysqlDatetime()}' class='ipsCalendarDate'>
|
||||
<span class='ipsCalendarDate_month' data-controller="core.global.core.datetime" data-time="{$event->nextOccurrence( $today, 'startDate' )->format('c')}" data-format="%b">{$event->nextOccurrence( $today, 'startDate' )->monthNameShort}</span>
|
||||
<span class='ipsCalendarDate_date' data-controller="core.global.core.datetime" data-time="{$event->nextOccurrence( $today, 'startDate' )->format('c')}" data-format="%d">{$event->nextOccurrence( $today, 'startDate' )->mday}</span>
|
||||
</time>
|
||||
<time datetime='{$event->nextOccurrence( $today, 'startDate' )->mysqlDatetime()}' class='ipsCalendarDate'>
|
||||
<span class='ipsCalendarDate_month' data-controller="core.global.core.datetime" data-time="{$event->nextOccurrence( $today, 'startDate' )->format('c')}" data-format="%b">{$event->nextOccurrence( $today, 'startDate' )->monthNameShort}</span>
|
||||
<span class='ipsCalendarDate_date' data-controller="core.global.core.datetime" data-time="{$event->nextOccurrence( $today, 'startDate' )->format('c')}" data-format="%d">{$event->nextOccurrence( $today, 'startDate' )->mday}</span>
|
||||
</time>
|
||||
{{else}}
|
||||
<time datetime='{$event->lastOccurrence( 'startDate' )->mysqlDatetime()}' class='ipsCalendarDate'>
|
||||
<span class='ipsCalendarDate_month' data-controller="core.global.core.datetime" data-time="{$event->lastOccurrence( $today, 'startDate' )->format('c')}" data-format="%b">{$event->lastOccurrence( 'startDate' )->monthNameShort}</span>
|
||||
<span class='ipsCalendarDate_date' data-controller="core.global.core.datetime" data-time="{$event->lastOccurrence( $today, 'startDate' )->format('c')}" data-format="%d">{$event->lastOccurrence( 'startDate' )->mday}</span>
|
||||
</time>
|
||||
<time datetime='{$event->lastOccurrence( 'startDate' )->mysqlDatetime()}' class='ipsCalendarDate'>
|
||||
<span class='ipsCalendarDate_month' data-controller="core.global.core.datetime" data-time="{$event->lastOccurrence( 'startDate' )->format('c')}" data-format="%b">{$event->lastOccurrence( 'startDate' )->monthNameShort}</span>
|
||||
<span class='ipsCalendarDate_date' data-controller="core.global.core.datetime" data-time="{$event->lastOccurrence( 'startDate' )->format('c')}" data-format="%d">{$event->lastOccurrence( 'startDate' )->mday}</span>
|
||||
</time>
|
||||
{{endif}}
|
||||
</div>
|
||||
<div class='ipsDataItem_main cWidgetComments'>
|
||||
{{if $event->container()->allow_comments && $orientation == 'vertical'}}
|
||||
<div class="ipsCommentCount ipsPos_right {{if $event->comments === 0}}ipsFaded{{endif}}" data-ipsTooltip title='{lang="num_replies" pluralize="$event->comments"}'>{expression="$event->comments"}</div>
|
||||
<div class="ipsCommentCount ipsPos_right {{if $event->comments === 0}}ipsFaded{{endif}}" data-ipsTooltip title='{lang="num_replies" pluralize="$event->comments"}'>{expression="$event->comments"}</div>
|
||||
{{endif}}
|
||||
<div class='ipsType_break ipsContained'>
|
||||
<a href="{$event->url()}" title='{lang="view_this_event" sprintf="$event->title"}'>{$event->title}</a>
|
||||
</div>
|
||||
<strong class='ipsType_small'>
|
||||
{{$sameDay = (bool) ( $event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' ) and $event->nextOccurrence( $today, 'startDate' )->calendarDate() == $event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' )->calendarDate() );}}
|
||||
{{if $event->nextOccurrence( $today, 'startDate' )}}
|
||||
<span data-controller="core.global.core.datetime" data-time="{$event->nextOccurrence( $today, 'startDate' )->format('c')}" data-format="{expression="\IPS\calendar\Date::calendarDateFormat()"}{{if !$event->all_day}} {expression="\IPS\calendar\Date::localeTimeFormat( FALSE )"} {{endif}}">{$event->nextOccurrence( $today, 'startDate' )->calendarDate()}{{if !$event->all_day}} {$event->nextOccurrence( $today, 'startDate' )->localeTime( FALSE )} {{endif}}</span>
|
||||
{{if $event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' ) }}
|
||||
{{if $orientation == 'vertical'}}<br>{{endif}}
|
||||
<span class='ipsType_light ipsType_unbold'>{lang="until"}</span>{{if $orientation == 'vertical' and !$sameDay}}<br>{{endif}}
|
||||
{{if !$sameDay}}<span data-controller="core.global.core.datetime" data-time="{$event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' )->format('c')}" data-format="{expression="\IPS\calendar\Date::calendarDateFormat()"}{{if !$event->all_day}} {expression="\IPS\calendar\Date::localeTimeFormat( FALSE )"}{{endif}}">{$event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' )->calendarDate()}{{endif}}{{if !$event->all_day}} {$event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' )->localeTime( FALSE )}{{endif}}</span>
|
||||
{{endif}}
|
||||
<span data-controller="core.global.core.datetime" data-time="{$event->nextOccurrence( $today, 'startDate' )->format('c')}" data-format="{expression="\IPS\calendar\Date::calendarDateFormat()"}{{if !$event->all_day}} {expression="\IPS\calendar\Date::localeTimeFormat( FALSE )"} {{endif}}">{$event->nextOccurrence( $today, 'startDate' )->calendarDate()}{{if !$event->all_day}} {$event->nextOccurrence( $today, 'startDate' )->localeTime( FALSE )} {{endif}}</span>
|
||||
{{if $event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' ) }}
|
||||
{{$sameDay = (bool) ( $event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' ) and ( $event->nextOccurrence( $today, 'startDate' ) and $event->nextOccurrence( $today, 'startDate' )->calendarDate() == $event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' )->calendarDate() ) );}}
|
||||
{{if $orientation == 'vertical'}}<br>{{endif}}
|
||||
<span class='ipsType_light ipsType_unbold'>{lang="until"}</span>{{if $orientation == 'vertical' and !$sameDay}}<br>{{endif}}
|
||||
{{if !$sameDay}}
|
||||
<span data-controller="core.global.core.datetime" data-time="{$event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' )->format('c')}" data-format="{expression="\IPS\calendar\Date::calendarDateFormat()"}{{if !$event->all_day}} {expression="\IPS\calendar\Date::localeTimeFormat( FALSE )"}{{endif}}">
|
||||
{$event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' )->calendarDate()}
|
||||
{{if !$event->all_day}} {$event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' )->localeTime( FALSE )}{{endif}}
|
||||
</span>
|
||||
{{else}}
|
||||
{{if !$event->all_day}}
|
||||
<span data-controller="core.global.core.datetime" data-time="{$event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' )->format('c')}" data-format="{expression="\IPS\calendar\Date::localeTimeFormat( FALSE )"}">
|
||||
{$event->nextOccurrence( $event->nextOccurrence( $today, 'startDate' ) ?: $today, 'endDate' )->localeTime( FALSE )}
|
||||
</span>
|
||||
{{endif}}
|
||||
{{endif}}
|
||||
{{endif}}
|
||||
{{else}}
|
||||
<span data-controller="core.global.core.datetime" data-time="{$event->lastOccurrence( 'startDate' )->format('c')}" data-format="{expression="\IPS\calendar\Date::calendarDateFormat()"}{{if !$event->all_day}} {expression="\IPS\calendar\Date::localeTimeFormat( FALSE )"} {{endif}}">{$event->lastOccurrence( 'startDate' )->calendarDate()}{{if !$event->all_day}} {$event->lastOccurrence( 'startDate' )->localeTime( FALSE )} </span>{{endif}}
|
||||
{{if $event->lastOccurrence( 'endDate' ) }}
|
||||
{{if $orientation == 'vertical'}}<br>{{endif}}
|
||||
<span class='ipsType_light ipsType_unbold'>{lang="until"}</span>{{if $orientation == 'vertical'}}<br>{{endif}}
|
||||
<span data-controller="core.global.core.datetime" data-time="{$event->lastOccurrence( 'endDate' )->format('c')}" data-format="{expression="\IPS\calendar\Date::calendarDateFormat()"}{{if !$event->all_day}} {expression="\IPS\calendar\Date::localeTimeFormat( FALSE )"}{{endif}}">{$event->lastOccurrence( 'endDate' )->calendarDate()}{{if !$event->all_day}} {$event->lastOccurrence( 'endDate' )->localeTime( FALSE )}{{endif}}</span>
|
||||
{{endif}}
|
||||
<span data-controller="core.global.core.datetime" data-time="{$event->lastOccurrence( 'startDate' )->format('c')}" data-format="{expression="\IPS\calendar\Date::calendarDateFormat()"}{{if !$event->all_day}} {expression="\IPS\calendar\Date::localeTimeFormat( FALSE )"} {{endif}}">{$event->lastOccurrence( 'startDate' )->calendarDate()}{{if !$event->all_day}} {$event->lastOccurrence( 'startDate' )->localeTime( FALSE )} </span>{{endif}}
|
||||
{{if $event->lastOccurrence( 'endDate' ) }}
|
||||
{{if $orientation == 'vertical'}}<br>{{endif}}
|
||||
<span class='ipsType_light ipsType_unbold'>{lang="until"}</span>{{if $orientation == 'vertical'}}<br>{{endif}}
|
||||
<span data-controller="core.global.core.datetime" data-time="{$event->lastOccurrence( 'endDate' )->format('c')}" data-format="{expression="\IPS\calendar\Date::calendarDateFormat()"}{{if !$event->all_day}} {expression="\IPS\calendar\Date::localeTimeFormat( FALSE )"}{{endif}}">{$event->lastOccurrence( 'endDate' )->calendarDate()}{{if !$event->all_day}} {$event->lastOccurrence( 'endDate' )->localeTime( FALSE )}{{endif}}</span>
|
||||
{{endif}}
|
||||
{{endif}}
|
||||
</strong>
|
||||
<br>
|
||||
{{if $event->container()->allow_comments && $orientation == 'horizontal'}}
|
||||
<span class="{{if $event->comments === 0}}ipsFaded{{endif}}" data-ipsTooltip title='{lang="num_replies" pluralize="$event->comments"}'><i class='fa fa-comment'></i> {expression="$event->comments"}</span>
|
||||
<span class="{{if $event->comments === 0}}ipsFaded{{endif}}" data-ipsTooltip title='{lang="num_replies" pluralize="$event->comments"}'><i class='fa fa-comment'></i> {expression="$event->comments"}</span>
|
||||
{{endif}}
|
||||
{{if $orientation == 'horizontal'}}
|
||||
<div class='ipsType_medium ipsType_richText' data-ipsTruncate data-ipsTruncate-type='remove' data-ipsTruncate-size='2 lines' data-ipsTruncate-watch='false'>
|
||||
{$event->truncated()|raw}
|
||||
</div>
|
||||
<div class='ipsType_medium ipsType_richText' data-ipsTruncate data-ipsTruncate-type='remove' data-ipsTruncate-size='2 lines' data-ipsTruncate-watch='false'>
|
||||
{$event->truncated()|raw}
|
||||
</div>
|
||||
{{endif}}
|
||||
</div>
|
||||
</li>
|
||||
{{endforeach}}
|
||||
{{endforeach}}
|
||||
|
||||
</ul>
|
||||
{{else}}
|
||||
{{else}}
|
||||
<div class='ipsType_light ipsPad_half ipsType_center'>{lang="no_upcoming_events"}</div>
|
||||
{{endif}}
|
||||
{{if $orientation == 'vertical'}}
|
||||
</div>
|
||||
{{endif}}
|
||||
|
||||
{{if $orientation == 'vertical'}}
|
||||
</div>
|
||||
{{endif}}
|
||||
|
||||
</div>]]></template>
|
||||
<css css_location="front" css_app="calendar" css_attributes="" css_path="." css_name="calendar_responsive.css"><![CDATA[/* BOTH */
|
||||
@media screen and (max-width: 979px) {
|
||||
@@ -2774,6 +2838,11 @@ tr td:not( :first-child ):not( .cCalendar_firstDay ) .cEvents_ranged .cEvents_ev
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
#elEventHeader > .ipsCoverPhotoMinimal {
|
||||
padding-top: 25px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.cEvent_to {
|
||||
font-size: 28px;
|
||||
margin: 6px 15px;
|
||||
|
||||
@@ -170,5 +170,56 @@
|
||||
"101117": "4.2.0 Beta 8",
|
||||
"102000": "4.2.0",
|
||||
"102001": "4.2.0",
|
||||
"102002": "4.2.0"
|
||||
"102002": "4.2.0",
|
||||
"102003": "4.2.0",
|
||||
"102004": "4.2.1",
|
||||
"102005": "4.2.2 Beta 1",
|
||||
"102006": "4.2.2 Beta 2",
|
||||
"102007": "4.2.2",
|
||||
"102008": "4.2.2",
|
||||
"102009": "4.2.2",
|
||||
"102010": "4.2.3 Beta 1",
|
||||
"102011": "4.2.3",
|
||||
"102012": "4.2.3",
|
||||
"102013": "4.2.3",
|
||||
"102014": "4.2.4 Beta 1",
|
||||
"102015": "4.2.4 Beta 2",
|
||||
"102016": "4.2.4",
|
||||
"102017": "4.2.4",
|
||||
"102018": "4.2.4",
|
||||
"102019": "4.2.4",
|
||||
"102020": "4.2.4",
|
||||
"102021": "4.2.5 Beta 1",
|
||||
"102022": "4.2.5 Beta 2",
|
||||
"102023": "4.2.5 Beta 3",
|
||||
"102024": "4.2.5",
|
||||
"102025": "4.2.5",
|
||||
"102026": "4.2.5",
|
||||
"102027": "4.2.5",
|
||||
"102028": "4.2.5",
|
||||
"102029": "4.2.5",
|
||||
"102030": "4.2.6 Beta 1",
|
||||
"102031": "4.2.6 Beta 1",
|
||||
"102032": "4.2.6 Beta 2",
|
||||
"102033": "4.2.6 Beta 3",
|
||||
"102034": "4.2.6",
|
||||
"102035": "4.2.6",
|
||||
"102036": "4.2.6",
|
||||
"102037": "4.2.7 Beta 1",
|
||||
"102038": "4.2.7 Beta 2",
|
||||
"102039": "4.2.7 Beta 3",
|
||||
"102040": "4.2.7 Beta 4",
|
||||
"102041": "4.2.7 Beta 5",
|
||||
"102042": "4.2.7",
|
||||
"102043": "4.2.7",
|
||||
"102044": "4.2.7",
|
||||
"102045": "4.2.7",
|
||||
"102046": "4.2.7",
|
||||
"102047": "4.2.8",
|
||||
"102048": "4.2.8",
|
||||
"103000": "4.3.0 Beta 1",
|
||||
"103002": "4.3.0 Beta 2",
|
||||
"103003": "4.3.0 Beta 3",
|
||||
"103004": "4.3.0 Beta 4",
|
||||
"103005": "4.3.0"
|
||||
}
|
||||
@@ -1 +1,29 @@
|
||||
{"todaysBirthdays":{"class":"\\IPS\\Widget\\StaticCache","restrict":[],"default_area":"","allow_reuse":false,"menu_style":"menu","embeddable":true},"upcomingEvents":{"class":"\\IPS\\Widget\\PermissionCache","restrict":[],"default_area":"","allow_reuse":false,"menu_style":"menu","embeddable":true},"recentReviews":{"class":"\\IPS\\Widget\\PermissionCache","restrict":[],"default_area":"","allow_reuse":false,"menu_style":"menu","embeddable":true}}
|
||||
{
|
||||
"todaysBirthdays": {
|
||||
"class": "\\IPS\\Widget\\StaticCache",
|
||||
"restrict": [],
|
||||
"default_area": "",
|
||||
"allow_reuse": false,
|
||||
"menu_style": "menu",
|
||||
"embeddable": true
|
||||
},
|
||||
"upcomingEvents": {
|
||||
"class": "\\IPS\\Widget\\PermissionCache",
|
||||
"restrict": [
|
||||
"sidebar",
|
||||
"cms"
|
||||
],
|
||||
"default_area": "",
|
||||
"allow_reuse": true,
|
||||
"menu_style": "menu",
|
||||
"embeddable": true
|
||||
},
|
||||
"recentReviews": {
|
||||
"class": "\\IPS\\Widget\\PermissionCache",
|
||||
"restrict": [],
|
||||
"default_area": "",
|
||||
"allow_reuse": false,
|
||||
"menu_style": "menu",
|
||||
"embeddable": true
|
||||
}
|
||||
}
|
||||
@@ -30,14 +30,26 @@ class _Event
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
if ( \IPS\calendar\Calendar::canOnAny( 'add' ) )
|
||||
if ( \IPS\calendar\Calendar::canOnAny( 'add', NULL, \IPS\Settings::i()->club_nodes_in_apps ? array() : array( array( 'cal_club_id IS NULL' ) ) ) )
|
||||
{
|
||||
return array( 'event' => array(
|
||||
'link' => \IPS\Http\Url::internal( "app=calendar&module=calendar&controller=submit&_new=1", 'front', 'calendar_submit' ),
|
||||
'extraData' => array( 'data-ipsDialog' => true, 'data-ipsDialog-size' => "narrow", ),
|
||||
'title' => 'select_calendar'
|
||||
)
|
||||
);
|
||||
if ( !\IPS\Settings::i()->club_nodes_in_apps and $theOnlyNode = \IPS\calendar\Calendar::theOnlyNode() )
|
||||
{
|
||||
return array(
|
||||
'event' => array(
|
||||
'link' => \IPS\Http\Url::internal( "app=calendar&module=calendar&controller=submit&do=submit&id=" . $theOnlyNode->_id, 'front', 'calendar_submit' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return array(
|
||||
'event' => array(
|
||||
'link' => \IPS\Http\Url::internal( "app=calendar&module=calendar&controller=submit&_new=1", 'front', 'calendar_submit' ),
|
||||
'extraData' => array( 'data-ipsDialog' => true, 'data-ipsDialog-size' => "narrow", ),
|
||||
'title' => 'select_calendar'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return array();
|
||||
|
||||
@@ -49,7 +49,8 @@ class _StreamItems
|
||||
{
|
||||
$member = \IPS\Member::load( $rsvp['rsvp_member_id'] );
|
||||
$event = \IPS\calendar\Event::load( $rsvp[ 'rsvp_event_id' ] );
|
||||
$rsvps[] = new \IPS\Content\Search\Result\Custom( \IPS\DateTime::ts( $rsvp[ 'rsvp_date' ] ), \IPS\Member::loggedIn()->language()->addToStack( 'calendar_activity_stream_rsvp', FALSE, array( 'htmlsprintf' => array( \IPS\Theme::i()->getTemplate( 'global', 'core', 'front' )->userLink( $member ), $event->url(), $event->title ) ) ) );
|
||||
$title = htmlspecialchars( $event->title, ENT_DISALLOWED, 'UTF-8', FALSE );
|
||||
$rsvps[] = new \IPS\Content\Search\Result\Custom( \IPS\DateTime::ts( $rsvp[ 'rsvp_date' ] ), \IPS\Member::loggedIn()->language()->addToStack( 'calendar_activity_stream_rsvp', FALSE, array( 'htmlsprintf' => array( \IPS\Theme::i()->getTemplate( 'global', 'core', 'front' )->userLink( $member ), $event->url(), $title ) ) ) );
|
||||
}
|
||||
|
||||
/* Return */
|
||||
|
||||
@@ -38,4 +38,15 @@ class _venues extends \IPS\Node\Controller
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'venues_manage' );
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow overloading to change how the title is displayed in the tree
|
||||
*
|
||||
* @param $node \IPS\Node Node
|
||||
* @return string
|
||||
*/
|
||||
protected static function nodeTitle( $node )
|
||||
{
|
||||
return $node->_title;
|
||||
}
|
||||
}
|
||||
@@ -130,13 +130,12 @@ class _event extends \IPS\Content\Controller
|
||||
$address = $location->toString();
|
||||
}
|
||||
|
||||
|
||||
/* Add JSON-LD */
|
||||
\IPS\Output::i()->jsonLd['event'] = array(
|
||||
'@context' => "http://schema.org",
|
||||
'@type' => "Event",
|
||||
'url' => (string) $this->event->url(),
|
||||
'name' => htmlspecialchars( $this->event->mapped('title'), ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
|
||||
'name' => $this->event->mapped('title'),
|
||||
'description' => strip_tags( $this->event->truncated() ),
|
||||
'eventStatus' => "EventScheduled",
|
||||
'startDate' => $this->event->nextOccurrence( \IPS\calendar\Date::getDate(), 'startDate' ) ?
|
||||
@@ -151,7 +150,7 @@ class _event extends \IPS\Content\Controller
|
||||
$this->event->lastOccurrence( 'endDate' )->format( \IPS\DateTime::ISO8601 );
|
||||
}
|
||||
|
||||
if( $this->event->container()->allow_reviews )
|
||||
if( $this->event->container()->allow_reviews AND $this->event->reviews )
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['event']['aggregateRating'] = array(
|
||||
'@type' => 'AggregateRating',
|
||||
@@ -159,23 +158,6 @@ class _event extends \IPS\Content\Controller
|
||||
'ratingValue' => $this->event->averageReviewRating(),
|
||||
'bestRating' => \IPS\Settings::i()->reviews_rating_out_of,
|
||||
);
|
||||
|
||||
\IPS\Output::i()->jsonLd['event']['interactionStatistic'][] = array(
|
||||
'@type' => 'InteractionCounter',
|
||||
'interactionType' => "http://schema.org/ReviewAction",
|
||||
'userInteractionCount' => $this->event->reviews
|
||||
);
|
||||
}
|
||||
|
||||
if( $this->event->container()->allow_comments )
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['event']['interactionStatistic'][] = array(
|
||||
'@type' => 'InteractionCounter',
|
||||
'interactionType' => "http://schema.org/CommentAction",
|
||||
'userInteractionCount' => $this->event->mapped('num_comments')
|
||||
);
|
||||
|
||||
\IPS\Output::i()->jsonLd['event']['commentCount'] = $this->event->mapped('num_comments');
|
||||
}
|
||||
|
||||
if( $this->event->coverPhoto()->file )
|
||||
@@ -185,12 +167,6 @@ class _event extends \IPS\Content\Controller
|
||||
|
||||
if( $this->event->rsvp )
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['event']['potentialAction'] = array(
|
||||
'@type' => 'RsvpAction',
|
||||
'target' => (string) $this->event->url( 'rsvp' )->setQueryString( 'action', '{rsvpResponse}' ),
|
||||
'rsvpResponse-input' => "required name=rsvpResponse"
|
||||
);
|
||||
|
||||
if( count( $attendees[1] ) )
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['event']['attendee'] = array();
|
||||
@@ -199,7 +175,7 @@ class _event extends \IPS\Content\Controller
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['event']['attendee'][] = array(
|
||||
'@type' => 'Person',
|
||||
'name' => htmlspecialchars( $attendee->name, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE )
|
||||
'name' => $attendee->name
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -391,6 +367,12 @@ class _event extends \IPS\Content\Controller
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Members only */
|
||||
if( !\IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '3L369/1', 403, '' );
|
||||
}
|
||||
|
||||
/* Existing reminder? */
|
||||
$existing = NULL;
|
||||
try
|
||||
@@ -403,7 +385,7 @@ class _event extends \IPS\Content\Controller
|
||||
|
||||
/* How far in the future is this event so we can set realistic max reminders */
|
||||
$diff = $this->event->_start_date->diff( \IPS\DateTime::create() );
|
||||
$max = $diff->d;
|
||||
$max = $diff->days;
|
||||
|
||||
$form = new \IPS\Helpers\Form;
|
||||
$form->class = 'ipsForm_vertical';
|
||||
|
||||
@@ -30,45 +30,46 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
$form = new \IPS\Helpers\Form( 'select_calendar', 'continue' );
|
||||
$form->class = 'ipsForm_vertical ipsForm_noLabels';
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'calendar', NULL, TRUE, array(
|
||||
'url' => \IPS\Http\Url::internal( 'app=calendar&module=calendar&controller=submit', 'front', 'calendar_submit' ),
|
||||
'class' => 'IPS\calendar\Calendar',
|
||||
'permissionCheck' => 'add',
|
||||
'forceOwner' => \IPS\Member::loggedIn(),
|
||||
) ) );
|
||||
$form = new \IPS\Helpers\Form( 'select_calendar', 'continue' );
|
||||
$form->class = 'ipsForm_vertical ipsForm_noLabels';
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'calendar', NULL, TRUE, array(
|
||||
'url' => \IPS\Http\Url::internal( 'app=calendar&module=calendar&controller=submit', 'front', 'calendar_submit' ),
|
||||
'class' => 'IPS\calendar\Calendar',
|
||||
'permissionCheck' => 'add',
|
||||
'forceOwner' => \IPS\Member::loggedIn(),
|
||||
'clubs' => \IPS\Settings::i()->club_nodes_in_apps
|
||||
) ) );
|
||||
|
||||
/* Are we creating an event for a specific day? If yes, pass the values to the form */
|
||||
if( \IPS\Request::i()->y AND \IPS\Request::i()->m AND \IPS\Request::i()->d )
|
||||
/* Are we creating an event for a specific day? If yes, pass the values to the form */
|
||||
if( \IPS\Request::i()->y AND \IPS\Request::i()->m AND \IPS\Request::i()->d )
|
||||
{
|
||||
$form->hiddenValues['y'] = \IPS\Request::i()->y;
|
||||
$form->hiddenValues['m'] = \IPS\Request::i()->m;
|
||||
$form->hiddenValues['d'] = \IPS\Request::i()->d;
|
||||
}
|
||||
|
||||
/* Are we coming from a venue? */
|
||||
if( \IPS\Settings::i()->calendar_venues_enabled and \IPS\Request::i()->venue )
|
||||
{
|
||||
$form->hiddenValues['venue'] = \IPS\Request::i()->venue;
|
||||
}
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
$url = \IPS\Http\Url::internal( 'app=calendar&module=calendar&controller=submit&do=submit', 'front', 'calendar_submit' )->setQueryString( 'id', $values['calendar']->_id );
|
||||
|
||||
if( isset( $values['y'], $values['m'], $values['d'] ) )
|
||||
{
|
||||
$form->hiddenValues['y'] = \IPS\Request::i()->y;
|
||||
$form->hiddenValues['m'] = \IPS\Request::i()->m;
|
||||
$form->hiddenValues['d'] = \IPS\Request::i()->d;
|
||||
$url = $url->setQueryString( 'd', $values['d'] )->setQueryString( 'm', $values['m'] )->setQueryString( 'y', $values['y'] );
|
||||
}
|
||||
|
||||
/* Are we coming from a venue? */
|
||||
if( \IPS\Settings::i()->calendar_venues_enabled and \IPS\Request::i()->venue )
|
||||
if( \IPS\Settings::i()->calendar_venues_enabled and isset( $values['venue'] ) )
|
||||
{
|
||||
$form->hiddenValues['venue'] = \IPS\Request::i()->venue;
|
||||
$url = $url->setQueryString( 'venue', $values['venue'] );
|
||||
}
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
$url = \IPS\Http\Url::internal( 'app=calendar&module=calendar&controller=submit&do=submit', 'front', 'calendar_submit' )->setQueryString( 'id', $values['calendar']->_id );
|
||||
|
||||
if( isset( $values['y'], $values['m'], $values['d'] ) )
|
||||
{
|
||||
$url = $url->setQueryString( 'd', $values['d'] )->setQueryString( 'm', $values['m'] )->setQueryString( 'y', $values['y'] );
|
||||
}
|
||||
|
||||
if( \IPS\Settings::i()->calendar_venues_enabled and isset( $values['venue'] ) )
|
||||
{
|
||||
$url = $url->setQueryString( 'venue', $values['venue'] );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->redirect( $url );
|
||||
}
|
||||
\IPS\Output::i()->redirect( $url );
|
||||
}
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'submit_event' );
|
||||
@@ -138,19 +139,15 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
\IPS\Output::i()->redirect( IPS\Http\Url::internal( 'app=calendar&module=calendar&controller=submit', 'front', 'calendar_submit' ) );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=calendar&module=calendar&controller=submit', 'front', 'calendar_submit' ) );
|
||||
}
|
||||
|
||||
/* Are we the author of the existing event? */
|
||||
if( $existing->author() !== \IPS\Member::loggedIn() )
|
||||
{
|
||||
\IPS\Output::i()->redirect( IPS\Http\Url::internal( 'app=calendar&module=calendar&controller=submit', 'front', 'calendar_submit' ) );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=calendar&module=calendar&controller=submit', 'front', 'calendar_submit' ) );
|
||||
}
|
||||
|
||||
/* Reset elements we don't want to copy */
|
||||
$existing->start_date = NULL;
|
||||
$existing->end_date = NULL;
|
||||
|
||||
$form = new \IPS\Helpers\Form( 'form', \IPS\Member::loggedIn()->language()->checkKeyExists( \IPS\Calendar\Event::$formLangPrefix . '_save' ) ? \IPS\Calendar\Event::$formLangPrefix . '_save' : 'save' );
|
||||
$form->class = 'ipsForm_vertical';
|
||||
$formElements = \IPS\Calendar\Event::formElements( $existing, $existing->container() );
|
||||
@@ -168,6 +165,12 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
/* Set the container */
|
||||
if ( !isset( $values[ 'event_container' ] ) )
|
||||
{
|
||||
$values[ 'event_container' ] = $existing->container();
|
||||
}
|
||||
|
||||
/* Disable read/write separation */
|
||||
\IPS\Db::i()->readWriteSeparation = FALSE;
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ class _venue extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
catch( \InvalidArgumentException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'error_bad_date', '', 403, '' ); //@todo
|
||||
\IPS\Output::i()->error( 'error_bad_date', '2L354/2', 403, '' );
|
||||
}
|
||||
|
||||
$upcoming = \IPS\calendar\Event::retrieveEvents(
|
||||
@@ -107,7 +107,7 @@ class _venue extends \IPS\Dispatcher\Controller
|
||||
'@context' => "http://schema.org",
|
||||
'@type' => "EventVenue",
|
||||
'url' => (string) $this->venue->url(),
|
||||
'name' => htmlspecialchars( $this->venue->_title, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE )
|
||||
'name' => $this->venue->_title
|
||||
);
|
||||
|
||||
\IPS\Output::i()->title = $this->venue->_title;
|
||||
|
||||
@@ -52,7 +52,7 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Is there only one calendar? */
|
||||
$roots = \IPS\calendar\Calendar::roots();
|
||||
$roots = \IPS\Settings::i()->club_nodes_in_apps ? \IPS\calendar\Calendar::rootsWithClubs() : \IPS\calendar\Calendar::roots();
|
||||
if ( count( $roots ) == 1 AND !isset( \IPS\Request::i()->id ) )
|
||||
{
|
||||
$roots = array_shift( $roots );
|
||||
@@ -96,6 +96,11 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
/* Get the date jumper - do this first in case we need to redirect */
|
||||
$jump = $this->_jump();
|
||||
|
||||
if( !\IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_browse.js', 'calendar', 'front' ) );
|
||||
}
|
||||
|
||||
/* If there is a view requested in the URL, use it */
|
||||
if( isset( \IPS\Request::i()->view ) )
|
||||
{
|
||||
@@ -118,7 +123,7 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Online User Location */
|
||||
if ($this->_calendar)
|
||||
if ( $this->_calendar )
|
||||
{
|
||||
\IPS\Session::i()->setLocation( $this->_calendar->url(), array(), 'loc_calendar_viewing_calendar', array( "calendar_calendar_{$this->_calendar->id}" => TRUE ) );
|
||||
}
|
||||
@@ -138,7 +143,7 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
protected function _viewMonth( $jump, $featured=array() )
|
||||
{
|
||||
/* Get the calendars we can view */
|
||||
$calendars = \IPS\calendar\Calendar::roots();
|
||||
$calendars = \IPS\Settings::i()->club_nodes_in_apps ? \IPS\calendar\Calendar::rootsWithClubs() : \IPS\calendar\Calendar::roots();
|
||||
|
||||
/* Get the month data */
|
||||
$day = NULL;
|
||||
@@ -164,7 +169,7 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'error_bad_date', '3L182/3', 403, '' );
|
||||
\IPS\Output::i()->error( 'error_bad_date', '2L182/7', 403, '' );
|
||||
}
|
||||
|
||||
/* If there are no events, tell search engines not to index the page but do NOT tell them not to follow links */
|
||||
@@ -182,7 +187,6 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_browse.js', 'calendar', 'front' ) );
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('cal_month_title', FALSE, array( 'sprintf' => array( $date->monthName, $date->year ) ) );
|
||||
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'browse' )->calendarWrapper(
|
||||
@@ -207,7 +211,7 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
protected function _viewWeek( $jump, $featured=array() )
|
||||
{
|
||||
/* Get the calendars we can view */
|
||||
$calendars = \IPS\calendar\Calendar::roots();
|
||||
$calendars = \IPS\Settings::i()->club_nodes_in_apps ? \IPS\calendar\Calendar::rootsWithClubs() : \IPS\calendar\Calendar::roots();
|
||||
|
||||
/* Get the month data */
|
||||
$week = \IPS\Request::i()->w ? explode( '-', \IPS\Request::i()->w ) : NULL;
|
||||
@@ -217,32 +221,39 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'error_bad_date', '3L182/4', 403, '' );
|
||||
\IPS\Output::i()->error( 'error_bad_date', '2L182/8', 403, '' );
|
||||
}
|
||||
|
||||
$nextWeek = $date->adjust( '+1 week' );
|
||||
$lastWeek = $date->adjust( '-1 week' );
|
||||
|
||||
/* Get the days of the week - we do this in PHP to help keep template a little cleaner */
|
||||
$days = array();
|
||||
|
||||
for( $i = 0; $i < 7; $i++ )
|
||||
try
|
||||
{
|
||||
$days[] = \IPS\calendar\Date::getDate( $date->firstDayOfWeek('year'), $date->firstDayOfWeek('mon'), $date->firstDayOfWeek('mday') )->adjust( $i . ' days' );
|
||||
$days = array();
|
||||
|
||||
for( $i = 0; $i < 7; $i++ )
|
||||
{
|
||||
$days[] = \IPS\calendar\Date::getDate( $date->firstDayOfWeek('year'), $date->firstDayOfWeek('mon'), $date->firstDayOfWeek('mday') )->adjust( $i . ' days' );
|
||||
}
|
||||
|
||||
/* Get birthdays */
|
||||
$birthdays = ( $this->_calendar === NULL OR count( $calendars ) == 1 ) ? $date->getBirthdays( FALSE, TRUE ) : array();
|
||||
|
||||
/* Get the events within this range */
|
||||
$events = \IPS\calendar\Event::retrieveEvents(
|
||||
\IPS\calendar\Date::getDate( $date->firstDayOfWeek('year'), $date->firstDayOfWeek('mon'), $date->firstDayOfWeek('mday') ),
|
||||
\IPS\calendar\Date::getDate( $date->lastDayOfWeek('year'), $date->lastDayOfWeek('mon'), $date->lastDayOfWeek('mday'), 23, 59, 59 ),
|
||||
$this->_calendar
|
||||
);
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'error_bad_date', '2L182/C', 403, '' );
|
||||
}
|
||||
|
||||
/* Get birthdays */
|
||||
$birthdays = ( $this->_calendar === NULL OR count( $calendars ) == 1 ) ? $date->getBirthdays( FALSE, TRUE ) : array();
|
||||
|
||||
/* Get the events within this range */
|
||||
$events = \IPS\calendar\Event::retrieveEvents(
|
||||
\IPS\calendar\Date::getDate( $date->firstDayOfWeek('year'), $date->firstDayOfWeek('mon'), $date->firstDayOfWeek('mday') ),
|
||||
\IPS\calendar\Date::getDate( $date->lastDayOfWeek('year'), $date->lastDayOfWeek('mon'), $date->lastDayOfWeek('mday'), 23, 59, 59 ),
|
||||
$this->_calendar
|
||||
);
|
||||
|
||||
/* If there are no events, tell search engines not to index the page but do NOT tell them not to follow links */
|
||||
if( count($events) === 0 )
|
||||
if( count( $events ) === 0 )
|
||||
{
|
||||
\IPS\Output::i()->metaTags['robots'] = 'noindex';
|
||||
}
|
||||
@@ -287,7 +298,7 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
protected function _viewDay( $jump, $featured=array() )
|
||||
{
|
||||
/* Get the calendars we can view */
|
||||
$calendars = \IPS\calendar\Calendar::roots();
|
||||
$calendars = \IPS\Settings::i()->club_nodes_in_apps ? \IPS\calendar\Calendar::rootsWithClubs() : \IPS\calendar\Calendar::roots();
|
||||
|
||||
/* Get the month data */
|
||||
try
|
||||
@@ -296,7 +307,7 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'error_bad_date', '3L182/5', 403, '' );
|
||||
\IPS\Output::i()->error( 'error_bad_date', '2L182/9', 403, '' );
|
||||
}
|
||||
|
||||
$tomorrow = $date->adjust( '+1 day' );
|
||||
@@ -312,6 +323,7 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
$table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'browse', 'calendar', 'front' ), 'birthday' );
|
||||
|
||||
\IPS\Output::i()->output = $table;
|
||||
\IPS\Output::i()->metaTags['robots'] = 'noindex';
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -394,7 +406,7 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
protected function _viewStream( $jump, $featured=array() )
|
||||
{
|
||||
/* Get the calendars we can view */
|
||||
$calendars = \IPS\calendar\Calendar::roots();
|
||||
$calendars = \IPS\Settings::i()->club_nodes_in_apps ? \IPS\calendar\Calendar::rootsWithClubs() : \IPS\calendar\Calendar::roots();
|
||||
|
||||
/* Get the month data */
|
||||
$day = NULL;
|
||||
@@ -407,21 +419,21 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
try
|
||||
{
|
||||
$date = \IPS\calendar\Date::getDate( \IPS\Request::i()->y ?: NULL, \IPS\Request::i()->m ?: NULL, $day );
|
||||
|
||||
/* Get the events within this range */
|
||||
$events = \IPS\calendar\Event::retrieveEvents(
|
||||
\IPS\calendar\Date::getDate( $date->firstDayOfMonth('year'), $date->firstDayOfMonth('mon'), $date->firstDayOfMonth('mday') ),
|
||||
\IPS\calendar\Date::getDate( $date->lastDayOfMonth('year'), $date->lastDayOfMonth('mon'), $date->lastDayOfMonth('mday'), 23, 59, 59 ),
|
||||
$this->_calendar,
|
||||
NULL,
|
||||
FALSE
|
||||
);
|
||||
}
|
||||
catch( \InvalidArgumentException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'error_bad_date', '3L182/6', 403, '' );
|
||||
\IPS\Output::i()->error( 'error_bad_date', '2L182/A', 403, '' );
|
||||
}
|
||||
|
||||
/* Get the events within this range */
|
||||
$events = \IPS\calendar\Event::retrieveEvents(
|
||||
\IPS\calendar\Date::getDate( $date->firstDayOfMonth('year'), $date->firstDayOfMonth('mon'), $date->firstDayOfMonth('mday') ),
|
||||
\IPS\calendar\Date::getDate( $date->lastDayOfMonth('year'), $date->lastDayOfMonth('mon'), $date->lastDayOfMonth('mday'), 23, 59, 59 ),
|
||||
$this->_calendar,
|
||||
NULL,
|
||||
FALSE
|
||||
);
|
||||
|
||||
/* Sort */
|
||||
$startDate = \IPS\calendar\Date::getDate();
|
||||
@usort( $events, function( $a, $b ) use ( $startDate )
|
||||
@@ -457,7 +469,7 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* If there are no events, tell search engines not to index the page but do NOT tell them not to follow links */
|
||||
if( count($events) === 0 )
|
||||
if( count( $events ) === 0 )
|
||||
{
|
||||
\IPS\Output::i()->metaTags['robots'] = 'noindex';
|
||||
}
|
||||
@@ -466,6 +478,12 @@ class _view extends \IPS\Dispatcher\Controller
|
||||
$events = array_slice( $events, ( $pagination['page'] - 1 ) * $this->streamPerPage, $this->streamPerPage );
|
||||
}
|
||||
|
||||
/* Non-existent page */
|
||||
if( $pagination['page'] > 1 AND !count( $events ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_events_month', '2L182/B', 404, '' );
|
||||
}
|
||||
|
||||
/* Display */
|
||||
$output = \IPS\Theme::i()->getTemplate( 'browse' )->calendarStream( $calendars, $date, $featured, $events, $this->_calendar, $jump, $pagination );
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.2.2 Beta 1 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @subpackage Calendar
|
||||
* @since 26 Jul 2017
|
||||
*/
|
||||
|
||||
namespace IPS\calendar\setup\upg_102005;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.2.2 Beta 1 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Recount containers
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function finish()
|
||||
{
|
||||
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\calendar\Calendar', 'count' => 0 ), 5, array( 'class' ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"calendar_event_reviews",
|
||||
{
|
||||
"name": "review_author_response",
|
||||
"type": "MEDIUMTEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"calendar_event_reviews",
|
||||
"review_mid",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "review_mid",
|
||||
"columns": [
|
||||
"review_mid",
|
||||
"review_date"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"calendar_event_rsvp",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "rsvp_search",
|
||||
"columns": [
|
||||
"rsvp_date",
|
||||
"rsvp_member_id"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"calendar_events",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "event_album",
|
||||
"columns": [
|
||||
"event_album",
|
||||
"event_approved",
|
||||
"event_saved"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -69,9 +69,9 @@ class _Date extends \IPS\DateTime
|
||||
public static $dateFormats = array(
|
||||
'locale' => "%x",
|
||||
'd_sm_y' => "%d %b %Y",
|
||||
'd_lm_y' => "%d %B %Y",
|
||||
'd_lm_y' => "%d {monthName} %Y",
|
||||
'sm_d_y' => "%b %d, %Y",
|
||||
'lm_d_y' => "%B %d, %Y",
|
||||
'lm_d_y' => "{monthName} %d, %Y",
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -127,7 +127,7 @@ class _Date extends \IPS\DateTime
|
||||
|
||||
/* Store the information and return the object */
|
||||
$obj = static::ts( $timeStamp - $offset );
|
||||
$obj->dateInformation = getdate( $timeStamp );
|
||||
$obj->getDateInformation( $timeStamp );
|
||||
$obj->offset = $offset;
|
||||
|
||||
return $obj;
|
||||
@@ -152,7 +152,7 @@ class _Date extends \IPS\DateTime
|
||||
$result = parent::__construct( $time );
|
||||
}
|
||||
|
||||
$this->dateInformation = getdate( $this->getTimestamp() );
|
||||
$this->getDateInformation( $this->getTimestamp() );
|
||||
$this->offset = $this->getOffset();
|
||||
|
||||
return $result;
|
||||
@@ -169,12 +169,36 @@ class _Date extends \IPS\DateTime
|
||||
{
|
||||
$result = parent::setTimezone( $timezone );
|
||||
|
||||
$this->dateInformation = getdate( $this->getTimestamp() );
|
||||
$this->getDateInformation( $this->getTimestamp() );
|
||||
$this->offset = $this->getOffset();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the date information
|
||||
*
|
||||
* @note This is basically a timezone aware wrapper for getdate
|
||||
* @param int $time Timestamp
|
||||
* @return void
|
||||
*/
|
||||
public function getDateInformation( $time )
|
||||
{
|
||||
$this->dateInformation = array(
|
||||
'seconds' => (int) $this->strFormat( '%S' ),
|
||||
'minutes' => (int) $this->strFormat( '%M' ),
|
||||
'hours' => (int) $this->strFormat( '%H' ),
|
||||
'mday' => (int) $this->strFormat( '%d' ),
|
||||
'wday' => (int) $this->strFormat( '%w' ),
|
||||
'mon' => (int) $this->strFormat( '%m' ),
|
||||
'year' => (int) $this->strFormat( '%Y' ),
|
||||
'yday' => (int) $this->strFormat( '%j' ) - 1,
|
||||
'weekday' => $this->strFormat( '%A' ),
|
||||
'month' => $this->strFormat( '%B' ),
|
||||
0 => $time
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a date object created based on an arbitrary string. Used for both relative time strings and SQL datetime values.
|
||||
*
|
||||
@@ -186,7 +210,47 @@ class _Date extends \IPS\DateTime
|
||||
public static function parseTime( $datetime, $forceUTC=FALSE )
|
||||
{
|
||||
/* Create an \IPS\DateTime object from the datetime value passed in */
|
||||
$timezone = ( $forceUTC === TRUE ) ? new \DateTimeZone( 'UTC' ) : ( \IPS\Member::loggedIn()->timezone ? new \DateTimeZone( \IPS\Member::loggedIn()->timezone ) : NULL );
|
||||
if ( !$forceUTC AND \IPS\Dispatcher::hasInstance() )
|
||||
{
|
||||
if( !\IPS\Member::loggedIn()->timezone )
|
||||
{
|
||||
$timezone = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
$validTimezone = TRUE;
|
||||
if( in_array( \IPS\Member::loggedIn()->timezone, static::getTimezoneIdentifiers() ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$timezone = new \DateTimeZone( \IPS\Member::loggedIn()->timezone );
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
$validTimezone = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$validTimezone = FALSE;
|
||||
}
|
||||
|
||||
if( ! $validTimezone )
|
||||
{
|
||||
\IPS\Member::loggedIn()->timezone = null;
|
||||
|
||||
if ( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
\IPS\Member::loggedIn()->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$timezone = new \DateTimeZone( 'UTC' );
|
||||
}
|
||||
|
||||
$datetime = new \IPS\DateTime( $datetime, $timezone );
|
||||
|
||||
/* Now correct it back if necessary */
|
||||
@@ -444,7 +508,7 @@ class _Date extends \IPS\DateTime
|
||||
}
|
||||
elseif( isset( static::$dateFormats[ \IPS\Settings::i()->calendar_date_format ] ) )
|
||||
{
|
||||
return static::$dateFormats[ \IPS\Settings::i()->calendar_date_format ];
|
||||
return str_replace( '{monthName}', static::setMonthModifier(), static::$dateFormats[ \IPS\Settings::i()->calendar_date_format ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -455,18 +519,25 @@ class _Date extends \IPS\DateTime
|
||||
/**
|
||||
* Return the MySQL-style datetime value
|
||||
*
|
||||
* @param bool $includeTime Whether to include time or not
|
||||
* @param bool $includeTime Whether to include time or not
|
||||
* @param bool $timezoned Whether to adjust for timezone or not. This will usually be FALSE for database purposes, but set to TRUE if you're using this to compare if two dates are on the same day
|
||||
* @return string
|
||||
*/
|
||||
public function mysqlDatetime( $includeTime=TRUE )
|
||||
public function mysqlDatetime( $includeTime=TRUE, $timezoned = FALSE )
|
||||
{
|
||||
$timeStamp = isset( $this->dateInformation[0] ) ? $this->dateInformation[0] : $this->getTimestamp();
|
||||
if ( $timezoned )
|
||||
{
|
||||
$timeStamp += $this->getTimezone()->getOffset( $this );
|
||||
}
|
||||
|
||||
if( $includeTime )
|
||||
{
|
||||
return date( 'Y-m-d H:i:s', isset( $this->dateInformation[0] ) ? $this->dateInformation[0] : $this->getTimestamp() );
|
||||
return date( 'Y-m-d H:i:s', $timeStamp );
|
||||
}
|
||||
else
|
||||
{
|
||||
return date( 'Y-m-d', isset( $this->dateInformation[0] ) ? $this->dateInformation[0] : $this->getTimestamp() );
|
||||
return date( 'Y-m-d', $timeStamp );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -756,7 +827,7 @@ class _Date extends \IPS\DateTime
|
||||
|
||||
if( $key == 'monthName' AND isset( $data[0] ) )
|
||||
{
|
||||
return mb_convert_case( \IPS\Member::loggedIn()->language()->convertString( strftime( '%B', $data[0] ) ), MB_CASE_TITLE );
|
||||
return mb_convert_case( \IPS\Member::loggedIn()->language()->convertString( strftime( static::setMonthModifier(), $data[0] ) ), MB_CASE_TITLE );
|
||||
}
|
||||
|
||||
if( $key == 'monthNameShort' AND isset( $data[0] ) )
|
||||
@@ -777,6 +848,36 @@ class _Date extends \IPS\DateTime
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief strftime-compatible modifier for month name
|
||||
*/
|
||||
protected static $monthNameModifier = NULL;
|
||||
|
||||
/**
|
||||
* Sets the month name modifier
|
||||
*
|
||||
* @note Some languages on some OS's (e.g. FreeBSD) require using a different modifier for full month name
|
||||
* @return void
|
||||
*/
|
||||
static protected function setMonthModifier()
|
||||
{
|
||||
if( static::$monthNameModifier === NULL )
|
||||
{
|
||||
$test = @strftime( '%OB' );
|
||||
|
||||
if( $test === FALSE OR $test == '%OB' )
|
||||
{
|
||||
static::$monthNameModifier = '%B';
|
||||
}
|
||||
else
|
||||
{
|
||||
static::$monthNameModifier = '%OB';
|
||||
}
|
||||
}
|
||||
|
||||
return static::$monthNameModifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the time according to the user's locale (without the date)
|
||||
*
|
||||
|
||||
@@ -21,9 +21,9 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
/**
|
||||
* Event Comment Model
|
||||
*/
|
||||
class _Comment extends \IPS\Content\Comment implements \IPS\Content\EditHistory, \IPS\Content\ReportCenter, \IPS\Content\Hideable, \IPS\Content\Searchable, \IPS\Content\Embeddable
|
||||
class _Comment extends \IPS\Content\Comment implements \IPS\Content\EditHistory, \IPS\Content\Hideable, \IPS\Content\Searchable, \IPS\Content\Embeddable
|
||||
{
|
||||
use \IPS\Content\Reactable;
|
||||
use \IPS\Content\Reactable, \IPS\Content\Reportable;
|
||||
|
||||
/**
|
||||
* @brief [ActiveRecord] Multiton Store
|
||||
@@ -99,7 +99,7 @@ class _Comment extends \IPS\Content\Comment implements \IPS\Content\EditHistory,
|
||||
*/
|
||||
public static function contentTableTemplate()
|
||||
{
|
||||
return array( \IPS\Theme::i()->getTemplate( 'tables', 'core' ), 'commentRows' );
|
||||
return array( \IPS\Theme::i()->getTemplate( 'tables', 'core', 'front' ), 'commentRows' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,6 @@ class _Event extends \IPS\Content\Item implements
|
||||
\IPS\Content\Permissions,
|
||||
\IPS\Content\Tags,
|
||||
\IPS\Content\Followable,
|
||||
\IPS\Content\ReportCenter,
|
||||
\IPS\Content\ReadMarkers,
|
||||
\IPS\Content\Hideable, \IPS\Content\Featurable, \IPS\Content\Lockable,
|
||||
\IPS\Content\Shareable,
|
||||
@@ -33,7 +32,7 @@ class _Event extends \IPS\Content\Item implements
|
||||
\IPS\Content\Embeddable,
|
||||
\IPS\Content\MetaData
|
||||
{
|
||||
use \IPS\Content\Reactable;
|
||||
use \IPS\Content\Reactable, \IPS\Content\Reportable;
|
||||
|
||||
/**
|
||||
* @brief Application
|
||||
@@ -124,6 +123,11 @@ class _Event extends \IPS\Content\Item implements
|
||||
* @brief Cover Photo Storage Extension
|
||||
*/
|
||||
public static $coverPhotoStorageExtension = 'calendar_Events';
|
||||
|
||||
/**
|
||||
* @brief Use a default cover photo
|
||||
*/
|
||||
public static $coverPhotoDefault = true;
|
||||
|
||||
/**
|
||||
* @brief Cached date objects
|
||||
@@ -134,6 +138,11 @@ class _Event extends \IPS\Content\Item implements
|
||||
* @brief Cached venue
|
||||
*/
|
||||
protected $venueObject = NULL;
|
||||
|
||||
/**
|
||||
* @brief Location Data Cache
|
||||
*/
|
||||
protected $locationData = NULL;
|
||||
|
||||
/**
|
||||
* @brief [Content] Key for hide reasons
|
||||
@@ -546,19 +555,19 @@ class _Event extends \IPS\Content\Item implements
|
||||
/* Do we have an occurrences limit? */
|
||||
if( $recurringData['repeat_end_occurrences'] )
|
||||
{
|
||||
while( $occurrences < $recurringData['repeat_end_occurrences'] )
|
||||
$period = new \DatePeriod( $date, new \DateInterval( 'P' . $recurringData['event_repeat_freq'] . mb_strtoupper( mb_substr( $keyword, 0, 1 ) ) ), $recurringData['repeat_end_occurrences'] );
|
||||
|
||||
foreach( $period as $dateOccurrence )
|
||||
{
|
||||
if( ( $date->mysqlDatetime( FALSE ) >= $startDate->mysqlDatetime( FALSE ) AND $date->mysqlDatetime( FALSE ) <= $endDate->mysqlDatetime( FALSE ) ) OR
|
||||
if( ( $dateOccurrence->mysqlDatetime( FALSE ) >= $startDate->mysqlDatetime( FALSE ) AND $dateOccurrence->mysqlDatetime( FALSE ) <= $endDate->mysqlDatetime( FALSE ) ) OR
|
||||
( $eDate !== NULL AND $eDate->mysqlDatetime( FALSE ) >= $startDate->mysqlDatetime( FALSE ) AND $eDate->mysqlDatetime( FALSE ) <= $endDate->mysqlDatetime( FALSE ) ) OR
|
||||
( $eDate !== NULL AND $date->mysqlDatetime( FALSE ) <= $startDate->mysqlDatetime( FALSE ) AND $eDate->mysqlDatetime( FALSE ) >= $endDate->mysqlDatetime( FALSE ) )
|
||||
)
|
||||
{
|
||||
$results[] = array( 'startDate' => $date, 'endDate' => $eDate );
|
||||
$results[] = array( 'startDate' => new \IPS\calendar\Date( $dateOccurrence->mysqlDatetime( FALSE, TRUE ) ), 'endDate' => $eDate );
|
||||
}
|
||||
|
||||
$date = $date->adjust( "+{$recurringData['event_repeat_freq']} {$keyword}" );
|
||||
$eDate = ( $eDate !== NULL ) ? $eDate->adjust( "+{$recurringData['event_repeat_freq']} {$keyword}" ) : NULL;
|
||||
$occurrences++;
|
||||
}
|
||||
}
|
||||
/* Do we have an end date for the recurrences? */
|
||||
@@ -566,34 +575,36 @@ class _Event extends \IPS\Content\Item implements
|
||||
{
|
||||
$endDateToUse = ( $endDate->mysqlDatetime( FALSE ) < $recurringData['repeat_end_date']->mysqlDatetime( FALSE ) ) ? $endDate : $recurringData['repeat_end_date'];
|
||||
|
||||
while( $date->mysqlDatetime( FALSE ) <= $endDateToUse->mysqlDatetime( FALSE ) )
|
||||
$period = new \DatePeriod( $date, new \DateInterval( 'P' . $recurringData['event_repeat_freq'] . mb_strtoupper( mb_substr( $keyword, 0, 1 ) ) ), $endDateToUse );
|
||||
|
||||
foreach( $period as $dateOccurrence )
|
||||
{
|
||||
if( ( $date->mysqlDatetime( FALSE ) >= $startDate->mysqlDatetime( FALSE ) AND $date->mysqlDatetime( FALSE ) <= $endDate->mysqlDatetime( FALSE ) ) OR
|
||||
if( ( $dateOccurrence->mysqlDatetime( FALSE ) >= $startDate->mysqlDatetime( FALSE ) AND $dateOccurrence->mysqlDatetime( FALSE ) <= $endDate->mysqlDatetime( FALSE ) ) OR
|
||||
( $eDate !== NULL AND $eDate->mysqlDatetime( FALSE ) >= $startDate->mysqlDatetime( FALSE ) AND $eDate->mysqlDatetime( FALSE ) <= $endDate->mysqlDatetime( FALSE ) ) OR
|
||||
( $eDate !== NULL AND $date->mysqlDatetime( FALSE ) <= $startDate->mysqlDatetime( FALSE ) AND $eDate->mysqlDatetime( FALSE ) >= $endDate->mysqlDatetime( FALSE ) )
|
||||
)
|
||||
{
|
||||
$results[] = array( 'startDate' => $date, 'endDate' => $eDate );
|
||||
$results[] = array( 'startDate' => new \IPS\calendar\Date( $dateOccurrence->mysqlDatetime( FALSE, TRUE ) ), 'endDate' => $eDate );
|
||||
}
|
||||
|
||||
$date = $date->adjust( "+{$recurringData['event_repeat_freq']} {$keyword}" );
|
||||
$eDate = ( $eDate !== NULL ) ? $eDate->adjust( "+{$recurringData['event_repeat_freq']} {$keyword}" ) : NULL;
|
||||
}
|
||||
}
|
||||
/* Recurs indefinitely... the most fun type... */
|
||||
else
|
||||
{
|
||||
while( $date->mysqlDatetime( FALSE ) <= $endDate->mysqlDatetime( FALSE ) )
|
||||
$period = new \DatePeriod( $date, new \DateInterval( 'P' . $recurringData['event_repeat_freq'] . mb_strtoupper( mb_substr( $keyword, 0, 1 ) ) ), $endDate );
|
||||
|
||||
foreach( $period as $dateOccurrence )
|
||||
{
|
||||
if( ( $date->mysqlDatetime( FALSE ) >= $startDate->mysqlDatetime( FALSE ) AND $date->mysqlDatetime( FALSE ) <= $endDate->mysqlDatetime( FALSE ) ) OR
|
||||
if( ( $dateOccurrence->mysqlDatetime( FALSE ) >= $startDate->mysqlDatetime( FALSE ) AND $dateOccurrence->mysqlDatetime( FALSE ) <= $endDate->mysqlDatetime( FALSE ) ) OR
|
||||
( $eDate !== NULL AND $eDate->mysqlDatetime( FALSE ) >= $startDate->mysqlDatetime( FALSE ) AND $eDate->mysqlDatetime( FALSE ) <= $endDate->mysqlDatetime( FALSE ) ) OR
|
||||
( $eDate !== NULL AND $date->mysqlDatetime( FALSE ) <= $startDate->mysqlDatetime( FALSE ) AND $eDate->mysqlDatetime( FALSE ) >= $endDate->mysqlDatetime( FALSE ) )
|
||||
)
|
||||
{
|
||||
$results[] = array( 'startDate' => $date, 'endDate' => $eDate );
|
||||
$results[] = array( 'startDate' => new \IPS\calendar\Date( $dateOccurrence->mysqlDatetime( FALSE, TRUE ) ), 'endDate' => $eDate );
|
||||
}
|
||||
|
||||
$date = $date->adjust( "+{$recurringData['event_repeat_freq']} {$keyword}" );
|
||||
$eDate = ( $eDate !== NULL ) ? $eDate->adjust( "+{$recurringData['event_repeat_freq']} {$keyword}" ) : NULL;
|
||||
}
|
||||
}
|
||||
@@ -622,7 +633,7 @@ class _Event extends \IPS\Content\Item implements
|
||||
{
|
||||
foreach( $this->parsedOccurrences as $occurrence )
|
||||
{
|
||||
if( $occurrence[ $type ] AND $occurrence[ $type ]->mysqlDatetime( FALSE ) >= $date->mysqlDatetime( FALSE ) )
|
||||
if( $occurrence[ $type ] AND $occurrence[ $type ]->mysqlDatetime( FALSE, TRUE ) >= $date->mysqlDatetime( FALSE, TRUE ) )
|
||||
{
|
||||
return $occurrence[ $type ];
|
||||
}
|
||||
@@ -632,7 +643,7 @@ class _Event extends \IPS\Content\Item implements
|
||||
/* Get the occurrences over the next year then and try from there. We go back one month to start with to account for the event stream. */
|
||||
foreach( $this->findOccurrences( $date->adjust( "-1 month" ), $date->adjust( "+2 years" ) ) as $occurrence )
|
||||
{
|
||||
if( $occurrence[ $type ] AND $occurrence[ $type ]->mysqlDatetime( FALSE ) >= $date->mysqlDatetime( FALSE ) )
|
||||
if( $occurrence[ $type ] AND $occurrence[ $type ]->mysqlDatetime( FALSE, TRUE ) >= $date->mysqlDatetime( FALSE, TRUE ) )
|
||||
{
|
||||
return $occurrence[ $type ];
|
||||
}
|
||||
@@ -905,9 +916,9 @@ class _Event extends \IPS\Content\Item implements
|
||||
*/
|
||||
public static function contentTableTemplate()
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'calendar.css', 'calendar' ) );
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'calendar_responsive.css', 'calendar' ) );
|
||||
return array( \IPS\Theme::i()->getTemplate( 'global', 'calendar' ), 'rows' );
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'calendar.css', 'calendar', 'front' ) );
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'calendar_responsive.css', 'calendar', 'front' ) );
|
||||
return array( \IPS\Theme::i()->getTemplate( 'global', 'calendar', 'front' ), 'rows' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1011,7 +1022,7 @@ class _Event extends \IPS\Content\Item implements
|
||||
{
|
||||
if ( $container and $container->moderate and !$member->group['g_avoid_q'] )
|
||||
{
|
||||
return TRUE;
|
||||
return !static::modPermission( 'approve', $member, $container );
|
||||
}
|
||||
|
||||
return parent::moderateNewItems( $member, $container );
|
||||
@@ -1086,6 +1097,15 @@ class _Event extends \IPS\Content\Item implements
|
||||
'repeat_end_date' => NULL, /* Ends on x date (which is separate from the event end date - e.g. jan 9 2014 3pm to jan 10 2014 3pm, repeat annually until jan 9 2019) */
|
||||
);
|
||||
|
||||
/* If we're copying an event, reset the date & time fields */
|
||||
if ( \IPS\Request::i()->do === 'copy' )
|
||||
{
|
||||
$dateValues['start_date'] = NULL;
|
||||
$dateValues['start_time'] = NULL;
|
||||
$dateValues['end_date'] = NULL;
|
||||
$dateValues['end_time'] = NULL;
|
||||
}
|
||||
|
||||
foreach( \IPS\calendar\Date::getDayNames() as $day )
|
||||
{
|
||||
$dateValues['repeat_freq_on_' . $day['ical'] ] = NULL; /* If repeating weekly, this is the days of the week as checkboxes (e.g. repeat every wed, fri and sat) */
|
||||
@@ -1112,6 +1132,11 @@ class _Event extends \IPS\Content\Item implements
|
||||
$val['start_time'] = str_replace( '.', ':', $val['start_time'] );
|
||||
}
|
||||
|
||||
if( isset( $val['no_end_time'] ) AND $val['no_end_time'] AND isset( $val['end_time'] ) )
|
||||
{
|
||||
unset( $val['end_time'] );
|
||||
}
|
||||
|
||||
if( isset( $val['end_time'] ) )
|
||||
{
|
||||
$val['end_time'] = str_replace( '.', ':', $val['end_time'] );
|
||||
@@ -1192,7 +1217,7 @@ class _Event extends \IPS\Content\Item implements
|
||||
}, NULL, NULL, 'event_dates' );
|
||||
|
||||
/* Init */
|
||||
if ( !$container or !$container->club() )
|
||||
if ( ( !$container or !$container->club() ) AND !\IPS\calendar\Calendar::theOnlyNode() )
|
||||
{
|
||||
$return['calendar'] = new \IPS\Helpers\Form\Node( static::$formLangPrefix . 'container', $container ? $container->id : ( isset( \IPS\Request::i()->calendar ) ? \IPS\Request::i()->calendar : NULL ), TRUE, array(
|
||||
'url' => \IPS\Http\Url::internal( 'app=calendar&module=calendar&controller=submit', 'front', 'calendar_submit' ),
|
||||
@@ -1207,7 +1232,7 @@ class _Event extends \IPS\Content\Item implements
|
||||
$return = array_merge( $return, parent::formElements( $item, $container ) );
|
||||
|
||||
/* Event description */
|
||||
$return['description'] = new \IPS\Helpers\Form\Editor( 'event_content', $item ? $item->content : NULL, TRUE, array( 'app' => 'calendar', 'key' => 'Calendar', 'autoSaveKey' => 'calendar-event', 'attachIds' => ( $item === NULL ? NULL : array( $item->id ) ) ) );
|
||||
$return['description'] = new \IPS\Helpers\Form\Editor( 'event_content', $item ? $item->content : NULL, TRUE, array( 'app' => 'calendar', 'key' => 'Calendar', 'autoSaveKey' => 'calendar-event', 'attachIds' => ( $item === NULL ? NULL : array( $item->id, NULL, 'description' ) ) ) );
|
||||
|
||||
/* Cover photo and location */
|
||||
$return['header'] = new \IPS\Helpers\Form\Upload( 'event_cover_photo', ( $item AND $item->cover_photo ) ? \IPS\File::get( 'calendar_Events', $item->cover_photo ) : NULL, FALSE, array( 'image' => TRUE, 'storageExtension' => 'calendar_Events' ) );
|
||||
@@ -1250,6 +1275,12 @@ class _Event extends \IPS\Content\Item implements
|
||||
$return['rsvplimit'] = new \IPS\Helpers\Form\Number( 'event_rsvp_limit', $item ? $item->rsvp_limit : -1, FALSE, array( 'unlimited' => -1 ), NULL, NULL, NULL, 'event_rsvp_limit' );
|
||||
}
|
||||
|
||||
/* If the calendar does not allow comments or reviews, disable the auto follow option */
|
||||
if( $container AND !$container->allow_comments AND !$container->allow_reviews )
|
||||
{
|
||||
unset( $return['auto_follow'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -1262,7 +1293,7 @@ class _Event extends \IPS\Content\Item implements
|
||||
protected function processBeforeCreate( $values )
|
||||
{
|
||||
/* Post key is very much needed because...bacon */
|
||||
$this->post_key = isset( $values['post_key'] ) ? $values['post_key'] : md5( uniqid() );
|
||||
$this->post_key = isset( $values['post_key'] ) ? $values['post_key'] : md5( mt_rand() );
|
||||
|
||||
parent::processBeforeCreate( $values );
|
||||
}
|
||||
@@ -1281,6 +1312,11 @@ class _Event extends \IPS\Content\Item implements
|
||||
$values['event_dates']['start_time'] = str_replace( '.', ':', $values['event_dates']['start_time'] );
|
||||
}
|
||||
|
||||
if( isset( $values['event_dates']['no_end_time'] ) AND $values['event_dates']['no_end_time'] AND isset( $values['event_dates']['end_time'] ) )
|
||||
{
|
||||
unset( $values['event_dates']['end_time'] );
|
||||
}
|
||||
|
||||
if( isset( $values['event_dates']['end_time'] ) )
|
||||
{
|
||||
$values['event_dates']['end_time'] = str_replace( '.', ':', $values['event_dates']['end_time'] );
|
||||
@@ -1324,7 +1360,7 @@ class _Event extends \IPS\Content\Item implements
|
||||
$this->end_date = \IPS\calendar\Date::createFromForm( $values['event_dates']['start_date'], $values['event_dates']['end_time'], ( isset( $values['event_dates']['all_day'] ) AND $values['event_dates']['all_day'] ) ? 'UTC' : $values['event_dates']['event_timezone'] )->format( 'Y-m-d H:i' );
|
||||
}
|
||||
}
|
||||
else if( ( !isset( $values['event_dates']['all_day'] ) OR !$values['event_dates']['all_day'] ) AND $values['event_dates']['end_time'] != $values['event_dates']['start_time'] )
|
||||
else if( ( !isset( $values['event_dates']['all_day'] ) OR !$values['event_dates']['all_day'] ) AND isset( $values['event_dates']['end_time'] ) AND $values['event_dates']['end_time'] != $values['event_dates']['start_time'] )
|
||||
{
|
||||
$this->end_date = \IPS\calendar\Date::createFromForm( $values['event_dates']['start_date'], $values['event_dates']['end_time'], ( isset( $values['event_dates']['all_day'] ) AND $values['event_dates']['all_day'] ) ? 'UTC' : $values['event_dates']['event_timezone'] )->format( 'Y-m-d H:i' );
|
||||
}
|
||||
@@ -1365,7 +1401,10 @@ class _Event extends \IPS\Content\Item implements
|
||||
$venue = new \IPS\calendar\Venue;
|
||||
$venue->address = json_encode( $values['event_location'] );
|
||||
$venue->save();
|
||||
|
||||
|
||||
/* Node titles can contain HTML, but we should prevent this from user submissions as these go right into the language DB */
|
||||
$values['venue_title'] = array_map( 'strip_tags', $values['venue_title'] );
|
||||
|
||||
\IPS\Lang::saveCustom( 'calendar', 'calendar_venue_' . $venue->id, $values['venue_title'] );
|
||||
\IPS\Lang::saveCustom( 'calendar', 'calendar_venue_' . $venue->id . '_desc', $values['venue_description'] );
|
||||
$venue->title_seo = \IPS\Http\Url\Friendly::seoTitle( $values['venue_title'][ \IPS\Lang::defaultLanguage() ] );
|
||||
@@ -1416,8 +1455,6 @@ class _Event extends \IPS\Content\Item implements
|
||||
{
|
||||
parent::processAfterCreate( $comment, $values );
|
||||
|
||||
$this->expireWidgetCaches();
|
||||
|
||||
/* And claim attachments */
|
||||
\IPS\File::claimAttachments( 'calendar-event', $this->id );
|
||||
|
||||
@@ -1671,7 +1708,7 @@ class _Event extends \IPS\Content\Item implements
|
||||
foreach( $recurringEvents as $event )
|
||||
{
|
||||
/* Find occurrences within our date range (if any) */
|
||||
$thisEndDate = ( $endDate ? $endDate : $startDate->adjust( "+2 years" ) );
|
||||
$thisEndDate = ( $endDate ? $endDate->setTime( 23, 59, 59 ) : $startDate->adjust( "+2 years" ) );
|
||||
$occurrences = $event->findOccurrences( $startDate, $thisEndDate );
|
||||
|
||||
/* Do we have any? */
|
||||
@@ -1739,6 +1776,36 @@ class _Event extends \IPS\Content\Item implements
|
||||
$formattedEvents = array_slice( $formattedEvents, 0, $limit, TRUE );
|
||||
}
|
||||
}
|
||||
/* Resort formatted events by time */
|
||||
else
|
||||
{
|
||||
foreach( $formattedEvents as $date => $type )
|
||||
{
|
||||
foreach( $type as $typeKey => $event )
|
||||
{
|
||||
/* @note: Error suppressor is needed due to PHP bug https://bugs.php.net/bug.php?id=50688 */
|
||||
@usort( $formattedEvents[ $date ][ $typeKey ], function( $a, $b ) use ( $startDate )
|
||||
{
|
||||
if( $a->nextOccurrence( $startDate, 'startDate' ) === NULL )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if( $b->nextOccurrence( $startDate, 'startDate' ) === NULL )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( $a->nextOccurrence( $startDate, 'startDate' )->mysqlDatetime() == $b->nextOccurrence( $startDate, 'startDate' )->mysqlDatetime() )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ( $a->nextOccurrence( $startDate, 'startDate' )->format( 'H:i:s' ) < $b->nextOccurrence( $startDate, 'startDate' )->format( 'H:i:s' ) ) ? -1 : 1;
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $formattedEvents;
|
||||
}
|
||||
@@ -1855,6 +1922,7 @@ class _Event extends \IPS\Content\Item implements
|
||||
/**
|
||||
* Get output for API
|
||||
*
|
||||
* @param \IPS\Member|NULL $authorizedMember The member making the API request or NULL for API Key / client_credentials
|
||||
* @return array
|
||||
* @apiresponse int id ID number
|
||||
* @apiresponse string title Title
|
||||
@@ -1865,7 +1933,8 @@ class _Event extends \IPS\Content\Item implements
|
||||
* @apiresponse bool rsvp If this event accepts RSVPs
|
||||
* @apiresponse int rsvpLimit The number of RSVPs the event is limited to
|
||||
* @apiresponse \IPS\GeoLocation location The location where the event is taking place
|
||||
* @apiresponse \IPS\Member author The member thgat created the event
|
||||
* @apiresponse \IPS\calendar\Venue venue The venue data
|
||||
* @apiresponse \IPS\Member author The member that created the event
|
||||
* @apiresponse datetime postedDate When the event was created
|
||||
* @apiresponse string description Event description
|
||||
* @apiresponse int comments Number of comments
|
||||
@@ -1878,19 +1947,20 @@ class _Event extends \IPS\Content\Item implements
|
||||
* @apiresponse bool featured Event is featured
|
||||
* @apiresponse string url URL
|
||||
*/
|
||||
public function apiOutput()
|
||||
public function apiOutput( \IPS\Member $authorizedMember = NULL )
|
||||
{
|
||||
return array(
|
||||
'id' => $this->tid,
|
||||
'id' => $this->id,
|
||||
'title' => $this->title,
|
||||
'calendar' => $this->container()->apiOutput(),
|
||||
'calendar' => $this->container()->apiOutput( $authorizedMember ),
|
||||
'start' => $this->_start_date->rfc3339(),
|
||||
'end' => $this->_end_date ? $this->_end_date->rfc3339() : NULL,
|
||||
'recurrence' => $this->recurring,
|
||||
'rsvp' => (bool) $this->rsvp,
|
||||
'rsvpLimit' => $this->rsvp_limit == -1 ? null : $this->rsvp_limit,
|
||||
'location' => $this->location ? \IPS\GeoLocation::buildFromJson( $this->location )->apiOutput() : null,
|
||||
'author' => $this->author()->apiOutput(),
|
||||
'rsvpLimit' => $this->rsvp_limit == -1 ? NULL : $this->rsvp_limit,
|
||||
'location' => $this->_location ? $this->_location->apiOutput( $authorizedMember ) : NULL,
|
||||
'venue' => $this->venue() ? $this->venue()->apiOutput( $authorizedMember ) : NULL,
|
||||
'author' => $this->author()->apiOutput( $authorizedMember ),
|
||||
'postedDate' => \IPS\DateTime::ts( $this->saved )->rfc3339(),
|
||||
'description' => $this->content(),
|
||||
'comments' => $this->comments,
|
||||
@@ -2009,4 +2079,30 @@ class _Event extends \IPS\Content\Item implements
|
||||
{
|
||||
return array( 'core_FeaturedComments', 'core_ContentMessages' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the real location, this method takes also the venue into account
|
||||
*
|
||||
* @return NULL|\IPS\GeoLocation
|
||||
*/
|
||||
public function get__location()
|
||||
{
|
||||
if ( $this->locationData === NULL )
|
||||
{
|
||||
if ( $this->venue() )
|
||||
{
|
||||
$this->locationData = \IPS\GeoLocation::buildFromjson( $this->venue()->address );
|
||||
}
|
||||
else if ( $this->location )
|
||||
{
|
||||
$this->locationData = \IPS\GeoLocation::buildFromjson( $this->location );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->locationData = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->locationData;
|
||||
}
|
||||
}
|
||||
@@ -21,9 +21,9 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
/**
|
||||
* Event Review Model
|
||||
*/
|
||||
class _Review extends \IPS\Content\Review implements \IPS\Content\EditHistory, \IPS\Content\ReportCenter, \IPS\Content\Hideable, \IPS\Content\Searchable, \IPS\Content\Embeddable
|
||||
class _Review extends \IPS\Content\Review implements \IPS\Content\EditHistory, \IPS\Content\Hideable, \IPS\Content\Searchable, \IPS\Content\Embeddable
|
||||
{
|
||||
use \IPS\Content\Reactable;
|
||||
use \IPS\Content\Reactable, \IPS\Content\Reportable;
|
||||
|
||||
/**
|
||||
* @brief [ActiveRecord] Multiton Store
|
||||
@@ -63,6 +63,7 @@ class _Review extends \IPS\Content\Review implements \IPS\Content\EditHistory, \
|
||||
'votes_helpful' => 'votes_helpful',
|
||||
'votes_data' => 'votes_data',
|
||||
'approved' => 'approved',
|
||||
'author_response' => 'author_response',
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -103,7 +104,7 @@ class _Review extends \IPS\Content\Review implements \IPS\Content\EditHistory, \
|
||||
*/
|
||||
public static function contentTableTemplate()
|
||||
{
|
||||
return array( \IPS\Theme::i()->getTemplate( 'tables', 'core' ), 'commentRows' );
|
||||
return array( \IPS\Theme::i()->getTemplate( 'tables', 'core', 'front' ), 'commentRows' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -303,15 +303,30 @@ class _ICSParser
|
||||
$_imported = 0;
|
||||
$_skipped = 0;
|
||||
$_newEvents = 0;
|
||||
|
||||
$maxImport = 500;
|
||||
|
||||
// Leave this here - useful for debugging
|
||||
// print_r($this->_parsedIcsData);exit;
|
||||
|
||||
if ( count( $this->_parsedIcsData ) and isset( $this->_parsedIcsData['events'] ) )
|
||||
{
|
||||
usort( $this->_parsedIcsData['events'], function( $a, $b ) {
|
||||
if ( $a['start']['raw_ts'] == $b['start']['raw_ts'] )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ( $a['start']['raw_ts'] > $b['start']['raw_ts'] ) ? -1 : 1;
|
||||
} );
|
||||
|
||||
/* Loop over the events */
|
||||
foreach( $this->_parsedIcsData['events'] as $event )
|
||||
{
|
||||
if ( $_imported > $maxImport )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Quickly, if we don't support the recurrence data provided let's just skip this event */
|
||||
if( isset( $event['recurr'] ) )
|
||||
{
|
||||
@@ -413,7 +428,7 @@ class _ICSParser
|
||||
$_new = TRUE;
|
||||
|
||||
/* Basics */
|
||||
$newEvent->post_key = md5( uniqid() );
|
||||
$newEvent->post_key = md5( mt_rand() );
|
||||
$newEvent->member_id = $this->member->member_id;
|
||||
$newEvent->calendar_id = $this->calendar->id;
|
||||
|
||||
@@ -1312,7 +1327,20 @@ class _ICSParser
|
||||
/* Is a timezone specified? */
|
||||
if ( isset( $event[ $method ]['tzid'] ) AND $event[ $method ]['tzid'] )
|
||||
{
|
||||
$event[ $method ]['utc_time'] = new \IPS\DateTime( $event[ $method ]['raw'], new \DateTimeZone( $event[ $method ]['tzid'] ) );
|
||||
/* Let's test it first... */
|
||||
if( in_array( $event[ $method ]['tzid'], \IPS\DateTime::getTimezoneIdentifiers() ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$timezone = new \DateTimeZone( $event[ $method ]['tzid'] );
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
$timezone = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
$event[ $method ]['utc_time'] = new \IPS\DateTime( $event[ $method ]['raw'], $timezone );
|
||||
}
|
||||
elseif( isset( $event[ $method ]['raw'] ) )
|
||||
{
|
||||
|
||||
@@ -142,7 +142,7 @@ class _Venue extends \IPS\Node\Model
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'venue_title', NULL, TRUE, array( 'app' => 'calendar', 'key' => ( $this->id ? "calendar_venue_{$this->id}" : NULL ) ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'venue_description', NULL, FALSE, array( 'app' => 'calendar', 'key' => ( $this->id ? "calendar_venue_{$this->id}_desc" : NULL ), 'editor' => array( 'app' => 'calendar', 'key' => 'Venue', 'autoSaveKey' => ( $this->id ? "calendar-venue-{$this->id}" : "calendar-new-venue" ), 'attachIds' => $this->id ? array( $this->id, NULL, 'description' ) : NULL ) ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Address( 'venue_address', $this->id ? \IPS\GeoLocation::buildFromJson( $this->address ) : NULL, TRUE, array( 'minimize' => FALSE, 'requireFullAddress' => TRUE ), NULL, NULL, NULL, 'venue_address' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Address( 'venue_address', $this->id ? \IPS\GeoLocation::buildFromJson( $this->address ) : NULL, TRUE, array( 'minimize' => FALSE, 'requireFullAddress' => FALSE ), NULL, NULL, NULL, 'venue_address' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -169,7 +169,7 @@ class _Venue extends \IPS\Node\Model
|
||||
|
||||
if( isset( $values['venue_description'] ) )
|
||||
{
|
||||
\IPS\Lang::saveCustom( 'venues', 'calendar_venue_' . $this->id .'_desc', $values['venue_description'] );
|
||||
\IPS\Lang::saveCustom( 'calendar', 'calendar_venue_' . $this->id .'_desc', $values['venue_description'] );
|
||||
unset( $values['venue_description'] );
|
||||
}
|
||||
|
||||
@@ -216,4 +216,22 @@ class _Venue extends \IPS\Node\Model
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get output for API
|
||||
*
|
||||
* @param \IPS\Member|NULL $authorizedMember The member making the API request or NULL for API Key / client_credentials
|
||||
* @return array
|
||||
* @apiresponse int id ID number
|
||||
* @apiresponse string title Title
|
||||
* @apiresponse \IPS\GeoLocation address The address
|
||||
*/
|
||||
public function apiOutput( \IPS\Member $authorizedMember = NULL )
|
||||
{
|
||||
return array(
|
||||
'id' => $this->id,
|
||||
'title' => $this->_title,
|
||||
'address' => \IPS\GeoLocation::buildFromJson( $this->address )->apiOutput( $authorizedMember )
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user