<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | 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$
*
*/
}
$form->addGroup($commPreff, 'preferred_communication_method', ts('Preferred Method(s)'));
- $form->add('select', 'preferred_language',
- ts('Preferred Language'),
- array(
- '' => ts('- select -')) +
- CRM_Contact_BAO_Contact::buildOptions('preferred_language')
- );
+ $form->addSelect('preferred_language');
if (!empty($privacyOptions)) {
$commPreference['privacy'] = $privacyOptions;
/**
* global form rule
*
- * @param array $fields the input form values
- * @param array $files the uploaded files if any
- * @param array $options additional user data
+ * @param array $fields the input form values
+ * @param array $files the uploaded files if any
+ * @param $self
+ *
+ * @internal param array $options additional user data
*
* @return true if no errors, else array of errors
* @access public
$greetings = self::getGreetingFields($self->_contactType);
foreach ($greetings as $greeting => $details) {
$customizedValue = CRM_Core_OptionGroup::getValue($greeting, 'Customized', 'name');
- if (CRM_Utils_Array::value($details['field'], $fields) == $customizedValue
- && !CRM_Utils_Array::value($details['customField'], $fields)
- ) {
+ if (CRM_Utils_Array::value($details['field'], $fields) == $customizedValue && empty($fields[$details['customField']])) {
$errors[$details['customField']] = ts('Custom %1 is a required field if %1 is of type Customized.',
array(1 => $details['label'])
);
*
* @access public
*
+ * @param $form
+ * @param $defaults
+ *
* @return void
*/
static function setDefaultValues(&$form, &$defaults) {
/**
* set array of greeting fields
*
+ * @param $contactType
+ *
* @return void
* @access public
*/