X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FAdmin%2FForm%2FTag.php;h=e1c9a276be5f47fda98de0762e8781ad6df4484e;hb=d25dd0ee5e47188c3ea9ad2918f627cfac97ddbd;hp=87076c91d05b87eae02a77dbd9d74d97ec5458f6;hpb=c52174d854bcc01af1e112d3bb0eee0e201d65e6;p=civicrm-core.git diff --git a/CRM/Admin/Form/Tag.php b/CRM/Admin/Form/Tag.php index 87076c91d0..e1c9a276be 100644 --- a/CRM/Admin/Form/Tag.php +++ b/CRM/Admin/Form/Tag.php @@ -1,7 +1,7 @@ setPageTitle($this->_isTagSet ? ts('Tag Set') : ts('Tag')); @@ -76,6 +75,14 @@ class CRM_Admin_Form_Tag extends CRM_Admin_Form { if (!$this->_isTagSet) { $this->add('select', 'parent_id', ts('Parent Tag'), $allTag, FALSE, array('class' => 'crm-select2')); + + // Tagsets are not selectable by definition so only include the selectable field if NOT a tagset. + $selectable = $this->add('checkbox', 'is_selectable', ts('Selectable?')); + // Selectable should be checked by default when creating a new tag + if ($this->_action == CRM_Core_Action::ADD) { + $selectable->setValue(1); + } + } $this->assign('isTagSet', $this->_isTagSet); @@ -85,14 +92,15 @@ class CRM_Admin_Form_Tag extends CRM_Admin_Form { $this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Tag', 'name'), TRUE ); - $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Core_DAO_Tag', $this->_id)); + $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array( + 'CRM_Core_DAO_Tag', + $this->_id, + )); $this->add('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Tag', 'description') ); - $this->add('checkbox', 'is_selectable', ts('Selectable?')); - $isReserved = $this->add('checkbox', 'is_reserved', ts('Reserved?')); $usedFor = $this->addSelect('used_for', array('multiple' => TRUE, 'option_url' => NULL)); @@ -123,7 +131,6 @@ class CRM_Admin_Form_Tag extends CRM_Admin_Form { /** * Process the form submission * - * @access public * * @return void */ @@ -167,4 +174,3 @@ class CRM_Admin_Form_Tag extends CRM_Admin_Form { } } -