|
@@ -2398,14 +2398,27 @@ EOF
|
|
$iFieldIndex = 0;
|
|
$iFieldIndex = 0;
|
|
$aFieldsMap = array();
|
|
$aFieldsMap = array();
|
|
|
|
|
|
|
|
+ // The list of candidate fields is made of the ordered list of "details" attributes + other attributes
|
|
|
|
+ $aAttributes = array();
|
|
|
|
+ foreach ($this->FlattenZList(MetaModel::GetZListItems($sClass, 'details')) as $sAttCode)
|
|
|
|
+ {
|
|
|
|
+ $aAttributes[$sAttCode] = true;
|
|
|
|
+ }
|
|
|
|
+ foreach(MetaModel::GetAttributesList($sClass) as $sAttCode)
|
|
|
|
+ {
|
|
|
|
+ if (!array_key_exists($sAttCode, $aAttributes))
|
|
|
|
+ {
|
|
|
|
+ $aAttributes[$sAttCode] = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// Order the fields based on their dependencies, set the fields for which there is only one possible value
|
|
// Order the fields based on their dependencies, set the fields for which there is only one possible value
|
|
// and perform this in the order of dependencies to avoid dead-ends
|
|
// and perform this in the order of dependencies to avoid dead-ends
|
|
$aDeps = array();
|
|
$aDeps = array();
|
|
- foreach(MetaModel::GetAttributesList($sClass) as $sAttCode)
|
|
|
|
|
|
+ foreach($aAttributes as $sAttCode => $trash)
|
|
{
|
|
{
|
|
$aDeps[$sAttCode] = MetaModel::GetPrequisiteAttributes($sClass, $sAttCode);
|
|
$aDeps[$sAttCode] = MetaModel::GetPrequisiteAttributes($sClass, $sAttCode);
|
|
}
|
|
}
|
|
- $aList =$this->OrderDependentFields($aDeps);
|
|
|
|
|
|
+ $aList = $this->OrderDependentFields($aDeps);
|
|
|
|
|
|
foreach($aList as $sAttCode)
|
|
foreach($aList as $sAttCode)
|
|
{
|
|
{
|