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

@@ -96,6 +96,13 @@ class _billingagreements extends \IPS\Dispatcher\Controller
{
if ( $billingAgreement->status() == $billingAgreement::STATUS_ACTIVE )
{
\IPS\Output::i()->sidebar['actions']['refresh'] = array(
'icon' => 'refresh',
'title' => 'billing_agreement_check',
'link' => $billingAgreement->acpUrl()->setQueryString( array( 'do' => 'act', 'act' => 'refresh' ) )->csrf(),
'data' => array( 'confirm' => '' )
);
\IPS\Output::i()->sidebar['actions']['suspend'] = array(
'icon' => 'times',
'title' => 'billing_agreement_suspend',
@@ -184,7 +191,7 @@ class _billingagreements extends \IPS\Dispatcher\Controller
/* Check act */
$act = \IPS\Request::i()->act;
if ( !\in_array( $act, array( 'suspend', 'reactivate', 'cancel' ) ) )
if ( !\in_array( $act, array( 'suspend', 'reactivate', 'cancel', 'refresh' ) ) )
{
\IPS\Output::i()->error( 'node_error', '3X320/8', 403, '' );
}
@@ -1368,6 +1368,39 @@ class _invoices extends \IPS\Dispatcher\Controller
\IPS\Output::i()->output = $form;
}
/**
* Track
*
* @return void
*/
protected function track()
{
\IPS\Session::i()->csrfCheck();
try
{
$invoice = \IPS\nexus\Invoice::load( \IPS\Request::i()->id );
if ( \IPS\Request::i()->track )
{
\IPS\Db::i()->insert( 'nexus_invoice_tracker', array(
'member_id' => \IPS\Member::loggedIn()->member_id,
'invoice_id' => $invoice->id
), TRUE );
}
else
{
\IPS\Db::i()->delete( 'nexus_invoice_tracker', array( 'member_id=? AND invoice_id=?', \IPS\Member::loggedIn()->member_id, $invoice->id ) );
}
$this->_redirect( $invoice );
}
catch ( \OutOfRangeException $e )
{
\IPS\Output::i()->error( 'node_error', '2X190/G', 404, '' );
}
}
/**
* Redirect
*
@@ -72,11 +72,16 @@ class _payouts extends \IPS\Dispatcher\Controller
$classname = \IPS\nexus\Gateway::payoutGateways()[ $gateway ];
if ( class_exists( $classname ) and method_exists( $classname, 'massProcess' ) )
{
\IPS\Output::i()->sidebar['actions'][] = array(
\IPS\Output::i()->sidebar['actions'][] = [
'icon' => 'check',
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'account_credit_mass_payout', TRUE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->addToStack( 'payout__admin_' . $gateway ) ) ) ),
'link' => \IPS\Http\Url::internal( 'app=nexus&module=payments&controller=payouts&do=massprocess&gateway=' . $gateway )->csrf()
);
'link' => \IPS\Http\Url::internal( 'app=nexus&module=payments&controller=payouts&do=massprocess&gateway=' . $gateway )->csrf(),
'data' => [
'confirm' => '',
'confirmMessage' => \IPS\Member::loggedIn()->language()->addToStack( 'nexus_payout_confirm_title' ),
'confirmSubMessage' => \IPS\Member::loggedIn()->language()->addToStack( 'nexus_payout_confirm_text' )
]
];
}
}
}
@@ -156,7 +161,7 @@ class _payouts extends \IPS\Dispatcher\Controller
protected function massprocess()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'payouts_process' );
\IPS\Session::i()->csrfCheck();
\IPS\Request::i()->confirmedDelete( 'nexus_payout_confirm_title', 'nexus_payout_confirm_text', 'nexus_payout_proceed' );
$classname = \IPS\nexus\Gateway::payoutGateways()[ \IPS\Request::i()->gateway ];
if ( !class_exists( $classname ) or !method_exists( $classname, 'massProcess' ) )
@@ -301,7 +306,7 @@ class _payouts extends \IPS\Dispatcher\Controller
$form = new \IPS\Helpers\Form;
$form->addMessage('payout_description');
$form->addHeader('commission_settings');
$form->add( new \IPS\Helpers\Form\Select( 'nexus_no_commission', explode( ',', \IPS\Settings::i()->nexus_no_commission ), FALSE, array( 'multiple' => TRUE, 'options' => $groups ) ) );
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'nexus_no_commission', explode( ',', \IPS\Settings::i()->nexus_no_commission ), FALSE, array( 'multiple' => TRUE, 'options' => $groups ) ) );
$form->addHeader('withdrawal_methods');
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'nexus_payout', $settings, FALSE, array( 'options' => $options, 'toggles' => $toggles ) ) );
foreach ( $fields as $field )
@@ -319,10 +324,13 @@ class _payouts extends \IPS\Dispatcher\Controller
} ), NULL, NULL, NULL, 'nexus_payout_maximum' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'nexus_payout_approve', \IPS\Settings::i()->nexus_payout_approve, FALSE, array(), NULL, NULL, NULL, 'nexus_payout_approve' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'nexus_payout_unlimited_times', \IPS\Settings::i()->nexus_payout_unlimited_times, TRUE ) );
$form->addHeader('topup_settings');
$form->add( new \IPS\Helpers\Form\YesNo( 'allow_topups', \IPS\Settings::i()->nexus_min_topup, FALSE, array( 'togglesOn' => array( 'nexus_min_topup', 'nexus_max_credit' ) ) ) );
$form->add( new \IPS\nexus\Form\Money( 'nexus_min_topup', \IPS\Settings::i()->nexus_min_topup ?: '*', FALSE, array( 'unlimitedLang' => 'no_restriction' ), NULL, NULL, NULL, 'nexus_min_topup' ) );
$form->add( new \IPS\nexus\Form\Money( 'nexus_max_credit', \IPS\Settings::i()->nexus_max_credit ?: '*', FALSE, array( 'unlimitedLang' => 'no_restriction' ), NULL, NULL, NULL, 'nexus_max_credit' ) );
if ( $values = $form->values() )
{
$payoutSettings = array();
@@ -65,7 +65,7 @@ class _shippingrates extends \IPS\Node\Controller
* @param string $lastUsedTab The tab last used in the form
* @return void
*/
protected function _afterSave( \IPS\Node\Model $old = NULL, \IPS\Node\Model $new, $lastUsedTab = FALSE )
protected function _afterSave( ?\IPS\Node\Model $old, \IPS\Node\Model $new, $lastUsedTab = FALSE )
{
$haveNoLowerLimit = FALSE;
$haveNoUpperLimit = FALSE;