Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-19853 replace interval controls with numeric #9664

Merged
merged 3 commits into from
Jan 11, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions CRM/Admin/Form/ScheduleReminders.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ public function buildQuickForm() {
//get the frequency units.
$this->_freqUnits = CRM_Core_SelectValues::getRecurringFrequencyUnits();

$numericOptions = CRM_Core_SelectValues::getNumericOptions(0, 30);

//reminder_interval
$this->add('select', 'start_action_offset', ts('When'), $numericOptions);
$this->add('number', 'start_action_offset', ts('When'), array('style' => 'width:5em'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a css class instead of an inline style? Like 'class' => 'six' ought to do it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add property 'min' => 1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did add 'min' => 1, but later noticed the select controls actually have 0-30, so changed min to zero.

$this->addRule('start_action_offset', ts('Value should be a positive number'), 'positiveInteger');

$isActive = ts('Send email');
$recordActivity = ts('Record activity for automated email');
if ($providersCount) {
Expand Down Expand Up @@ -208,9 +208,13 @@ public function buildQuickForm() {
);

$this->add('select', 'repetition_frequency_unit', ts('every'), $freqUnitsDisplay);
$this->add('select', 'repetition_frequency_interval', ts('every'), $numericOptions);
$this->add('number', 'repetition_frequency_interval', ts('every'), array('style' => 'width:5em'));
$this->addRule('repetition_frequency_interval', ts('Value should be a positive number'), 'positiveInteger');

$this->add('select', 'end_frequency_unit', ts('until'), $freqUnitsDisplay);
$this->add('select', 'end_frequency_interval', ts('until'), $numericOptions);
$this->add('number', 'end_frequency_interval', ts('until'), array('style' => 'width:5em'));
$this->addRule('end_frequency_interval', ts('Value should be a positive number'), 'positiveInteger');

$this->add('select', 'end_action', ts('Repetition Condition'), $condition, TRUE);
$this->add('select', 'end_date', ts('Date Field'), $selectedMapping->getDateFields(), TRUE);

Expand Down