diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 1dee1a34e..0c6566b92 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -4024,15 +4024,14 @@ class AttributeExternalKey extends AttributeDBFieldVoid $oFormField = new $sFormFieldClass($this->GetCode()); } + // Setting choices regarding the field dependencies $aFieldDependencies = $this->GetPrerequisiteAttributes(); - // Field dependencies if (!empty($aFieldDependencies)) { $oTmpAttDef = $this; $oTmpField = $oFormField; $oFormField->SetOnFinalizeCallback(function() use ($oTmpField, $oTmpAttDef, $oObject) { - //$oTmpField = $oForm->GetField($sFieldId); $oTmpField->SetChoices($oTmpAttDef->GetAllowedValues($oObject->ToArgsForQuery())); }); } @@ -4040,7 +4039,7 @@ class AttributeExternalKey extends AttributeDBFieldVoid { $oFormField->SetChoices($this->GetAllowedValues($oObject->ToArgsForQuery())); } - + // If ExtKey is mandatory, we add a validator to ensure that the value 0 is not selected if ($oObject->GetAttributeFlags($this->GetCode()) & OPT_ATT_MANDATORY) { @@ -6561,7 +6560,7 @@ class AttributeCustomFields extends AttributeDefinition $oFormField->SetForm($this->GetForm($oObject)); } parent::MakeFormField($oObject, $oFormField); - + return $oFormField; } diff --git a/sources/renderer/bootstrap/fieldrenderer/bssimplefieldrenderer.class.inc.php b/sources/renderer/bootstrap/fieldrenderer/bssimplefieldrenderer.class.inc.php index 923f495eb..4bf0d8674 100644 --- a/sources/renderer/bootstrap/fieldrenderer/bssimplefieldrenderer.class.inc.php +++ b/sources/renderer/bootstrap/fieldrenderer/bssimplefieldrenderer.class.inc.php @@ -59,9 +59,7 @@ class BsSimpleFieldRenderer extends FieldRenderer $oOutput->AddHtml(''); } $oOutput->AddHtml('
'); - $oOutput->AddHtml(''); + $oOutput->AddHtml(''); $oOutput->AddHtml(''); break; @@ -139,9 +137,7 @@ EOF break; case 'Combodo\\iTop\\Form\\Field\\HiddenField': - $oOutput->AddHtml(''); + $oOutput->AddHtml(''); break; } } @@ -170,13 +166,9 @@ EOF { $oOutput->AddHtml(''); } - $oOutput->AddHtml('
'); - $oOutput->AddHtml($this->oField->GetCurrentValue(), $bEncodeHtmlEntities); - $oOutput->AddHtml('
'); + $oOutput->AddHtml('
')->AddHtml($this->oField->GetCurrentValue(), $bEncodeHtmlEntities)->AddHtml('
'); } - $oOutput->AddHtml(''); + $oOutput->AddHtml(''); $oOutput->AddHtml(''); break; diff --git a/sources/renderer/bootstrap/fieldrenderer/bssubformfieldrenderer.class.inc.php b/sources/renderer/bootstrap/fieldrenderer/bssubformfieldrenderer.class.inc.php index d51a67544..46e2d4068 100644 --- a/sources/renderer/bootstrap/fieldrenderer/bssubformfieldrenderer.class.inc.php +++ b/sources/renderer/bootstrap/fieldrenderer/bssubformfieldrenderer.class.inc.php @@ -29,8 +29,16 @@ class BsSubFormFieldRenderer extends FieldRenderer { $oOutput = new RenderingOutput(); - $oOutput->AddHtml('
'); + if (($this->oField->GetLabel() !== null) && ($this->oField->GetLabel() !== '')) + { + $oOutput->AddHtml('
' . $this->oField->GetLabel() . ''); + } + $oOutput->AddHtml('
'); $oOutput->AddHtml('
'); + if (($this->oField->GetLabel() !== null) && ($this->oField->GetLabel() !== '')) + { + $oOutput->AddHtml('
'); + } $oRenderer = new BsFormRenderer($this->oField->GetForm()); $aRenderRes = $oRenderer->Render();