Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Advertisement Package
|
||||
* @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 29 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -174,11 +174,12 @@ class _Ad extends \IPS\nexus\Package
|
||||
/**
|
||||
* Update existing purchases
|
||||
*
|
||||
* @param \IPS\nexus\Purchase $purchase The purchase
|
||||
* @param array $changes The old values
|
||||
* @param \IPS\nexus\Purchase $purchase The purchase
|
||||
* @param array $changes The old values
|
||||
* @param bool $cancelBillingAgreementIfNecessary If making changes to renewal terms, TRUE will cancel associated billing agreements. FALSE will skip that change
|
||||
* @return void
|
||||
*/
|
||||
public function updatePurchase( \IPS\nexus\Purchase $purchase, $changes )
|
||||
public function updatePurchase( \IPS\nexus\Purchase $purchase, $changes, $cancelBillingAgreementIfNecessary=FALSE )
|
||||
{
|
||||
if ( $purchase->extra['ad'] )
|
||||
{
|
||||
@@ -188,7 +189,7 @@ class _Ad extends \IPS\nexus\Package
|
||||
}
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
return parent::updatePurchase( $purchase, $changes );
|
||||
return parent::updatePurchase( $purchase, $changes, $cancelBillingAgreementIfNecessary );
|
||||
}
|
||||
|
||||
$update = array();
|
||||
@@ -224,7 +225,7 @@ class _Ad extends \IPS\nexus\Package
|
||||
}
|
||||
}
|
||||
|
||||
return parent::updatePurchase( $purchase, $changes );
|
||||
return parent::updatePurchase( $purchase, $changes, $cancelBillingAgreementIfNecessary );
|
||||
}
|
||||
|
||||
/* !Store */
|
||||
@@ -253,7 +254,12 @@ class _Ad extends \IPS\nexus\Package
|
||||
$maxDims['maxHeight'] = $this->max_height;
|
||||
}
|
||||
}
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'advertisement_image', NULL, TRUE, array( 'storageExtension' => 'nexus_Ads', 'image' => $maxDims ) ) );
|
||||
|
||||
if ( !isset( \IPS\Request::i()->stockCheck ) ) // The stock check will attempt to save the upload which we don't want to do until the form is actually submitted
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'advertisement_image', NULL, TRUE, array( 'storageExtension' => 'nexus_Ads', 'image' => $maxDims ) ) );
|
||||
}
|
||||
|
||||
if ( $this->max_height and $this->max_width )
|
||||
{
|
||||
\IPS\Member::loggedIn()->language()->words['advertisement_image_desc'] = \IPS\Member::loggedIn()->language()->addToStack( 'advertisement_image_max_wh', FALSE, array( 'sprintf' => array( $this->max_width, $this->max_height ) ) );
|
||||
@@ -444,6 +450,8 @@ class _Ad extends \IPS\nexus\Package
|
||||
$purchase->save();
|
||||
|
||||
unset( \IPS\Data\Cache::i()->advertisements );
|
||||
|
||||
parent::onPurchaseGenerated( $purchase, $invoice );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -461,7 +469,7 @@ class _Ad extends \IPS\nexus\Package
|
||||
|
||||
if ( ( !$ad->end or $ad->end > time() ) )
|
||||
{
|
||||
if ( $ad->maximum_value )
|
||||
if ( $ad->maximum_value > -1 AND $ad->maximum_value )
|
||||
{
|
||||
if ( $ad->maximum_unit == 'i' )
|
||||
{
|
||||
@@ -499,6 +507,8 @@ class _Ad extends \IPS\nexus\Package
|
||||
$ad->save();
|
||||
}
|
||||
catch ( \OutOfRangeException $e ) { }
|
||||
|
||||
parent::onExpirationDateChange( $purchase );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -516,6 +526,8 @@ class _Ad extends \IPS\nexus\Package
|
||||
$ad->save();
|
||||
}
|
||||
catch ( \OutOfRangeException $e ) { }
|
||||
|
||||
parent::onExpire( $purchase );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -533,6 +545,8 @@ class _Ad extends \IPS\nexus\Package
|
||||
$ad->save();
|
||||
}
|
||||
catch ( \OutOfRangeException $e ) { }
|
||||
|
||||
parent::onCancel( $purchase );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -548,6 +562,8 @@ class _Ad extends \IPS\nexus\Package
|
||||
\IPS\core\Advertisement::load( $purchase->extra['ad'] )->delete();
|
||||
}
|
||||
catch ( \OutOfRangeException $e ) { }
|
||||
|
||||
parent::onDelete( $purchase );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -559,6 +575,8 @@ class _Ad extends \IPS\nexus\Package
|
||||
public function onReactivate( \IPS\nexus\Purchase $purchase )
|
||||
{
|
||||
$this->onExpirationDateChange( $purchase );
|
||||
|
||||
parent::onReactivate( $purchase );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -577,6 +595,8 @@ class _Ad extends \IPS\nexus\Package
|
||||
$ad->save();
|
||||
}
|
||||
catch ( \OutOfRangeException $e ) { }
|
||||
|
||||
parent::onTransfer( $purchase, $newCustomer );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user