cvs: php-bugs-web / bug.php fix.php report.php style.css /include functions.inc prepend.inc resolve.inc

From: Date: Fri, 01 Feb 2002 20:25:58 +0000
Subject: cvs: php-bugs-web / bug.php fix.php report.php style.css /include functions.inc prepend.inc resolve.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-8425@lists.php.net to get a copy of this message
jimw Fri Feb 1 15:25:58 2002 EDT Added files: /php-bugs-web fix.php /php-bugs-web/include resolve.inc Modified files: /php-bugs-web bug.php report.php style.css /php-bugs-web/include functions.inc prepend.inc Log: 'quick fix' dropdown on developer page, and from links included in footer of bug report

Index: php-bugs-web/bug.php diff -u php-bugs-web/bug.php:1.21 php-bugs-web/bug.php:1.22 --- php-bugs-web/bug.php:1.21 Fri Feb 1 14:21:44 2002 +++ php-bugs-web/bug.php Fri Feb 1 15:25:57 2002 @@ -100,7 +100,7 @@ } if ($in && !$errors && $success) { - mail_bug_updates($bug,$in,$from,$ncomment); + mail_bug_updates($bug,$in,$from,$ncomment); header("Location: $PHP_SELF?id=$id&thanks=$edit"); exit; } @@ -195,20 +195,7 @@ <br clear="all" /> <?php -if ($errors) { - echo '<div class="errors">'; - if (count($errors) > 1) { - echo "You need to do the following before your submission will be accepted:<ul>"; - foreach ($errors as $error) { - echo "<li>$error</li>\n"; - } - echo "</ul>"; - } - else { - echo $errors[0]; - } - echo '</div>'; -} +if ($errors) display_errors($errors); if (!$errors && !$success) {?> <div class="errors"> Some sort of database error has happened. Maybe this will be illuminating: @@ -216,9 +203,18 @@ </div> <?php } -?> -<?php if ($edit == 1 || $edit == 2) {?> +if ($edit == 1) {?> +<form id="quickfix" method="post" action="fix.php"> +<b>Quick Fix:</b> +<select name="r"><?php show_reason_types()?></select> +<input type="hidden" name="id" value="<?php echo $id?>" /> +<input type="submit" value="Resolve" /> +</form> +<?php +} + +if ($edit == 1 || $edit == 2) {?> <form id="update" action="<?php echo $PHP_SELF?>" method="post"> <?php if ($edit == 2) { @@ -411,23 +407,6 @@ } commonFooter(); - -function changed($n) { - return $GLOBALS['in'][$n] - && trim($GLOBALS['in'][$n]) != trim($GLOBALS['bug'][$n]); -} - -function field($n) { - return oneof(clean($GLOBALS['in'][$n]), - htmlspecialchars($GLOBALS['bug'][$n])); -} - -function format_date($date) { - if (date("Y") != date("Y", $date)) { - return date("j M Y g:ia", $date); - } - return date("j M g:ia", $date); -} function output_note($ts,$email,$comment) { echo "<div class=\"comment\">"; Index: php-bugs-web/report.php diff -u php-bugs-web/report.php:1.7 php-bugs-web/report.php:1.8 --- php-bugs-web/report.php:1.7 Tue Jan 8 20:02:09 2002 +++ php-bugs-web/report.php Fri Feb 1 15:25:57 2002 @@ -42,7 +42,15 @@ $email = stripslashes($in['email']); - if (mail($mailto, "Bug #$cid: $sdesc", $ascii_report."1\n", "From: $email\nX-PHP-Bug: $cid\nMessage-ID: <bug-$cid@bugs.php.net>")) { + $dev_extra = ""; + foreach ($RESOLVE_REASONS as $k => $v) { + if (!$v['webonly']) + $dev_extra .= "$v[desc]: http://bugs.php.net/fix.php?id=$cid&r=$k\n"; + } + + # mail to appropriate mailing lists + if (mail($mailto, "Bug #$cid: $sdesc", $ascii_report."1\n$dev_extra", "From: $email\nX-PHP-Bug: $cid\nMessage-ID: <bug-$cid@bugs.php.net>")) { + # mail to reporter @mail($email, "Bug #$cid: $sdesc", $ascii_report."2\n", "From: PHP Bug Database <$mailfrom>\nX-PHP-Bug: $cid\nMessage-ID: <bug-$cid@bugs.php.net>"); header("Location: bug.php?id=$cid&thanks=4"); @@ -88,20 +96,7 @@ <?php } -if ($errors) { - echo '<div class="errors">'; - if (count($errors) > 1) { - echo "You need to do the following before your submission will be accepted:<ul>"; - foreach ($errors as $error) { - echo "<li>$error</li>\n"; - } - echo "</ul>"; - } - else { - echo $errors[0]; - } - echo '</div>'; -} +if ($errors) display_errors($errors); ?> <form method="post" action="<?php echo $PHP_SELF;?>"> <table> Index: php-bugs-web/style.css diff -u php-bugs-web/style.css:1.5 php-bugs-web/style.css:1.6 --- php-bugs-web/style.css:1.5 Thu Jan 17 17:30:17 2002 +++ php-bugs-web/style.css Fri Feb 1 15:25:57 2002 @@ -161,10 +161,6 @@ border-bottom: 2px solid #666666; } -div#bugheader { - border-bottom: 2px solid #666666; -} - div#bugheader table#details th { text-align: right; color: #666666; @@ -203,6 +199,18 @@ } div#controls a:hover { text-decoration: underline; +} + +form#quickfix { + float: right; + border: 1px solid #990000; + font-size: smaller; + padding: 4px; + margin: 4px; + background: #fee; +} +form#quickfix input, form#quickfix select { + vertical-align: middle; } form#vote { Index: php-bugs-web/include/functions.inc diff -u php-bugs-web/include/functions.inc:1.10 php-bugs-web/include/functions.inc:1.11 --- php-bugs-web/include/functions.inc:1.10 Fri Feb 1 14:21:44 2002 +++ php-bugs-web/include/functions.inc Fri Feb 1 15:25:58 2002 @@ -101,6 +101,22 @@ echo "<option value=\"earlier\">Earlier? Upgrade first!</option>\n"; } +function display_errors($errors) +{ + echo '<div class="errors">'; + if (count($errors) > 1) { + echo "You need to do the following before your submission will be accepted:<ul>"; + foreach ($errors as $error) { + echo "<li>$error</li>\n"; + } + echo "</ul>"; + } + else { + echo $errors[0]; + } + echo '</div>'; +} + function show_types($current,$show_any,$default="") { include 'bugtypes.inc'; @@ -182,7 +198,7 @@ $user_text = wordwrap($user_text, 72); /* use 72 to make piners happy */ $dev_text = wordwrap($dev_text, 72); - list($mailto,$mailfrom) = get_bugtype_mail($in['bug_type']); + list($mailto,$mailfrom) = get_bugtype_mail(oneof($in['bug_type'],$bug['bug_type'])); /* send mail if status was changed or there is a comment */ if ($status != $bug[status] || $ncomment != "") { @@ -199,6 +215,23 @@ "X-PHP-Bug: $bug[id]\n". "In-Reply-To: <bug-$bug[id]@bugs.php.net>"); } +} + +function changed($n) { + return $GLOBALS['in'][$n] + && trim($GLOBALS['in'][$n]) != trim($GLOBALS['bug'][$n]); +} + +function field($n) { + return oneof(clean($GLOBALS['in'][$n]), + htmlspecialchars($GLOBALS['bug'][$n])); +} + +function format_date($date) { + if (date("Y") != date("Y", $date)) { + return date("j M Y g:ia", $date); + } + return date("j M g:ia", $date); } function txfield($n) Index: php-bugs-web/include/prepend.inc diff -u php-bugs-web/include/prepend.inc:1.2 php-bugs-web/include/prepend.inc:1.3 --- php-bugs-web/include/prepend.inc:1.2 Sun Sep 23 19:27:04 2001 +++ php-bugs-web/include/prepend.inc Fri Feb 1 15:25:58 2002 @@ -1,3 +1,4 @@ <?php require_once 'layout.inc'; require_once 'functions.inc'; +require_once 'resolve.inc'; Index: php-bugs-web/fix.php +++ php-bugs-web/fix.php <?php $id = (int)$id; if (!$id) { header("Location: /"); exit; } require_once 'prepend.inc'; require_once 'cvs-auth.inc'; $mail_bugs_to = 'php-dev@lists.php.net'; if (isset($save) && isset($pw)) { # non-developers don't have $user set setcookie("MAGIC_COOKIE", base64_encode("$user:$pw"), time()+3600*24*12, '/','.php.net'); } if (isset($MAGIC_COOKIE) && !isset($user) && !isset($pw)) { list($user,$pw) = explode(":", base64_decode($MAGIC_COOKIE)); } $errors = array(); if (!isset($user) || !isset($pw)) { $errors[] = "You have to log in to resolve a bug this way."; } elseif (!verify_password($user,$pw)) { $errors[] = "The username or password you supplied was incorrect."; } if (!isset($r) || !isset($RESOLVE_REASONS[$r])) { $errors[] = "You have to use a valid reason to resolve this bug."; } if ($errors) { commonHeader("Resolve Bug"); display_errors($errors); ?> <form method="post" action="<?php echo $PHP_SELF?>"> <input type="hidden" name="id" value="<?php echo $id?>" /> <table> <tr> <th>CVS Username:</th> <td><input type="text" name="user" value="<?php echo clean($user)?>" size="10" maxlength="20" /></td> <th>CVS Password:</th> <td><input type="password" name="pw" value="<?php echo clean($pw)?>" size="10" maxlength="20" /></td> <th> <label for="save">Remember:</label> </th> <td> <input type="checkbox" id="save" name="save"<?php if ($save) echo ' checked="checked"'?> /> </td> </tr> <tr> <th>Reason:</th> <td colspan="5"><select name="r"><?php echo show_reason_types($r)?></select></td> </tr> </table> <input type="submit" value="Resolve" /> </form> <?php commonFooter(); exit; } @mysql_connect("localhost","nobody","") or die("Unable to connect to SQL server."); @mysql_select_db("php3"); # fetch info about the bug into $bug $query = "SELECT id,bug_type,email,passwd,sdesc,ldesc," . "php_version,php_os,status,ts1,ts2,assign," . "UNIX_TIMESTAMP(ts1) AS submitted, UNIX_TIMESTAMP(ts2) AS modified" . " FROM bugdb WHERE id=$id"; $res = mysql_query($query); if ($res) $bug = mysql_fetch_array($res,MYSQL_ASSOC); if (!$res || !$bug) { commonHeader("No such bug."); echo "<h1 class=\"error\">No such bug #$id!</h1>"; commonFooter(); exit; } /* update bug record */ $status = $RESOLVE_REASONS[$r]['status']; $ncomment = $RESOLVE_REASONS[$r]['message']; $query = "UPDATE bugdb SET status='$status', ts2=NOW() WHERE id=$id"; $success = @mysql_query($query); /* add comment */ if ($success && !empty($ncomment)) { $query = "INSERT INTO bugdb_comments (bug, email, ts, comment) VALUES ($id,'$user@php.net',NOW(),'$ncomment')"; $success = @mysql_query($query); } if ($success) { mail_bug_updates($bug,array('status' => $status),"$user@php.net",$ncomment); header("Location: bug.php?id=$id&thanks=1"); exit; } else { commonHeader("Resolve Bug: Problem"); ?> <p>Something went wrong trying to update the bug.</p> <?php echo '<pre>',mysql_error(),"</pre>\n"; commonFooter(); } Index: php-bugs-web/include/resolve.inc +++ php-bugs-web/include/resolve.inc <?php $RESOLVE_REASONS = array( 'fixedcvs' => array( 'status' => 'Closed', 'desc' => 'Fixed in CVS', 'message' => 'This bug has been fixed in CVS.', ), 'alreadyfixed' => array( 'status' => 'Closed', 'desc' => 'Fixed in release', 'message' => 'This bug has already been fixed in the latest released version of PHP, which you can download at http://www.php.net/downloads.php', ), 'needtrace' => array( 'status' => 'Feedback', 'desc' => 'Need backtrace', 'message' => 'To properly diagnose this bug, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open".', ), 'oldversion' => array( 'status' => 'Bogus', 'desc' => 'Try newer version', 'message' => 'The version of PHP that this bug was reported in is too old. Please try to reproduce this bug in the latest version of PHP (available from http://www.php.net/downloads.php If you are still able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open".', ), 'support' => array( 'status' => 'Bogus', 'desc' => 'Not for support', 'message' => 'The bug system is not the appropriate forum for asking support questions. For a list of a range of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php', ), 'nofeedback' => array( 'status' => 'No Feedback', 'desc' => 'No feedback', 'webonly' => 1, 'message' => 'No feedback was provided for this bug, so it is being suspended. If you are able to provide the information that was requested, please do so and change the status of the bug back to "Open".', ), 'notwrong' => array( 'status' => 'Bogus', 'desc' => 'Not wrong behavior', 'message' => 'This is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php', ), 'notenoughinfo' => array( 'status' => 'Bogus', 'desc' => 'Not enough info', 'message' => 'Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". ', ), ); function show_reason_types($current="") { while (list($k,$v) = each($GLOBALS['RESOLVE_REASONS'])) { echo "<option value=\"$k\"", ($current==$k ? " selected" : ""), ">$v[desc]</option>\n"; } }
« previous php.mirrors (#8425) next »