BUGFIX: Removed parameters were somtimes shown on the wrong side
authorarjen <arjen>
Thu, 14 Aug 2003 10:31:57 +0000 (10:31 +0000)
committerarjen <arjen>
Thu, 14 Aug 2003 10:31:57 +0000 (10:31 +0000)
of the parameter difference page.

src/web/parameter_compare.php

index 9cc64bd..a977b6f 100644 (file)
@@ -9,7 +9,7 @@
 ***********************
 **      FILE NAME      : parameter_compare.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.4 $
+**      VERSION NUMBER : $Revision: 1.5 $
 **
 **  DESCRIPTION      : 
 **
 
 /*****************************
    $Log: parameter_compare.php,v $
-   Revision 1.4  2003-07-15 11:06:45  arjen
+   Revision 1.5  2003-08-14 10:31:57  arjen
+   BUGFIX: Removed parameters were somtimes shown on the wrong side
+   of the parameter difference page.
+
+   Revision 1.4  2003/07/15 11:06:45  arjen
    Removed parameters are displayed in a shaded style.
 
    Revision 1.3  2003/02/13 09:01:29  arjen
@@ -38,7 +42,7 @@
 
 ******************************/
 
-// RCSID = "$Id: parameter_compare.php,v 1.4 2003-07-15 11:06:45 arjen Exp $";
+// RCSID = "$Id: parameter_compare.php,v 1.5 2003-08-14 10:31:57 arjen Exp $";
 
 ini_set('include_path', '.:./classes:../phpclasses');
 
@@ -129,10 +133,12 @@ class param_diff extends page
    {
    if (!empty($_POST['oid']))
    {
-      $res = pg_exec($this->database, "SELECT objectid, objectname FROM object WHERE objectid=" . $_POST['oid']);
+      $res = pg_exec($this->database, "SELECT objectid, objectname FROM object
+                                       WHERE objectid=" . $_POST['oid']);
       $obj = pg_fetch_object($res, 0);
       echo "<h1>" . $_POST['class'] . " parameters for " . $obj->objectname;
-      $res = pg_exec($this->database, "SELECT objectid, objectname FROM object WHERE objectid=" . $_POST['compare_to']);
+      $res = pg_exec($this->database, "SELECT objectid, objectname FROM object
+                                       WHERE objectid=" . $_POST['compare_to']);
       $cmp_obj = pg_fetch_object($res, 0);
       echo " compared to " . $cmp_obj->objectname . "</h1><hr>";
 
@@ -164,25 +170,26 @@ class param_diff extends page
             $prnext = param_properties($this->database, $nextpar->paramid);
             if (property_compare($pr, $prnext))
             {
-               display_parameter($par->name, $pr, "", $this->is_removed($par->paramid));
-               display_parameter($nextpar->name, $prnext, "", $this->is_removed($nextpar->paramid));
+               $Style = "";
+            }
+            else
+            {
+               $Style = "both";
+            }
+            // We want the parameters of $obj on the left, so we need
+            // to swap the left and right sides if appropriate.
+
+            if ($par->objectid == $obj->objectid)
+            {
+               display_parameter($par->name, $pr, $Style, $this->is_removed($par->paramid));
+               display_parameter($nextpar->name, $prnext, $Style, $this->is_removed($nextpar->paramid));
             }
             else
             {
-               // We want the parameters of $obj on the left, so we need
-               // to swap the left and right sides if appropriate.
-
-               if ($par->objectid == $obj->objectid)
-               {
-                  display_parameter($par->name, $pr, "both", $this->is_removed($par->paramid));
-                  display_parameter($nextpar->name, $prnext, "both", $this->is_removed($nextpar->paramid));
-               }
-               else
-               {
-                  display_parameter($nextpar->name, $prnext, "both", $this->is_removed($nextpar->paramid));
-                  display_parameter($par->name, $pr, "both", $this->is_removed($par->paramid));
-               }
+               display_parameter($nextpar->name, $prnext, $Style, $this->is_removed($nextpar->paramid));
+               display_parameter($par->name, $pr, $Style, $this->is_removed($par->paramid));
             }
          }
          else
          {