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

@@ -1351,9 +1351,17 @@ class QueryBuilderExpressions
protected $m_aJoinFields;
protected $m_aClassIds;
public function __construct($oSearch, $aGroupByExpr = null)
public function __construct(DBObjectSearch $oSearch, $aGroupByExpr = null)
{
$this->m_oConditionExpr = $oSearch->GetCriteria();
if ($oSearch->GetShowObsoleteData() || !MetaModel::IsObsoletable($oSearch->GetClass()))
{
$this->m_oConditionExpr = $oSearch->GetCriteria();
}
else
{
$oNotObsolete = new BinaryExpression(new FieldExpression('obsolescence_flag', $oSearch->GetClassAlias()), '=', new ScalarExpression(0));
$this->m_oConditionExpr = new BinaryExpression($oSearch->GetCriteria(), 'AND', $oNotObsolete);
}
$this->m_aSelectExpr = array();
$this->m_aGroupByExpr = $aGroupByExpr;
$this->m_aJoinFields = array();