svn: /pear/packages/Bugtracker/trunk/scripts/cron/ no-feedback
| From: | Jani Taskinen | Date: | Wed, 03 Mar 2010 18:19:56 +0000 |
| Subject: | svn: /pear/packages/Bugtracker/trunk/scripts/cron/ no-feedback | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-9256@lists.php.net to get a copy of this message | ||
jani Wed, 03 Mar 2010 18:19:56 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=295802
Log:
- Get rid of hard-coded message here as well
Changed paths:
U pear/packages/Bugtracker/trunk/scripts/cron/no-feedback
Modified: pear/packages/Bugtracker/trunk/scripts/cron/no-feedback
===================================================================
--- pear/packages/Bugtracker/trunk/scripts/cron/no-feedback 2010-03-03 18:19:35 UTC (rev 295801)
+++ pear/packages/Bugtracker/trunk/scripts/cron/no-feedback 2010-03-03 18:19:56 UTC (rev 295802)
@@ -5,29 +5,23 @@
require dirname(__FILE__).'/../../include/prepend.php';
-$message =
-'No feedback was provided for this bug for over a week, so it is
-being suspended automatically. If you are able to provide the
-information that was originally requested, please do so and change
-the status of the bug back to "Open".';
-
# date interval to close after
$after = "7 DAY";
-# fetch info about the bug into $bug
-$query = "
- SELECT id, package_name, 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 status = 'Feedback' AND ts2 < DATE_SUB(NOW(), INTERVAL {$after})";
-
# Set "input" array
$in = array('status' => 'No Feedback');
# Update relevant reports
if ($dbh)
{
- $res = $dbh->prepare($query)->execute(array());
+ list($RESOLVE_REASONS, $FIX_VARIATIONS) = get_resolve_reasons($site);
+
+ $res = $dbh->prepare("
+ SELECT id, package_name, 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 status = 'Feedback' AND ts2 < DATE_SUB(NOW(), INTERVAL {$after})
+ ")->execute(array());
if (PEAR::isError($res)) {
throw new Exception("SQL Error in no-feedback");
}
@@ -35,15 +29,40 @@
{
list($mailto, $mailfrom) = get_package_mail($bug['package_name']);
+ // Changelog entry
+ $changed = bug_diff($bug, $_POST['in']);
+ if (!empty($changed)) {
+ $log_comment = bug_diff_render_html($changed);
+ }
+ if (!empty($log_comment)) {
+ $dbh->prepare('
+ INSERT INTO bugdb_comments (bug, email, comment, reporter_name, comment_type, ts)
+ VALUES (?, ?, ?, "", "log", NOW())
+ ')->execute(array(
+ $bug['id'],
+ $mailfrom,
+ $log_comment,
+ ));
+ }
+
+ // No feedback message
+ if (isset($FIX_VARIATIONS) &&
isset($FIX_VARIATIONS['nofeedback'][$bug['package_name']])) {
+ $message = $FIX_VARIATIONS['nofeedback'][$bug['package_name']];
+ } elseif (isset($RESOLVE_REASONS['nofeedback'])) {
+ $message = $RESOLVE_REASONS['nofeedback']['message'];
+ } else {
+ die('[no-feedback] Could not find resolve reason! (this should not happen!)');
+ }
$dbh->prepare('
- INSERT INTO bugdb_comments (bug, email, comment, reporter_name, ts)
- VALUES (?, ?, ?, "", NOW())
+ INSERT INTO bugdb_comments (bug, email, comment, reporter_name, comment_type, ts)
+ VALUES (?, ?, ?, "", "comment", NOW())
')->execute(array(
$bug['id'],
$mailfrom,
$message,
));
+ // Update status
$dbh->prepare('
UPDATE bugdb
SET status = "No Feedback", ts2 = NOW()
@@ -52,6 +71,7 @@
$bug['id'],
));
+ // Send emails
mail_bug_updates($bug, $in, $mailfrom, $message);
}
}