mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 17:48:43 +02:00
N°1986 Portal: Fix read-only forms from da5ccaa to work with auto-generated ones
This commit is contained in:
@@ -485,12 +485,6 @@ class ObjectFormManager extends FormManager
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a form can't be submitted to update an object, we have no reason to allow fields to be editable
|
|
||||||
if (!$this->GetIsSubmittable())
|
|
||||||
{
|
|
||||||
$sFieldFlags .= ' read_only';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise we proceed as usual
|
// Otherwise we proceed as usual
|
||||||
foreach (explode(' ', $sFieldFlags) as $sFieldFlag)
|
foreach (explode(' ', $sFieldFlags) as $sFieldFlag)
|
||||||
@@ -681,7 +675,8 @@ class ObjectFormManager extends FormManager
|
|||||||
// Failsafe for AttributeType that would not have MakeFormField and therefore could not be used in a form
|
// Failsafe for AttributeType that would not have MakeFormField and therefore could not be used in a form
|
||||||
if ($oField !== null)
|
if ($oField !== null)
|
||||||
{
|
{
|
||||||
if ($this->sMode !== static::ENUM_MODE_VIEW)
|
// If a form is in edit mode and can't be submitted to update an object (only transitions available), we have no reason to allow fields to be editable
|
||||||
|
if ($this->sMode !== static::ENUM_MODE_VIEW && $this->GetIsSubmittable())
|
||||||
{
|
{
|
||||||
// Field dependencies
|
// Field dependencies
|
||||||
$aFieldDependencies = $oAttDef->GetPrerequisiteAttributes();
|
$aFieldDependencies = $oAttDef->GetPrerequisiteAttributes();
|
||||||
|
|||||||
Reference in New Issue
Block a user