From 695825992bea24f7d9cf88635518037eb32bd4b8 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Thu, 18 Dec 2014 14:04:26 -0800 Subject: [PATCH] CRM-15180 - https://issues.civicrm.org/jira/browse/CRM-15180 --- CRM/Admin/Form/Tag.php | 14 ++++++++------ templates/CRM/Admin/Form/Tag.tpl | 30 ++++++++++++++++-------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/CRM/Admin/Form/Tag.php b/CRM/Admin/Form/Tag.php index 861bb978ab..f3dce6a01f 100644 --- a/CRM/Admin/Form/Tag.php +++ b/CRM/Admin/Form/Tag.php @@ -76,6 +76,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); @@ -91,12 +99,6 @@ class CRM_Admin_Form_Tag extends CRM_Admin_Form { CRM_Core_DAO::getAttribute('CRM_Core_DAO_Tag', 'description') ); - $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); - } - $isReserved = $this->add('checkbox', 'is_reserved', ts('Reserved?')); $usedFor = $this->addSelect('used_for', array('multiple' => TRUE, 'option_url' => NULL)); diff --git a/templates/CRM/Admin/Form/Tag.tpl b/templates/CRM/Admin/Form/Tag.tpl index cbea49a7eb..92f5b74106 100644 --- a/templates/CRM/Admin/Form/Tag.tpl +++ b/templates/CRM/Admin/Form/Tag.tpl @@ -25,7 +25,7 @@ *} {* this template is used for adding/editing a tag (admin) *}
- {if $action eq 1 or $action eq 2 } + {if $action eq 1 or $action eq 2 }
{include file="CRM/common/formButtons.tpl" location="top"}
@@ -38,18 +38,18 @@ {if $form.parent_id.html} - - + + {/if} - @@ -57,11 +57,13 @@ - - - - + {if ! $isTagSet} {* Tagsets are not selectable by definition, so exclude this field for tagsets *} + + + + + {/if}
{$form.parent_id.label}{$form.parent_id.html}{$form.parent_id.label}{$form.parent_id.html}
{$form.used_for.label}{$form.used_for.html}
- - {if $is_parent}{ts}You can change the types of records which this tag can be used for by editing the 'Parent' tag.{/ts} - {else}{ts}What types of record(s) can this tag be used for?{/ts} - {/if} - +
{$form.used_for.html}
+ + {if $is_parent}{ts}You can change the types of records which this tag can be used for by editing the 'Parent' tag.{/ts} + {else}{ts}What types of record(s) can this tag be used for?{/ts} + {/if} +
{$form.is_reserved.html}
{ts}Reserved tags can not be deleted. Users with 'administer reserved tags' permission can set or unset the reserved flag. You must uncheck 'Reserved' (and delete any child tags) before you can delete a tag.{/ts}
{$form.is_selectable.label}{$form.is_selectable.html}
{ts}Defines if you can select this tag.{/ts} -
{$form.is_selectable.label}{$form.is_selectable.html}
{ts}Defines if you can select this tag.{/ts} +
{if $parent_tags|@count > 0} -- 2.25.1