N.500 Changed the query to fetch tickets related to a CI, so as to make it unambiguous whatever customization is made to the datamodel.

SVN:trunk[4498]
This commit is contained in:
Romain Quetiez
2016-12-08 08:22:36 +00:00
parent 21fc272674
commit 1b1e91f0dc

View File

@@ -1582,7 +1582,8 @@
$sStateAttCode = MetaModel::GetStateAttributeCode($sSubClass);
if ($sStateAttCode != '')
{
$oSearch = DBSearch::FromOQL("SELECT $sSubClass AS t JOIN $sLnkClass AS lnk ON lnk.$sExtKeyToRemote = t.id WHERE $sExtKeyToMe = :myself AND $sStateAttCode NOT IN ('rejected', 'resolved', 'closed')", array('myself' => $this->GetKey()));
// Todo: base the search condition on operational_status = 'ongoing' for a more flexible behavior
$oSearch = DBSearch::FromOQL("SELECT $sSubClass AS t JOIN $sLnkClass AS lnk ON lnk.$sExtKeyToRemote = t.id WHERE lnk.$sExtKeyToMe = :myself AND t.$sStateAttCode NOT IN ('rejected', 'resolved', 'closed')", array('myself' => $this->GetKey()));
$aSearches[$sSubClass] = $oSearch;
$oSet = new DBObjectSet($oSearch);