From 43da94ed9c18a198ac71d0f145be8e9d238421d4 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Wed, 17 Oct 2018 14:42:49 -0400 Subject: [PATCH] Fix for #57 --- classes/ste_cat.inc | 12 ++++++++---- ste/index.php | 17 ++++------------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/classes/ste_cat.inc b/classes/ste_cat.inc index 5b3bc86..cf6f4a3 100644 --- a/classes/ste_cat.inc +++ b/classes/ste_cat.inc @@ -254,10 +254,10 @@ class ste_cat */ public function get_Table_Row($intCount = 0, $status_count = null) { - $nf = 0; - $open = 0; - $na = 0; - if (!is_null($status_count)) { + $nf = $this->nf; + $open = $this->open; + $na = $this->na; + if (!is_null($status_count) && is_array($status_count)) { if (isset($status_count['nf'])) { $nf = $status_count['nf']; } @@ -271,6 +271,10 @@ class ste_cat } } + if(!$intCount) { + $intCount = $this->tgt_count; + } + $cat_sources = []; if (is_array($this->sources) && count($this->sources)) { foreach ($this->sources as $src) { diff --git a/ste/index.php b/ste/index.php index d540fd6..fe8d330 100644 --- a/ste/index.php +++ b/ste/index.php @@ -468,20 +468,11 @@ include_once 'header.inc'; } } + /** + * @var ste_cat $cat + */ foreach ($cats as $cat) { - $nr = $db->get_Finding_Count_By_Status($cat->get_ID(), "Not Reviewed"); - $na = $db->get_Finding_Count_By_Status($cat->get_ID(), "Not Applicable"); - $nf = $db->get_Finding_Count_By_Status($cat->get_ID(), "Not a Finding"); - $open = $db->get_Finding_Count_By_Status($cat->get_ID(), "Open"); - - $count = $db->get_STE_Cat_TGT_Count($cat->get_ID()); - - print $cat->get_Table_Row($count, [ - "open" => $open, - "nf" => $nf, - "na" => $na, - "nr" => $nr - ]); + print $cat->get_Table_Row(); } } else {