Skip to content

Commit

Permalink
Custom field form cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw committed Oct 27, 2016
1 parent 7557288 commit 8fab1e2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions CRM/Custom/Form/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,10 @@ public function buildQuickForm() {
$_showHide->addToTemplate();

// text length for alpha numeric data types
$this->add('text',
$this->add('number',
'text_length',
ts('Database field length'),
$attributes['text_length'],
$attributes['text_length'] + array('min' => 1),
FALSE
);
$this->addRule('text_length', ts('Value should be a positive number'), 'integer');
Expand Down Expand Up @@ -455,19 +455,19 @@ public function buildQuickForm() {
);

// for Note field
$this->add('text',
$this->add('number',
'note_columns',
ts('Width (columns)') . ' ',
$attributes['note_columns'],
FALSE
);
$this->add('text',
$this->add('number',
'note_rows',
ts('Height (rows)') . ' ',
$attributes['note_rows'],
FALSE
);
$this->add('text',
$this->add('number',
'note_length',
ts('Maximum length') . ' ',
$attributes['text_length'], // note_length is an alias for the text-length field
Expand All @@ -479,7 +479,7 @@ public function buildQuickForm() {
$this->addRule('note_length', ts('Value should be a positive number'), 'positiveInteger');

// weight
$this->add('text', 'weight', ts('Order'),
$this->add('number', 'weight', ts('Order'),
$attributes['weight'],
TRUE
);
Expand All @@ -489,7 +489,7 @@ public function buildQuickForm() {
$this->add('advcheckbox', 'is_required', ts('Required?'));

// checkbox / radio options per line
$this->add('text', 'options_per_line', ts('Options Per Line'));
$this->add('number', 'options_per_line', ts('Options Per Line'), array('min' => 0));
$this->addRule('options_per_line', ts('must be a numeric value'), 'numeric');

// default value, help pre, help post, mask, attributes, javascript ?
Expand Down

0 comments on commit 8fab1e2

Please sign in to comment.