From: Tim Mallezie Date: Wed, 29 Apr 2015 15:52:27 +0000 (+0200) Subject: Use addField in contact_form_domain CRM-16178 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a104f8f585e52bb9c801ab37d724f3ea72e04e64;p=civicrm-core.git Use addField in contact_form_domain CRM-16178 --- diff --git a/CRM/Contact/Form/Domain.php b/CRM/Contact/Form/Domain.php index d9525d15f9..0ec0030303 100644 --- a/CRM/Contact/Form/Domain.php +++ b/CRM/Contact/Form/Domain.php @@ -74,6 +74,20 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form { */ const LOCATION_BLOCKS = 1; + /** + * Explicitly declare the entity api name. + */ + public function getDefaultEntity() { + return 'Domain'; + } + + /** + * Explicitly declare the form context. + */ + public function getDefaultContext() { + return 'create'; + } + public function preProcess() { CRM_Utils_System::setTitle(ts('Organization Address and Contact Info')); $breadCrumbPath = CRM_Utils_System::url('civicrm/admin', 'reset=1'); @@ -144,12 +158,9 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form { * @return void */ public function buildQuickForm() { - - $this->add('text', 'name', ts('Organization Name'), array('size' => 25), TRUE); - $this->add('text', 'description', ts('Description'), array('size' => 25)); - + $this->addField('name', array('label' => ts('Organization Name')), TRUE); + $this->addField('description', array('label' => ts('Description'), 'size' => 30)); $this->add('text', 'email_name', ts('FROM Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Email', 'email'), TRUE); - $this->add('text', 'email_address', ts('FROM Email Address'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Email', 'email'), TRUE); $this->addRule('email_address', ts('Domain Email Address must use a valid email address format (e.g. \'info@example.org\').'), 'email'); diff --git a/xml/schema/Core/Domain.xml b/xml/schema/Core/Domain.xml index d9ed287d56..c3a6020313 100644 --- a/xml/schema/Core/Domain.xml +++ b/xml/schema/Core/Domain.xml @@ -25,6 +25,9 @@ 64 Name of Domain / Organization 1.1 + + Text + description @@ -33,6 +36,9 @@ 255 Description of Domain. 1.1 + + Text + UI_name