Skip to content

Commit

Permalink
Merge pull request #13403 from pradpnayak/FieldLength
Browse files Browse the repository at this point in the history
Donot allow to enter more than max length of the field
  • Loading branch information
eileenmcnaughton authored Feb 5, 2019
2 parents 2b65ef5 + 2b59da4 commit 67c953d
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions CRM/Note/Form/Note.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ public function setDefaultValues() {
return $defaults;
}

/**
* Explicitly declare the entity api name.
*/
public function getDefaultEntity() {
return 'Note';
}

/**
* Explicitly declare the form context.
*/
public function getDefaultContext() {
return 'create';
}

/**
* Build the form object.
*
Expand All @@ -134,10 +148,9 @@ public function buildQuickForm() {
return;
}

$this->add('text', 'subject', ts('Subject:'), array('size' => 20));
$this->add('textarea', 'note', ts('Note:'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Note', 'note'), TRUE);
$this->add('select', 'privacy', ts('Privacy:'), CRM_Core_OptionGroup::values('note_privacy'));

$this->addField('subject');
$this->addField('note', [], TRUE);
$this->addField('privacy');
$this->add('hidden', 'parent_id');

// add attachments part
Expand Down

0 comments on commit 67c953d

Please sign in to comment.