From 63379898ac9d8bcd8e020a8d01e2c826124ddeba Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Thu, 9 Jan 2025 13:01:23 +0100 Subject: [PATCH] (Multi)QuickActions: Hide `Process check` button when related feature command is disabled --- library/Icingadb/Widget/Detail/MultiselectQuickActions.php | 2 ++ library/Icingadb/Widget/Detail/QuickActions.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/library/Icingadb/Widget/Detail/MultiselectQuickActions.php b/library/Icingadb/Widget/Detail/MultiselectQuickActions.php index b9a9f0c8..aefc6a21 100644 --- a/library/Icingadb/Widget/Detail/MultiselectQuickActions.php +++ b/library/Icingadb/Widget/Detail/MultiselectQuickActions.php @@ -120,6 +120,7 @@ class MultiselectQuickActions extends BaseHtmlElement $unacknowledged = "{$this->getColumnPrefix()}_problems_unacknowledged"; $acks = "{$this->getColumnPrefix()}_acknowledged"; $activeChecks = "{$this->getColumnPrefix()}_active_checks_enabled"; + $passiveChecks = "{$this->getColumnPrefix()}_passive_checks_enabled"; if ( $this->summary->$unacknowledged > $this->summary->$acks @@ -233,6 +234,7 @@ class MultiselectQuickActions extends BaseHtmlElement if ( $this->allowToProcessCheckResults + && $this->summary->$passiveChecks > 0 && $this->isGrantedOnType( 'icingadb/command/process-check-result', $this->type, diff --git a/library/Icingadb/Widget/Detail/QuickActions.php b/library/Icingadb/Widget/Detail/QuickActions.php index 2ea26c26..52eacab8 100644 --- a/library/Icingadb/Widget/Detail/QuickActions.php +++ b/library/Icingadb/Widget/Detail/QuickActions.php @@ -104,7 +104,10 @@ class QuickActions extends BaseHtmlElement ); } - if ($this->isGrantedOn('icingadb/command/process-check-result', $this->object)) { + if ( + $this->object->passive_checks_enabled + && $this->isGrantedOn('icingadb/command/process-check-result', $this->object) + ) { $this->assembleAction( 'processCheckresult', t('Process check result'),