diff --git a/datamodels/2.x/itop-portal-base/portal/src/forms/objectformmanager.class.inc.php b/datamodels/2.x/itop-portal-base/portal/src/forms/objectformmanager.class.inc.php index 379da9cde9..785958ef57 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/forms/objectformmanager.class.inc.php +++ b/datamodels/2.x/itop-portal-base/portal/src/forms/objectformmanager.class.inc.php @@ -1,6 +1,6 @@ + * @since iTop 2.3.0 */ class ObjectFormManager extends FormManager { @@ -611,13 +612,14 @@ class ObjectFormManager extends FormManager // - Else if it's must change (transition), we force it as not readonly and not hidden elseif (($iFieldFlags & OPT_ATT_MUSTCHANGE) === OPT_ATT_MUSTCHANGE && $this->IsTransitionForm()) { - $oField->SetReadOnly(false); + $oField->SetMustChange(true); + $oField->SetReadOnly(false); $oField->SetHidden(false); } - // - Else if it's must prompt (transition), we force it as not readonly and not hidden + // - Else if it's must prompt (transition), we force it as mustchange, not readonly and not hidden elseif (($iFieldFlags & OPT_ATT_MUSTPROMPT) === OPT_ATT_MUSTPROMPT && $this->IsTransitionForm()) { - $oField->SetReadOnly(false); + $oField->SetReadOnly(false); $oField->SetHidden(false); } // - Else if it wasn't mandatory or already had a value, and it's hidden, we force it as hidden diff --git a/sources/form/field/caselogfield.class.inc.php b/sources/form/field/caselogfield.class.inc.php index c14545d96a..fc0cae63e4 100644 --- a/sources/form/field/caselogfield.class.inc.php +++ b/sources/form/field/caselogfield.class.inc.php @@ -1,6 +1,6 @@ + * @since iTop 2.3.0 */ class CaseLogField extends TextAreaField { protected $aEntries; + /** + * @param bool $bMustChange + * @return $this + */ + public function SetMustChange($bMustChange) + { + $this->SetMandatory($bMustChange); + return $this; + } + /** * * @return array diff --git a/sources/form/field/field.class.inc.php b/sources/form/field/field.class.inc.php index 417175e595..58f61044a9 100644 --- a/sources/form/field/field.class.inc.php +++ b/sources/form/field/field.class.inc.php @@ -1,6 +1,6 @@ + * @since iTop 2.3.0 */ abstract class Field { @@ -134,6 +135,18 @@ abstract class Field return $this->bReadOnly; } + /** + * Note: This not implemented yet! Just a pre-conception for CaseLogField + * + * @todo Implement + * @return boolean + */ + public function GetMustChange() + { + // TODO + return false; + } + /** * * @return boolean @@ -272,6 +285,20 @@ abstract class Field return $this; } + /** + * Sets if the field is must change or not. + * Note: This not implemented yet! Just a pre-conception for CaseLogField + * + * @todo Implement + * @param boolean $bMustChange + * @return \Combodo\iTop\Form\Field\Field + */ + public function SetMustChange($bMustChange) + { + // TODO. + return $this; + } + /** * * @param $sDisplayMode