From: Kurund Jalmi Date: Sun, 15 Nov 2015 19:57:44 +0000 (+0530) Subject: Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-11-16-01-17-32 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=750c4bb5c5e5d101ad43c1352b6f1ab82752b5d4;p=civicrm-core.git Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-11-16-01-17-32 --- 750c4bb5c5e5d101ad43c1352b6f1ab82752b5d4 diff --cc CRM/Contact/Form/Search/Basic.php index d8d27abf83,e6c2bb7f22..6dfa818867 --- a/CRM/Contact/Form/Search/Basic.php +++ b/CRM/Contact/Form/Search/Basic.php @@@ -45,12 -52,12 +45,9 @@@ class CRM_Contact_Form_Search_Basic ext /** * Build the form object. - * - * - * @return void */ public function buildQuickForm() { - // text for sort_name or email criteria - $config = CRM_Core_Config::singleton(); - $label = empty($config->includeEmailInName) ? ts('Name') : ts('Name or Email'); - $this->add('text', 'sort_name', $label); + $this->addSortNameField(); $searchOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'advanced_search_options' diff --cc CRM/Report/Form.php index 516ef52bbe,4980983f84..e1532b3037 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@@ -1782,33 -1737,17 +1782,33 @@@ class CRM_Report_Form extends CRM_Core_ break; case 'mhas': + // mhas == multiple has + if ($value !== NULL && count($value) > 0) { + $sqlOP = $this->getSQLOperator($op); + foreach ($value as $key => $val) { + $val = str_replace('(', '[[.left-parenthesis.]]', $val); + $val = str_replace(')', '[[.right-parenthesis.]]', $val); + $value[$key] = $val; + } + $sp = CRM_Core_DAO::VALUE_SEPARATOR; + $clause + = "{$field['dbAlias']} REGEXP '$sp" . implode("$sp|$sp", $value) . "$sp'"; + } + break; + case 'mnot': - // mnot == multiple is not one of + // mhas == multiple has if ($value !== NULL && count($value) > 0) { $sqlOP = $this->getSQLOperator($op); - $operator = ''; - if ($op == 'mnot') { - // mnot == multiple is not one of - $operator = 'NOT'; + foreach ($value as $key => $val) { + $val = str_replace('(', '[[.left-parenthesis.]]', $val); + $val = str_replace(')', '[[.right-parenthesis.]]', $val); + $value[$key] = $val; } - $regexp = "[[:cntrl:]]*" . implode('[[:>:]]*|[[:<:]]*', (array) $value) . "[[:cntrl:]]*"; - $clause = "{$field['dbAlias']} {$operator} REGEXP '{$regexp}'"; + $sp = CRM_Core_DAO::VALUE_SEPARATOR; + $clause + = "( {$field['dbAlias']} NOT REGEXP '$sp" . implode("$sp|$sp", $value) . + "$sp' OR {$field['dbAlias']} IS NULL )"; } break; diff --cc CRM/Utils/Hook.php index 15bc0bf93b,e96d7c473f..78d7a5c874 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@@ -1883,9 -1884,9 +1884,9 @@@ abstract class CRM_Utils_Hook */ public static function caseChange(\Civi\CCase\Analyzer $analyzer) { $event = new \Civi\CCase\Event\CaseChangeEvent($analyzer); - \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_caseChange", $event); + \Civi::service('dispatcher')->dispatch("hook_civicrm_caseChange", $event); - return self::singleton()->invoke(1, $angularModules, + self::singleton()->invoke(1, $analyzer, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_caseChange' );