diff --git a/core/config.class.inc.php b/core/config.class.inc.php
index 857dfbaff3..89e306d576 100644
--- a/core/config.class.inc.php
+++ b/core/config.class.inc.php
@@ -1787,6 +1787,14 @@ class Config
'source_of_value' => '',
'show_in_conf_sample' => false,
],
+ 'audit.filter' => [
+ 'type' => 'array',
+ 'description' => 'Array to use in filter "field" => ["label" =>"my_label", "values" => "array_of_values","oql"=>"my_oql"]',
+ 'default' => [],
+ 'value' => [],
+ 'source_of_value' => '',
+ 'show_in_conf_sample' => false,
+ ],
'application.secret' => [
'type' => 'string',
'description' => 'Application secret, uses this value for encrypting the cookies used in the remember me functionality and for creating signed URIs when using ESI (Edge Side Includes).',
diff --git a/dictionaries/en.dictionary.itop.ui.php b/dictionaries/en.dictionary.itop.ui.php
index e3d5dcd585..125b9f03a7 100644
--- a/dictionaries/en.dictionary.itop.ui.php
+++ b/dictionaries/en.dictionary.itop.ui.php
@@ -778,6 +778,8 @@
'UI:Audit:Dashboard:ObjectsInError' => 'Objects in errors',
'UI:Audit:Dashboard:ObjectsValidated' => 'Objects validated',
'UI:Audit:AuditCategory:Subtitle' => '%1$s errors ouf of %2$s - %3$s%% of the object are valid',
+ 'UI:Audit:Interactive:Selection:SubTitleParams' => 'Please select the following parameters: ',
+ 'UI:Audit:Interactive:FilterList' => 'With following parameters: ',
'UI:RunQuery:Title' => ITOP_APPLICATION_SHORT.' - OQL Query Evaluation',
diff --git a/dictionaries/fr.dictionary.itop.ui.php b/dictionaries/fr.dictionary.itop.ui.php
index a1a1238412..54e7edeb68 100644
--- a/dictionaries/fr.dictionary.itop.ui.php
+++ b/dictionaries/fr.dictionary.itop.ui.php
@@ -470,7 +470,9 @@
'UI:AttemptingToSetAReadOnlyAttribute_Name' => 'Tentative de modification du champ en lecture seule: %1$s',
'UI:AttemptingToSetASlaveAttribute_Name' => 'Le champ %1$s (%2$s) ne peut pas être modifié car il est géré par une synchronisation avec une source de données. Valeur ignorée.',
'UI:Audit:AuditCategory:Subtitle' => '%1$s en erreur sur %2$s - %3$s%% des objets sont valides',
- 'UI:Audit:AuditErrors' => 'Audit Errors~~',
+ 'UI:Audit:Interactive:Selection:SubTitleParams' => 'Veuillez sélectionner les paramètres suivant : ',
+ 'UI:Audit:Interactive:FilterList' => 'Avec les paramètres suivants : ',
+ 'UI:Audit:AuditErrors' => 'Audit Errors~~',
'UI:Audit:Dashboard:ObjectsAudited' => 'Objets audités',
'UI:Audit:Dashboard:ObjectsInError' => 'Objets en erreur',
'UI:Audit:Dashboard:ObjectsValidated' => 'Objets valides',
diff --git a/pages/audit.php b/pages/audit.php
index ed952ebbff..2c89601c6d 100644
--- a/pages/audit.php
+++ b/pages/audit.php
@@ -9,14 +9,23 @@
use Combodo\iTop\Application\UI\Base\Component\Dashlet\DashletContainer;
use Combodo\iTop\Application\UI\Base\Component\Dashlet\DashletFactory;
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableUIBlockFactory;
+use Combodo\iTop\Application\UI\Base\Component\Field\FieldUIBlockFactory;
+use Combodo\iTop\Application\UI\Base\Component\Html\Html;
+use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
+use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory;
+use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Panel\Panel;
+use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Text\Text;
use Combodo\iTop\Application\UI\Base\Component\Title\TitleUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardColumn;
use Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardRow;
+use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
use Combodo\iTop\Application\WebPage\CSVPage;
use Combodo\iTop\Application\WebPage\ErrorPage;
use Combodo\iTop\Application\WebPage\iTopWebPage;
+use Combodo\iTop\Core\MetaModel\FriendlyNameType;
+use Combodo\iTop\Form\Field\SelectObjectField;
/**
* Adds the context parameters to the audit rule query
@@ -97,11 +106,12 @@ function FilterByContext(DBSearch &$oFilter, ApplicationContext $oAppContext)
* @throws \CoreException
* @throws \OQLException
*/
-function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
+function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext, $aParams = [])
{
$oRule = MetaModel::GetObject('AuditRule', $iRuleId);
$sOql = $oRule->Get('query');
- $oRuleFilter = DBObjectSearch::FromOQL($sOql);
+ $oRuleFilter = DBObjectSearch::FromOQL($sOql, $aParams);
+
$oRuleFilter->UpdateContextFromUser();
FilterByContext($oRuleFilter, $oAppContext); // Not needed since this filter is a subset of the definition filter, but may speedup things
@@ -122,6 +132,7 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
}
/** @var \DBObjectSearch $oFilter */
$oFilter = $oDefinitionFilter->DeepClone();
+
if (count($aValidIds) > 0)
{
$aInDefSet = array();
@@ -143,6 +154,324 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
return $oFilter;
}
+function MakeSelectField($oPage, string $sLabel, string $sFieldName, string $sOql, string $sCurrentValue)
+{
+ $oSearch = DBObjectSearch::FromOQL($sOql);
+ $oAllowedValues = new DBObjectSet($oSearch);
+ $oAllowedValues->SetShowObsoleteData(utils::ShowObsoleteData());
+ $iMaxComboLength = MetaModel::GetConfig()->Get('max_combo_length');
+
+ $bIsAutocomplete = $oAllowedValues->CountExceeds($iMaxComboLength);
+ $sWrapperCssClass = $bIsAutocomplete ? 'ibo-input-select-autocomplete-wrapper' : 'ibo-input-select-wrapper';
+ $sHTMLValue = "
";
+
+ return new Html( $sHTMLValue);
+}
try
{
require_once('../approot.inc.php');
@@ -152,6 +481,11 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
$bSelectionAuditRulesByDefault = utils::GetConfig()->Get('audit.enable_selection_landing_page');
$operation = utils::ReadParam('operation', $bSelectionAuditRulesByDefault ? 'selection' : 'audit');
+ $aAuditFilter = utils::GetConfig()->Get('audit.filter');
+ if ($aAuditFilter == null){
+ $aAuditFilter = [];
+ }
+
$oAppContext = new ApplicationContext();
require_once(APPROOT.'/application/loginwebpage.class.inc.php');
@@ -167,19 +501,32 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
// Therefore we don't use the standard "search_oql" operation of UI.php to display the CSV
$iCategory = utils::ReadParam('category', '');
$iRuleIndex = utils::ReadParam('rule', 0);
-
- $oAuditCategory = MetaModel::GetObject('AuditCategory', $iCategory);
- $oDefinitionFilter = DBObjectSearch::FromOQL($oAuditCategory->Get('definition_set'));
+
+ $aFilterParams = [];
+ $sAddingParams = '';
+ if($aAuditFilter !=[] ){
+ foreach ($aAuditFilter as $sFieldName => $aFieldParam) {
+ $sCurrentValue = utils::ReadParam($sFieldName, '');
+ $sAddingParams .= "&$sFieldName=$sCurrentValue";
+ $aFilterParams[$sFieldName] = $sCurrentValue;
+ }
+ }
+
+ $oAuditCategory = MetaModel::GetObject('AuditCategory', $iCategory);
+ $oDefinitionFilter = DBObjectSearch::FromOQL($oAuditCategory->Get('definition_set'),$aFilterParams);
$oDefinitionFilter->UpdateContextFromUser();
FilterByContext($oDefinitionFilter, $oAppContext);
$oDefinitionSet = new CMDBObjectSet($oDefinitionFilter);
- $oFilter = GetRuleResultFilter($iRuleIndex, $oDefinitionFilter, $oAppContext);
+ $oFilter = GetRuleResultFilter($iRuleIndex, $oDefinitionFilter, $oAppContext, $aFilterParams);
$oErrorObjectSet = new CMDBObjectSet($oFilter);
$oAuditRule = MetaModel::GetObject('AuditRule', $iRuleIndex);
$sFileName = utils::ReadParam('filename', null, true, 'string');
$bAdvanced = utils::ReadParam('advanced', false);
$sAdvanced = $bAdvanced ? '&advanced=1' : '';
-
+
+
+
+
if ($sFileName != null)
{
$oP = new CSVPage("iTop - Export");
@@ -224,7 +571,7 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
$oP->p("");
// Adjust the size of the Textarea containing the CSV to fit almost all the remaining space
$oP->add_ready_script(" $('#1>textarea').height(400);"); // adjust the size of the block
- $sExportUrl = utils::GetAbsoluteUrlAppRoot()."pages/audit.php?operation=csv&category=".$oAuditCategory->GetKey()."&rule=".$oAuditRule->GetKey();
+ $sExportUrl = utils::GetAbsoluteUrlAppRoot()."pages/audit.php?operation=csv&category=".$oAuditCategory->GetKey()."&rule=".$oAuditRule->GetKey().$sAddingParams;
$oDownloadButton = ButtonUIBlockFactory::MakeForAlternativePrimaryAction('fas fa-chevron-left', Dict::S('UI:Audit:InteractiveAudit:Back'), "./audit.php?".$oAppContext->GetForLink());
$oP->add_ready_script("$('a[href*=\"webservices/export.php?expression=\"]').attr('href', '".$sExportUrl."&filename=audit.csv".$sAdvanced."');");
@@ -237,12 +584,34 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
$iCategory = utils::ReadParam('category', '');
$iRuleIndex = utils::ReadParam('rule', 0);
+ $aFilterParams = [];
+ $sAddingParams = '';
+ $oPanel = PanelUIBlockFactory::MakeNeutral('',Dict::S('UI:Audit:Interactive:FilterList'));
+ if($aAuditFilter !=[] ){
+ foreach ($aAuditFilter as $sFieldName => $aFieldParam) {
+ $sCurrentValue = utils::ReadParam($sFieldName, '');
+ $sAddingParams .= "&$sFieldName=$sCurrentValue";
+ $aFilterParams[$sFieldName] = $sCurrentValue;
+ $sName = '';
+ if (array_key_exists('oql', $aFieldParam) && utils::IsNotNullOrEmptyString($aFieldParam['oql'])) {
+ $oSearch = new DBObjectSet(DBObjectSearch::FromOQL($aFieldParam['oql']));
+ $sClass = $oSearch->GetClass();
+ $oObject = MetaModel::GetObject($sClass, $sCurrentValue);
+ $sName = $oObject->GetName();
+ } else {//this is a list of values
+ $sName = $aFieldParam['values'][$sCurrentValue];
+ }
+ $sFilterText .= ''.$aFieldParam['label'].': '.$sName.'';
+ }
+ $oPanel->AddSubBlock(new Html($sFilterText.''));
+ }
+
$oAuditCategory = MetaModel::GetObject('AuditCategory', $iCategory);
- $oDefinitionFilter = DBObjectSearch::FromOQL($oAuditCategory->Get('definition_set'));
+ $oDefinitionFilter = DBObjectSearch::FromOQL($oAuditCategory->Get('definition_set'), $aFilterParams);
$oDefinitionFilter->UpdateContextFromUser();
FilterByContext($oDefinitionFilter, $oAppContext);
$oDefinitionSet = new CMDBObjectSet($oDefinitionFilter);
- $oFilter = GetRuleResultFilter($iRuleIndex, $oDefinitionFilter, $oAppContext);
+ $oFilter = GetRuleResultFilter($iRuleIndex, $oDefinitionFilter, $oAppContext,$aFilterParams);
$oErrorObjectSet = new CMDBObjectSet($oFilter);
$oAuditRule = MetaModel::GetObject('AuditRule', $iRuleIndex);
$sDescription = get_class($oAuditRule).": ".$oAuditRule->GetName();
@@ -251,12 +620,16 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
$oBackButton = ButtonUIBlockFactory::MakeIconLink('fas fa-chevron-left', Dict::S('UI:Audit:Interactive:Button:Back'), "./audit.php?".$oAppContext->GetForLink());
$oP->AddUiBlock($oBackButton);
$oP->AddUiBlock(TitleUIBlockFactory::MakeForPage($sTitle.$oAuditRule->Get('description')));
+ if($aAuditFilter !=[] ){
+ $oP->AddUiBlock($oPanel);
+ $oP->AddUiBlock(new Html('
'));
+ }
$sBlockId = 'audit_errors';
$oP->p("");
$oBlock = DisplayBlock::FromObjectSet($oErrorObjectSet, 'list', array('show_obsolete_data' => true));
$oBlock->Display($oP, 1);
$oP->p("
");
- $sExportUrl = utils::GetAbsoluteUrlAppRoot()."pages/audit.php?operation=csv&category=".$oAuditCategory->GetKey()."&rule=".$oAuditRule->GetKey();
+ $sExportUrl = utils::GetAbsoluteUrlAppRoot()."pages/audit.php?operation=csv&category=".$oAuditCategory->GetKey()."&rule=".$oAuditRule->GetKey().$sAddingParams;
$oP->add_ready_script("$('a[href*=\"pages/UI.php?operation=search\"]').attr('href', '".$sExportUrl."')");
break;
@@ -267,7 +640,39 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
$oP->AddUiBlock($oButton);
}
$oP->AddUiBlock(TitleUIBlockFactory::MakeForPage(Dict::S('UI:Audit:Interactive:Selection:Title')));
- $oP->AddUiBlock(new Text(Dict::S('UI:Audit:Interactive:Selection:SubTitle')));
+
+ if($aAuditFilter !=[] ){
+ $oPanel = PanelUIBlockFactory::MakeNeutral('',Dict::S('UI:Audit:Interactive:Selection:SubTitleParams'));
+ $oP->AddUiBlock($oPanel);
+ foreach ($aAuditFilter as $sFieldName => $aFieldParam) {
+
+ $oBlock = FieldUIBlockFactory::MakeStandard($aFieldParam['label']);
+ $oBlock->SetAttLabel($aFieldParam['label'])
+ ->AddDataAttribute("input-id", $sFieldName)
+ ->AddDataAttribute("input-type", 'input-type');
+ $oValue = UIContentBlockUIBlockFactory::MakeStandard("", ["form-field-content", "ibo-input-field-wrapper"]);
+
+ $sCurrentValue = utils::ReadParam($sFieldName, '');
+
+ if (array_key_exists('oql', $aFieldParam) && utils::IsNotNullOrEmptyString($aFieldParam['oql'])) {
+ $oValue->AddSubBlock(MakeSelectField( $oP, $aFieldParam['label'], $sFieldName, $aFieldParam['oql'], $sCurrentValue));
+ } else {//this is a list of values
+ $aListValues = $aFieldParam['values'];
+ $oSelect = SelectUIBlockFactory::MakeForSelect($sFieldName, $sFieldName);
+ $oSelect->AddCSSClass('ibo-input-field-wrapper');
+
+ foreach($aListValues as $sKey => $sValue) {
+ $oSelect->AddOption(SelectOptionUIBlockFactory::MakeForSelectOption($sKey, $sValue, ($sCurrentValue == $sKey)));
+ }
+
+ $oValue->AddSubBlock($oSelect);
+ }
+ $oBlock->AddSubBlock($oValue);
+ $oPanel->AddSubBlock($oBlock);
+ }
+
+ }
+ $oP->AddUiBlock(TitleUIBlockFactory::MakeNeutral(Dict::S('UI:Audit:Interactive:Selection:SubTitle'),2));
// Header block to select all audit categories
$oCategoriesSet = new DBObjectSet(new DBObjectSearch('AuditCategory'));
@@ -278,11 +683,23 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
$oDashboardColumn = new DashboardColumn(false, true);
$oDashboardRow->AddDashboardColumn($oDashboardColumn);
$oAllCategoriesDashlet = new DashletContainer();
+
+ $sDomainUrl = utils::GetAbsoluteUrlAppRoot()."pages/audit.php?operation=audit";
+ if($aAuditFilter !=[] ) {
+ //modif URLLink In order to send params
+ $sGetParams = '';
+ foreach ($aAuditFilter as $sFieldName => $aFieldParam) {
+ $sGetParams .= $sFieldName."=$('[name=$sFieldName]').val();";
+ $sDomainUrl .= "&".$sFieldName."='+$sFieldName+'";
+ }
+ $sDomainUrl = 'javascript:'.$sGetParams.' window.location = \''.$sDomainUrl.'\'';
+ }
+
$oAllCategoriesDashlet
->AddCSSClasses(['ibo-dashlet--is-inline', 'ibo-dashlet-badge'])
->AddSubBlock(DashletFactory::MakeForDashletBadge(
utils::GetAbsoluteUrlAppRoot().'images/icons/icons8-audit.svg',
- utils::GetAbsoluteUrlAppRoot()."pages/audit.php?operation=audit",
+ $sDomainUrl,
$iCategoryCount,
Dict::S('UI:Audit:Interactive:Selection:BadgeAll')
));
@@ -311,14 +728,25 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
$sIconUrl = $oImage->GetDisplayURL(get_class($oAuditDomain), $oAuditDomain->GetKey(), 'icon');
}
$iCategoryCount = $oAuditDomain->Get('categories_list')->Count();
+
+ if($aAuditFilter !=[] ) {
+ //modif URLLink In order to send params
+ $sGetParams = '';
+ foreach ($aAuditFilter as $sFieldName => $aFieldParam) {
+ $sGetParams .= $sFieldName."=$('[name=$sFieldName]').val();";
+ $sDomainUrl .= "&".$sFieldName."='+$sFieldName+'";
+ }
+ $sDomainUrl = 'javascript:'.$sGetParams.' window.location = \''.$sDomainUrl.'\'';
+ }
+
$oDomainBlock = DashletFactory::MakeForDashletBadge($sIconUrl, $sDomainUrl, $iCategoryCount, $oAuditDomain->Get('name'));
$oDomainDashlet = new DashletContainer();
$oDomainDashlet->AddSubBlock($oDomainBlock)->AddCSSClasses(['ibo-dashlet--is-inline', 'ibo-dashlet-badge']);
$oDashboardRow->GetSubBlocks()[$iDomainCnt % 3]->AddUIBlock($oDomainDashlet); // ;
$iDomainCnt++;
}
+ $oP->AddUiBlock($oDashboardRow);
- $oP->AddUiBlock($oDashboardRow);
break;
case 'audit':
@@ -355,6 +783,33 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
$oBackButton = ButtonUIBlockFactory::MakeLinkNeutral("./audit.php?".$oAppContext->GetForLink(), Dict::S('UI:Audit:Interactive:Button:Back'), 'fas fa-chevron-left');
$oP->AddUiBlock($oBackButton);
$oP->AddUiBlock(TitleUIBlockFactory::MakeForPage($sTitle));
+
+
+ $aFilterParams = [];
+ $sAddingParams = '';
+ if($aAuditFilter !=[] ){
+ $oPanel = PanelUIBlockFactory::MakeNeutral('',Dict::S('UI:Audit:Interactive:FilterList'));
+ $oP->AddUiBlock($oPanel);
+
+ foreach ($aAuditFilter as $sFieldName => $aFieldParam) {
+ $sCurrentValue = utils::ReadParam($sFieldName, '');
+ $sAddingParams .= "&$sFieldName=$sCurrentValue";
+ $aFilterParams[$sFieldName] = $sCurrentValue;
+ $sName = '';
+ if (array_key_exists('oql', $aFieldParam) && utils::IsNotNullOrEmptyString($aFieldParam['oql'])) {
+ $oSearch = new DBObjectSet(DBObjectSearch::FromOQL($aFieldParam['oql']));
+ $sClass = $oSearch->GetClass();
+ $oObject = MetaModel::GetObject($sClass, $sCurrentValue);
+ $sName = $oObject->GetName();
+ } else {//this is a list of values
+ $sName = $aFieldParam['values'][$sCurrentValue];
+ }
+ $sFilterText .= ''.$aFieldParam['label'].': '.$sName.'';
+ }
+ $oPanel->AddSubBlock(new Html($sFilterText.''));
+ }
+ $oP->AddUiBlock(new Html('
'));
+
$oP->AddUiBlock(new Text($sSubTitle));
$oTotalBlock = DashletFactory::MakeForDashletBadge(utils::GetAbsoluteUrlAppRoot().'images/icons/icons8-audit.svg', '#', 0, Dict::S('UI:Audit:Dashboard:ObjectsAudited'));
@@ -400,12 +855,12 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
// Add a button in the above toolbar
$sAuditCategoryClass = get_class($oAuditCategory);
if (UserRights::IsActionAllowed($sAuditCategoryClass, UR_ACTION_READ)) {
- $oToolbar->AddSubBlock(ButtonUIBlockFactory::MakeIconLink('fas fa-wrench fa-lg', Dict::S('UI:Audit:ViewRules'), ApplicationContext::MakeObjectUrl($sAuditCategoryClass, $oAuditCategory->GetKey()).'ObjectProperties=tab_ClassAuditCategoryAttributerules_list'),);
+ $oToolbar->AddSubBlock(ButtonUIBlockFactory::MakeIconLink('fas fa-wrench fa-lg', Dict::S('UI:Audit:ViewRules'), ApplicationContext::MakeObjectUrl($sAuditCategoryClass, $oAuditCategory->GetKey()).$sAddingParams.'ObjectProperties=tab_ClassAuditCategoryAttributerules_list'),);
}
$aResults = array();
try {
$iCount = 0;
- $oDefinitionFilter = DBObjectSearch::FromOQL($oAuditCategory->Get('definition_set'));
+ $oDefinitionFilter = DBObjectSearch::FromOQL($oAuditCategory->Get('definition_set'),$aFilterParams);
$oDefinitionFilter->UpdateContextFromUser();
FilterByContext($oDefinitionFilter, $oAppContext);
@@ -419,24 +874,28 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext)
$iCount = $oDefinitionSet->Count();
$oRulesFilter = new DBObjectSearch('AuditRule');
$oRulesFilter->AddCondition('category_id', $oAuditCategory->GetKey(), '=');
+ foreach ($aFilterParams as $sFieldName => $sCurrentValue) {
+ $oRulesFilter->AddInternalParam($sFieldName, $sCurrentValue);
+ }
+
$oRulesSet = new DBObjectSet($oRulesFilter);
while ($oAuditRule = $oRulesSet->fetch()) {
$aRow = array();
$aRow['description'] = $oAuditRule->GetName();
if ($iCount == 0) {
// nothing to check, really !
- $aRow['nb_errors'] = "GetKey()."&rule=".$oAuditRule->GetKey()."\">0";
+ $aRow['nb_errors'] = "GetKey()."&rule=".$oAuditRule->GetKey().$sAddingParams."\">0";
$aRow['percent_ok'] = '100.00';
$aRow['class'] = $oAuditCategory->GetReportColor($iCount, 0);
} else {
try {
- $oFilter = GetRuleResultFilter($oAuditRule->GetKey(), $oDefinitionFilter, $oAppContext);
- $aErrors = $oFilter->SelectAttributeToArray('id');
+ $oFilter = GetRuleResultFilter($oAuditRule->GetKey(), $oDefinitionFilter, $oAppContext, $aFilterParams);
+ $aErrors = $oFilter->SelectAttributeToArray('id');
$iErrorsCount = count($aErrors);
foreach ($aErrors as $aErrorRow) {
$aObjectsWithErrors[$aErrorRow['id']] = true;
}
- $aRow['nb_errors'] = ($iErrorsCount == 0) ? '0' : "GetKey()."&rule=".$oAuditRule->GetKey()."&".$oAppContext->GetForLink()."\">$iErrorsCount GetKey()."&rule=".$oAuditRule->GetKey()."&".$oAppContext->GetForLink()."\">";
+ $aRow['nb_errors'] = ($iErrorsCount == 0) ? '0' : "GetKey()."&rule=".$oAuditRule->GetKey().$sAddingParams."&".$oAppContext->GetForLink()."\">$iErrorsCount GetKey()."&rule=".$oAuditRule->GetKey().$sAddingParams."&".$oAppContext->GetForLink()."\">";
$aRow['percent_ok'] = sprintf('%.2f', 100.0 * (($iCount - $iErrorsCount) / $iCount));
$aRow['class'] = $oAuditCategory->GetReportColor($iCount, $iErrorsCount);
}