]> git.mjollnir.org Git - moodle.git/commitdiff
todochecker: bug summary in tool tip.
authortjhunt <tjhunt>
Fri, 17 Jul 2009 07:19:43 +0000 (07:19 +0000)
committertjhunt <tjhunt>
Fri, 17 Jul 2009 07:19:43 +0000 (07:19 +0000)
lib/simpletest/todochecker.php

index 37c564e5ef9730d4bd708a6a81e4cc0d4a59725d..172878dcd8045e4dabe54e0e95c56abcdab54ecb 100644 (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() {