CRM-21011 Sort out tag descriptions when displaying better
authorSeamus Lee <seamuslee001@gmail.com>
Tue, 19 Sep 2017 00:58:38 +0000 (10:58 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Tue, 19 Sep 2017 00:58:38 +0000 (10:58 +1000)
templates/CRM/Contact/Form/Edit/Tagtree.tpl
templates/CRM/Contact/Page/View/Summary.tpl
templates/CRM/Tag/Form/Tag.tpl
templates/CRM/Tag/Form/Tagtree.tpl

index 2f6d1c51b111a5578e1821e01af9d70535227dde..d35eea13e393e1507042a658d04bcf704c00937c 100644 (file)
@@ -29,7 +29,7 @@
     <li id="tagli_{$id}">
       <input name="tag[{$id}]" id="tag_{$id}" class="form-checkbox" type="checkbox" value="1" {if $node.is_selectable EQ 0}disabled=""{/if} {if $form.tag.value.$id EQ 1}checked="checked"{/if}/>
       <span>
-        <label for="tag_{$id}" id="tagLabel_{$id}" class="crm-tag-item" {if !empty($allTags.$id.color)}style="background-color: {$allTags.$id.color}; color: {$allTags.$id.color|colorContrast};"{/if} title="{$node.description}">{$node.name}</label>
+        <label for="tag_{$id}" id="tagLabel_{$id}" class="crm-tag-item" {if !empty($allTags.$id.color)}style="background-color: {$allTags.$id.color}; color: {$allTags.$id.color|colorContrast};"{/if} title="{$node.description|escape:'html'}">{$node.name}</label>
       </span>
       {if $node.children}
         {* Recurse... *}
index 3e646f28014967bd24cd302b727cfb5e3be5e13d..4b359d825c1620c9f9b5d33ed4cb9627eefc695d 100644 (file)
                       </div>
                       <div class="crm-content" id="tags">
                         {foreach from=$contactTag item=tagName key=tagId}
-                          <span class="crm-tag-item" {if !empty($allTags.$tagId.color)}style="background-color: {$allTags.$tagId.color}; color: {$allTags.$tagId.color|colorContrast};"{/if} title="{$allTags.$tagId.description}">
+                          <span class="crm-tag-item" {if !empty($allTags.$tagId.color)}style="background-color: {$allTags.$tagId.color}; color: {$allTags.$tagId.color|colorContrast};"{/if} title="{$allTags.$tagId.description|escape:'html'}">
                             {$tagName}
                           </span>
                         {/foreach}
index 64ccc9707eda5fc098f578e6b3e019997b4bfe8f..bad26d491b3b73d9d58cdc3cd97e7cdfed44c7b2 100644 (file)
           selected = $("#tagtree").jstree(true).get_selected(true);
         $.each(selected, function(k, item) {
           var $tag = $(item.text);
-          tags.push('<span class="crm-tag-item" style="' + $tag.attr('style') + '" title="' + ($tag.attr('title') || '') + '">' + $tag.text() + '</span>');
+          tags.push('<span class="crm-tag-item" style="' + $tag.attr('style') + '" title="' + ($.parseHTML($tag.attr('title')) || '') + '">' + $tag.text() + '</span>');
         });
         $('input.crm-contact-tagset').each(function() {
           $.each($(this).select2('data'), function (i, tag) {
-            tags.push('<span class="crm-tag-item" title="' + (tag.description || '') + '"' + (tag.color ? 'style="color: ' + CRM.utils.colorContrast(tag.color) + '; background-color: ' + tag.color + ';"' : '') + '>' + tag.label + '</span>');
+            tags.push('<span class="crm-tag-item" title="' + ($.parseHTML(tag.description.text) || '') + '"' + (tag.color ? 'style="color: ' + CRM.utils.colorContrast(tag.color) + '; background-color: ' + tag.color + ';"' : '') + '>' + tag.label + '</span>');
           });
         });
         // contact summary tabs and search forms both listen for this event
index 8f3a1df17e9a583d6c14e98cb7bf67aff525dd1d..9c00437c4f58928579383f5afaecb9a48f77d2ee 100644 (file)
@@ -28,7 +28,7 @@
   {foreach from=$tree item="node" key="id"}
     <li>
       <a id="tag_{$id}" class="{if !$node.is_selectable || $permission neq 'edit'}jstree-disabled{/if} {if $tagged[$id]}jstree-clicked{/if}">
-        <span class="crm-tag-item" {if !empty($allTags.$id.color)}style="background-color: {$allTags.$id.color}; color: {$allTags.$id.color|colorContrast};"{/if} title="{$node.description}">
+        <span class="crm-tag-item" {if !empty($allTags.$id.color)}style="background-color: {$allTags.$id.color}; color: {$allTags.$id.color|colorContrast};"{/if} title="{$node.description|escape:'html'}">
           {$node.name}
         </span>
       </a>