[-] BO : Fixed #PSFV-281 : new created tab are now set active by default
This commit is contained in:
1 parent
0f22326300
commit
2877eaa7cc
1 file changed
+2
-6
+2
-6
@@ -42,7 +42,7 @@ class TabCore extends ObjectModel
|
|||||||
public $position;
|
public $position;
|
||||||
|
|
||||||
/** @var integer active */
|
/** @var integer active */
|
||||||
public $active;
|
public $active = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ObjectModel::$definition
|
* @see ObjectModel::$definition
|
||||||
@@ -56,7 +56,7 @@ class TabCore extends ObjectModel
|
|||||||
'position' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
'position' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||||
'module' => array('type' => self::TYPE_STRING, 'validate' => 'isTabName', 'size' => 64),
|
'module' => array('type' => self::TYPE_STRING, 'validate' => 'isTabName', 'size' => 64),
|
||||||
'class_name' => array('type' => self::TYPE_STRING, 'required' => true, 'size' => 64),
|
'class_name' => array('type' => self::TYPE_STRING, 'required' => true, 'size' => 64),
|
||||||
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||||
|
|
||||||
// Lang fields
|
// Lang fields
|
||||||
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 32),
|
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 32),
|
||||||
@@ -77,10 +77,6 @@ class TabCore extends ObjectModel
|
|||||||
public function add($autodate = true, $null_values = false)
|
public function add($autodate = true, $null_values = false)
|
||||||
{
|
{
|
||||||
$this->position = self::getNewLastPosition($this->id_parent);
|
$this->position = self::getNewLastPosition($this->id_parent);
|
||||||
// if you don't precise active or not, automatically set it
|
|
||||||
if (is_null($this->active))
|
|
||||||
$this->active = 1;
|
|
||||||
|
|
||||||
if (parent::add($autodate, $null_values))
|
if (parent::add($autodate, $null_values))
|
||||||
{
|
{
|
||||||
// refresh cache when adding new tab
|
// refresh cache when adding new tab
|
||||||
|
|||||||
Reference in new issue
Block a user