diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 48e5802ab2e5..57364c977041 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -912,7 +912,7 @@ public static function getGroupList(&$params) { CRM_Core_DAO::storeValues($object, $values[$object->id]); if ($object->saved_search_id) { - $values[$object->id]['title'] .= ' (' . ts('Smart Group') . ')'; + $values[$object->id]['class'][] = "crm-smart-group"; // check if custom search, if so fix view link $customSearchID = CRM_Core_DAO::getFieldValue( 'CRM_Contact_DAO_SavedSearch', diff --git a/templates/CRM/Group/Form/Search.tpl b/templates/CRM/Group/Form/Search.tpl index 6363fba591a0..44d69191cbd4 100644 --- a/templates/CRM/Group/Form/Search.tpl +++ b/templates/CRM/Group/Form/Search.tpl @@ -111,6 +111,7 @@ // also to handle search filtering for initial load of same page. var parentsOnly = 1 var ZeroRecordText = {/literal}'{ts escape="js"}
'{literal}; + var smartGroupText = {/literal}'({ts escape="js"}Smart Group{/ts})'{literal}; $('table.crm-group-selector').data({ "ajax": { "url": {/literal}'{crmURL p="civicrm/ajax/grouplist" h=0 q="snippet=4"}'{literal}, @@ -157,15 +158,19 @@ }); //Reload table after draw $(settings.nTable).trigger('crmLoad'); - if (parentsOnly) { - CRM.loadScript(CRM.config.resourceBase + 'js/jquery/jquery.crmEditable.js').done(function () { + CRM.loadScript(CRM.config.resourceBase + 'js/jquery/jquery.crmEditable.js').done(function () { + if (parentsOnly) { $('tbody tr.crm-group-parent', settings.nTable).each(function () { $(this).find('td:first') .prepend('{/literal}{literal}') .find('div').css({'display': 'inline'}); }); + } + $('tbody tr.crm-smart-group', settings.nTable).each(function () { + $(this).find('td:first') + .append(smartGroupText); }); - } + }); } }); $(function($) { @@ -234,15 +239,18 @@ 'parent_is_' + parent_id, 'crm-row-child' ]; + if (!$.inArray("crm-smart-group", val.row_classes)) { + smartGroupText = ''; + } if ('DT_RowClass' in val) { val.row_classes = val.row_classes.concat(val.DT_RowClass.split(' ').filter((item) => val.row_classes.indexOf(item) < 0)); } appendHTML += '