Diff for /cdn/www/boogs.html between versions 1.1 and 1.2

version 1.1, 2005/01/22 15:20:58 version 1.2, 2005/01/29 18:56:42
Line 9 Line 9
 <p><input type="submit" value="Find"> <input size="6" name="id"></p></form>  <p><input type="submit" value="Find"> <input size="6" name="id"></p></form>
 </li>  </li>
 </ul>  </ul>
<?php $doNotCapitalise = 1;<?php $doNotCapitalise = 1; ?>
 <?php
   
include(PHP_INC.'/bugs_2005');// rewritten to suit bugzilla 2.18 branch
   
?>  if ( ! $hiding_BZ_h4 ) {
     echo '<h4 id="BZ-h4">Latest bugs filed for ';
     if ( $doNotCapitalise ) echo $project;
     else echo ucwords($project);
     echo "</h4>\n\n";
   }
 
   $Latest_bugs_filed = 'Latest bugs filed on ';
   
   if ( $hide_Latest_bugs_filed )
     $Latest_bugs_filed = '';
     
   if (!isset($amount))
     $amount       = 10;
 
   $bug_url        = "http://bugzilla." . HOST . "/show_bug.cgi?id=";
 
 require_once(PHP_INC.CONNECT);
 
 // port to PEAR :: DB ?
 
 require_once 'DB.php';
 
 $dsn = "mysql://$user:$password@$host/$database";
 
 $q1 =& DB::connect($dsn);
 if (DB::isError($q1)) {
   die($q1->getMessage());
 }
 
 $rq1 = $q1 -> getOne("select id from products where name='$project'");
 if (DB::isError($rq1)) {
         die ($rq1->getMessage());
 }
 
 if($rq1) {
 
  $pID = $rq1;
 
  $q2 =& DB::connect($dsn);
  if (DB::isError($q2)) {
    die($q2->getMessage());
  }
 
  $rq2 = $q2 -> query("select bug_id, short_desc, resolution, bug_status from bugs
  where product_id=$pID
  ORDER BY bug_id DESC
  LIMIT $amount");
 
  echo '<table class="BZ-table" cellspacing="0" cellpadding="0" border="0">' . "\n";
 
  echo "<thead>\n<tr>\n";
  echo '<th class="BZ-th-bug">Bug #</th>';
  echo '<th class="BZ-th-desc">Description</th>' . "\n\n";
  echo "</tr>\n</thead>\n";
 
  echo "<tbody>\n";
  while ($row = $rq2 -> fetchRow(DB_FETCHMODE_OBJECT)) {
   // do stuff
     $printstrike = false;
     print "<tr><td>\n";
 
     $bug_id = $row -> bug_id;
     $status = $row -> bug_status;
     $strike =   $row -> resolution;
 
     if ($status == "CLOSED" || $strike == "DUPLICATE" || $strike == "FIXED" ||
         $strike == "WONTFIX" || $strike == "WORKSFORME" || $strike == "INVALID")
       $printstrike = true;
     if ($printstrike)
       print '<span class="BZ-strike" title="' . $status . ' ' . $strike . '">'; // ?
     print "<a href=\"$bug_url$bug_id\">";
     print $bug_id;
     print "</a>";
     if ($printstrike)
       print "</span>";
     print "\n</td>\n<td>\n";
     print htmlspecialchars ($row -> short_desc), ENT_QUOTES);
     print "</td>\n</tr>\n";
  }
 
  if ( ! $rq2 -> numRows() )
   echo '<tr><td colspan="2">No bugs.</td></tr>' . "\n";
 
  $rq2 -> free();
 
  echo "</tbody>\n";
  echo "</table>\n";
 
 } else {
   echo "\n<p>This project has no bugzilla product.</p>\n";
 }
 
  $rq1 -> free();
 
  $q2 -> disconnect();
  $q1 -> disconnect();
 
 ?>
   

Removed from v.1.1  
changed lines
  Added in v.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>