*/
public $_preEditValues;
+ /**
+ * Explicitly declare the entity api name.
+ */
+ public function getDefaultEntity() {
+ return 'Contact';
+ }
+
+ /**
+ * Explicitly declare the form context.
+ */
+ public function getDefaultContext() {
+ return 'create';
+ }
+
/**
* Build all the data structures needed to build the form.
*
// subtype is a common field. lets keep it here
$subtypes = CRM_Contact_BAO_Contact::buildOptions('contact_sub_type', 'create', array('contact_type' => $this->_contactType));
if (!empty($subtypes)) {
- $sel = $this->add('select', 'contact_sub_type', ts('Contact Type'),
- $subtypes, FALSE,
- array(
- 'id' => 'contact_sub_type',
- 'multiple' => 'multiple',
- 'class' => $buildCustomData . ' crm-select2',
- )
+ $this->addField('contact_sub_type', array(
+ 'label' => ts('Contact Type'),
+ 'options' => $subtypes,
+ 'class' => $buildCustomData,
+ 'multiple' => 'multiple',
+ 'options-url' => FALSE,
+ )
);
}
CRM_Contact_Form_Location::buildQuickForm($this);
// add attachment
- $this->addElement('file', 'image_URL', ts('Browse/Upload Image'), 'size=30 maxlength=60');
- $this->addUploadElement('image_URL');
+ $this->addField('image_URL', array('maxlength' => '60', 'label' => ts('Browse/Upload Image')));
// add the dedupe button
$this->addElement('submit',