);
}
- $this->add('text',
+ $this->add('number',
'weight',
ts('Order'),
CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'weight'),
$this->add('datepicker', 'start_date', ts('Start'), [], !$this->_isTemplate, ['time' => TRUE]);
$this->add('datepicker', 'end_date', ts('End'), [], FALSE, ['time' => TRUE]);
- $this->add('text', 'max_participants', ts('Max Number of Participants'),
+ $this->add('number', 'max_participants', ts('Max Number of Participants'),
array('onchange' => "if (this.value != '') {cj('#id-waitlist').show(); showHideByValue('has_waitlist','0','id-waitlist-text','table-row','radio',false); showHideByValue('has_waitlist','0','id-event_full','table-row','radio',true); return;} else {cj('#id-event_full, #id-waitlist, #id-waitlist-text').hide(); return;}")
);
$this->addRule('max_participants', ts('Max participants should be a positive number'), 'positiveInteger');
}
if ($this->_action & CRM_Core_Action::ADD) {
- $this->add('text', 'num_terms', ts('Number of Terms'), array('size' => 6));
+ $this->add('number', 'num_terms', ts('Number of Terms'), array('size' => 6));
}
$this->add('text', 'source', ts('Source'),
array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType()
);
- $this->add('text', 'num_terms', ts('Extend Membership by'), array('onchange' => "setPaymentBlock();"), TRUE);
+ $this->add('number', 'num_terms', ts('Extend Membership by'), array('onchange' => "setPaymentBlock();"), TRUE);
$this->addRule('num_terms', ts('Please enter a whole number for how many periods to renew.'), 'integer');
if (CRM_Core_Permission::access('CiviContribute') && !$this->_mode) {
$form->addElement('checkbox', 'is_tellfriend_enabled', ts("Allow 'Tell a friend' functionality"), NULL, array('onclick' => "return showHideByValue('is_tellfriend_enabled',true,'tflimit','table-row','radio',false);"));
- $form->add('text',
+ $form->add('number',
'tellfriend_limit',
ts("'Tell a friend' maximum recipients limit"),
CRM_Core_DAO::getAttribute('CRM_PCP_DAO_PCPBlock', 'tellfriend_limit')
);
$this->addRule('installments', ts('Please enter a valid number of installments.'), 'positiveInteger');
- $frequencyInterval = $this->add('text', 'frequency_interval', ts('every'),
+ $frequencyInterval = $this->add('number', 'frequency_interval', ts('every'),
$attributes['pledge_frequency_interval'], TRUE
);
$this->addRule('frequency_interval', ts('Please enter a number for frequency (e.g. every "3" months).'), 'positiveInteger');
TRUE
);
- $frequencyDay = $this->add('text', 'frequency_day', ts('Payments are due on the'), $attributes['frequency_day'], TRUE);
+ $frequencyDay = $this->add('number', 'frequency_day', ts('Payments are due on the'), $attributes['frequency_day'], TRUE);
$this->addRule('frequency_day', ts('Please enter a valid payment due day.'), 'positiveInteger');
$this->add('text', 'eachPaymentAmount', ts('each'), array(
'' => ' ',
) + $membershipTypes, FALSE,
array('onClick' => "calculateRowValues( );"));
- $this->add('text', 'membership_num_terms', ts('Number of Terms'), $attributes['membership_num_terms']);
+ $this->add('number', 'membership_num_terms', ts('Number of Terms'), $attributes['membership_num_terms']);
}
else {
$allComponents = explode(CRM_Core_DAO::VALUE_SEPARATOR, $extendComponentId);
if (in_array($eventComponentId, $allComponents)) {
$this->isEvent = TRUE;
// count
- $this->add('text', 'count', ts('Participant Count'));
+ $this->add('number', 'count', ts('Participant Count'));
$this->addRule('count', ts('Please enter a valid Max Participants.'), 'positiveInteger');
- $this->add('text', 'max_value', ts('Max Participants'));
+ $this->add('number', 'max_value', ts('Max Participants'));
$this->addRule('max_value', ts('Please enter a valid Max Participants.'), 'positiveInteger');
}