/**
* 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'
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;
*/
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'
);