Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

@@ -35,6 +35,7 @@ class _addresses extends \IPS\Dispatcher\Controller
\IPS\Output::i()->error( 'no_module_permission_guest', '2X235/1', 403, '' );
}
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'global_forms.js', 'nexus', 'global' ) );
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'clients.css', 'nexus' ) );
\IPS\Output::i()->breadcrumb[] = array( \IPS\Http\Url::internal( 'app=nexus&module=clients&controller=addresses', 'front', 'clientsaddresses' ), \IPS\Member::loggedIn()->language()->addToStack('client_addresses') );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('client_addresses');
@@ -79,6 +79,18 @@ class _credit extends \IPS\Dispatcher\Controller
$perPage
);
$pastWithdrawals = new \IPS\Patterns\ActiveRecordIterator( $pastWithdrawalsSelect, 'IPS\nexus\Payout' );
$activePayouts = [];
if( !\IPS\Settings::i()->nexus_payout_unlimited_times )
{
foreach ( $pastWithdrawals as $payout )
{
if ( $payout->status == \IPS\nexus\Payout::STATUS_PENDING )
{
$activePayouts[ $payout->currency ] = TRUE;
}
}
}
/* Can we withdraw? */
$canWithdraw = FALSE;
@@ -87,7 +99,7 @@ class _credit extends \IPS\Dispatcher\Controller
{
foreach ( \IPS\nexus\Money::currencies() as $currency )
{
if ( isset( $balance[ $currency ] ) and $balance[ $currency ]->amount->isGreaterThanZero() )
if ( isset( $balance[ $currency ] ) and $balance[ $currency ]->amount->isGreaterThanZero() and !isset( $activePayouts[ $currency ] ) )
{
$canWithdraw = TRUE;
}
@@ -130,6 +142,7 @@ class _credit extends \IPS\Dispatcher\Controller
*/
protected function withdraw()
{
$activeWithdrawals = \IPS\Settings::i()->nexus_payout_unlimited_times ? [] : iterator_to_array( \IPS\Db::i()->select( 'po_currency', 'nexus_payouts', array( 'po_status=? AND po_member=?', \IPS\nexus\Payout::STATUS_PENDING, \IPS\nexus\Customer::loggedIn()->member_id ) ) );
$withdrawForm = NULL;
$withdrawOptions = json_decode( \IPS\Settings::i()->nexus_payout, TRUE );
if ( isset( $withdrawOptions['Stripe'] ) )
@@ -154,7 +167,7 @@ class _credit extends \IPS\Dispatcher\Controller
$currencyToggles = array();
foreach ( \IPS\nexus\Money::currencies() as $currency )
{
if ( isset( $balance[ $currency ] ) )
if ( isset( $balance[ $currency ] ) AND !\in_array( $currency, $activeWithdrawals ) )
{
$currencyOptions[ $currency ] = $currency;
$currencyToggles[ $currency ] = array( 'withdraw_amount_' . $currency );
@@ -163,11 +176,11 @@ class _credit extends \IPS\Dispatcher\Controller
$withdrawForm->add( new \IPS\Helpers\Form\Radio( 'withdraw_currency', NULL, TRUE, array( 'options' => $currencyOptions, 'toggles' => $currencyToggles ) ) );
}
$canWithdraw = FALSE;
foreach ( \IPS\nexus\Money::currencies() as $currency )
{
if ( !isset( $balance[ $currency ] ) )
if ( !isset( $balance[ $currency ] ) OR ( !\IPS\Settings::i()->nexus_payout_unlimited_times AND \in_array( $currency, $activeWithdrawals ) ) )
{
continue;
}
@@ -177,10 +190,10 @@ class _credit extends \IPS\Dispatcher\Controller
/* Default 'max' is our balance */
$max = (string) $balance[ $currency ]->amount;
/* Do we have a maximum withdrawl amount set up? */
/* Do we have a maximum withdrawal amount set up? */
if( $maximumWithdrawalsAmounts AND $maximumWithdrawalsAmounts[ $currency ] )
{
/* If our maximum withdrawl amount is less than our balance, then the max we can withdraw is that */
/* If our maximum withdrawal amount is less than our balance, then the max we can withdraw is that */
$upperLimit = $maximumWithdrawalsAmounts[ $currency ];
/* Determine our date cutoff */
@@ -46,7 +46,13 @@ class _donations extends \IPS\Dispatcher\Controller
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('client_donations');
\IPS\Output::i()->sidebar['enabled'] = FALSE;
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'donations.css' ) );
/* "Nowt 'ere lad, may as well knock it over tut 404" - Marc */
if( \count( \IPS\nexus\Donation\Goal::roots() ) === 0 )
{
\IPS\Output::i()->error( 'nexus_no_donations_found', '1X238/2', 404, '' );
}
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('clients')->donations();
}
@@ -0,0 +1,36 @@
<?php
/**
* @brief Legacy Referrals Controller
* @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 10 Sep 2020
*/
namespace IPS\nexus\modules\front\clients;
/* 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;
}
/**
* Legacy Referrals Controller
*/
class _referrals extends \IPS\Dispatcher\Controller
{
/**
* Manage
*
* @return void
*/
protected function manage()
{
/* Referrals have moved to the core. */
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=system&controller=settings&area=referrals", 'front', 'settings_referrals' ) );
}
}