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,9 +142,9 @@ class _Goal extends \IPS\Node\Model
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save Changed Columns
|
||||
* [ActiveRecord] Save Changed Columns
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@@ -152,6 +152,31 @@ class _Goal extends \IPS\Node\Model
|
||||
{
|
||||
parent::save();
|
||||
\IPS\Widget::deleteCaches( 'donations', 'nexus' );
|
||||
static::recountDonationGoals();
|
||||
}
|
||||
|
||||
/**
|
||||
* [ActiveRecord] Delete
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
parent::delete();
|
||||
static::recountDonationGoals();
|
||||
}
|
||||
|
||||
/**
|
||||
* Recount card storage gateays
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function recountDonationGoals()
|
||||
{
|
||||
$count = count( static::roots() );
|
||||
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => $count ), array( 'conf_key=?', 'donation_goals' ) );
|
||||
\IPS\Settings::i()->donation_goals = $count;
|
||||
unset( \IPS\Data\Store::i()->settings );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user