mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
BUG: open ticket 7314 fixing some bugs that have been found
This commit is contained in:
parent
4335d8d910
commit
eba5edd60b
@ -756,7 +756,7 @@ JS
|
||||
// check to see if they are a dynamic sender. eg based on a email field a user selected
|
||||
if($recipient->SendEmailFromField()) {
|
||||
$submittedFormField = $submittedFields->find('Name', $recipient->SendEmailFromField()->Name);
|
||||
if($submittedFormField) {
|
||||
if($submittedFormField && is_string($submittedFormField->Value)) {
|
||||
$email->setFrom($submittedFormField->Value);
|
||||
}
|
||||
}
|
||||
@ -764,7 +764,7 @@ JS
|
||||
if($recipient->SendEmailToField()) {
|
||||
$submittedFormField = $submittedFields->find('Name', $recipient->SendEmailToField()->Name);
|
||||
|
||||
if($submittedFormField) {
|
||||
if($submittedFormField && is_string($submittedFormField->Value)) {
|
||||
$email->setTo($submittedFormField->Value);
|
||||
}
|
||||
}
|
||||
@ -859,7 +859,8 @@ class UserDefinedForm_EmailRecipient extends DataObject {
|
||||
|
||||
// if they have email fields then we could send from it
|
||||
if($validEmailFields) {
|
||||
$fields->insertAfter(new DropdownField('SendEmailFromFieldID', _t('UserDefinedForm.ORSELECTAFIELDTOUSEASFROM', '.. or Select a Form Field to use as the From Address'), $validEmailFields->map('ID', 'Title'), '', null,""), 'EmailFrom');
|
||||
$fields->insertAfter(new DropdownField('SendEmailFromFieldID', _t('UserDefinedForm.ORSELECTAFIELDTOUSEASFROM', '.. or Select a Form Field to use as the From Address'),
|
||||
$validEmailFields->map('ID', 'Title'), '', null,""), 'EmailFrom');
|
||||
}
|
||||
|
||||
// if they have multiple options
|
||||
@ -875,7 +876,8 @@ class UserDefinedForm_EmailRecipient extends DataObject {
|
||||
}
|
||||
|
||||
$multiOptionFields = $multiOptionFields->map('ID', 'Title');
|
||||
$fields->insertAfter(new DropdownField('SendEmailToFieldID', _t('UserDefinedForm.ORSELECTAFIELDTOUSEASTO', '.. or Select a Field to use as the To Address'), $multiOptionFields, '', null, ""), 'EmailAddress');
|
||||
$fields->insertAfter(new DropdownField('SendEmailToFieldID', _t('UserDefinedForm.ORSELECTAFIELDTOUSEASTO', '.. or Select a Field to use as the To Address'),
|
||||
$multiOptionFields, '', null, ""), 'EmailAddress');
|
||||
}
|
||||
}
|
||||
|
||||
@ -904,7 +906,7 @@ class UserDefinedForm_SubmittedFormEmail extends Email {
|
||||
protected $ss_template = "SubmittedFormEmail";
|
||||
protected $data;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
public function __construct($submittedFields = null) {
|
||||
parent::__construct($submittedFields = null);
|
||||
}
|
||||
}
|
||||
|
@ -14,10 +14,12 @@ class EditableLiteralField extends EditableFormField {
|
||||
static $plural_name = 'HTML Blocks';
|
||||
|
||||
public function getFieldConfiguration() {
|
||||
|
||||
$customSettings = unserialize($this->CustomSettings);
|
||||
$content = (isset($customSettings['Content'])) ? $customSettings['Content'] : '';
|
||||
$textAreaField = new TextareaField(
|
||||
$this->getSettingName('Content'),
|
||||
"HTML"
|
||||
"HTML",
|
||||
$content
|
||||
);
|
||||
$textAreaField->setRows(4);
|
||||
$textAreaField->setColumns(20);
|
||||
|
Loading…
Reference in New Issue
Block a user