Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

@@ -2,9 +2,9 @@
/**
* @brief Purchases
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @subpackage Nexus
* @since 06 May 2014
* @version SVN_VERSION_NUMBER
@@ -38,7 +38,7 @@ class _purchases extends \IPS\Dispatcher\Controller
if ( mb_strtolower( $_SERVER['REQUEST_METHOD'] ) == 'get' and \IPS\Settings::i()->nexus_https and \IPS\Request::i()->url()->data['scheme'] !== 'https' )
{
\IPS\Output::i()->redirect( new \IPS\Http\Url( preg_replace( '/^http:/', 'https:', \IPS\Request::i()->url() ) ) );
\IPS\Output::i()->redirect( \IPS\Request::i()->url()->setScheme('https') );
}
/* Purchases breadcrumb */
@@ -182,7 +182,7 @@ class _purchases extends \IPS\Dispatcher\Controller
$form->add( new \IPS\Helpers\Form\Number( 'renew_for', 1, TRUE, array( 'min' => 1, 'max' => $cycles === TRUE ? NULL : $cycles ), NULL, NULL, $suffix ) );
if( $values = $form->values() or $cycles === 1 )
{
if ( $pendingInvoice = $this->purchase->invoice_pending )
if ( $pendingInvoice = $this->purchase->invoice_pending and $pendingInvoice->status === $pendingInvoice::STATUS_PENDING )
{
if ( count( $pendingInvoice->items ) === 1 )
{
@@ -231,6 +231,15 @@ class _purchases extends \IPS\Dispatcher\Controller
$this->purchase->member->log( 'purchase', array( 'type' => 'info', 'id' => $this->purchase->id, 'name' => $this->purchase->name, 'info' => 'remove_renewals' ) );
/* If we have a pending renewal invoice, cancel it (as at this point, we need to reactivate instead) */
if ( $this->purchase->invoice_pending )
{
$this->purchase->invoice_pending->status = \IPS\nexus\Invoice::STATUS_CANCELED; # The constant has a typo and it make me sad
$this->purchase->invoice_pending->save();
$this->purchase->invoice_pending = NULL;
}
$this->purchase->renewals = NULL;
$this->purchase->can_reactivate = TRUE;
$this->purchase->save();