mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-18 16:18:47 +02:00
Retrofit from trunk
N°870 - Avoid Obsolete data export in CSV, Excel and PDF [from revision 5218] N°870 - Avoid Obsolete data in audit results [from revision 5219] N°870 - Fix the display of archived objects in the dashlets when activating/deactivating the archive mode. [from revision 5226] SVN:2.4[5248]
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -2155,6 +2155,7 @@ EOF
|
||||
if ($sExpression === null)
|
||||
{
|
||||
$oQuerySearch = DBObjectSearch::FromOQL('SELECT QueryOQL WHERE id = :query_id', array('query_id' => $iQueryId));
|
||||
$oQuerySearch->UpdateContextFromUser();
|
||||
$oQueries = new DBObjectSet($oQuerySearch);
|
||||
if ($oQueries->Count() > 0)
|
||||
{
|
||||
@@ -2169,6 +2170,7 @@ EOF
|
||||
if($sExpression !== null)
|
||||
{
|
||||
$oSearch = DBObjectSearch::FromOQL($sExpression);
|
||||
$oSearch->UpdateContextFromUser();
|
||||
$oExporter = BulkExport::FindExporter($sFormat, $oSearch);
|
||||
$oExporter->SetObjectList($oSearch);
|
||||
$oExporter->SetFormat($sFormat);
|
||||
|
||||
@@ -88,6 +88,7 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
|
||||
$oRule = MetaModel::GetObject('AuditRule', $iRuleId);
|
||||
$sOql = $oRule->Get('query');
|
||||
$oRuleFilter = DBObjectSearch::FromOQL($sOql);
|
||||
$oRuleFilter->UpdateContextFromUser();
|
||||
FilterByContext($oRuleFilter, $oAppContext); // Not needed since this filter is a subset of the definition filter, but may speedup things
|
||||
|
||||
if ($oRule->Get('valid_flag') == 'false')
|
||||
@@ -168,6 +169,7 @@ try
|
||||
|
||||
$oAuditCategory = MetaModel::GetObject('AuditCategory', $iCategory);
|
||||
$oDefinitionFilter = DBObjectSearch::FromOQL($oAuditCategory->Get('definition_set'));
|
||||
$oDefinitionFilter->UpdateContextFromUser();
|
||||
FilterByContext($oDefinitionFilter, $oAppContext);
|
||||
$oDefinitionSet = new CMDBObjectSet($oDefinitionFilter);
|
||||
$oFilter = GetRuleResultFilter($iRuleIndex, $oDefinitionFilter, $oAppContext);
|
||||
@@ -232,6 +234,7 @@ try
|
||||
|
||||
$oAuditCategory = MetaModel::GetObject('AuditCategory', $iCategory);
|
||||
$oDefinitionFilter = DBObjectSearch::FromOQL($oAuditCategory->Get('definition_set'));
|
||||
$oDefinitionFilter->UpdateContextFromUser();
|
||||
FilterByContext($oDefinitionFilter, $oAppContext);
|
||||
$oDefinitionSet = new CMDBObjectSet($oDefinitionFilter);
|
||||
$oFilter = GetRuleResultFilter($iRuleIndex, $oDefinitionFilter, $oAppContext);
|
||||
@@ -265,6 +268,7 @@ try
|
||||
try
|
||||
{
|
||||
$oDefinitionFilter = DBObjectSearch::FromOQL($oAuditCategory->Get('definition_set'));
|
||||
$oDefinitionFilter->UpdateContextFromUser();
|
||||
FilterByContext($oDefinitionFilter, $oAppContext);
|
||||
|
||||
$aObjectsWithErrors = array();
|
||||
|
||||
@@ -137,6 +137,7 @@ function DisplayExpressionForm(WebPage $oP, $sAction, $sExpression = '', $sExcep
|
||||
$oP->add('<td><select name="query" id="select_phrasebook">');
|
||||
$oP->add('<option value="">'.Dict::S('UI:SelectOne').'</option>');
|
||||
$oSearch = DBObjectSearch::FromOQL('SELECT QueryOQL');
|
||||
$oSearch->UpdateContextFromUser();
|
||||
$oQueries = new DBObjectSet($oSearch);
|
||||
while ($oQuery = $oQueries->Fetch())
|
||||
{
|
||||
@@ -239,6 +240,7 @@ EOF
|
||||
try
|
||||
{
|
||||
$oExportSearch = DBObjectSearch::FromOQL($sExpression);
|
||||
$oExportSearch->UpdateContextFromUser();
|
||||
}
|
||||
catch(OQLException $e)
|
||||
{
|
||||
@@ -257,11 +259,13 @@ EOF
|
||||
{
|
||||
$oP->add('<input type="hidden" name="expression" value="'.htmlentities($sExpression, ENT_QUOTES, 'UTF-8').'">');
|
||||
$oExportSearch = DBObjectSearch::FromOQL($sExpression);
|
||||
$oExportSearch->UpdateContextFromUser();
|
||||
}
|
||||
else
|
||||
{
|
||||
$oQuery = MetaModel::GetObject('QueryOQL', $sQueryId);
|
||||
$oExportSearch = DBObjectSearch::FromOQL($oQuery->Get('oql'));
|
||||
$oExportSearch->UpdateContextFromUser();
|
||||
$oP->add('<input type="hidden" name="query" value="'.htmlentities($sQueryId, ENT_QUOTES, 'UTF-8').'">');
|
||||
}
|
||||
$aFormPartsByFormat = array();
|
||||
@@ -379,6 +383,7 @@ EOF
|
||||
if ($sQueryId !== null)
|
||||
{
|
||||
$oSearch = DBObjectSearch::FromOQL('SELECT QueryOQL WHERE id = :query_id', array('query_id' => $sQueryId));
|
||||
$oSearch->UpdateContextFromUser();
|
||||
$oQueries = new DBObjectSet($oSearch);
|
||||
if ($oQueries->Count() > 0)
|
||||
{
|
||||
@@ -406,6 +411,7 @@ EOF
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($sFormat !== null)
|
||||
{
|
||||
@@ -458,7 +464,8 @@ function CheckParameters($sExpression, $sQueryId, $sFormat)
|
||||
if ($sExpression === null)
|
||||
{
|
||||
$oSearch = DBObjectSearch::FromOQL('SELECT QueryOQL WHERE id = :query_id', array('query_id' => $sQueryId));
|
||||
$oQueries = new DBObjectSet($oSearch);
|
||||
$oSearch->UpdateContextFromUser();
|
||||
$oQueries = new DBObjectSet($oSearch);
|
||||
if ($oQueries->Count() > 0)
|
||||
{
|
||||
$oQuery = $oQueries->Fetch();
|
||||
@@ -478,6 +485,7 @@ function CheckParameters($sExpression, $sQueryId, $sFormat)
|
||||
try
|
||||
{
|
||||
$oSearch = DBObjectSearch::FromOQL($sExpression);
|
||||
$oSearch->UpdateContextFromUser();
|
||||
$aArgs = array();
|
||||
foreach($oSearch->GetQueryParams() as $sParam => $foo)
|
||||
{
|
||||
@@ -608,6 +616,7 @@ if (utils::IsModeCLI())
|
||||
if ($sExpression === null)
|
||||
{
|
||||
$oSearch = DBObjectSearch::FromOQL('SELECT QueryOQL WHERE id = :query_id', array('query_id' => $sQueryId));
|
||||
$oSearch->UpdateContextFromUser();
|
||||
$oQueries = new DBObjectSet($oSearch);
|
||||
if ($oQueries->Count() > 0)
|
||||
{
|
||||
@@ -622,6 +631,7 @@ if (utils::IsModeCLI())
|
||||
try
|
||||
{
|
||||
$oSearch = DBObjectSearch::FromOQL($sExpression);
|
||||
$oSearch->UpdateContextFromUser();
|
||||
$aArgs = array();
|
||||
foreach($oSearch->GetQueryParams() as $sParam => $foo)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user