From: Tim Mallezie Date: Sun, 17 May 2015 13:20:50 +0000 (+0200) Subject: convert some form elements in email to addfield X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=031f9ac8007b71a793a1fbd16ab9902951c0a360;p=civicrm-core.git convert some form elements in email to addfield --- diff --git a/CRM/Contact/Form/Edit/Email.php b/CRM/Contact/Form/Edit/Email.php index d86c8f5645..81ddd1cff8 100644 --- a/CRM/Contact/Form/Edit/Email.php +++ b/CRM/Contact/Form/Edit/Email.php @@ -62,16 +62,13 @@ class CRM_Contact_Form_Edit_Email { $form->applyFilter('__ALL__', 'trim'); //Email box - $form->addElement('text', "email[$blockId][email]", ts('Email'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Email', 'email')); + $form->addField("email[$blockId][email]", array('entity' => 'email')); $form->addRule("email[$blockId][email]", ts('Email is not valid.'), 'email'); if (isset($form->_contactType) || $blockEdit) { //Block type - $form->addSelect("email[$blockId][location_type_id]", array( - 'entity' => 'email', - 'class' => 'eight', - 'placeholder' => NULL, - )); + $form->addField("email[$blockId][location_type_id]", array('entity' => 'email', 'placeholder' => NULL, 'class' => 'eight')); + //TODO: Refactor on_hold field to select. $multipleBulk = CRM_Core_BAO_Email::isMultipleBulkMail(); //On-hold select @@ -84,7 +81,7 @@ class CRM_Contact_Form_Edit_Email { $form->addElement('select', "email[$blockId][on_hold]", '', $holdOptions); } else { - $form->addElement('advcheckbox', "email[$blockId][on_hold]", NULL); + $form->addField("email[$blockId][on_hold]", array('entity' => 'email')); } //Bulkmail checkbox diff --git a/xml/schema/Core/Email.xml b/xml/schema/Core/Email.xml index 9e60f7f804..bc9cedb877 100644 --- a/xml/schema/Core/Email.xml +++ b/xml/schema/Core/Email.xml @@ -115,6 +115,9 @@ true Is this address on bounce hold? 1.1 + + CheckBox + is_bulkmail