CC-3718: Please enable user to input the mail server settings

-done
This commit is contained in:
denise 2012-06-11 12:53:09 -04:00
parent 7d4851573f
commit ca8187c9c2
10 changed files with 352 additions and 82 deletions

View file

@ -68,44 +68,6 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
$week_start_day->setValue(Application_Model_Preference::GetWeekStartDay());
$week_start_day->setDecorators(array('ViewHelper'));
$this->addElement($week_start_day);
//enable system emails.
$this->addElement('checkbox', 'enableSystemEmail', array(
'label' => 'Enable System Emails (Password Reset)',
'required' => false,
'value' => Application_Model_Preference::GetEnableSystemEmail(),
'decorators' => array(
'ViewHelper'
)
));
// Add end date element
$systemEmail = new Zend_Form_Element_Text('systemEmail');
$systemEmail->class = 'input_text';
$systemEmail->setRequired(false)
->setValue(Application_Model_Preference::GetSystemEmail())
->setLabel('Reset Password \'From\' Email')
->setFilters(array('StringTrim'))
->setValidators(array(
'NotEmpty',
'EmailAddress'
))
->setDecorators(array('ViewHelper'));
$systemEmail->addValidator('Callback', true, array(
'callback' => function($value, $context) {
if ($context['enableSystemEmail']) {
return true;
}
return false;
},
'messages' => array(
Zend_Validate_Callback::INVALID_VALUE => 'Email must be enabled'
),
));
$this->addElement($systemEmail);
}
private function getTimezones(){