Skip to content
Snippets Groups Projects
Commit 762f768e authored by luke.stewart's avatar luke.stewart
Browse files

dev/core/248 - Fixes advanced search results headers mailings

Removes language from advanced search results mailings column
headers for non-multilingual sites.
parent 4c5fa0aa
Branches
Tags
No related merge requests found
......@@ -341,8 +341,12 @@ class CRM_Mailing_Selector_Search extends CRM_Core_Selector_Base implements CRM_
* the column headers that need to be displayed
*/
public function &getColumnHeaders($action = NULL, $output = NULL) {
if (!isset(self::$_columnHeaders)) {
self::$_columnHeaders = [
$enabledLanguages = CRM_Core_I18n::languages(TRUE);
$isMultiLingual = (count($enabledLanguages) > 1);
$headers = [
['desc' => ts('Contact Type')],
[
'name' => ts('Name'),
......@@ -359,11 +363,17 @@ class CRM_Mailing_Selector_Search extends CRM_Core_Selector_Base implements CRM_
'sort' => 'mailing_name',
'direction' => CRM_Utils_Sort::DONTCARE,
],
[
];
// Check to see if languages column should be displayed.
if ($isMultiLingual) {
$headers[] = [
'name' => ts('Language'),
'sort' => 'language',
'direction' => CRM_Utils_Sort::DONTCARE,
],
];
}
self::$_columnHeaders = array_merge($headers, [
[
'name' => ts('Mailing Subject'),
'sort' => 'mailing_subject',
......@@ -380,7 +390,7 @@ class CRM_Mailing_Selector_Search extends CRM_Core_Selector_Base implements CRM_
'direction' => CRM_Utils_Sort::DONTCARE,
],
['desc' => ts('Actions')],
];
]);
}
return self::$_columnHeaders;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment