Version 5.0.6

This commit is contained in:
Neo committed 2025-12-19 18:55:49 -08:00
1 parent a3a4a9ccbd
commit b89858b2ff
1214 files changed
+92828 -14859

No files matched your search

@@ -423,7 +423,7 @@ class event extends Controller
];
Webhook::fire( 'calendarEvent_rsvp', $webhookData );
\IPS\Events\Event::fire( 'onEventRsvp', Member::loggedIn(), array( $this->event, $_go ) );
\IPS\Events\Event::fire( 'onEventRsvp', Member::loggedIn(), array( $this->event, $_go ?? EventClass::RSVP_LEFT ) );
$message = 'rsvp_selection_' . Request::i()->action;
Output::i()->redirect( $this->event->url(), $message );
@@ -191,6 +191,9 @@ class submit extends Controller
}
}
/* Make sure we fire extensions */
Event::extendForm( $form, $existing, $existing->container() );
if ( $values = $form->values() )
{
/* Set the container */
@@ -17,13 +17,11 @@ use BadFunctionCallException;
use DateInterval;
use DatePeriod;
use DateTime;
use DateTimeZone;
use Exception;
use InvalidArgumentException;
use IPS\calendar\Calendar;
use IPS\calendar\Date;
use IPS\calendar\Event;
use IPS\Db;
use IPS\Dispatcher\Controller;
use IPS\GeoLocation;
use IPS\Helpers\Form;
@@ -33,7 +31,6 @@ use IPS\Helpers\Form\Text;
use IPS\Http\Url;
use IPS\Member;
use IPS\Output;
use IPS\Patterns\ActiveRecordIterator;
use IPS\Request;
use IPS\Session;
use IPS\Settings;
@@ -158,12 +155,10 @@ class view extends Controller
if( method_exists( $this, '_view' . ucwords( Request::i()->view ) ) )
{
$method = "_view" . ucwords( Request::i()->view );
$this->$method( $jump );
}
else
{
$method = "_view" . ucwords( Settings::i()->calendar_default_view );
$this->$method( $jump );
}
}
/* Otherwise use ACP default preference */
@@ -171,9 +166,16 @@ class view extends Controller
{
Request::i()->view = Settings::i()->calendar_default_view;
$method = "_view" . ucwords( Settings::i()->calendar_default_view );
$this->$method( $jump );
}
/* Remove overview for club calendars only */
if( Request::i()->view == 'overview' and $this->_calendar and $club = $this->_calendar->club() )
{
$method = '_viewMonth';
}
$this->$method( $jump );
/* Online User Location */
if ( $this->_calendar )
{
@@ -196,6 +198,13 @@ class view extends Controller
/* Get the month data */
$day = NULL;
preg_match( '/^\d{4}$/', Request::i()->y, $y );
preg_match( '/^\d{1,2}$/', Request::i()->m, $m );
if( ( empty( $y ) and !empty( $m ) ) or ( !empty( $y ) and empty( $m ) ) )
{
Output::i()->error( 'error_bad_date', '2L182/4', 403 );
}
if( ( !Request::i()->y OR Request::i()->y == $this->_today->year ) AND ( !Request::i()->m OR Request::i()->m == $this->_today->mon ) )
{
$day = $this->_today->mday;
@@ -253,6 +262,16 @@ class view extends Controller
*/
protected function _viewWeek( Form $jump ) : void
{
/* Make sure we have a valid date */
if( isset( Request::i()->w ) )
{
preg_match( '/^\d{4}-\d{2}-\d{2}$/', Request::i()->w, $match );
if( empty( $match ) )
{
Output::i()->error( 'error_bad_date', '2L182/1', 403, '' );
}
}
/* Get the week data */
$week = Request::i()->w ? explode( '-', Request::i()->w ) : NULL;
try
@@ -332,6 +351,19 @@ class view extends Controller
*/
protected function _viewDay( Form $jump ) : void
{
/* Did Esther have a bad date? */
if( isset( Request::i()->y ) or isset( Request::i()->m ) or isset( Request::i()->d ) )
{
preg_match( '/^\d{4}$/', Request::i()->y, $y );
preg_match( '/^\d{1,2}$/', Request::i()->m, $m );
preg_match( '/^\d{1,2}$/', Request::i()->d, $d );
if( empty( $y ) or empty( $m ) or empty( $d ) )
{
/* All signs point to yes */
Output::i()->error( 'error_bad_date', '2L182/3', 403 );
}
}
/* Get the day data */
try
{
@@ -499,7 +531,7 @@ class view extends Controller
$featured = iterator_to_array( Event::featured( 13, '_rand' ) );
/* Get the calendars we can view */
$calendars = \IPS\Settings::i()->club_nodes_in_apps ? \IPS\calendar\Calendar::rootsWithClubs() : \IPS\calendar\Calendar::roots();
$calendars = Settings::i()->club_nodes_in_apps ? Calendar::rootsWithClubs() : Calendar::roots();
/* If there are no featured get upcoming */
if( count( $featured ) === 0 )