From 67413f59691e1b8d99fef392266c2a0bf710d6d4 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 30 Dec 2016 16:12:37 -0500 Subject: [PATCH] CRM-19769 - Show title and more colors for tags --- CRM/Contact/Form/Edit/TagsAndGroups.php | 1 + CRM/Core/BAO/Tag.php | 1 + templates/CRM/Contact/Form/Edit/Tagtree.tpl | 3 +-- templates/CRM/Contact/Page/View/Summary.tpl | 2 +- templates/CRM/Tag/Form/Tag.tpl | 7 +++-- templates/CRM/Tag/Form/Tagtree.hlp | 30 --------------------- templates/CRM/Tag/Form/Tagtree.tpl | 3 +-- 7 files changed, 8 insertions(+), 39 deletions(-) delete mode 100644 templates/CRM/Tag/Form/Tagtree.hlp diff --git a/CRM/Contact/Form/Edit/TagsAndGroups.php b/CRM/Contact/Form/Edit/TagsAndGroups.php index 69bf9d34e91..def736d726e 100644 --- a/CRM/Contact/Form/Edit/TagsAndGroups.php +++ b/CRM/Contact/Form/Edit/TagsAndGroups.php @@ -175,6 +175,7 @@ public static function buildQuickForm( $form->assign('tag', $tree); $form->assign('entityID', $contactId); $form->assign('entityTable', 'civicrm_contact'); + $form->assign('allTags', CRM_Core_BAO_Tag::getTagsUsedFor('civicrm_contact', FALSE)); if ($isRequired) { $form->addRule($fName, ts('%1 is a required field.', array(1 => $tagName)), 'required'); diff --git a/CRM/Core/BAO/Tag.php b/CRM/Core/BAO/Tag.php index fab7bda40a3..c1b4ae44f41 100644 --- a/CRM/Core/BAO/Tag.php +++ b/CRM/Core/BAO/Tag.php @@ -172,6 +172,7 @@ public static function getTagsUsedFor( $tags[$tag->id]['parent_id'] = $tag->parent_id; $tags[$tag->id]['is_tagset'] = $tag->is_tagset; $tags[$tag->id]['used_for'] = $tag->used_for; + $tags[$tag->id]['description'] = $tag->description; $tags[$tag->id]['color'] = !empty($tag->color) ? $tag->color : NULL; } } diff --git a/templates/CRM/Contact/Form/Edit/Tagtree.tpl b/templates/CRM/Contact/Form/Edit/Tagtree.tpl index 118dead2052..34c1d233714 100644 --- a/templates/CRM/Contact/Form/Edit/Tagtree.tpl +++ b/templates/CRM/Contact/Form/Edit/Tagtree.tpl @@ -29,8 +29,7 @@
  • - - {if $node.description}{help id=$id title=$node.name file="CRM/Tag/Form/Tagtree"}{/if} + {if $node.children} {* Recurse... *} diff --git a/templates/CRM/Contact/Page/View/Summary.tpl b/templates/CRM/Contact/Page/View/Summary.tpl index 31dd6268114..3e646f28014 100644 --- a/templates/CRM/Contact/Page/View/Summary.tpl +++ b/templates/CRM/Contact/Page/View/Summary.tpl @@ -166,7 +166,7 @@
    {foreach from=$contactTag item=tagName key=tagId} - + {$tagName} {/foreach} diff --git a/templates/CRM/Tag/Form/Tag.tpl b/templates/CRM/Tag/Form/Tag.tpl index 029adb63047..5466de4cfd0 100644 --- a/templates/CRM/Tag/Form/Tag.tpl +++ b/templates/CRM/Tag/Form/Tag.tpl @@ -45,12 +45,11 @@ CRM.updateContactSummaryTags = function() { var tags = []; $('#tagtree input:checkbox:checked+span label').each(function() { - tags.push('' + $(this).text() + ''); + tags.push('' + $(this).text() + ''); }); $('input.crm-contact-tagset').each(function() { - var setTags = _.pluck($(this).select2('data'), 'label'); - $.each(setTags, function (i, item) { - tags.push('' + item + ''); + $.each($(this).select2('data'), function (i, tag) { + tags.push('' + tag.label + ''); }); }); // contact summary tabs and search forms both listen for this event diff --git a/templates/CRM/Tag/Form/Tagtree.hlp b/templates/CRM/Tag/Form/Tagtree.hlp deleted file mode 100644 index df576d2d8c2..00000000000 --- a/templates/CRM/Tag/Form/Tagtree.hlp +++ /dev/null @@ -1,30 +0,0 @@ -{* - +--------------------------------------------------------------------+ - | CiviCRM version 4.7 | - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2017 | - +--------------------------------------------------------------------+ - | This file is a part of CiviCRM. | - | | - | CiviCRM is free software; you can copy, modify, and distribute it | - | under the terms of the GNU Affero General Public License | - | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | - | | - | CiviCRM is distributed in the hope that it will be useful, but | - | WITHOUT ANY WARRANTY; without even the implied warranty of | - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | - | See the GNU Affero General Public License for more details. | - | | - | You should have received a copy of the GNU Affero General Public | - | License and the CiviCRM Licensing Exception along | - | with this program; if not, contact CiviCRM LLC | - | at info[AT]civicrm[DOT]org. If you have questions about the | - | GNU Affero General Public License or the licensing of CiviCRM, | - | see the CiviCRM license FAQ at http://civicrm.org/licensing | - +--------------------------------------------------------------------+ -*} - -{htxt id=$id} - {crmAPI var='result' entity='tag' action='getsingle' return="description" id=$id} - {$result.description} -{/htxt} diff --git a/templates/CRM/Tag/Form/Tagtree.tpl b/templates/CRM/Tag/Form/Tagtree.tpl index fdbb89f3584..39133ec9209 100644 --- a/templates/CRM/Tag/Form/Tagtree.tpl +++ b/templates/CRM/Tag/Form/Tagtree.tpl @@ -29,10 +29,9 @@
  • - {if $node.children} {* Recurse... *}