X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FUFGroup.php;h=5240a93d2a447930e830f3d2a35e8666d04b0ac5;hb=7e9e8871fab6ef8220dffbe418460ebc9c61ed33;hp=d2ae65bcd723e911b0075219b876c251ee1157d9;hpb=6a74bca3f16ddd23a12542d8a294a91fa5462053;p=civicrm-core.git diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index d2ae65bcd7..5240a93d2a 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -1,7 +1,7 @@ add('select', $name, $title, $subtypeList, $required); - $sel->setMultiple(TRUE); + $form->add('select', $name, $title, $subtypeList, $required, array('class' => 'crm-select2', 'multiple' => TRUE)); } elseif (in_array($fieldName, CRM_Contact_BAO_Contact::$_greetingTypes)) { //add email greeting, postal greeting, addressee, CRM-4575 @@ -2088,16 +2098,8 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) ); } elseif (substr($fieldName, 0, 4) === 'url-') { - $form->add('text', $name, $title, - array_merge(CRM_Core_DAO::getAttribute('CRM_Core_DAO_Website', 'url'), - array( - 'onfocus' => "if (!this.value) { this.value='http://';} else return false", - 'onblur' => "if ( this.value == 'http://') { this.value='';} else return false", - ) - ), $required - ); - - $form->addRule($name, ts('Enter a valid Website.'), 'url'); + $form->add('text', $name, $title, CRM_Core_DAO::getAttribute('CRM_Core_DAO_Website', 'url'), $required); + $form->addRule($name, ts('Enter a valid web address beginning with \'http://\' or \'https://\'.'), 'url'); } // Note should be rendered as textarea elseif (substr($fieldName, -4) == 'note') { @@ -2239,7 +2241,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) $form->add('select', $name, $title, CRM_Core_PseudoConstant::worldRegion(), $required, $selectAttributes); } elseif ($fieldName == 'signature_html') { - $form->addWysiwyg($name, $title, CRM_Core_DAO::getAttribute('CRM_Core_DAO_Email', $fieldName)); + $form->add('wysiwyg', $name, $title, CRM_Core_DAO::getAttribute('CRM_Core_DAO_Email', $fieldName)); } elseif ($fieldName == 'signature_text') { $form->add('textarea', $name, $title, CRM_Core_DAO::getAttribute('CRM_Core_DAO_Email', $fieldName)); @@ -2257,7 +2259,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) } } elseif ($fieldName == 'activity_details') { - $form->addWysiwyg($fieldName, $title, array('rows' => 4, 'cols' => 60), $required); + $form->add('wysiwyg', $fieldName, $title, array('rows' => 4, 'cols' => 60), $required); } elseif ($fieldName == 'activity_duration') { $form->add('text', $name, $title, $attributes, $required); @@ -2876,7 +2878,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @param int $contactId * * @return array - * assoicated formatted array + * associated formatted array */ public static function formatFields($params, $contactId = NULL) { if ($contactId) {