Version 4.0.13.1

This commit is contained in:
Neo committed 2025-12-19 04:57:54 -08:00
1 parent f9e857d255
commit c6a86f0d9b
7517 files changed
+597400 -668041

No files matched your search

Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,20 @@
{
"1": {
"method": "insert",
"params": [
"core_permission_index",
{
"app": "calendar",
"perm_type": "calendar",
"perm_type_id": 1,
"perm_view": "*",
"perm_2": "*",
"perm_3": "<%NO_GUESTS%>",
"perm_4": "<%NO_GUESTS%>",
"perm_5": "<%NO_GUESTS%>",
"perm_6": "<%NO_GUESTS%>",
"perm_7": "<%NO_GUESTS%>"
}
]
}
}
Whitespace-only changes.
@@ -0,0 +1,49 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage Calendar
* @since 30 Oct 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\setup\upg_100002;
/* 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.0.0 Upgrade Code
*/
class _Upgrade
{
/**
* Act on blogs
*
* @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 step1()
{
\IPS\Db::i()->update( 'calendar_calendars', array( 'cal_title_seo' => null ) );
\IPS\Db::i()->update( 'calendar_events', array( 'event_title_seo' => null ) );
return true;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Resetting calendar friendly URL titles";
}
}
Whitespace-only changes.
@@ -0,0 +1,30 @@
{
"1": {
"method": "dropIndex",
"params": [
"calendar_events",
"event_content"
]
},
"2": {
"method": "dropIndex",
"params": [
"calendar_events",
"event_title"
]
},
"3": {
"method": "dropIndex",
"params": [
"calendar_event_comments",
"comment_text"
]
},
"4": {
"method": "dropIndex",
"params": [
"calendar_event_reviews",
"review_text"
]
}
}
Whitespace-only changes.
@@ -0,0 +1,23 @@
{
"1": {
"method": "changeColumn",
"params": [
"calendar_event_reviews",
"review_votes_data",
{
"name": "review_votes_data",
"type": "TEXT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": "",
"comment": "JSON object containing data about who has voted helpful\/unhelpful ",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
Whitespace-only changes.
@@ -0,0 +1,38 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 15 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\setup\upg_100015;
/* 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.0.0 RC 2 Upgrade Code
*/
class _Upgrade
{
/**
* Finish - This is run after all apps have been upgraded
*
* @return mixed 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)
* @note We opted not to let users run this immediately during the upgrade because of potential issues (it taking a long time and users stopping it or getting frustrated) but we can revisit later
*/
public function finish()
{
\IPS\Task::queue( 'core', 'RebuildItems', array( 'class' => 'IPS\calendar\Event' ), 3, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\calendar\Event', 'count' => 0 ), 4, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\calendar\Calendar', 'count' => 0 ), 5, array( 'class' ) );
}
}
Whitespace-only changes.
@@ -0,0 +1,13 @@
{
"1": {
"method": "delete",
"params": [
"core_modules",
[
"sys_module_application=? AND sys_module_key=?",
"calendar",
"events"
]
]
}
}
@@ -0,0 +1,43 @@
<?php
/**
* @brief 4.0.0 RC 5 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage Blog
* @since 5 May 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\setup\upg_100018;
/* 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.0.0 RC 5 Upgrade Code
*/
class _Upgrade
{
/**
* Make sure all theme settings are applied to every theme.
*
* @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', 'RebuildReputationIndex', array( 'class' => 'IPS\calendar\Event' ), 4 );
\IPS\Task::queue( 'core', 'RebuildReputationIndex', array( 'class' => 'IPS\calendar\Event\Comment' ), 4 );
\IPS\Task::queue( 'core', 'RebuildReputationIndex', array( 'class' => 'IPS\calendar\Event\Review' ), 4 );
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\calendar\Calendar', 'count' => 0 ), 5, array( 'class' ) );
return TRUE;
}
}
Whitespace-only changes.
@@ -0,0 +1,111 @@
{
"1": {
"method": "changeColumn",
"params": [
"calendar_events",
"event_start_date",
{
"name": "event_start_date",
"type": "DATETIME",
"length": 0,
"decimals": null,
"values": [],
"allow_null": false,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "addIndex",
"params": [
"calendar_event_comments",
{
"type": "key",
"name": "comment_approved",
"columns": [
"comment_approved"
],
"length": [
null
]
}
]
},
"3": {
"method": "addIndex",
"params": [
"calendar_event_reviews",
{
"type": "key",
"name": "review_approved",
"columns": [
"review_approved"
],
"length": [
null
]
}
]
},
"4": {
"method": "addIndex",
"params": [
"calendar_events",
{
"type": "key",
"name": "event_featured",
"columns": [
"event_featured",
"event_approved",
"event_calendar_id"
],
"length": [
null,
null,
null
]
}
]
},
"5": {
"method": "addIndex",
"params": [
"calendar_events",
{
"type": "key",
"name": "recurring_events",
"columns": [
"event_recurring",
"event_approved",
"event_calendar_id"
],
"length": [
250,
null,
null
]
}
]
},
"6": {
"method": "addIndex",
"params": [
"calendar_events",
{
"type": "key",
"name": "ip_lookup",
"columns": [
"event_ip_address"
],
"length": [
null
]
}
]
}
}
Whitespace-only changes.
@@ -0,0 +1,12 @@
{
"1": {
"method": "update",
"params": [
"calendar_events",
{
"event_end_date": null
},
"event_start_date=event_end_date"
]
}
}
@@ -0,0 +1,89 @@
{
"1": {
"method": "dropColumn",
"params": [
"calendar_events",
"event_comments_pending"
]
},
"2": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_queued_comments",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"3": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_hidden_comments",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"4": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_unapproved_reviews",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"5": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_hidden_reviews",
"type": "INT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,42 @@
<?php
/**
* @brief 4.0.5 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage Blog
* @since 5 May 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\setup\upg_100028;
/* 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.0.5 Upgrade Code
*/
class _Upgrade
{
/**
* Make sure all theme settings are applied to every theme.
*
* @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\core\Setup\Upgrade::repairFileUrls('calendar');
\IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\calendar\Event' ), 3, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\calendar\Event\Comment' ), 3, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\calendar\Event\Review' ), 3, array( 'class' ) );
return TRUE;
}
}
@@ -0,0 +1,120 @@
<?php
/**
* @brief 4.0.12 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 21 Jul 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\setup\upg_100042;
/* 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.0.12 Upgrade Code
*/
class _Upgrade
{
/**
* Fix all day calendar events
*
* @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 step1()
{
$perCycle = 500;
$did = 0;
$limit = intval( \IPS\Request::i()->extra );
/* Try to prevent timeouts to the extent possible */
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
/* We need all day events where the time is not already 00:00 - these are the ones that are time zone adjusted and need to be fixed */
foreach( \IPS\Db::i()->select( '*', 'calendar_events', array( "event_all_day=? AND DATE_FORMAT(event_start_date,'%H:%i') != ?", 1, '00:00' ), 'event_id ASC', array( $limit, $perCycle ) ) as $event )
{
if( $cutOff !== null AND time() >= $cutOff )
{
return ( $limit + $did );
}
$did++;
$update = array();
/* We need to figure out the submitter's time zone offset so we can put the event back to where it belongs */
if( $event['event_member_id'] )
{
$member = \IPS\Member::load( $event['event_member_id'] );
$startDate = new \IPS\DateTime( $event['event_start_date'], $member->timezone ? new \DateTimeZone( $member->timezone ) : NULL );
}
else
{
$startDate = new \IPS\DateTime( $event['event_start_date'], NULL );
}
/* Then move it back to UTC */
$startDate->setTimezone( new \DateTimeZone('UTC') );
/* And then return our datetime */
$update['event_start_date'] = $startDate->format( 'Y-m-d 00:00:00' );
/* Do the same if we have an end date */
if( $event['event_end_date'] )
{
/* We need to figure out the submitter's time zone offset so we can put the event back to where it belongs */
if( $event['event_member_id'] )
{
$member = \IPS\Member::load( $event['event_member_id'] );
$endDate = new \IPS\DateTime( $event['event_end_date'], $member->timezone ? new \DateTimeZone( $member->timezone ) : NULL );
}
else
{
$endDate = new \IPS\DateTime( $event['event_end_date'], NULL );
}
/* Then move it back to UTC */
$endDate->setTimezone( new \DateTimeZone('UTC') );
/* And then return our datetime */
$update['event_end_date'] = $endDate->format( 'Y-m-d 00:00:00' );
}
\IPS\Db::i()->update( 'calendar_events', $update, array( 'event_id=?', $event['event_id'] ) );
}
if( $did )
{
return ( $limit + $did );
}
else
{
unset( $_SESSION['_step1Count'] );
return TRUE;
}
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
if( !isset( $_SESSION['_step1Count'] ) )
{
$_SESSION['_step1Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'calendar_events', array( "event_all_day=? AND DATE_FORMAT(event_start_date,'%H:%i') != ?", 1, '00:00' ) )->first();
}
return "Fixing all day calendar events (Updated so far: " . ( ( $limit > $_SESSION['_step1Count'] ) ? $_SESSION['_step1Count'] : $limit ) . ' out of ' . $_SESSION['_step1Count'] . ')';
}
}
Whitespace-only changes.
@@ -0,0 +1,112 @@
<?php
$SQL[] = "ALTER TABLE cal_calendars DROP cal_permissions,
ADD cal_title_seo VARCHAR( 255 ) NULL DEFAULT NULL,
ADD cal_comment_moderate TINYINT( 1 ) NOT NULL DEFAULT '0',
ADD cal_rsvp_owner TINYINT( 1 ) NOT NULL DEFAULT '0';";
$SQL[] = "CREATE TABLE cal_event_ratings (
rating_id int(10) NOT NULL auto_increment,
rating_eid int(10) NOT NULL default '0',
rating_member_id mediumint(8) NOT NULL default '0',
rating_value smallint(6) NOT NULL default '0',
rating_ip_address varchar(46) NOT NULL,
PRIMARY KEY (rating_id),
KEY rating_eid (rating_eid,rating_member_id),
KEY rating_ip_address (rating_ip_address)
);";
$SQL[] = "CREATE TABLE cal_event_comments (
comment_id int(10) NOT NULL auto_increment,
comment_eid int(10) NOT NULL default '0',
comment_mid mediumint(8) NOT NULL default '0',
comment_date int(11) NOT NULL default '0',
comment_approved tinyint(1) NOT NULL default '0',
comment_text mediumtext,
comment_append_edit tinyint(1) NOT NULL default '0',
comment_edit_time int(11) NOT NULL default '0',
comment_edit_name varchar(255) default NULL,
ip_address varchar(46) default NULL,
comment_author varchar(255) default NULL,
PRIMARY KEY (comment_id),
KEY comment_eid (comment_eid),
KEY ip_address (ip_address)
);";
$SQL[] = "CREATE TABLE cal_event_rsvp (
rsvp_id int(11) NOT NULL auto_increment,
rsvp_event_id int(11) NOT NULL default '0',
rsvp_member_id int(11) NOT NULL default '0',
rsvp_date int(11) NOT NULL default '0',
PRIMARY KEY (rsvp_id),
KEY rsvp_event_id (rsvp_event_id),
KEY rsvp_member_id (rsvp_member_id)
);";
$SQL[] = "CREATE TABLE cal_import_feeds (
feed_id int(11) NOT NULL auto_increment,
feed_title varchar(255) default NULL,
feed_url text,
feed_added int(11) NOT NULL default '0',
feed_lastupdated int(11) NOT NULL default '0',
feed_recache_freq int(11) NOT NULL default '0',
feed_calendar_id int(11) NOT NULL default '0',
feed_member_id INT NOT NULL DEFAULT '0',
feed_next_run INT NOT NULL DEFAULT '0',
PRIMARY KEY (feed_id),
KEY feed_calendar_id (feed_calendar_id),
KEY feed_next_run (feed_next_run)
);";
$SQL[] = "CREATE TABLE cal_import_map (
import_id int(11) NOT NULL auto_increment,
import_feed_id int(11) NOT NULL default '0',
import_event_id int(11) NOT NULL default '0',
import_guid varchar(255) NOT NULL default '0',
PRIMARY KEY (import_id),
KEY import_feed_id (import_feed_id),
KEY import_event_id (import_event_id),
KEY import_guid (import_guid)
);";
$SQL[] = "RENAME TABLE cal_events TO cal_events_bak;";
$SQL[] = "CREATE TABLE cal_events (
event_id int(10) unsigned NOT NULL auto_increment,
event_calendar_id int(10) unsigned NOT NULL default '0',
event_member_id mediumint(8) unsigned NOT NULL default '0',
event_content mediumtext,
event_title varchar(255) NOT NULL default '',
event_smilies tinyint(1) NOT NULL default '0',
event_comments int NOT NULL default '0',
event_rsvp tinyint(1) NOT NULL default '0',
event_perms text,
event_private tinyint(1) NOT NULL default '0',
event_approved tinyint(1) NOT NULL default '0',
event_saved int(10) unsigned NOT NULL default '0',
event_lastupdated int(10) unsigned NOT NULL default '0',
event_recurring int(2) unsigned NOT NULL default '0',
event_start_date datetime NOT NULL,
event_end_date datetime default NULL,
event_title_seo VARCHAR( 255 ) NULL DEFAULT NULL,
event_rating_total INT NOT NULL DEFAULT '0',
event_rating_hits INT NOT NULL DEFAULT '0',
event_rating_avg INT NOT NULL DEFAULT '0',
event_attachments INT NOT NULL DEFAULT '0',
event_post_key VARCHAR( 32 ) NULL DEFAULT NULL,
event_comments_pending INT NOT NULL DEFAULT '0',
event_sequence INT NOT NULL DEFAULT '0',
PRIMARY KEY (event_id),
KEY approved (event_calendar_id , event_approved , event_start_date , event_end_date),
KEY event_member_id (event_member_id, event_approved, event_private, event_lastupdated)
);";
$SQL[] = "INSERT INTO cal_events SELECT event_id, event_calendar_id, event_member_id, event_content, event_title, event_smilies, 0, 0, event_perms, event_private, event_approved, event_unixstamp, event_unixstamp,
event_recurring, FROM_UNIXTIME(event_unix_from), CASE WHEN event_unix_to > 0 THEN FROM_UNIXTIME(event_unix_to) ELSE NULL END, '', 0, 0, 0, 0, MD5( CONCAT( event_id, event_title ) ), 0, 1 FROM " . \IPS\Db::i()->prefix . "cal_events_bak;";
$SQL[] = "DROP TABLE cal_events_bak;";
$SQL[] = "ALTER TABLE cal_events ADD event_all_day TINYINT NOT NULL DEFAULT '0';";
$SQL[] = "UPDATE cal_events SET event_all_day=1 WHERE TIME(event_start_date) = '00:00:00';";
@@ -0,0 +1,38 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage Calendar
* @since 24 Oct 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\setup\upg_32000;
/* 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.0.0 Upgrade Code
*/
class _Upgrade
{
/**
* Conversion from 3.0
*
* @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 step1()
{
\IPS\core\Setup\Upgrade::runLegacySql( 'calendar', 32000 );
return TRUE;
}
}
Whitespace-only changes.
@@ -0,0 +1,909 @@
{
"1": {
"method": "renameTable",
"params": [
"cal_calendars",
"calendar_calendars"
]
},
"2": {
"method": "renameTable",
"params": [
"cal_event_comments",
"calendar_event_comments"
]
},
"3": {
"method": "renameTable",
"params": [
"cal_event_rsvp",
"calendar_event_rsvp"
]
},
"4": {
"method": "dropTable",
"params": [
"calendar_events",
true
]
},
"5": {
"method": "renameTable",
"params": [
"cal_events",
"calendar_events"
]
},
"6": {
"method": "renameTable",
"params": [
"cal_import_feeds",
"calendar_import_feeds"
]
},
"7": {
"method": "renameTable",
"params": [
"cal_import_map",
"calendar_import_map"
]
},
"8": {
"method": "dropIndex",
"params": [
"calendar_events",
"event_content"
]
},
"9": {
"method": "dropIndex",
"params": [
"calendar_events",
"event_title"
]
},
"10": {
"method": "dropIndex",
"params": [
"calendar_event_comments",
"comment_text"
]
},
"11": {
"method": "dropColumn",
"params": [
"calendar_calendars",
[
"cal_rss_cache",
"cal_rss_update",
"cal_rss_export",
"cal_rss_export_days",
"cal_rss_update_last",
"cal_rss_export_max",
"cal_rsvp_owner",
"cal_bday_limit",
"cal_event_limit"
]
]
},
"12": {
"method": "dropColumn",
"params": [
"calendar_import_feeds",
"feed_recache_freq"
]
},
"13": {
"method": "addColumn",
"params": [
"calendar_calendars",
{
"name": "cal_color",
"type": "VARCHAR",
"length": 7,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "Hex color code to represent this calendar",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"14": {
"method": "update",
"params": [
"calendar_calendars",
"cal_color='#000000'"
]
},
"15": {
"method": "changeColumn",
"params": [
"calendar_event_comments",
"ip_address",
{
"name": "comment_ip_address",
"type": "VARCHAR",
"length": 46,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"16": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_reviews",
"type": "INT",
"length": null,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"17": {
"method": "dropColumn",
"params": [
"calendar_events",
[
"event_smilies",
"event_rating_hits",
"event_rating_total",
"event_attachments"
]
]
},
"18": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_ip_address",
"type": "VARCHAR",
"length": 46,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"19": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_locked",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "Whether the event is locked (for new comments\/reviews) or not",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"20": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_featured",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "Whether the event is featured or not",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"21": {
"method": "changeColumn",
"params": [
"calendar_events",
"event_rating_avg",
{
"name": "event_rating",
"type": "SMALLINT",
"length": 5,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"22": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_last_comment",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"23": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_last_review",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"24": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_approved_by",
"type": "BIGINT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "Member ID who approved the event",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"25": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_approved_on",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "Date the event was approved on",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"26": {
"method": "dropTable",
"params": [
"cal_event_ratings",
true
]
},
"27": {
"method": "addColumn",
"params": [
"calendar_calendars",
{
"name": "cal_allow_comments",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": [],
"allow_null": false,
"default": "1",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"28": {
"method": "addColumn",
"params": [
"calendar_calendars",
{
"name": "cal_allow_reviews",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"29": {
"method": "addColumn",
"params": [
"calendar_calendars",
{
"name": "cal_review_moderate",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"30": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_location",
"type": "TEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "Stores location data for the event, used to create a map",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"31": {
"method": "addColumn",
"params": [
"calendar_import_feeds",
{
"name": "feed_allow_rsvp",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"32": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_rsvp_limit",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "Maximum number of attendees allowed for the event",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"33": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_cover_photo",
"type": "VARCHAR",
"length": 255,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "Header background image for the event",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"34": {
"method": "addColumn",
"params": [
"calendar_event_rsvp",
{
"name": "rsvp_response",
"type": "TINYINT",
"length": null,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "0=No, 1=Yes, 2=Maybe",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"35": {
"method": "update",
"params": [
"calendar_event_rsvp",
"rsvp_response=1"
]
},
"36": {
"method": "changeColumn",
"params": [
"calendar_events",
"event_recurring",
{
"name": "event_recurring",
"type": "TEXT",
"length": 2,
"decimals": null,
"values": [],
"allow_null": true,
"default": "0",
"comment": "Holds an RRULE value to indicate how the event recurs",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"37": {
"method": "changeColumn",
"params": [
"calendar_events",
"event_end_date",
{
"name": "event_end_date",
"type": "DATETIME",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": "0000-00-00 00:00:00",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"38": {
"method": "changeColumn",
"params": [
"calendar_import_feeds",
"feed_next_run",
{
"name": "feed_last_run",
"type": "INT",
"length": 11,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"39": {
"method": "changeIndex",
"params": [
"calendar_import_feeds",
"feed_next_run",
{
"type": "key",
"name": "feed_last_run",
"columns": [
"feed_last_run"
],
"length": [
null
]
}
]
},
"40": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_album",
"type": "MEDIUMINT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "Holds album ID associated with this event",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"41": {
"method": "createTable",
"params": [
{
"name": "calendar_event_reviews",
"columns": {
"review_id": {
"allow_null": false,
"auto_increment": true,
"binary": false,
"comment": "ID Number",
"decimals": null,
"default": null,
"length": 20,
"name": "review_id",
"type": "BIGINT",
"unsigned": true,
"values": [],
"zerofill": false
},
"review_eid": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "The event ID",
"decimals": null,
"default": "0",
"length": 10,
"name": "review_eid",
"type": "INT",
"unsigned": true,
"values": [],
"zerofill": false
},
"review_mid": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "The member ID of the review author",
"decimals": null,
"default": "0",
"length": 8,
"name": "review_mid",
"type": "MEDIUMINT",
"unsigned": true,
"values": [],
"zerofill": false
},
"review_text": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "The review contents",
"decimals": null,
"default": null,
"length": 0,
"name": "review_text",
"type": "MEDIUMTEXT",
"unsigned": false,
"values": [],
"zerofill": false
},
"review_append_edit": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "Boolean indicating if edit message should show",
"decimals": null,
"default": "0",
"length": 1,
"name": "review_append_edit",
"type": "TINYINT",
"unsigned": true,
"values": [],
"zerofill": false
},
"review_edit_time": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "Unix timestamp of when the review was last edited",
"decimals": null,
"default": null,
"length": 10,
"name": "review_edit_time",
"type": "INT",
"unsigned": true,
"values": [],
"zerofill": false
},
"review_edit_name": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "Username of user who last edited review",
"decimals": null,
"default": null,
"length": 255,
"name": "review_edit_name",
"type": "VARCHAR",
"unsigned": false,
"values": [],
"zerofill": false
},
"review_date": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "Unix timestamp of when review was made",
"decimals": null,
"default": null,
"length": 10,
"name": "review_date",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"review_ip": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "IP address review was made from",
"decimals": null,
"default": "",
"length": 46,
"name": "review_ip",
"type": "VARCHAR",
"unsigned": false,
"values": [],
"zerofill": false
},
"review_author_name": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "Username of user who made review",
"decimals": null,
"default": "",
"length": 255,
"name": "review_author_name",
"type": "VARCHAR",
"unsigned": false,
"values": [],
"zerofill": false
},
"review_rating": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "The rating (out of 5) with the review",
"decimals": null,
"default": null,
"length": 1,
"name": "review_rating",
"type": "TINYINT",
"unsigned": true,
"values": [],
"zerofill": false
},
"review_votes": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "The number of people who have voted \"helpful\" or \"unhelpful\"",
"decimals": null,
"default": "0",
"length": 10,
"name": "review_votes",
"type": "INT",
"unsigned": true,
"values": [],
"zerofill": false
},
"review_votes_helpful": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "The number of people who have voted \"helpful\"",
"decimals": null,
"default": "0",
"length": 10,
"name": "review_votes_helpful",
"type": "INT",
"unsigned": true,
"values": [],
"zerofill": false
},
"review_votes_data": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "JSON object containing data about who has voted helpful\/unhelpful ",
"decimals": null,
"default": "",
"length": 0,
"name": "review_votes_data",
"type": "TEXT",
"unsigned": false,
"values": [],
"zerofill": false
},
"review_approved": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "Review is approved?",
"decimals": null,
"default": "1",
"length": 1,
"name": "review_approved",
"type": "TINYINT",
"unsigned": false,
"values": [],
"zerofill": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"length": [
null
],
"columns": [
"review_id"
]
},
"review_eid": {
"type": "key",
"name": "review_eid",
"length": [
null
],
"columns": [
"review_eid"
]
},
"review_mid": {
"type": "key",
"name": "review_mid",
"length": [
null
],
"columns": [
"review_mid"
]
},
"review_ip": {
"type": "key",
"name": "review_ip",
"columns": [
"review_ip"
],
"length": [
null
]
}
}
}
]
},
"42": {
"method": "addIndex",
"params": [
"calendar_event_comments",
{
"type": "key",
"name": "comment_mid",
"columns": [
"comment_mid"
],
"length": [
null
]
}
]
},
"43": {
"method": "addColumn",
"params": [
"calendar_events",
{
"name": "event_cover_offset",
"type": "INT",
"length": null,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,100 @@
<?php
/**
* @brief 4.0.0 Alpha 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @subpackage Calendar
* @package IPS Social Suite
* @since 8 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\setup\upg_40000;
/* 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.0.0 Alpha 1 Upgrade Code
*/
class _Upgrade
{
/**
* Upgrade calendar
*
* @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 step1()
{
\IPS\Db::i()->update( 'calendar_events', array( 'event_recurring' => NULL ), array( 'event_recurring=?', '0' ) );
\IPS\Db::i()->update( 'calendar_events', array( 'event_recurring' => "FREQ=yearly;INTERVAL=1" ), array( 'event_recurring=?', '3' ) );
\IPS\Db::i()->update( 'calendar_events', array( 'event_recurring' => "FREQ=monthly;INTERVAL=1" ), array( 'event_recurring=?', '2' ) );
\IPS\Db::i()->update( 'calendar_events', array( 'event_recurring' => "FREQ=weekly;INTERVAL=1" ), array( 'event_recurring=?', '1' ) );
\IPS\Db::i()->update( 'calendar_events', "event_recurring=CONCAT( event_recurring, ';UNTIL=', DATE_FORMAT( event_end_date, '%Y%m%dT%k%i%sZ' ) ), event_end_date=NULL", 'event_recurring IS NOT NULL AND event_end_date IS NOT NULL' );
\IPS\Db::i()->update( 'calendar_events', array( 'event_approved' => 0 ), "event_private=1 or event_perms!='*'" );
\IPS\Db::i()->update( 'calendar_events', array( 'event_end_date' => NULL ), array( 'event_end_date=?', '0000-00-00 00:00:00' ) );
\IPS\Db::i()->dropColumn( 'calendar_events', array( 'event_private', 'event_perms' ) );
return true;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Upgrading calendar events";
}
/**
* Upgrade calendar
*
* @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 step2()
{
foreach( \IPS\Db::i()->select( '*', 'calendar_calendars' ) as $calendar )
{
\IPS\Lang::saveCustom( 'calendar', "calendar_calendar_{$calendar['cal_id']}", html_entity_decode( $calendar['cal_title'], ENT_QUOTES, 'UTF-8' ) );
}
\IPS\Db::i()->dropColumn( 'calendar_calendars', 'cal_title' );
return true;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Upgrading calendars";
}
/**
* Finish - This is run after all apps have been upgraded
*
* @return mixed 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)
* @note We opted not to let users run this immediately during the upgrade because of potential issues (it taking a long time and users stopping it or getting frustrated) but we can revisit later
*/
public function finish()
{
\IPS\Task::queue( 'core', 'RebuildPosts', array( 'class' => 'IPS\calendar\Event' ), 2 );
\IPS\Task::queue( 'core', 'RebuildPosts', array( 'class' => 'IPS\calendar\Event\Comment' ), 2 );
\IPS\Task::queue( 'core', 'RebuildPosts', array( 'class' => 'IPS\calendar\Event\Review' ), 2 );
return TRUE;
}
}