todochecker: bug summary in tool tip.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user