Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

@@ -40,7 +40,7 @@ class _Upgrade
$select = \IPS\Db::i()->select( '*', 'nexus_ads', NULL, 'ad_id', array( $offset, 100 ) );
if ( count( $select ) )
{
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => 1 ), array( 'conf_key=?', 'ads_exist' ) );
\IPS\Settings::i()->changeValues( array( 'ads_exist' => 1 ) );
foreach ( $select as $ad )
{
@@ -62,14 +62,14 @@ class _Upgrade
switch ( \IPS\Settings::i()->nexus_sout_from )
{
case 0:
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => 'staff' ), array( 'conf_key=?', 'nexus_sout_from' ) );
\IPS\Settings::i()->changeValues( array( 'nexus_sout_from' => 'staff' ) );
break;
case 1:
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => 'dpt' ), array( 'conf_key=?', 'nexus_sout_from' ) );
\IPS\Settings::i()->changeValues( array( 'nexus_sout_from' => 'dpt' ) );
break;
}
unset( \IPS\Data\Store::i()->settings );
\IPS\Settings::i()->clearCache();
return TRUE;
}
+20 -11
View File
@@ -30,19 +30,11 @@ class _Upgrade
*/
public function step1()
{
foreach ( array(
\IPS\Settings::i()->changeValues( array(
'card_storage_gateways' => count( \IPS\nexus\Gateway::cardStorageGateways() ),
'donation_goals' => count( \IPS\nexus\Donation\Goal::roots() ),
'customer_fields' => count( \IPS\nexus\Customer\CustomField::roots() )
) as $k => $v )
{
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => $v ), array( 'conf_key=?', $k ) );
\IPS\Settings::i()->$k = $v;
}
unset( \IPS\Data\Store::i()->settings );
) );
return TRUE;
}
@@ -188,8 +180,25 @@ class _Upgrade
{
if ( !isset( $value['min'] ) )
{
switch( $row['s_type'] )
{
// Number of items
default:
case 'q':
$min = (int) $value['value'];
break;
// Invoice subtotal
case 't':
$min = array( \IPS\Settings::i()->nexus_currency => floatval( $value['value'] ) );
break;
// Total weight of items
case 'w':
$min = floatval( $value['value'] );
break;
}
$decoded[ $k ] = array(
'min' => array( \IPS\Settings::i()->nexus_currency => floatval( $value['value'] ) ),
'min' => $min,
'max' => isset( $decoded[ $k + 1 ] ) ? array( \IPS\Settings::i()->nexus_currency => floatval( $decoded[ $k + 1 ]['value'] ) ) : '*',
'price' => array( \IPS\Settings::i()->nexus_currency => floatval( $value['cost'] ) )
);
@@ -95,16 +95,7 @@ class _Upgrade
*/
public function step2()
{
foreach ( array(
'billing_agreement_gateways' => count( \IPS\nexus\Gateway::billingAgreementGateways() ),
) as $k => $v )
{
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => $v ), array( 'conf_key=?', $k ) );
\IPS\Settings::i()->$k = $v;
}
unset( \IPS\Data\Store::i()->settings );
\IPS\Settings::i()->changeValues( array( 'billing_agreement_gateways' => count( \IPS\nexus\Gateway::billingAgreementGateways() ) ) );
return TRUE;
}
}
@@ -75,4 +75,39 @@ class _Upgrade
{
return "Adjusting customer custom field definitions";
}
/**
* Fix a possible missing column; Clients upgrading from IPB3.1 could be missing this column
*
* @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()
{
if ( !\IPS\Db::i()->checkForColumn( 'core_members', 'cm_return_group' ) )
{
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array( array(
'table' => 'core_members',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "core_members ADD COLUMN cm_return_group SMALLINT(3) NOT NULL DEFAULT 0;"
) ) );
if ( count( $toRun ) )
{
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'nexus', 'extra' => array( '_upgradeStep' => 3 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ) );
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Fixing members table structure";
}
}
@@ -0,0 +1,39 @@
<?php
/**
* @brief 4.2.0 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 Commerce
* @since 03 Aug 2017
*/
namespace IPS\nexus\setup\upg_101100;
/* 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.0 Beta 1 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()
{
/* Move customer history to member history */
\IPS\Task::queue( 'nexus', 'MoveCustomerHistory', array(), 3 );
return TRUE;
}
}
@@ -0,0 +1,43 @@
<?php
/**
* @brief 4.2.3 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 Commerce
* @since 31 Jul 2017
*/
namespace IPS\nexus\setup\upg_102010;
/* 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.3 Upgrade Code
*/
class _Upgrade
{
/**
* Repair Custom Field URLs
*
* @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()
{
$support = new \IPS\nexus\extensions\core\FileStorage\Support;
\IPS\Task::queue( 'core', 'RepairFileUrls', array( 'storageExtension' => 'filestorage__nexus_Support', 'count' => $support->count() ), 1 );
$purchase = new \IPS\nexus\extensions\core\FileStorage\PurchaseFields;
\IPS\Task::queue( 'core', 'RepairFileUrls', array( 'storageExtension' => 'filestorage__nexus_PurchaseFields', 'count' => $purchase->count() ), 1 );
$customer = new \IPS\nexus\extensions\core\FileStorage\Customer;
\IPS\Task::queue( 'core', 'RepairFileUrls', array( 'storageExtension' => 'filestorage__nexus_Customer', 'count' => $customer->count() ), 1 );
return TRUE;
}
}
@@ -0,0 +1,856 @@
{
"1": {
"method": "addColumn",
"params": [
"nexus_packages",
{
"name": "p_email_purchase",
"type": "MEDIUMTEXT",
"length": null,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "Email to send on new purchase",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "addColumn",
"params": [
"nexus_packages",
{
"name": "p_email_expire_soon",
"type": "MEDIUMTEXT",
"length": null,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "Email to send when purchase will expire soon",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"3": {
"method": "addColumn",
"params": [
"nexus_packages",
{
"name": "p_email_expire",
"type": "MEDIUMTEXT",
"length": null,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "Email to send when purchase expires",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"4": {
"method": "addColumn",
"params": [
"nexus_packages",
{
"name": "p_email_purchase_type",
"type": "VARCHAR",
"length": 16,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"5": {
"method": "addColumn",
"params": [
"nexus_packages",
{
"name": "p_email_expire_soon_type",
"type": "VARCHAR",
"length": 16,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"6": {
"method": "addColumn",
"params": [
"nexus_packages",
{
"name": "p_email_expire_type",
"type": "VARCHAR",
"length": 16,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"7": {
"method": "delete",
"params": [
"core_sys_conf_settings",
[
"conf_key=?",
"nexus_https"
]
]
},
"8": {
"method": "delete",
"params": [
"core_sys_lang_words",
[
"word_app=? AND ( word_key IN ( 'nexus_https', 'nexus_https_desc', 'nexus_https_err' ) )",
"nexus"
]
]
},
"9": {
"method": "addColumn",
"params": [
"nexus_packages",
{
"name": "p_date_updated",
"type": "INT",
"length": 10,
"decimals": null,
"values": null,
"allow_null": true,
"default": "",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"10": {
"method": "update",
"params": [
"nexus_packages",
"p_date_updated=p_date_added"
]
},
"11": {
"method": "addColumn",
"params": [
"nexus_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
}
]
},
"12": {
"method": "addColumn",
"params": [
"nexus_purchases",
{
"name": "ps_fee",
"type": "DECIMAL",
"length": 20,
"decimals": 2,
"values": null,
"allow_null": true,
"default": null,
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"13": {
"method": "delete",
"params": [
"core_sys_lang_words",
[
"word_app=? AND word_key=?",
"nexus",
"support"
]
]
},
"14": {
"method": "createTable",
"params": [
{
"name": "nexus_member_subscription_packages",
"columns": {
"sp_id": {
"allow_null": false,
"auto_increment": true,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 10,
"name": "sp_id",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sp_enabled": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "1",
"length": 1,
"name": "sp_enabled",
"type": "TINYINT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sp_tax": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 5,
"name": "sp_tax",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sp_gateways": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 0,
"name": "sp_gateways",
"type": "TEXT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sp_price": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 0,
"name": "sp_price",
"type": "TEXT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sp_primary_group": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "sp_primary_group",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sp_secondary_group": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 0,
"name": "sp_secondary_group",
"type": "TEXT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sp_position": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "sp_position",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sp_renew_options": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 0,
"name": "sp_renew_options",
"type": "TEXT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sp_reg_show": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 1,
"name": "sp_reg_show",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sp_featured": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 1,
"name": "sp_featured",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sp_count_active": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "sp_count_active",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sp_count_inactive": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "sp_count_inactive",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sp_return_primary": {
"name": "sp_return_primary",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": null,
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"sp_image": {
"name": "sp_image",
"type": "TEXT",
"length": null,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"length": [
null
],
"columns": [
"sp_id"
]
},
"sp_enabled": {
"type": "key",
"name": "sp_enabled",
"length": [
null
],
"columns": [
"sp_enabled"
]
}
},
"collation": "utf8_general_ci",
"engine": "InnoDB"
}
]
},
"15": {
"method": "createTable",
"params": [
{
"name": "nexus_member_subscriptions",
"columns": {
"sub_id": {
"allow_null": false,
"auto_increment": true,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 10,
"name": "sub_id",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sub_member_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 20,
"name": "sub_member_id",
"type": "BIGINT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sub_active": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 1,
"name": "sub_active",
"type": "TINYINT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sub_cancelled": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 1,
"name": "sub_cancelled",
"type": "TINYINT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sub_start": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "sub_start",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sub_expire": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "sub_expire",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"sub_package_id": {
"name": "sub_package_id",
"type": "INT",
"length": 10,
"decimals": null,
"values": null,
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"sub_previous_group": {
"name": "sub_previous_group",
"type": "INT",
"length": 10,
"decimals": null,
"values": null,
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"sub_previous_secondary_groups": {
"name": "sub_previous_secondary_groups",
"type": "TEXT",
"length": null,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"sub_renews": {
"name": "sub_renews",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": null,
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"sub_invoice_id": {
"name": "sub_invoice_id",
"type": "BIGINT",
"length": 20,
"decimals": null,
"values": null,
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"sub_purchase_id": {
"name": "sub_purchase_id",
"type": "BIGINT",
"length": 20,
"decimals": null,
"values": null,
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"sub_added_manually": {
"name": "sub_added_manually",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": null,
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"length": [
null
],
"columns": [
"sub_id"
]
},
"sub_active": {
"type": "key",
"name": "sub_active",
"length": [
null
],
"columns": [
"sub_active"
]
},
"sub_cancelled": {
"type": "key",
"name": "sub_cancelled",
"length": [
null
],
"columns": [
"sub_cancelled"
]
},
"sub_expire": {
"type": "key",
"name": "sub_expire",
"length": [
null
],
"columns": [
"sub_expire"
]
},
"member_sub_id": {
"type": "key",
"name": "member_sub_id",
"columns": [
"sub_member_id",
"sub_package_id"
],
"length": [
null,
null
]
}
},
"collation": "utf8_general_ci",
"engine": "InnoDB"
}
]
},
"16": {
"method": "changeColumn",
"params": [
"nexus_support_requests",
"r_status",
{
"name": "r_status",
"type": "INT",
"length": 5,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"17": {
"method": "addIndex",
"params": [
"nexus_packages",
{
"type": "key",
"name": "p_group",
"columns": [
"p_group"
],
"length": [
null
]
}
]
},
"18": {
"method": "addIndex",
"params": [
"nexus_support_requests",
{
"type": "key",
"name": "status_and_department",
"columns": [
"r_status",
"r_department"
],
"length": [
null,
null
]
}
]
},
"19": {
"method": "addIndex",
"params": [
"nexus_alternate_contacts",
{
"type": "key",
"name": "alt_id",
"columns": [
"alt_id"
],
"length": [
null
]
}
]
},
"20": {
"method": "changeIndex",
"params": [
"nexus_support_replies",
"reply_request",
{
"type": "key",
"name": "reply_request",
"columns": [
"reply_request",
"reply_hidden",
"reply_date"
],
"length": [
null,
null,
null
]
}
]
},
"21": {
"method": "addIndex",
"params": [
"nexus_support_tracker",
{
"type": "key",
"name": "notifications",
"columns": [
"request_id",
"notify"
],
"length": [
null,
null
]
}
]
},
"22": {
"method": "addIndex",
"params": [
"nexus_support_statuses",
{
"type": "key",
"name": "member_default",
"columns": [
"status_default_member"
],
"length": [
null
]
}
]
},
"23": {
"method": "addIndex",
"params": [
"nexus_payouts",
{
"type": "key",
"name": "po_member",
"columns": [
"po_member",
"po_date"
],
"length": [
null,
null
]
}
]
}
}
@@ -0,0 +1,87 @@
<?php
/**
* @brief 4.3.0 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 Nexus
* @since 28 Dec 2017
*/
namespace IPS\nexus\setup\upg_103000;
/* 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.3.0 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Index products
*
* @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\Task::queue( 'core', 'RebuildSearchIndex', array( 'class' => 'IPS\nexus\Package\Item' ), 5 );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return 'Adding products to search index';
}
/**
* Store certain informaiton in settings to ease performance on menu
*
* @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()
{
$counts = array();
foreach ( \IPS\nexus\Gateway::roots() as $gateway )
{
if ( !isset( $counts[ $gateway->gateway ] ) )
{
$counts[ $gateway->gateway ] = 0;
}
$counts[ $gateway->gateway ]++;
}
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => json_encode( $counts ) ), array( 'conf_key=?', 'gateways_counts' ) );
\IPS\Settings::i()->gateways_counts = json_encode( $counts );
unset( \IPS\Data\Store::i()->settings );
return TRUE;
}
/**
* Add the subscriptions menu item
*
* @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 step3()
{
\IPS\core\FrontNavigation::insertMenuItem( NULL, array( 'app' => 'nexus', 'key' => 'Subscriptions' ), \IPS\Db::i()->select( 'MAX(position)', 'core_menu' )->first() );
return TRUE;
}
}
@@ -0,0 +1,22 @@
{
"1": {
"method": "addColumn",
"params": [
"nexus_support_departments",
{
"name": "dpt_subscriptions",
"type": "TEXT",
"length": null,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,74 @@
<?php
/**
* @brief 4.3.0 Beta 3 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 Commerce
* @since 28 Mar 2018
*/
namespace IPS\nexus\setup\upg_103003;
/* 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.3.0 Beta 3 Upgrade Code
*/
class _Upgrade
{
/**
* Clean up orphaned Commerce packages from 3.x
*
* @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()
{
/* Do we even need to do this? */
$count = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_packages', array( "p_group!=? AND " . \IPS\Db::i()->in( 'p_group', iterator_to_array( \IPS\Db::i()->select( 'pg_id', 'nexus_package_groups' ) ), TRUE ), 0 ) )->first();
if ( $count )
{
/* Create a new group */
try
{
$position = (int) \IPS\Db::i()->select( 'MAX(pg_position)', 'nexus_package_groups' )->first();
$position++;
}
catch( \Exception $e )
{
/* Technically shouldn't happen but... */
$position = 1;
}
$group = new \IPS\nexus\Package\Group;
$group->position = $position;
$group->save();
\IPS\Lang::saveCustom( 'nexus', "nexus_pgroup_{$group->id}", "Products" );
foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'nexus_packages', array( "p_group!=? AND " . \IPS\Db::i()->in( 'p_group', iterator_to_array( \IPS\Db::i()->select( 'pg_id', 'nexus_package_groups' ) ), TRUE ), 0 ) ), 'IPS\nexus\Package' ) AS $pkg )
{
$pkg->group = $group->id;
$pkg->save();
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return 'Cleaning up orphaned Commerce packages';
}
}
@@ -0,0 +1,18 @@
{
"1": {
"method": "addIndex",
"params": [
"nexus_support_replies",
{
"type": "key",
"name": "reply_member",
"columns": [
"reply_member"
],
"length": [
null
]
}
]
}
}
@@ -325,7 +325,7 @@ class _Upgrade
$transFee = array();
$transFee[ \IPS\Settings::i()->nexus_currency ] = array( 'amount' => \IPS\Settings::i()->idm_nexus_transfee, 'currency' => \IPS\Settings::i()->nexus_currency );
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => json_encode( $transFee ) ), array( 'conf_key=?', 'idm_nexus_transfee' ) );
\IPS\Settings::i()->changeValues( array( 'idm_nexus_transfee' => json_encode( $transFee ) ) );
}
return TRUE;
@@ -425,7 +425,6 @@ class _Upgrade
\IPS\Lang::saveCustom( 'nexus', 'nexus_tax_explain_val', \IPS\Text\Parser::parseStatic( \IPS\Settings::i()->nexus_tax_explain, TRUE, NULL, NULL, TRUE, TRUE, TRUE ) );
\IPS\Db::i()->delete( 'core_sys_conf_settings', "conf_key IN( 'network_status_text_val', 'nexus_com_rules_val', 'nexus_tax_explain_val', 'nexus_ca_home' )" );
unset( \IPS\Data\Store::i()->settings );
return TRUE;
}
@@ -593,8 +592,10 @@ class _Upgrade
{
\IPS\Lang::saveCustom( 'nexus', "nexus_package_{$row['p_id']}", $row['p_name'] );
\IPS\Lang::saveCustom( 'nexus', "nexus_package_{$row['p_id']}_assoc", $row['p_assoc_error'] );
\IPS\Lang::saveCustom( 'nexus', "nexus_package_{$row['p_id']}_desc", \IPS\Text\Parser::parseStatic( $row['p_desc'], TRUE, NULL, NULL, TRUE, TRUE, TRUE ) );
\IPS\Lang::saveCustom( 'nexus', "nexus_package_{$row['p_id']}_page", \IPS\Text\Parser::parseStatic( $row['p_page'], TRUE, NULL, NULL, TRUE, TRUE, TRUE ) );
/* Previously, we were passing these values through \IPS\Text\LegacyParser::parseStatic(), however this is *also* done as a part of rebuildNonContentPosts for nexus_Admin, so they have been removed from here */
\IPS\Lang::saveCustom( 'nexus', "nexus_package_{$row['p_id']}_desc", $row['p_desc'] );
\IPS\Lang::saveCustom( 'nexus', "nexus_package_{$row['p_id']}_page", $row['p_page'] );
$renewOptions = \unserialize( $row['p_renew_options'] );
if( is_array( $renewOptions ) AND count( $renewOptions ) )