Version 5.0.0 beta 4
This commit is contained in:
1 parent
e86153356a
commit
2f24f9de48
276 files changed
+8614
-6044
No files matched your search
@@ -19,6 +19,7 @@ use IPS\calendar\Calendar as CalendarClass;
|
||||
use IPS\calendar\Date;
|
||||
use IPS\calendar\Icalendar\ICSParser;
|
||||
use IPS\convert\App;
|
||||
use IPS\convert\Software;
|
||||
use IPS\DateTime;
|
||||
use IPS\Db;
|
||||
use IPS\File;
|
||||
@@ -50,7 +51,7 @@ class Calendar extends Core
|
||||
/**
|
||||
* @brief Application
|
||||
*/
|
||||
public $app = 'calendar';
|
||||
public string $app = 'calendar';
|
||||
|
||||
/**
|
||||
* Returns an array of items that we can convert, including the amount of rows stored in the Community Suite as well as the recommend value of rows to convert per cycle
|
||||
@@ -58,7 +59,7 @@ class Calendar extends Core
|
||||
* @param bool $rowCounts enable row counts
|
||||
* @return array
|
||||
*/
|
||||
public function menuRows( $rowCounts=FALSE )
|
||||
public function menuRows( bool $rowCounts=FALSE ) : array
|
||||
{
|
||||
$return = array();
|
||||
$extraRows = $this->software->extraMenuRows();
|
||||
@@ -204,11 +205,12 @@ class Calendar extends Core
|
||||
* @param string $method Method to truncate
|
||||
* @return array
|
||||
*/
|
||||
protected function truncate( $method )
|
||||
protected function truncate( string $method ) : array
|
||||
{
|
||||
$return = array();
|
||||
$classname = get_class( $this->software );
|
||||
|
||||
/* @var Software $classname */
|
||||
if( $classname::canConvert() === NULL )
|
||||
{
|
||||
return array();
|
||||
@@ -285,9 +287,9 @@ class Calendar extends Core
|
||||
* Convert a Calendar
|
||||
*
|
||||
* @param array $info Data to insert
|
||||
* @return integer|boolean The ID of the newly inserted calendar, or FALSE on failure.
|
||||
* @return int|bool The ID of the newly inserted calendar, or FALSE on failure.
|
||||
*/
|
||||
public function convertCalendar( $info=array() )
|
||||
public function convertCalendar( array $info=array() ) : bool|int
|
||||
{
|
||||
if ( !isset( $info['cal_id'] ) )
|
||||
{
|
||||
@@ -340,7 +342,7 @@ class Calendar extends Core
|
||||
|
||||
if ( !isset( $info['cal_color'] ) )
|
||||
{
|
||||
$genericCalendar = new Calendar;
|
||||
$genericCalendar = new CalendarClass;
|
||||
$info['cal_color'] = $genericCalendar->_generateColor();
|
||||
}
|
||||
|
||||
@@ -392,9 +394,9 @@ class Calendar extends Core
|
||||
* @param array $info Data to insert
|
||||
* @param string|NULL $filepath Path to the event cover photo, or NULL.
|
||||
* @param string|NULL $filedata Cover photo binary data, or NULL
|
||||
* @return integer|boolean The ID of the newly inserted event, or FALSE on failure.
|
||||
* @return int|bool The ID of the newly inserted event, or FALSE on failure.
|
||||
*/
|
||||
public function convertCalendarEvent( $info=array(), $filepath=NULL, $filedata=NULL )
|
||||
public function convertCalendarEvent( array $info=array(), ?string $filepath=NULL, ?string $filedata=NULL ) : bool|int
|
||||
{
|
||||
if ( !isset( $info['event_id'] ) )
|
||||
{
|
||||
@@ -532,7 +534,7 @@ class Calendar extends Core
|
||||
}
|
||||
else if ( $info['event_start_date'] instanceof DateTime )
|
||||
{
|
||||
$info['event_start_date'] = Date::create( (string) $info['event_start_date'] )->mysqlDatetime();
|
||||
$info['event_start_date'] = Date::ts( $info['event_start_date']->getTimestamp() )->mysqlDatetime();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -549,7 +551,7 @@ class Calendar extends Core
|
||||
}
|
||||
else if ( $info['event_end_date'] instanceof DateTime )
|
||||
{
|
||||
$info['event_end_date'] = Date::create( (string) $info['event_end_date'] )->mysqlDatetime();
|
||||
$info['event_end_date'] = Date::ts( $info['event_end_date']->getTimestamp() )->mySqlDatetime();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -626,7 +628,7 @@ class Calendar extends Core
|
||||
{
|
||||
if ( is_array( $info['event_location'] ) AND isset( $info['event_location']['lat'] ) AND isset( $info['event_location']['long'] ) )
|
||||
{
|
||||
$info['event_location'] = (string) GeoLocation::getFromLatLong( $info['event_location']['lat'], $info['event_location']['long'] );
|
||||
$info['event_location'] = (string) GeoLocation::getByLatLong( $info['event_location']['lat'], $info['event_location']['long'] );
|
||||
}
|
||||
else if ( $info['event_location'] instanceof GeoLocation )
|
||||
{
|
||||
@@ -671,11 +673,7 @@ class Calendar extends Core
|
||||
$file = File::create( 'calendar_Events', $info['event_cover_photo'], $filedata );
|
||||
$info['event_cover_photo'] = (string) $file;
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
$info['event_cover_photo'] = NULL;
|
||||
}
|
||||
catch( ErrorException $e )
|
||||
catch( Exception|ErrorException $e )
|
||||
{
|
||||
$info['event_cover_photo'] = NULL;
|
||||
}
|
||||
@@ -725,9 +723,9 @@ class Calendar extends Core
|
||||
* Convert a comment
|
||||
*
|
||||
* @param array $info Data to insert
|
||||
* @return integer|boolean The ID of the newly inserted comment, or FALSE on failure.
|
||||
* @return int|bool The ID of the newly inserted comment, or FALSE on failure.
|
||||
*/
|
||||
public function convertCalendarComment( $info=array() )
|
||||
public function convertCalendarComment( array $info=array() ) : bool|int
|
||||
{
|
||||
if ( !isset( $info['comment_id'] ) )
|
||||
{
|
||||
@@ -846,9 +844,9 @@ class Calendar extends Core
|
||||
* Convert a review
|
||||
*
|
||||
* @param array $info Data to insert
|
||||
* @return integer|boolean The ID of the newly inserted review, or FALSE on failure.
|
||||
* @return int|bool The ID of the newly inserted review, or FALSE on failure.
|
||||
*/
|
||||
public function convertCalendarReview( $info=array() )
|
||||
public function convertCalendarReview( array $info=array() ) : bool|int
|
||||
{
|
||||
if ( !isset( $info['review_id'] ) )
|
||||
{
|
||||
@@ -1049,9 +1047,9 @@ class Calendar extends Core
|
||||
* Convert an RSVP
|
||||
*
|
||||
* @param array $info Data to insert
|
||||
* @return integer|boolean The ID of the newly inserted RSVP, or FALSE on failure.
|
||||
* @return int|bool The ID of the newly inserted RSVP, or FALSE on failure.
|
||||
*/
|
||||
public function convertCalendarRsvp( $info=array() )
|
||||
public function convertCalendarRsvp( array $info=array() ) : bool|int
|
||||
{
|
||||
$hasId = TRUE;
|
||||
if ( !isset( $info['rsvp_id'] ) )
|
||||
@@ -1133,9 +1131,9 @@ class Calendar extends Core
|
||||
* Convert a Calendar Import Feed
|
||||
*
|
||||
* @param array $info Data to insert
|
||||
* @return integer|boolean The ID of the newly inserted feed, or FALSE on failure.
|
||||
* @return int|bool The ID of the newly inserted feed, or FALSE on failure.
|
||||
*/
|
||||
public function convertCalendarFeed( $info=array() )
|
||||
public function convertCalendarFeed( array $info=array() ) : bool|int
|
||||
{
|
||||
if ( !isset( $info['feed_id'] ) )
|
||||
{
|
||||
@@ -1245,9 +1243,9 @@ class Calendar extends Core
|
||||
* Convert a Calendar Venue
|
||||
*
|
||||
* @param array $info Data to insert
|
||||
* @return integer|boolean The ID of the newly inserted venue, or FALSE on failure.
|
||||
* @return int|bool The ID of the newly inserted venue, or FALSE on failure.
|
||||
*/
|
||||
public function convertCalendarVenue( $info=array() )
|
||||
public function convertCalendarVenue( array $info=array() ) : bool|int
|
||||
{
|
||||
if ( !isset( $info['venue_id'] ) )
|
||||
{
|
||||
@@ -1270,7 +1268,7 @@ class Calendar extends Core
|
||||
{
|
||||
if ( is_array( $info['venue_address'] ) AND isset( $info['venue_address']['lat'] ) AND isset( $info['venue_address']['long'] ) )
|
||||
{
|
||||
$info['venue_address'] = (string) GeoLocation::getFromLatLong( $info['venue_address']['lat'], $info['venue_address']['long'] );
|
||||
$info['venue_address'] = (string) GeoLocation::getByLatLong( $info['venue_address']['lat'], $info['venue_address']['long'] );
|
||||
}
|
||||
else if ( $info['venue_address'] instanceof GeoLocation )
|
||||
{
|
||||
@@ -1307,9 +1305,9 @@ class Calendar extends Core
|
||||
* Convert a Calendar Event Reminder
|
||||
*
|
||||
* @param array $info Data to insert
|
||||
* @return integer|boolean The ID of the newly inserted reminder, or FALSE on failure.
|
||||
* @return int|bool The ID of the newly inserted reminder, or FALSE on failure.
|
||||
*/
|
||||
public function convertCalendarReminder( $info=array() )
|
||||
public function convertCalendarReminder( array $info=array() ) : bool|int
|
||||
{
|
||||
if ( !isset( $info['reminder_id'] ) )
|
||||
{
|
||||
@@ -1387,9 +1385,9 @@ class Calendar extends Core
|
||||
* @param string|NULL $filepath Path to the file, or NULL.
|
||||
* @param string|NULL $filedata Binary data for the file, or NULL.
|
||||
* @param string|NULL $thumbnailpath Path to thumbnail, or NULL.
|
||||
* @return integer|boolean The ID of the newly inserted attachment, or FALSE on failure.
|
||||
* @return int|bool The ID of the newly inserted attachment, or FALSE on failure.
|
||||
*/
|
||||
public function convertAttachment( $info=array(), $map=array(), $filepath=NULL, $filedata=NULL, $thumbnailpath=NULL )
|
||||
public function convertAttachment( array $info=array(), array $map=array(), ?string $filepath=NULL, ?string $filedata=NULL, ?string $thumbnailpath=NULL ) : bool|int
|
||||
{
|
||||
$map['location_key'] = 'calendar_Calendar';
|
||||
$map['id1_type'] = 'calendar_events';
|
||||
|
||||
Reference in new issue
Block a user