From 735cd28dfd7db2b70f9cfdbc79924980b0a53e60 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Fri, 26 Mar 2010 16:40:58 +0000 Subject: [PATCH] Regression when fixing bug #89: the "state" attribute was editable. This is now fixed. SVN:trunk[320] --- application/uiwizard.class.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/uiwizard.class.inc.php b/application/uiwizard.class.inc.php index 72ee34e6d..16f08163e 100644 --- a/application/uiwizard.class.inc.php +++ b/application/uiwizard.class.inc.php @@ -145,13 +145,15 @@ $sJSHandlerCode $aFieldsDone = array(); // Store all the fields that are already covered by a previous step of the wizard $aStates = MetaModel::EnumStates($this->m_sClass); + $sStateAttCode = MetaModel::GetStateAttributeCode($this->m_sClass); $aMandatoryAttributes = array(); // Some attributes are always mandatory independently of the state machine (if any) foreach(MetaModel::GetAttributesList($this->m_sClass) as $sAttCode) { $oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $sAttCode); - if (!$oAttDef->IsExternalField() && !$oAttDef->IsNullAllowed()) + if (!$oAttDef->IsExternalField() && !$oAttDef->IsNullAllowed() && + ($sAttCode != 'finalclass') && ($sAttCode != $sStateAttCode) ) { $aMandatoryAttributes[$sAttCode] = OPT_ATT_MANDATORY; } @@ -231,7 +233,6 @@ $sJSHandlerCode // Now computes the steps to fill the optional fields - $sStateAttCode = MetaModel::GetStateAttributeCode($this->m_sClass); $aFields = array(); // reset foreach(MetaModel::ListAttributeDefs($this->m_sClass) as $sAttCode=>$oAttDef) {