todochecker: bug summary in tool tip.

This commit is contained in:
tjhunt
2009-07-17 07:19:43 +00:00
parent 64d7949245
commit 05280d5f97
+17 -6
View File
@@ -75,14 +75,16 @@ if (empty($found)) {
$issueurl = 'http://tracker.moodle.org/browse/' . $issueid;
// Make sure the issue is still open.
if (issue_open($issueid)) {
list($issueopen, $issuesummary) = issue_info($issueid);
if ($issueopen) {
$issuename = $issueid;
} else {
$issuename = '<strike>' . $issueid . '</strike>';
$error = 'The associated tracker issue is Resolved.';
}
$line = str_replace($issueid, '<a href="' . $issueurl . '">' . $issuename . '</a>', htmlspecialchars($line));
$line = str_replace($issueid, '<a href="' . $issueurl . '" title="' . s($issuesummary) .
'">' . $issuename . '</a>', htmlspecialchars($line));
} else {
$line = htmlspecialchars($line);
$error = 'No associated tracker issue.';
@@ -118,7 +120,7 @@ function check_to_dos($filepath) {
}
}
function issue_open($issueid) {
function issue_info($issueid) {
static $cache = array();
if (array_key_exists($issueid, $cache)) {
return $cache[$issueid];
@@ -126,10 +128,19 @@ function issue_open($issueid) {
$xmlurl = 'http://tracker.moodle.org/si/jira.issueviews:issue-xml/' . $issueid . '/' . $issueid . '.xml';
$content = download_file_content($xmlurl);
$result = preg_match('/Unresolved<\/resolution>/', $content);
$cache[$issueid] = $result;
return $result;
// Get the status.
$open = preg_match('/Unresolved<\/resolution>/', $content);
// Get the summary.
$matches = array();
preg_match('/<title>\[' . $issueid . '\]\s+(.*?)<\/title>/', $content, $matches);
$summary = $matches[1];
preg_match('/<assignee[^>]*>(.*?)<\/assignee>/', $content, $matches);
$summary .= ' - Assignee: ' . $matches[1];
$cache[$issueid] = array($open, $summary);
return $cache[$issueid];
}
function load_third_party_lib_list() {