Author:   Lars Michelsen <[email protected]>
Date:     Sun Nov 24 16:05:32 2013 +0100
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Sun Nov 24 16:05:32 2013 +0100

FIX: Fixed dependent attribute update in case of "parent" toggle/untoggle

---

 ChangeLog                                         |    1 +
 share/server/core/classes/WuiViewMapAddModify.php |   17 ++++++++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 00b9d78..1d7e3a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,6 +48,7 @@ Frontend:
     another menu which then shows up the hover menu
   * FIX: Ajax request: Not setting headers which are usually set by the browser
   * FIX: Fixed displaying default value in object / global attribute edit 
dialog
+  * FIX: Fixed dependent attribute update in case of "parent" toggle/untoggle
 
 1.7.10
 Frontend:
diff --git a/share/server/core/classes/WuiViewMapAddModify.php 
b/share/server/core/classes/WuiViewMapAddModify.php
index f856f35..ffe93b7 100644
--- a/share/server/core/classes/WuiViewMapAddModify.php
+++ b/share/server/core/classes/WuiViewMapAddModify.php
@@ -241,10 +241,19 @@ class WuiViewMapAddModify {
 
             $ret .= '<tr class="'.implode(' ', $rowClasses).'"'.$rowHide.'><td 
class=tdlabel>'.$propname.'</td><td class=tdbox>';
 
+            $multiple = $fieldType == 'dropdown' && isset($prop['multiple']) 
&& $prop['multiple'];
+
             $onChange = '';
             // Submit the form when an attribute which has dependant 
attributes is changed
-            if($this->MAPCFG->hasDependants($type, $propname))
+            if($this->MAPCFG->hasDependants($type, $propname)) {
+                $onChange = 
'document.getElementById(\'update\').value=\'1\';document.getElementById(\'commit\').click();';
+            }
+            elseif ($onChange == '' && (($multiple && $value !== 
'<<<multiple>>>')
+                                        || ($type == 'service' && $propname == 
'host_name'))) {
+                // If var is backend_id or var is host_name in service objects 
submit the form
+                // to update the depdant lists.
                 $onChange = 
'document.getElementById(\'update\').value=\'1\';document.getElementById(\'commit\').click();';
+            }
             
             // Add a checkbox to toggle the usage of an attribute. But only 
add it for
             // non-must attributes.
@@ -297,12 +306,6 @@ class WuiViewMapAddModify {
                 break;
                 case 'dropdown':
                     $array    = isset($prop['array']) && $prop['array'];
-                    $multiple = isset($prop['multiple']) && $prop['multiple'];
-                    // If var is backend_id or var is host_name in service 
objects submit the form
-                    // to update the depdant lists.
-                    if($onChange == '' && (($multiple && $value !== 
'<<<multiple>>>')
-                       || ($type == 'service' && $propname == 'host_name')))
-                        $onChange = 
'document.getElementById(\'update\').value=\'1\';document.getElementById(\'commit\').click();';
 
                     $func = $this->MAPCFG->getListFunc($type, $propname);
                     // Handle case that e.g. host_names can not be fetched 
from backend by


------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to