Version 4.7.13
This commit is contained in:
1 parent
fd22d99e69
commit
7124a02564
954 files changed
+29277
-59308
No files matched your search
@@ -405,7 +405,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
if( $qanda )
|
||||
{
|
||||
$question = \IPS\Db::i()->select( '*', 'core_question_and_answer', array( 'qa_id=?', $qanda ) )->first();
|
||||
$answers = json_decode( $question['qa_answers'] );
|
||||
$answers = json_decode( $question['qa_answers'], true );
|
||||
|
||||
if( \count( $answers ) )
|
||||
{
|
||||
@@ -1248,26 +1248,44 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
$term = $item->renewalTerm;
|
||||
$dueDate = \IPS\DateTime::create()->add( $item->initialInterval ?: $term->interval );
|
||||
}
|
||||
|
||||
|
||||
if ( $term )
|
||||
{
|
||||
$format = $item->groupWithParent ? 'grouped' : $term->interval->format('%d/%m/%y') . '/' . $term->cost->currency . '/' . ( $term->tax ? $term->tax->id : '0' );
|
||||
|
||||
$clonedItem = clone $item;
|
||||
$showDueDate = true;
|
||||
if ( $item instanceof \IPS\nexus\Invoice\Item\Renewal ) // If they are renewing for more than one cycle now, that's fine, but subsequently they will be moved back to the normal terms
|
||||
{
|
||||
$clonedItem->quantity = 1;
|
||||
}
|
||||
|
||||
/* If there are different expiration dates then we want to display things a little differently */
|
||||
if( isset( $item->initialInterval ) AND $item->initialInterval instanceof \DateInterval )
|
||||
{
|
||||
$clonedItem->expireDate = \IPS\DateTime::create()->add( $item->initialInterval );
|
||||
$showDueDate = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$clonedItem->expireDate = \IPS\DateTime::create()->add( $term->interval );
|
||||
}
|
||||
|
||||
if ( isset( $recurrings[ $format ] ) )
|
||||
{
|
||||
$recurrings[ $format ]['items'][] = $clonedItem;
|
||||
}
|
||||
else
|
||||
{
|
||||
$recurrings[ $format ] = array( 'items' => array( $clonedItem ), 'term' => new \IPS\nexus\Purchase\RenewalTerm( new \IPS\nexus\Money( 0, $term->cost->currency ), $term->interval, $term->tax ) );
|
||||
$recurrings[ $format ] = array( 'items' => array( $clonedItem ), 'term' => new \IPS\nexus\Purchase\RenewalTerm( new \IPS\nexus\Money( 0, $term->cost->currency ), $term->interval, $term->tax ), 'showDueDate' => true );
|
||||
}
|
||||
|
||||
$recurrings[ $format ]['term']->cost->amount = $recurrings[ $format ]['term']->cost->amount->add( $term->cost->amount->multiply( new \IPS\Math\Number( "{$clonedItem->quantity}" ) ) );
|
||||
$recurrings[ $format ]['dueDate'] = $dueDate;
|
||||
if( !$showDueDate )
|
||||
{
|
||||
$recurrings[ $format ]['showDueDate'] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Network Status
|
||||
* @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 11 Sep 2014
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Network Status
|
||||
*/
|
||||
class _networkStatus extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* View
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
if ( !\IPS\Settings::i()->network_status )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '2X246/1', 403, '' );
|
||||
}
|
||||
|
||||
if ( \IPS\Settings::i()->network_status == 2 )
|
||||
{
|
||||
$servers = \IPS\nexus\Hosting\Server::roots( NULL, NULL, array( 'server_monitor<>?', '' ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$servers = \IPS\nexus\Hosting\Server::roots( NULL, NULL, array( 'server_monitor<>? AND server_monitor_fails>0', '' ) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('network_status');
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('clients')->networkStatus( $servers );
|
||||
|
||||
unset( \IPS\Output::i()->breadcrumb['module'] );
|
||||
\IPS\Output::i()->breadcrumb[] = array( NULL, \IPS\Member::loggedIn()->language()->addToStack('network_status') );
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,11 @@ class _gifts extends \IPS\Dispatcher\Controller
|
||||
/* Handle submissions */
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
if( ! abs( $values['gift_voucher_amount'] ) )
|
||||
if( ! \is_numeric( $values['gift_voucher_amount'] ) )
|
||||
{
|
||||
$form->error = \IPS\Member::loggedIn()->language()->addToStack( 'gift_voucher_invalid_value' );
|
||||
}
|
||||
elseif( ! abs( $values['gift_voucher_amount'] ) )
|
||||
{
|
||||
$form->error = \IPS\Member::loggedIn()->language()->addToStack( 'gift_voucher_invalid_amount' );
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ class _product extends \IPS\Content\Controller
|
||||
{
|
||||
try
|
||||
{
|
||||
$shipAddress = \IPS\GeoLocation::getByIp( \IPS\Request::i()->ipAddress() );
|
||||
$shipAddress = \IPS\GeoLocation::getRequesterLocation();
|
||||
$locationType = 'geo';
|
||||
}
|
||||
catch ( \Exception $e ) { }
|
||||
|
||||
@@ -277,7 +277,15 @@ class _subscriptions extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Set renewal terms */
|
||||
$currency = $purchase->original_invoice->currency;
|
||||
try
|
||||
{
|
||||
$currency = $purchase->original_invoice->currency;
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
$currency = $purchase->member->defaultCurrency();
|
||||
}
|
||||
|
||||
$purchase->renewals = $package->renewalTerm( $currency );
|
||||
$purchase->cancelled = FALSE;
|
||||
$purchase->save();
|
||||
|
||||
Reference in new issue
Block a user