mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 15:05:42 +00:00
BUGFIX: fixed sorting values on new fields
This commit is contained in:
parent
d4d53acf40
commit
b83bc79fc2
@ -328,8 +328,8 @@ class UserDefinedForm_Controller extends Page_Controller {
|
||||
$sendCopy = false;
|
||||
$attachments = array();
|
||||
|
||||
$submittedFields = new DataObjectSet();
|
||||
|
||||
$submittedFields = new DataObjectSet();
|
||||
|
||||
foreach($this->Fields() as $field) {
|
||||
$submittedField = new SubmittedFormField();
|
||||
$submittedField->ParentID = $submittedForm->ID;
|
||||
|
@ -86,13 +86,9 @@ class EditableTextField extends EditableFormField {
|
||||
* Populates the default fields.
|
||||
*/
|
||||
function DefaultField() {
|
||||
$disabled = '';
|
||||
if( $this->readonly ){
|
||||
$disabled = " disabled=\"disabled\"";
|
||||
} else {
|
||||
$disabled = '';
|
||||
}
|
||||
if( $this->Rows == 1 ){
|
||||
$disabled = ($this->readonly) ? " disabled=\"disabled\"" : '';
|
||||
|
||||
if($this->Rows == 1){
|
||||
return '<div class="field text"><label class="left">'._t('EditableTextField.DEFAULTTEXT', 'Default Text').' </label> <input class="defaultText" name="Fields['.Convert::raw2att( $this->ID ).'][Default]" type="text" value="'.Convert::raw2att( $this->getField('Default') ).'"'.$disabled.' /></div>';
|
||||
}else{
|
||||
return '<div class="field text"><label class="left">'._t('EditableTextField.DEFAULTTEXT', 'Default Text').' </label> <textarea class="defaultText" name="Fields['.Convert::raw2att( $this->ID ).'][Default]"'.$disabled.'>'.Convert::raw2att( $this->getField('Default') ).'</textarea></div>';
|
||||
|
@ -159,12 +159,13 @@ class FieldEditor extends FormField {
|
||||
$className = "Editable" . ucfirst($_REQUEST['Type']);
|
||||
$name = $this->name;
|
||||
if(is_subclass_of($className, "EditableFormField")) {
|
||||
$e = new $className();
|
||||
$e->write();
|
||||
$e->ParentID = $this->form->getRecord()->ID;
|
||||
$e->Name = $e->class . $e->ID;
|
||||
$e->write();
|
||||
return $e->EditSegment();
|
||||
$field = new $className();
|
||||
$field->write();
|
||||
$field->ParentID = $this->form->getRecord()->ID;
|
||||
$field->Name = $e->class . $e->ID;
|
||||
$field->Sort = $sort;
|
||||
$field->write();
|
||||
return $field->EditSegment();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -58,5 +58,5 @@
|
||||
<input type="hidden" class="canDeleteHidden" name="$Name.Attr[CanDelete]" value="$CanDelete" />
|
||||
<input type="hidden" class="customParameterHidden" name="$Name.Attr[CustomParameter]" value="$CustomParameter" />
|
||||
<input type="hidden" class="typeHidden" name="$Name.Attr[Type]" value="$ClassName" />
|
||||
<input type="hidden" class="sortHidden" name="$Name.Attr[Sort]" value="-1" />
|
||||
<input type="hidden" class="sortHidden" name="$Name.Attr[Sort]" value="$Sort" />
|
||||
</li>
|
Loading…
x
Reference in New Issue
Block a user