Author:   Lars Michelsen <[email protected]>
Date:     Fri Jan 10 11:09:04 2014 +0100
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Fri Jan 10 11:09:04 2014 +0100

FIX: Fixed missing values alias, display_name, address values in hover templates

---

 ChangeLog                                          |    1 +
 share/server/core/classes/objects/NagVisMapObj.php |    3 +-
 share/server/core/classes/objects/NagVisObject.php |   24 +++++++++++--------
 .../server/core/classes/objects/NagVisService.php  |   17 --------------
 4 files changed, 17 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 38e97fe..b454fd8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@ Core:
   * Dropped the merlinmy backend for the moment as it was not working for a
     time. Please provide a fixed one if you like to see this working again
   * FIX: Fixed PHP errors when acknowleding host/service problems 
+  * FIX: Fixed missing values alias, display_name, address values in hover 
templates
 
 Installer:
   * FIX: Installer uses /etc/apache2/conf-available instead of the old conf.d
diff --git a/share/server/core/classes/objects/NagVisMapObj.php 
b/share/server/core/classes/objects/NagVisMapObj.php
index 72052b9..e2e0f65 100644
--- a/share/server/core/classes/objects/NagVisMapObj.php
+++ b/share/server/core/classes/objects/NagVisMapObj.php
@@ -57,7 +57,6 @@ class NagVisMapObj extends NagVisStatefulObject {
         $this->MAPCFG = $MAPCFG;
 
         $this->map_name = $this->MAPCFG->getName();
-        $this->alias = $this->MAPCFG->getAlias();
 
         $this->linkedMaps = Array();
         $this->isSummaryObject = false;
@@ -69,6 +68,8 @@ class NagVisMapObj extends NagVisStatefulObject {
         $this->backend_id = $this->MAPCFG->getValue(0, 'backend_id');
 
         parent::__construct();
+
+        $this->state[ALIAS] = $this->MAPCFG->getAlias();
     }
 
     /**
diff --git a/share/server/core/classes/objects/NagVisObject.php 
b/share/server/core/classes/objects/NagVisObject.php
index d1ee06c..c61fade 100644
--- a/share/server/core/classes/objects/NagVisObject.php
+++ b/share/server/core/classes/objects/NagVisObject.php
@@ -314,16 +314,20 @@ class NagVisObject {
                 unset($arr[$this->type.'_name']);
             }
 
-            if(isset($this->alias) && $this->alias != '') {
-                $arr['alias'] = $this->alias;
-            } else {
-                $arr['alias'] = '';
-            }
-
-            if(isset($this->display_name) && $this->display_name != '') {
-                $arr['display_name'] = $this->display_name;
-            } else {
-                $arr['display_name'] = '';
+            if ($this->type == 'host' || $this->type == 'service') {
+                $obj_attrs = array(
+                    'alias'         => ALIAS,
+                    'display_name'  => DISPLAY_NAME,
+                    'address'       => ADDRESS,
+                    'notes'         => NOTES,
+                    'check_command' => CHECK_COMMAND,
+                );
+                foreach ($obj_attrs AS $attr => $state_key) {
+                    if (isset($this->state[$state_key]) && 
$this->state[$state_key] != '')
+                        $arr[$attr] = $this->state[$state_key];
+                    else
+                        $arr[$attr] = '';
+                }
             }
 
             // Add the custom htmlcgi path for the object
diff --git a/share/server/core/classes/objects/NagVisService.php 
b/share/server/core/classes/objects/NagVisService.php
index 4e28888..ea91500 100644
--- a/share/server/core/classes/objects/NagVisService.php
+++ b/share/server/core/classes/objects/NagVisService.php
@@ -32,23 +32,6 @@ class NagVisService extends NagVisStatefulObject {
     protected static $langType = null;
     protected static $langSelf = null;
 
-    protected $host_name;
-    protected $service_description;
-    protected $alias;
-    protected $display_name;
-    protected $address;
-    protected $notes;
-    protected $check_command;
-
-    protected $perfdata;
-    protected $last_check;
-    protected $next_check;
-    protected $state_type;
-    protected $current_check_attempt;
-    protected $max_check_attempts;
-    protected $last_state_change;
-    protected $last_hard_state_change;
-
     protected $gadget_url;
 
     public function __construct($backend_id, $hostName, $serviceDescription) {


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to