[icinga-checkins] icinga.org: icingaweb2-module-director/master: index: improve details

git at icinga.org git at icinga.org
Fri Feb 19 01:10:15 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: 1463a1930c907bba5001cbe3e3a29848f9a2e188
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=1463a1930c907bba5001cbe3e3a29848f9a2e188

Author: Thomas Gelf <thomas at gelf.net>
Date:   Fri Feb 19 01:09:57 2016 +0100

index: improve details

---

 application/views/scripts/index/index.phtml |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/application/views/scripts/index/index.phtml b/application/views/scripts/index/index.phtml
index ab9dad7..835b57c 100644
--- a/application/views/scripts/index/index.phtml
+++ b/application/views/scripts/index/index.phtml
@@ -27,7 +27,6 @@ function statSummary($self, $type) {
             $msg = $self->translate('One object has been defined');
         }
 
-        return $msg;
     } else {
         $msg = sprintf(
             $self->translate('%d objects have been defined'),
@@ -35,11 +34,9 @@ function statSummary($self, $type) {
         );
     }
 
-    if ($stat->cnt_total === $stat->cnt_object) {
-        return $msg;
-    }
-
     $extra = array();
+    if ($stat->cnt_total !== $stat->cnt_object) {
+
     if ($stat->cnt_template > 0) {
         $extra[] = sprintf(
             $self->translate('%d of them are templates'),
@@ -52,6 +49,7 @@ function statSummary($self, $type) {
             $stat->cnt_external
         );
     }
+    }
 
     if (array_key_exists($type . 'group', $self->stats)) {
         $groupstat = $self->stats[$type . 'group'];
@@ -61,11 +59,16 @@ function statSummary($self, $type) {
             $extra[] = $self->translate('one related group exists');
         } else {
             $extra[] = sprintf(
-                $self->translate('%s related group objects have been created', $groupstat->cnt_total)
+                $self->translate('%s related group objects have been created'),
+                $groupstat->cnt_total
             );
         }
     }
 
+    if (empty($extra)) {
+        return $msg;
+    }
+
     return $msg . ', ' . implode(', ', $extra);
 }
 



More information about the icinga-checkins mailing list