Annotation of cdn/www/boogs.html, revision 1.4

1.1       cdn         1: <h5 class="page-header">Bugs</h5>
                      2: 
                      3: <ul>
                      4: <li>Enter a <a href="http://www.mozdev.org/bugs/enter_bug.cgi?product=cdn">new bug</a> for cdn</li>
                      5: <li>View <a href="http://mozdev.org/bugs/buglist.cgi?email1=&amp;emailtype1=substring&amp;emailassigned_to1=1&amp;email2=&amp;emailtype2=substring&amp;emailreporter2=1&amp;bugidtype=include&amp;bug_id=&amp;changedin=&amp;votes=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;product=cdn&amp;short_desc=&amp;short_desc_type=allwordssubstr&amp;long_desc=&amp;long_desc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_file_loc_type=allwordssubstr&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;cmdtype=doit&amp;order=Bug+Number">all bugs</a>
                      6: <li>See all <a href="http://mozdev.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;email1=&amp;emailtype1=substring&amp;emailassigned_to1=1&amp;email2=&amp;emailtype2=substring&amp;emailreporter2=1&amp;bugidtype=include&amp;bug_id=&amp;changedin=&amp;votes=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;product=cdn&amp;short_desc=&amp;short_desc_type=allwordssubstr&amp;long_desc=&amp;long_desc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_file_loc_type=allwordssubstr&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;cmdtype=doit&amp;order=Bug+Number">open bugs</a></li>
                      7: <li>Search by Bug Number<br>
                      8: <form action="http://mozdev.org/bugs/show_bug.cgi" method="get">
                      9: <p><input type="submit" value="Find"> <input size="6" name="id"></p></form>
                     10: </li>
                     11: </ul>
1.2       cdn        12: <?php $doNotCapitalise = 1; ?>
                     13: <?php
1.1       cdn        14: 
1.2       cdn        15: // rewritten to suit bugzilla 2.18 branch
1.1       cdn        16: 
1.2       cdn        17:   if ( ! $hiding_BZ_h4 ) {
                     18:     echo '<h4 id="BZ-h4">Latest bugs filed for ';
                     19:     if ( $doNotCapitalise ) echo $project;
                     20:     else echo ucwords($project);
                     21:     echo "</h4>\n\n";
                     22:   }
                     23: 
                     24:   $Latest_bugs_filed = 'Latest bugs filed on ';
                     25:   
                     26:   if ( $hide_Latest_bugs_filed )
                     27:     $Latest_bugs_filed = '';
                     28:     
                     29:   if (!isset($amount))
                     30:     $amount       = 10;
                     31: 
                     32:   $bug_url        = "http://bugzilla." . HOST . "/show_bug.cgi?id=";
                     33: 
                     34: require_once(PHP_INC.CONNECT);
                     35: 
                     36: // port to PEAR :: DB ?
                     37: 
                     38: require_once 'DB.php';
                     39: 
                     40: $dsn = "mysql://$user:$password@$host/$database";
                     41: 
                     42: $q1 =& DB::connect($dsn);
                     43: if (DB::isError($q1)) {
                     44:   die($q1->getMessage());
                     45: }
                     46: 
                     47: $rq1 = $q1 -> getOne("select id from products where name='$project'");
                     48: if (DB::isError($rq1)) {
                     49:         die ($rq1->getMessage());
                     50: }
                     51: 
                     52: if($rq1) {
                     53: 
                     54:  $pID = $rq1;
                     55: 
                     56:  $q2 =& DB::connect($dsn);
                     57:  if (DB::isError($q2)) {
                     58:    die($q2->getMessage());
                     59:  }
                     60: 
                     61:  $rq2 = $q2 -> query("select bug_id, short_desc, resolution, bug_status from bugs
                     62:  where product_id=$pID
                     63:  ORDER BY bug_id DESC
                     64:  LIMIT $amount");
                     65: 
                     66:  echo '<table class="BZ-table" cellspacing="0" cellpadding="0" border="0">' . "\n";
                     67: 
                     68:  echo "<thead>\n<tr>\n";
                     69:  echo '<th class="BZ-th-bug">Bug #</th>';
                     70:  echo '<th class="BZ-th-desc">Description</th>' . "\n\n";
                     71:  echo "</tr>\n</thead>\n";
                     72: 
                     73:  echo "<tbody>\n";
                     74:  while ($row = $rq2 -> fetchRow(DB_FETCHMODE_OBJECT)) {
                     75:   // do stuff
                     76:     $printstrike = false;
                     77:     print "<tr><td>\n";
                     78: 
                     79:     $bug_id = $row -> bug_id;
                     80:     $status = $row -> bug_status;
                     81:     $strike =   $row -> resolution;
                     82: 
                     83:     if ($status == "CLOSED" || $strike == "DUPLICATE" || $strike == "FIXED" ||
                     84:         $strike == "WONTFIX" || $strike == "WORKSFORME" || $strike == "INVALID")
                     85:       $printstrike = true;
                     86:     if ($printstrike)
                     87:       print '<span class="BZ-strike" title="' . $status . ' ' . $strike . '">'; // ?
                     88:     print "<a href=\"$bug_url$bug_id\">";
                     89:     print $bug_id;
                     90:     print "</a>";
                     91:     if ($printstrike)
                     92:       print "</span>";
                     93:     print "\n</td>\n<td>\n";
1.3       cdn        94:     print htmlspecialchars ($row -> short_desc, ENT_QUOTES);
1.2       cdn        95:     print "</td>\n</tr>\n";
                     96:  }
                     97: 
                     98:  if ( ! $rq2 -> numRows() )
                     99:   echo '<tr><td colspan="2">No bugs.</td></tr>' . "\n";
                    100: 
                    101:  $rq2 -> free();
                    102: 
                    103:  echo "</tbody>\n";
                    104:  echo "</table>\n";
                    105: 
                    106: } else {
                    107:   echo "\n<p>This project has no bugzilla product.</p>\n";
                    108: }
                    109: 
                    110:  $q2 -> disconnect();
                    111:  $q1 -> disconnect();
                    112: 
                    113: ?>

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