mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°6135 Delegate form & field creation in AttributeDefinition
Will allow to create SubFormField for the portal
This commit is contained in:
@@ -2508,22 +2508,7 @@ HTML;
|
||||
/** @var \ormCustomFieldsValue $value */
|
||||
$oForm = $value->GetForm($sFormPrefix);
|
||||
} else if ($sAttDefEditClass === 'FormField') {
|
||||
$sFormId = 'ff_'.$oAttDef->GetCode();
|
||||
if (utils::IsNotNullOrEmptyString($sFormPrefix)) {
|
||||
$sFormId = $sFormPrefix.$sFormId;
|
||||
}
|
||||
|
||||
$oForm = new Combodo\iTop\Form\Form($sFormId);
|
||||
|
||||
// creating manually the field, as we need a specific id for the JS to work (send data back to the server)
|
||||
$sFormFieldClass = $oAttDef::GetFormFieldClass();
|
||||
$oAttDefField = new $sFormFieldClass($sAttCode.'_field');
|
||||
|
||||
$oAttDef->MakeFormField($aArgs['this'], $oAttDefField);
|
||||
// Remove label generated in MakeFormField : the current method should return the field only, as the label is already generated in the caller GetBareProperties()
|
||||
$oAttDefField->SetLabel('');
|
||||
|
||||
$oForm->AddField($oAttDefField);
|
||||
$oForm = $oAttDef->GetForm($aArgs['this'], $sFormPrefix);
|
||||
}
|
||||
|
||||
$oFormRenderer = new ConsoleFormRenderer($oForm);
|
||||
|
||||
Reference in New Issue
Block a user