[icinga-checkins] icinga.org: icinga-web/mhein/default: * Changed process of grid count queries

git at icinga.org git at icinga.org
Tue Jul 27 09:54:15 CEST 2010


Module: icinga-web
Branch: mhein/default
Commit: 851f9220a3dcc00021a5e1a40babf2b3d6078c5f
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=851f9220a3dcc00021a5e1a40babf2b3d6078c5f

Author: Marius Hein <marius.hein at netways.de>
Date:   Tue Jul 27 09:52:44 2010 +0200

* Changed process of grid count queries

---

 .../lib/template/IcingaTemplateWorker.class.php    |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/app/modules/Web/lib/template/IcingaTemplateWorker.class.php b/app/modules/Web/lib/template/IcingaTemplateWorker.class.php
index 0b57caa..c8538bb 100755
--- a/app/modules/Web/lib/template/IcingaTemplateWorker.class.php
+++ b/app/modules/Web/lib/template/IcingaTemplateWorker.class.php
@@ -100,14 +100,13 @@ class IcingaTemplateWorker {
 					$this->api_count->setResultColumns($fields);
 					$this->api_count->setResultType(IcingaApi::RESULT_ARRAY);
 					$result  = $this->api_count->fetch();
-					
+
 					// Try to determine the fields
 					$row = $result->getRow();
 					
 					if ($row !== false) {
 						$fields = array_keys($row);
 						$field = array_shift($fields);
-					
 						$this->result_count = (int)$row[ $field ];
 					}
 				}
@@ -282,16 +281,16 @@ class IcingaTemplateWorker {
 			}
 			
 			$this->setPrivileges($search);
-			
+
+			// Clone our count query
+			$this->api_count = clone $search;
+
 			// Groupby fields
 			$gbf = $this->getGroupByFields();
 			if (is_array($gbf) && count($gbf)>0) {
 				$search->setSearchGroup($gbf);
 			}
 			
-			// Clone our count query
-			$this->api_count = clone $search;
-			
 			// the result columns
 			$search->setResultColumns($this->collectColumns());
 			





More information about the icinga-checkins mailing list