mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 15:05:42 +00:00
MINOR: usability improvements to the email popup
This commit is contained in:
parent
1ba4972e00
commit
f20a6f2c31
@ -574,28 +574,32 @@ class UserDefinedForm_EmailRecipient extends DataObject {
|
|||||||
* @return FieldSet
|
* @return FieldSet
|
||||||
*/
|
*/
|
||||||
public function getCMSFields_forPopup() {
|
public function getCMSFields_forPopup() {
|
||||||
|
|
||||||
$fields = new FieldSet(
|
$fields = new FieldSet(
|
||||||
new TextField('EmailSubject', _t('UserDefinedForm.EMAILSUBJECT', 'Email Subject')),
|
new TextField('EmailSubject', _t('UserDefinedForm.EMAILSUBJECT', 'Email Subject')),
|
||||||
new TextField('EmailFrom', _t('UserDefinedForm.FROMADDRESS','From Address')),
|
new TextField('EmailFrom', _t('UserDefinedForm.FROMADDRESS','Send Email From')),
|
||||||
new TextField('EmailAddress', _t('UserDefinedForm.SENDEMAILTO','Send Email To')),
|
new TextField('EmailAddress', _t('UserDefinedForm.SENDEMAILTO','Send Email To')),
|
||||||
new CheckboxField('SendPlain', _t('UserDefinedForm.SENDPLAIN', 'Send Email as Plain Text (HTML will be stripped)'))
|
new CheckboxField('SendPlain', _t('UserDefinedForm.SENDPLAIN', 'Send Email as Plain Text (HTML will be stripped)')),
|
||||||
|
new TextareaField('EmailBody', 'Body')
|
||||||
);
|
);
|
||||||
|
|
||||||
if($this->Form()) {
|
if($this->Form()) {
|
||||||
$validEmailFields = DataObject::get("EditableEmailField", "ParentID = '$this->FormID'");
|
$validEmailFields = DataObject::get("EditableEmailField", "ParentID = '$this->FormID'");
|
||||||
|
$multiOptionFields = DataObject::get("EditableMultipleOptionField", "ParentID = '$this->FormID'");
|
||||||
|
|
||||||
|
// if they have email fields then we could send from it
|
||||||
if($validEmailFields) {
|
if($validEmailFields) {
|
||||||
$validEmailFields = $validEmailFields->toDropdownMap('ID', 'Title');
|
$validEmailFields = $validEmailFields->toDropdownMap('ID', 'Title');
|
||||||
$fields->push(new DropdownField('SendEmailFromFieldID', _t('UserDefinedForm.SENDEMAILINSTEAD', 'Send Email Instead From'),$validEmailFields, '', null, _t('UserDefinedForm.USEDEFINEDVALUE', 'Use Defined Value')));
|
$fields->insertAfter(new DropdownField('SendEmailFromFieldID', _t('UserDefinedForm.ORSELECTAFIELDTOUSEASFROM', '.. or Select a Form Field to use as the From Address'),$validEmailFields, '', null,""), 'EmailFrom');
|
||||||
}
|
}
|
||||||
|
|
||||||
$dropdownFields = DataObject::get("EditableMultipleOptionField", "ParentID = '$this->FormID'");
|
// if they have multiple options
|
||||||
if($dropdownFields) {
|
if($multiOptionFields) {
|
||||||
$dropdownFields = $dropdownFields->toDropdownMap('ID', 'Title');
|
$multiOptionFields = $multiOptionFields->toDropdownMap('ID', 'Title');
|
||||||
$fields->push(new DropdownField('SendEmailToFieldID', _t('UserDefinedForm.SENDEMAILTO', 'Send Email Instead To'), $dropdownFields, '', null, _t('UserDefinedForm.USEDEFINEDVALUE', 'Use Defined Value')));
|
$fields->insertAfter(new DropdownField('SendEmailToFieldID', _t('UserDefinedForm.ORSELECTAFIELDTOUSEASTO', '.. or Select a Field to use as the To Address'), $multiOptionFields, '', null, ""), 'EmailAddress');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fields->push(new TextareaField('EmailBody', 'Body'));
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ $lang['en_US']['UserDefinedForm']['PLURALNAME'] = array(
|
|||||||
);
|
);
|
||||||
$lang['en_US']['UserDefinedForm']['RECEIVED'] = 'Received Submissions';
|
$lang['en_US']['UserDefinedForm']['RECEIVED'] = 'Received Submissions';
|
||||||
$lang['en_US']['UserDefinedForm']['SENDEMAILINSTEAD'] = 'Send Email Instead From';
|
$lang['en_US']['UserDefinedForm']['SENDEMAILINSTEAD'] = 'Send Email Instead From';
|
||||||
$lang['en_US']['UserDefinedForm']['SENDEMAILTO'] = 'Send Email Instead To';
|
$lang['en_US']['UserDefinedForm']['SENDEMAILTO'] = 'Send Email To';
|
||||||
$lang['en_US']['UserDefinedForm']['SENDPLAIN'] = 'Send Email as Plain Text (HTML will be stripped)';
|
$lang['en_US']['UserDefinedForm']['SENDPLAIN'] = 'Send Email as Plain Text (HTML will be stripped)';
|
||||||
$lang['en_US']['UserDefinedForm']['SHOWCLEARFORM'] = 'Show Clear Form Button';
|
$lang['en_US']['UserDefinedForm']['SHOWCLEARFORM'] = 'Show Clear Form Button';
|
||||||
$lang['en_US']['UserDefinedForm']['SINGULARNAME'] = array(
|
$lang['en_US']['UserDefinedForm']['SINGULARNAME'] = array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user