Obsolescence: finalizing the implementation of the flag (hide obsolete objects, show an icon on hyperlinks and a tag on the object details, user preference defaulting to the new setting 'show_obsolete_data')

SVN:trunk[4739]
This commit is contained in:
Romain Quetiez
2017-05-17 08:51:10 +00:00
parent ebe467b77a
commit 248f8d6fd4
45 changed files with 372 additions and 57 deletions

View File

@@ -209,8 +209,7 @@ class RelationGraph extends SimpleGraph
{
if ($sOQL === '') return;
$oSearch = DBObjectSearch::FromOQL($sOQL);
$oSearch->SetArchiveMode(false); // Exclude archived objects anytime
$oSearch = static::MakeSearch($sOQL);
$aAliases = $oSearch->GetSelectedClasses();
if (count($aAliases) < 2 )
{
@@ -394,8 +393,7 @@ class RelationGraph extends SimpleGraph
$sQuery = $bDown ? $aQueryInfo['sQueryDown'] : $aQueryInfo['sQueryUp'];
try
{
$oFlt = DBObjectSearch::FromOQL($sQuery);
$oFlt->SetArchiveMode(false); // Exclude archived objects anytime
$oFlt = static::MakeSearch($sQuery);
$oObjSet = new DBObjectSet($oFlt, array(), $oObject->ToArgsForQuery());
$oRelatedObj = $oObjSet->Fetch();
}
@@ -461,8 +459,7 @@ class RelationGraph extends SimpleGraph
$sQuery = $aQueryInfo['sQueryUp'];
try
{
$oFlt = DBObjectSearch::FromOQL($sQuery);
$oFlt->SetArchiveMode(false); // Exclude archived objects anytime
$oFlt = static::MakeSearch($sQuery);
$oObjSet = new DBObjectSet($oFlt, array(), $oObject->ToArgsForQuery());
$iCount = $oObjSet->Count();
}
@@ -580,4 +577,17 @@ class RelationGraph extends SimpleGraph
}
return $aResults;
}
protected static function MakeSearch($sOQL)
{
$oSearch = DBSearch::FromOQL($sOQL);
if (MetaModel::IsObsoletable($oSearch->GetClass()))
{
// Exclude obsolete objects anytime
$oSearch->AddCondition('obsolescence_flag', 0);
}
// Exclude archived objects anytime
$oSearch->SetArchiveMode(false);
return $oSearch;
}
}