CRM-15180 - https://issues.civicrm.org/jira/browse/CRM-15180
authorDave Greenberg <dave@civicrm.org>
Thu, 18 Dec 2014 22:04:26 +0000 (14:04 -0800)
committerDave Greenberg <dave@civicrm.org>
Thu, 18 Dec 2014 22:04:26 +0000 (14:04 -0800)
CRM/Admin/Form/Tag.php
templates/CRM/Admin/Form/Tag.tpl

index 861bb978ab6c3f77c34849aeafbf2c06b9cf5114..f3dce6a01fd923d20d96bceace486b7b826fdf69 100644 (file)
@@ -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));
index cbea49a7ebfb273ecf47c43b3d55d3e9dbcd58ee..92f5b741060d184169b142218116bd9ea55596d1 100644 (file)
@@ -25,7 +25,7 @@
 *}
 {* this template is used for adding/editing a tag (admin)  *}
 <div class="crm-block crm-form-block crm-tag-form-block">
-    {if $action eq 1 or $action eq 2 }
+  {if $action eq 1 or $action eq 2 }
     <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
     <table class="form-layout-compressed">
        <tr class="crm-tag-form-block-label">
        </tr>
          {if $form.parent_id.html}
        <tr class="crm-tag-form-block-parent_id">
-     <td class="label">{$form.parent_id.label}</td>
-          <td>{$form.parent_id.html}</td>
+         <td class="label">{$form.parent_id.label}</td>
+         <td>{$form.parent_id.html}</td>
        </tr>
    {/if}
        <tr class="crm-tag-form-block-used_for">
           <td class="label">{$form.used_for.label}</td>
-    <td>{$form.used_for.html} <br />
-          <span class="description">
-                 {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}
-              </span>
+          <td>{$form.used_for.html} <br />
+            <span class="description">
+              {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}
+            </span>
           </td>
         </tr>
         <tr class="crm-tag-form-block-is_reserved">
            <td>{$form.is_reserved.html} <br /><span class="description">{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}
            </td>
         </tr>
-        <tr class="crm-tag-form-block-is_slectable">
-           <td class="label">{$form.is_selectable.label}</td>
-           <td>{$form.is_selectable.html}<br /><span class="description">{ts}Defines if you can select this tag.{/ts}
-           </td>
-        </tr>
+        {if ! $isTagSet} {* Tagsets are not selectable by definition, so exclude this field for tagsets *}
+          <tr class="crm-tag-form-block-is_slectable">
+             <td class="label">{$form.is_selectable.label}</td>
+             <td>{$form.is_selectable.html}<br /><span class="description">{ts}Defines if you can select this tag.{/ts}
+             </td>
+          </tr>
+        {/if}
     </table>
         {if $parent_tags|@count > 0}
         <table class="form-layout-compressed">