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 );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user