}
$this->assign('relationshipData', $jsData);
- $this->add(
- 'select',
- 'relationship_type_id',
- ts('Relationship Type'),
- array('' => ts('- select -')) + $relationshipList,
- TRUE,
- array('class' => 'crm-select2 huge')
- );
+ $this->addField('relationship_type_id', array('options' => array('' => ts('- select -')) + $relationshipList, 'class' => 'huge', 'placeholder' => '- select -'), TRUE);
$label = $this->_action & CRM_Core_Action::ADD ? ts('Contact(s)') : ts('Contact');
- $contactField = $this->addEntityRef('related_contact_id', $label, array(
- 'multiple' => TRUE,
- 'create' => TRUE,
- ), TRUE);
+ $contactField = $this->addField('related_contact_id', array('label' => $label, 'name' => 'contact_id_b', 'multiple' => TRUE,
+ 'create' => TRUE,), TRUE);
// This field cannot be updated
if ($this->_action & CRM_Core_Action::UPDATE) {
$contactField->freeze();
$this->add('advcheckbox', 'is_current_employer', $this->_contactType == 'Organization' ? ts('Current Employee') : ts('Current Employer'));
- $this->addDate('start_date', ts('Start Date'), FALSE, array('formatType' => 'searchDate'));
- $this->addDate('end_date', ts('End Date'), FALSE, array('formatType' => 'searchDate'));
+ $this->addField('start_date', array('label' => ts('Start Date'), 'formatType' => 'searchDate'));
+ $this->addField('end_date', array('label' => ts('End Date'), 'formatType' => 'searchDate'));
- $this->add('advcheckbox', 'is_active', ts('Enabled?'));
+ $this->addField('is_active', array('label' => ts('Enabled?')));
- // CRM-14612 - Don't use adv-checkbox as it interferes with the form js
- $this->add('checkbox', 'is_permission_a_b');
- $this->add('checkbox', 'is_permission_b_a');
+ $this->addField('is_permission_a_b');
+ $this->addField('is_permission_b_a');
- $this->add('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Relationship', 'description'));
+ $this->addField('description', array('label' => ts('Description')));
CRM_Contact_Form_Edit_Notes::buildQuickForm($this);
$this->addElement('textarea', $name, $label, $props, $required);
break;
- //case 'Select Date':
- //TODO: Add date formats
- //TODO: Add javascript template for dates.
+ case 'Select Date':
+ //TODO: add range support
+ //TODO: Add date formats
+ //TODO: Add javascript template for dates.
+ $this->addDate($name, $label, $required, $props);
+ break;
+
case 'Radio':
$separator = isset($props['separator']) ? $props['separator'] : NULL;
unset($props['separator']);
<required>true</required>
<comment>id of the second contact</comment>
<add>1.1</add>
+ <html>
+ <type>EntityRef</type>
+ </html>
</field>
<foreignKey>
<name>contact_id_b</name>
<required>true</required>
<comment>id of the relationship</comment>
<add>1.1</add>
+ <html>
+ <type>Select</type>
+ </html>
</field>
<foreignKey>
<name>relationship_type_id</name>
<title>Relationship Start Date</title>
<comment>date when the relationship started</comment>
<add>1.1</add>
+ <html>
+ <type>Select Date</type>
+ </html>
</field>
<field>
<name>end_date</name>
<title>Relationship End Date</title>
<comment>date when the relationship ended</comment>
<add>1.1</add>
+ <html>
+ <type>Select Date</type>
+ </html>
</field>
<field>
<name>is_active</name>
<default>1</default>
<comment>is the relationship active ?</comment>
<add>1.1</add>
+ <html>
+ <type>CheckBox</type>
+ </html>
</field>
<field>
<name>description</name>
<length>255</length>
<comment>Optional verbose description for the relationship.</comment>
<add>1.5</add>
+ <html>
+ <type>Text</type>
+ </html>
</field>
<field>
<name>is_permission_a_b</name>
related data for contact b ?
</comment>
<add>2.1</add>
+ <html>
+ <type>CheckBox</type>
+ </html>
</field>
<field>
<name>is_permission_b_a</name>
related data for contact a ?
</comment>
<add>2.1</add>
+ <html>
+ <type>CheckBox</type>
+ </html>
</field>
<field>
<name>case_id</name>