Solved the problem when the option sendEmail is set to no and the field validation. Now, if the option is set to no, the validation of the fields is deactivated. If is set to yes, the validation is activated.
Dieser Commit ist enthalten in:
Ursprung
d8c714ce28
Commit
b9754277c9
2 geänderte Dateien mit 28 neuen und 17 gelöschten Zeilen
|
@ -44,15 +44,22 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
||||||
'Msd_Form_Decorator',
|
'Msd_Form_Decorator',
|
||||||
'Msd/Form/Decorator/'
|
'Msd/Form/Decorator/'
|
||||||
);
|
);
|
||||||
$this->setDisplayGroupDecorators(array('DisplayGroup'));
|
|
||||||
|
if (isset($_POST['sendEmail']) && $_POST['sendEmail'] == 'y') {
|
||||||
|
$activateValidator = true;
|
||||||
|
} else {
|
||||||
|
$activateValidator = false;
|
||||||
|
}
|
||||||
|
|
||||||
$this->_addActivateButton();
|
$this->_addActivateButton();
|
||||||
$this->_addSender();
|
$this->_addSender($activateValidator);
|
||||||
$this->_addRecipient();
|
$this->_addRecipient($activateValidator);
|
||||||
$this->_addButtonAddRecipientCc();
|
$this->_addButtonAddRecipientCc();
|
||||||
|
|
||||||
// add Recipients CC
|
// add Recipients CC
|
||||||
$ccElements = $this->_setRecipientCc(
|
$ccElements = $this->_setRecipientCc(
|
||||||
$this->_config->get('config.email.RecipientCc')
|
$this->_config->get('config.email.RecipientCc'),
|
||||||
|
$activateValidator
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->_addAttachement();
|
$this->_addAttachement();
|
||||||
|
@ -157,9 +164,11 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
||||||
/**
|
/**
|
||||||
* Adds line with sender inputs
|
* Adds line with sender inputs
|
||||||
*
|
*
|
||||||
|
* @param bool $activateValidator
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function _addSender()
|
private function _addSender($activateValidator)
|
||||||
{
|
{
|
||||||
//Sender email
|
//Sender email
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
|
@ -171,7 +180,7 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
||||||
'size' => 30,
|
'size' => 30,
|
||||||
'listsep' => ' ',
|
'listsep' => ' ',
|
||||||
'disableLoadDefaultDecorators' => true,
|
'disableLoadDefaultDecorators' => true,
|
||||||
'required' => true,
|
'required' => $activateValidator,
|
||||||
'decorators' => array('LineStart'),
|
'decorators' => array('LineStart'),
|
||||||
'validators' => array('EmailAddress'),
|
'validators' => array('EmailAddress'),
|
||||||
)
|
)
|
||||||
|
@ -187,7 +196,7 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
||||||
'size' => 30,
|
'size' => 30,
|
||||||
'listsep' => ' ',
|
'listsep' => ' ',
|
||||||
'disableLoadDefaultDecorators' => true,
|
'disableLoadDefaultDecorators' => true,
|
||||||
'required' => true,
|
'required' => $activateValidator,
|
||||||
'decorators' => array('LineEnd'),
|
'decorators' => array('LineEnd'),
|
||||||
'validators' => array('NotEmpty'),
|
'validators' => array('NotEmpty'),
|
||||||
)
|
)
|
||||||
|
@ -197,11 +206,12 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
||||||
/**
|
/**
|
||||||
* Add line with recipient name and e-mail
|
* Add line with recipient name and e-mail
|
||||||
*
|
*
|
||||||
|
* @param bool $activateValidator
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function _addRecipient()
|
private function _addRecipient($activateValidator)
|
||||||
{
|
{
|
||||||
|
|
||||||
//Recipient email
|
//Recipient email
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'text',
|
'text',
|
||||||
|
@ -212,7 +222,7 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
||||||
'size' => 30,
|
'size' => 30,
|
||||||
'listsep' => ' ',
|
'listsep' => ' ',
|
||||||
'disableLoadDefaultDecorators' => true,
|
'disableLoadDefaultDecorators' => true,
|
||||||
'required' => true,
|
'required' => $activateValidator,
|
||||||
'decorators' => array('LineStart'),
|
'decorators' => array('LineStart'),
|
||||||
'validators' => array('EmailAddress'),
|
'validators' => array('EmailAddress'),
|
||||||
)
|
)
|
||||||
|
@ -228,7 +238,7 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
||||||
'size' => 30,
|
'size' => 30,
|
||||||
'listsep' => ' ',
|
'listsep' => ' ',
|
||||||
'disableLoadDefaultDecorators' => true,
|
'disableLoadDefaultDecorators' => true,
|
||||||
'required' => true,
|
'required' => $activateValidator,
|
||||||
'decorators' => array('LineEnd'),
|
'decorators' => array('LineEnd'),
|
||||||
'validators' => array('NotEmpty'),
|
'validators' => array('NotEmpty'),
|
||||||
)
|
)
|
||||||
|
@ -259,16 +269,17 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add Cc-Recipients
|
* Add Cc-Recipients
|
||||||
*
|
*
|
||||||
* @param $recipientsCc
|
* @param $recipientsCc
|
||||||
|
* @param bool $activateValidator
|
||||||
*
|
*
|
||||||
* @internal param array $configRecipientCc All Cc-Recipients
|
* @internal param array $configRecipientCc All Cc-Recipients
|
||||||
*
|
*
|
||||||
* @return array Element names to add to display group
|
* @return array Element names to add to display group
|
||||||
*/
|
*/
|
||||||
private function _setRecipientCc($recipientsCc)
|
private function _setRecipientCc($recipientsCc, $activateValidator)
|
||||||
{
|
{
|
||||||
if ($recipientsCc === null) {
|
if ($recipientsCc === null) {
|
||||||
return;
|
return;
|
||||||
|
@ -290,7 +301,7 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
||||||
'listsep' => ' ',
|
'listsep' => ' ',
|
||||||
'size' => 30,
|
'size' => 30,
|
||||||
'disableLoadDefaultDecorators' => true,
|
'disableLoadDefaultDecorators' => true,
|
||||||
'required' => true,
|
'required' => $activateValidator,
|
||||||
'decorators' => array('LineStart'),
|
'decorators' => array('LineStart'),
|
||||||
'validators' => array('EmailAddress'),
|
'validators' => array('EmailAddress'),
|
||||||
|
|
||||||
|
@ -307,7 +318,7 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
||||||
'listsep' => ' ',
|
'listsep' => ' ',
|
||||||
'size' => 30,
|
'size' => 30,
|
||||||
'disableLoadDefaultDecorators' => true,
|
'disableLoadDefaultDecorators' => true,
|
||||||
'required' => true,
|
'required' => $activateValidator,
|
||||||
'decorators' => array('LineMiddle'),
|
'decorators' => array('LineMiddle'),
|
||||||
'validators' => array('NotEmpty'),
|
'validators' => array('NotEmpty'),
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# If you're a developer add the following line to your apache config. Otherwise ignore the line.
|
SetEnv APPLICATION_ENV development
|
||||||
# SetEnv APPLICATION_ENV development
|
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
|
RewriteBase /msd
|
||||||
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||||
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||||
RewriteCond %{REQUEST_FILENAME} -d
|
RewriteCond %{REQUEST_FILENAME} -d
|
||||||
|
|
Laden …
In neuem Issue referenzieren