*/
public static function buildQuickForm(&$form) {
$form->applyFilter('__ALL__', 'trim');
- $form->add('text', 'subject', ts('Subject'), array('size' => 60, 'maxlength' => 254));
- $form->add('textarea', 'note', ts('Notes'), array('cols' => '60', 'rows' => '3'));
+ $form->addField('note', array('entity' => 'note', 'cols' => '60', 'rows' => '3'));
}
}
*/
public $_cdType;
+ /**
+ * Explicitly declare the form context.
+ */
+ public function getDefaultContext() {
+ return 'create';
+ }
+
+ /**
+ * Explicitly declare the entity api name.
+ */
+ public function getDefaultEntity() {
+ return 'Relationship';
+ }
+
public function preProcess() {
//custom data related code
$this->_cdType = CRM_Utils_Array::value('type', $_GET);
$this->add('hidden', $name, $label, $props, $required);
break;
- //case 'TextArea':
+ case 'TextArea':
+ //Set default columns and rows for textarea.
+ $props['rows'] = isset($props['rows']) ? $props['rows'] : 4;
+ $props['cols'] = isset($props['cols']) ? $props['cols'] : 60;
+ $this->addElement('textarea', $name, $label, $props, $required);
+ break;
+
//case 'Select Date':
//TODO: Add date formats
//TODO: Add javascript template for dates.