Sort by country,second_name,first_name for pdf generation of international mailings
authorRuben Rodriguez <ruben@fsf.org>
Wed, 15 Nov 2017 17:29:39 +0000 (12:29 -0500)
committerAndrew Engelbrecht <andrew@fsf.org>
Wed, 11 Apr 2018 21:33:32 +0000 (17:33 -0400)
(change currently disabled / commented out -- sudoman)

CRM/Utils/Sort.php

index 991cced62a1e25e05e4b0000628ddd60ed3e512d..0c4e761bffecd94b5741cf9c9b2e1d164395c5a5 100644 (file)
@@ -152,10 +152,18 @@ class CRM_Utils_Sort {
       $this->_vars[$this->_currentSortID]['direction'] == self::DONTCARE
     ) {
       $this->_vars[$this->_currentSortID]['name'] = str_replace(' ', '_', $this->_vars[$this->_currentSortID]['name']);
+      // quidam: hack to reorder by country,second_name,first_name on pdf generation
+      // un-comment next two lines to re-enable quidam's hack
+      //if ($this->_vars[$this->_currentSortID]['title'] == 'Country'){
+      //  return CRM_Utils_Type::escape($this->_vars[$this->_currentSortID]['name'], 'MysqlColumnNameOrAlias') . ' asc,last_name asc,first_name asc'; }
       return CRM_Utils_Type::escape($this->_vars[$this->_currentSortID]['name'], 'MysqlColumnNameOrAlias') . ' asc';
     }
     else {
       $this->_vars[$this->_currentSortID]['name'] = str_replace(' ', '_', $this->_vars[$this->_currentSortID]['name']);
+      // quidam: hack to reorder by country,second_name,first_name on pdf generation
+      // un-comment next two lines to re-enable quidam's hack
+      //if ($this->_vars[$this->_currentSortID]['title'] == 'Country'){
+      //  return CRM_Utils_Type::escape($this->_vars[$this->_currentSortID]['name'], 'MysqlColumnNameOrAlias') . ' desc,last_name asc,first_name asc'; }
       return CRM_Utils_Type::escape($this->_vars[$this->_currentSortID]['name'], 'MysqlColumnNameOrAlias') . ' desc';
     }
   }