cvs: bugtracker /includes bug.php

From: Date: Wed, 13 Aug 2008 23:59:04 +0000
Subject: cvs: bugtracker /includes bug.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-2408@lists.php.net to get a copy of this message
bcarlyon Wed Aug 13 23:59:04 2008 UTC Modified files: /bugtracker/includes bug.php Log: Taught the bug tracker to send emails to relevant users when a bug is assigned http://cvs.php.net/viewvc.cgi/bugtracker/includes/bug.php?r1=1.15&r2=1.16&diff_format=u Index: bugtracker/includes/bug.php diff -u bugtracker/includes/bug.php:1.15 bugtracker/includes/bug.php:1.16 --- bugtracker/includes/bug.php:1.15 Wed Aug 13 23:42:13 2008 +++ bugtracker/includes/bug.php Wed Aug 13 23:59:03 2008 @@ -38,7 +38,7 @@ * @author Barry Carlyon <bcarlyon@php.net> * @copyright 2008-2008 Barry Carlyon * @license http://www.opensource.org/licenses/bsd-license.php BSD License -* @version CVS: $Id: bug.php,v 1.15 2008/08/13 23:42:13 bcarlyon Exp $ +* @version CVS: $Id: bug.php,v 1.16 2008/08/13 23:59:03 bcarlyon Exp $ * @link http://gsoc.barrycarlyon.servegame.org/ */ @@ -118,7 +118,7 @@ function is_bug() { global $db; - $query = 'SELECT bug_id,status FROM ' . BUG_TABLE . ' WHERE bug_id = ' . $this->bug_id; + $query = 'SELECT bug_id,status,reported_by FROM ' . BUG_TABLE . ' WHERE bug_id = ' . $this->bug_id; $db->get_data($query); if ($db->total_rows) { $this->bug_data = $db->fetch_row(); @@ -128,7 +128,7 @@ } function assign($target) { - global $db; + global $db, $cookie, $email, $cache, $user; $query = 'UPDATE ' . BUG_TABLE . ' SET assigned_to = \'' . $target . '\', assigned_on = NOW() WHERE bug_id = ' . $this->bug_id; $db->get_data($query); if ($db->affected_rows) @@ -137,11 +137,17 @@ if ($this->bug_data['status'] == PENDING) { $query = 'UPDATE ' . BUG_TABLE . ' SET status = ' . ASSIGNED . ' WHERE bug_id = ' . $this->bug_id; + $this->bug_data['status'] == ASSIGNED; $db->get_data($query); } //email time - //email the reported + $email_message = 'Greetings,' . "\n\r\n\r" . 'The bug http://' . $cookie['host'] . 'bug/' . $this->bug_id . '/ has been updated'; + $email_message .= "\n\r\n\r" . 'The update was '; + $email_message .= 'Bug Assigned to: ' . $target . ', by ' . $user->handle . ', the bug\'s status is currently: ' . $cache->obtain('status',$this->bug_data['status']); + //email the reportee + $email->send_to_user($this->bug_data['reported_by'], 'Bug Update; #' . $this->bug_id, $email_message); //email the assigned + $email->send_to_user($target, 'Bug Assinged: #' . $this->bug_id, $email_message . "\n\r\n\r" . 'AKA assinged to you!'); //email the subscribed return TRUE; }

« previous php.webmaster (#2408) next »