<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
*
* @param array $params (ref.) an assoc array of name/value pairs
*
+ * @param $files
+ * @param $self
+ *
* @return mixed true or array of errors
* @access public
* @static
foreach ($greetings as $key => $value) {
$otherOption = CRM_Utils_Array::value($key, $params);
- if ((CRM_Utils_Array::value($otherOption, $self->_greetingOptions[$key]) == ts('Other')) &&
- !CRM_Utils_Array::value($value, $params)
- ) {
+ if ((CRM_Utils_Array::value($otherOption, $self->_greetingOptions[$key]) == ts('Other')) && empty($params[$value])) {
$label = ucwords(str_replace('_', ' ', $key));
$errors[$value] = ts('Please enter a value for %1 (merging > 2 contacts), or select a pre-configured option from the list.', array(1 => $label));
}
}
+ /**
+ * @return array
+ */
static function getGreetingOptions() {
$options = array();
$greetings = array(