Index: trunk/ippMonitor/raw/czartool_labels.php
===================================================================
--- trunk/ippMonitor/raw/czartool_labels.php	(revision 38200)
+++ trunk/ippMonitor/raw/czartool_labels.php	(revision 38206)
@@ -34,4 +34,5 @@
         "stack",
         "staticsky",
+        "fullforce",
         "diff",
         "dist", 
@@ -39,4 +40,43 @@
 	);
         # "chipbackground");
+
+$getFailures = array(
+        "chip"      => "failedChipProcessedImfile.php",
+        "cam"       => "failedCamProcessedExp.php",
+        "fake"      => "failedFakeProcessedImfile.php",
+        "warp"      => "failedWarpSkyfiles.php",
+        "stack"     => "failedStackSkyfile.php",
+        "staticsky" => "failedStaticsky.php",
+        "fullforce" => "failedChipProcessedImfile.php",
+        "diff"      => "failedDiffSkyfile.php",
+        "dist"      => "NONE", 
+        "pub"       => "publishDone.php",
+);	     
+
+$mainTable = array(
+        "chip"      => "chipRun",
+        "cam"       => "camRun",
+        "fake"      => "fakeRun",
+        "warp"      => "warpRun",
+        "stack"     => "stackRun",
+        "staticsky" => "staticskyRun",
+        "fullforce" => "fullForceRun",
+        "diff"      => "diffRun",
+        "dist"      => "distRun", 
+        "pub"       => "publishRun",
+);	     
+
+$addSearchState = array(
+        "chip"      => 0,
+        "cam"       => 0,
+        "fake"      => 1,
+        "warp"      => 0,
+        "stack"     => 0,
+        "staticsky" => 0,
+        "fullforce" => 0,
+        "diff"      => 0,
+        "dist"      => 0,
+        "pub"       => 0,
+);	     
 
 $servers=array(
@@ -448,45 +488,29 @@
         $anyFaults = false; 
 
-        // Note: Do not include the state for chip, cam, and warp so that both new and update faults are listed
-        $link = "failedChipProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&chipRun.label=" . $thisLabel ; # . "&chipRun.state=".$searchState;
-        getStateAndFaults($db, $thisLabel, $selectedState, "chip", $str, $anyFaults);
-        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
-
-        $link = "failedCamProcessedExp.php?pass=" . $pass . "&proj=" . $proj . "&camRun.label=" . $thisLabel ; # . "&camRun.state=".$searchState;
-        getStateAndFaults($db, $thisLabel, $selectedState, "cam", $str, $anyFaults);
-        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
-
-        $link =  "failedFakeProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&fakeRun.label=" . $thisLabel . "&fakeRun.state=".$searchState;
-        getStateAndFaults($db, $thisLabel, $selectedState, "fake", $str, $anyFaults);
-        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
-
-        $link = "failedWarpSkyfiles.php?pass=" . $pass . "&proj=" . $proj . "&warpRun.label=" . $thisLabel ; # . "&warpRun.state=".$searchState;
-        getStateAndFaults($db, $thisLabel, $selectedState, "warp", $str, $anyFaults);
-        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
-
-        $link = "failedStackSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&stackRun.label=" . $thisLabel . "&stackRun.state=".$searchState;
-        getStateAndFaults($db, $thisLabel, $selectedState, "stack", $str, $anyFaults);
-        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
-
-        $link = "failedStaticsky.php?pass=" . $pass . "&proj=" . $proj . "&staticskyRun.label=" . $thisLabel . "&staticskyRun.state=".$searchState;
-        getStateAndFaults($db, $thisLabel, $selectedState, "staticsky", $str, $anyFaults);
-        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
-
-        $link = "failedDiffSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&diffRun.label=" . $thisLabel . "&diffRun.state=".$searchState;
-        getStateAndFaults($db, $thisLabel, $selectedState, "diff", $str, $anyFaults);
-        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
-
-        $link = $defaultlink;
-        getStateAndFaults($db, $thisLabel, $selectedState, "dist", $str, $anyFaults);
-        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$distributing) ? "gray" : null);
-
-        $link = "publishDone.php?pass=" . $pass . "&proj=" . $proj . "&publishRun.label=" . $thisLabel . "&publishRun.state=".$searchState;
-        getStateAndFaults($db, $thisLabel, $selectedState, "pub", $str, $anyFaults);
-        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$publishing) ? "gray" : null);
-
-        $link = $defaultlink;
-        getStateAndFaults($db, $thisLabel, $selectedState, "chipbackground", $str, $anyFaults);
-        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
-
+        foreach ($stages as &$stage) {
+          // Note: Do not include the state for chip, cam, and warp so that both new and update faults are listed
+	  $myTable    = $mainTable[$stage];
+	  $myFailures = $getFailures[$stage];
+
+	  if ("$myFailures" == "NONE") {
+            $link = $defaultlink;
+          } else {
+            $link = $getFailures[$stage] . "?pass=" . $pass . "&proj=" . $proj . "&" . $myTable . ".label=" . $thisLabel;
+	    if ($addSearchState[$stage]) {
+              // Note: Do not include the state for chip, cam, and warp so that both new and update faults are listed
+              $link .= "&" . $myTable . ".state=" . $searchState;
+            }
+          }
+          getStateAndFaults($db, $thisLabel, $selectedState, $stage, $str, $anyFaults);
+
+	  $cellcolor = 0;
+	  if ("$stage" == "dist") { 
+	    $cellcolor = (!$isUpdate && !$distributing) ? "gray" : 0;
+          }
+          if ("$stage" == "pub") {
+	    $cellcolor = (!$isUpdate && !$publishing) ? "gray" : 0;
+          }
+          createFormattedTableCell($anyFaults, $link, $str, $anyFaults, $cellcolor);
+        }
         echo "</tr>\n";
     }
