MINOR: fixed validation button width. MINOR: increased title to 255 chars rather then 50 to allow for longer checkboxs

This commit is contained in:
Will Rossiter 2009-07-05 07:14:03 +00:00
parent 9fd0a4b531
commit 3351ef17b3
4 changed files with 31 additions and 8 deletions

View File

@ -474,9 +474,10 @@ JS
$email->setBody($recipient->EmailBody);
$email->setSubject($recipient->EmailSubject);
$email->setTo($recipient->EmailAddress);
// check to see if they are a dynamic recipient. eg based on a field
// check to see if they are a dynamic sender. eg based on a email field
// a user selected
if($recipient->SendEmailFromFieldID) {
if($recipient->SendEmailFromField()) {
$name = Convert::raw2sql($recipient->SendEmailFromField()->Name);
if(defined('Database::USE_ANSI_SQL')) {
@ -485,10 +486,26 @@ JS
$submittedFormField = DataObject::get_one("SubmittedFormField", "Name = '$name' AND ParentID = '$submittedForm->ID'");
}
if($submittedFormField) {
$email->setFrom($submittedFormField->Value);
}
}
// check to see if they are a dynamic reciever eg based on a dropdown field
// a user selected
if($recipient->SendEmailToField()) {
$name = Convert::raw2sql($recipient->SendEmailToField()->Name);
if(defined('Database::USE_ANSI_SQL')) {
$submittedFormField = DataObject::get_one("SubmittedFormField", "\"Name\" = '$name' AND \"ParentID\" = '$submittedForm->ID'");
} else {
$submittedFormField = DataObject::get_one("SubmittedFormField", "Name = '$name' AND ParentID = '$submittedForm->ID'");
}
if($submittedFormField) {
$email->setTo($submittedFormField->Value);
}
}
if($recipient->SendPlain) {
$body = strip_tags($recipient->EmailBody) . "\n ";
if(isset($emailData['Fields'])) {
@ -549,7 +566,8 @@ class UserDefinedForm_EmailRecipient extends DataObject {
static $has_one = array(
'Form' => 'UserDefinedForm',
'SendEmailFromField' => 'EditableFormField'
'SendEmailFromField' => 'EditableFormField',
'SendEmailToField' => 'EditableFormField'
);
/**
@ -569,7 +587,13 @@ class UserDefinedForm_EmailRecipient extends DataObject {
if($validEmailFields) {
$validEmailFields = $validEmailFields->toDropdownMap('ID', 'Title');
$fields->push(new DropdownField('SendEmailFromFieldID', _t('UserDefinedForm.SENDEMAILINSTEAD', 'Send Email Instead To'),$validEmailFields, '', null, 'Use Fixed Email'));
$fields->push(new DropdownField('SendEmailFromFieldID', _t('UserDefinedForm.SENDEMAILINSTEAD', 'Send Email Instead From'),$validEmailFields, '', null, _t('UserDefinedForm.USEDEFINEDVALUE', 'Use Defined Value')));
}
$dropdownFields = DataObject::get("EditableMultipleOptionField", "ParentID = '$this->FormID'");
if($dropdownFields) {
$dropdownFields = $dropdownFields->toDropdownMap('ID', 'Title');
$fields->push(new DropdownField('SendEmailToFieldID', _t('UserDefinedForm.SENDEMAILTO', 'Send Email Instead To'), $dropdownFields, '', null, _t('UserDefinedForm.USEDEFINEDVALUE', 'Use Defined Value')));
}
}
$fields->push(new TextareaField('EmailBody', 'Body'));

View File

@ -12,8 +12,8 @@ class EditableOption extends DataObject {
static $default_sort = "Sort";
static $db = array(
"Name" => "Varchar",
"Title" => "Varchar",
"Name" => "Varchar(255)",
"Title" => "Varchar(255)",
"Default" => "Boolean",
"Sort" => "Int"
);

View File

@ -161,6 +161,7 @@
#Fields_fields .EditableFormField .checkbox input {
float: left;
width:auto;
margin: 0 8px 0 0;
}

View File

@ -1,6 +1,4 @@
<div class="FieldEditor <% if isReadonly %>readonly<% end_if %>" id="Fields">
<% include AddField %>
<div class="FieldListHold">
<ul class="FieldList" id="Fields_fields">