Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -142,4 +142,40 @@ class _CustomField extends \IPS\CustomField
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [ActiveRecord] Save Changed Columns
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
parent::save();
|
||||
\IPS\Widget::deleteCaches( 'donations', 'nexus' );
|
||||
static::recountCustomerFields();
|
||||
}
|
||||
|
||||
/**
|
||||
* [ActiveRecord] Delete
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
parent::delete();
|
||||
static::recountCustomerFields();
|
||||
}
|
||||
|
||||
/**
|
||||
* Recount card storage gateays
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function recountCustomerFields()
|
||||
{
|
||||
$count = count( static::roots() );
|
||||
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => $count ), array( 'conf_key=?', 'customer_fields' ) );
|
||||
\IPS\Settings::i()->customer_fields = $count;
|
||||
unset( \IPS\Data\Store::i()->settings );
|
||||
}
|
||||
}
|
||||
@@ -368,20 +368,40 @@ class _History extends \IPS\Helpers\Table\Db
|
||||
switch ( $val['type'] )
|
||||
{
|
||||
case 'used':
|
||||
/* If the customer who used this gift card no longer exists, then we need to load up a guest customer object to avoid an OutOfRangeException */
|
||||
try
|
||||
{
|
||||
$customer = \IPS\nexus\Customer::load( $val['by'] );
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
$customer = new \IPS\nexus\Customer;
|
||||
}
|
||||
|
||||
return
|
||||
\IPS\Member::loggedIn()->language()->addToStack( 'history_giftvoucher_used', FALSE, array( 'htmlsprintf' => array(
|
||||
new \IPS\nexus\Money( $val['amount'], $currency ),
|
||||
$val['code'],
|
||||
\IPS\Theme::i()->getTemplate('global', 'nexus')->userLink( \IPS\nexus\Customer::load( $val['by'] ) )
|
||||
\IPS\Theme::i()->getTemplate('global', 'nexus')->userLink( $customer )
|
||||
) ) );
|
||||
break;
|
||||
|
||||
case 'redeemed':
|
||||
/* If the customer who redeemed this gift card no longer exists, then we need to load up a guest customer object to avoid an OutOfRangeException */
|
||||
try
|
||||
{
|
||||
$customer = \IPS\nexus\Customer::load( $val['ps_member'] );
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
$customer = new \IPS\nexus\Customer;
|
||||
}
|
||||
|
||||
return
|
||||
\IPS\Member::loggedIn()->language()->addToStack( 'history_giftvoucher_redeemed', FALSE, array( 'htmlsprintf' => array(
|
||||
new \IPS\nexus\Money( $val['amount'], $currency ),
|
||||
$val['code'],
|
||||
\IPS\Theme::i()->getTemplate('global', 'nexus')->userLink( \IPS\nexus\Customer::load( $val['ps_member'] ) ),
|
||||
\IPS\Theme::i()->getTemplate('global', 'nexus')->userLink( $customer ),
|
||||
new \IPS\nexus\Money( $val['newCreditAmount'], $currency )
|
||||
) ) );
|
||||
break;
|
||||
@@ -557,7 +577,7 @@ class _History extends \IPS\Helpers\Table\Db
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
$options = array( 'htmlsprintf' => array( $file, htmlentities( $val['ps_name'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ) ) );
|
||||
$options = array( 'htmlsprintf' => array( $file, htmlspecialchars( $val['ps_name'], ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ) ) );
|
||||
}
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( 'history_download_with_purchase', FALSE, $options );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user