Index: project_issue.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/project_issue.module,v
retrieving revision 1.125
diff -u -p -r1.125 project_issue.module
--- project_issue.module	1 Feb 2009 18:34:09 -0000	1.125
+++ project_issue.module	2 Feb 2009 06:21:32 -0000
@@ -312,6 +312,7 @@ function project_issue_theme() {
         'node' => NULL,
         'comment_id' => NULL,
         'comment_number' => NULL,
+        'include_assigned' => FALSE,
       ),
     ),
   );
@@ -1220,11 +1221,16 @@ function project_issue_link_alter(&$link
  *   The comment id to be appended to the link, optional.
  * @param $comment_number
  *   The comment's number, as visible to users, optional.
+ * @param $include_assigned
+ *   Optional boolean to include the user the issue is assigned to.
  */
-function theme_project_issue_issue_link($node, $comment_id = NULL, $comment_number = NULL) {
+function theme_project_issue_issue_link($node, $comment_id = NULL, $comment_number = NULL, $include_assigned = FALSE) {
   $path = "node/$node->nid";
-  $attributes = array('title' => project_issue_state($node->project_issue['sid']));
-  if ($comment_id) {
+
+  // l() runs $attributes through drupal_attributes() which escapes the value.
+  $attributes = array('title' => t('Issue status: !status', array('!status' => project_issue_state($node->project_issue['sid']))));
+
+  if (isset($comment_id)) {
     $title = "#$node->nid-$comment_number: $node->title";
     $link = l($title, $path, array('attributes' => $attributes, 'fragment' => "comment-$comment_id"));
   }
@@ -1232,7 +1238,14 @@ function theme_project_issue_issue_link(
     $title = "#$node->nid: $node->title";
     $link = l($title, $path, array('attributes' => $attributes));
   }
-  $output = "<span class=\"project-issue-status-". $node->project_issue['sid'] ."\">$link</span>";
+  $output = '<span class="project-issue-status-'. $node->project_issue['sid'] .' project-issue-status-info">'. $link;
+  if ($include_assigned && !empty($node->project_issue['assigned'])) {
+    $username = db_result(db_query("SELECT name FROM {users} WHERE uid = %d", $node->project_issue['assigned']));
+    if (isset($username)) {
+      $output .= ' <span class="project-issue-assigned-user">'. t('Assigned to: @username', array('@username' => $username)) .'</span>';
+    }
+  }
+  $output .= '</span>';
   return $output;
 }
 
@@ -1242,7 +1255,7 @@ function theme_project_issue_issue_link(
  */
 function project_issue_filter_tips($delta, $format, $long = FALSE) {
   if ($long) {
-    return t('References to project issues in the form of [#1234] (or [#1234-2] for comments) turn into links automatically, with the title of the issue appended. The status of the issue is shown on hover.');
+    return t("References to project issues in the form of [#1234] (or [#1234-2] for comments) turn into links automatically, with the title of the issue appended. The status of the issue is shown on hover. If '@' is appended (e.g. [#1234@]), the user the issue is assigned to will also be printed.");
   }
   else {
     return t('Project issue numbers (ex. [#12345]) turn into links automatically.');
@@ -1264,21 +1277,23 @@ function project_issue_filter($op, $delt
     case 'prepare':
       return $text;
     case 'process':
-      $regex = '(?<!\w)(\[#(\d+)(-(\d+))?\])(?![^<]*<\/a>|([^<]++|(<(?!code)))*<\/code>|([^<]++|(<(?!pre)))*<\/pre>|\w)';
+      $regex = '(?<!\w)(\[#(\d+)(-(\d+))?(@)?\])(?![^<]*<\/a>|([^<]++|(<(?!code)))*<\/code>|([^<]++|(<(?!pre)))*<\/pre>|\w)';
       $offset = 0;
+      $preg_matches = array();
       while(preg_match("/$regex/", $text, $preg_matches, PREG_OFFSET_CAPTURE, $offset)) {
         $offset++;
         $match = $preg_matches[1];
         $nid = $preg_matches[2][0];
-        $comment_number = $preg_matches[4][0];
+        $comment_number = isset($preg_matches[4][0]) ? $preg_matches[4][0] : NULL;
+        $include_assigned = isset($preg_matches[5][0]);
         $node = node_load($nid);
         if (is_object($node) && node_access('view', $node) && $node->type == 'project_issue') {
           // Pull comment id based on the comment number if we have one.
-          if (!is_null($comment_number) && ($comment_id = db_result(db_query("SELECT pic.cid FROM {project_issue_comments} pic INNER JOIN {comments} c ON pic.cid = c.cid WHERE pic.nid = %d AND pic.comment_number = %d AND c.status = %d", $nid, $comment_number, COMMENT_PUBLISHED)))) {
-            $link = theme('project_issue_issue_link', $node, $comment_id, $comment_number);
+          if (isset($comment_number) && ($comment_id = db_result(db_query("SELECT pic.cid FROM {project_issue_comments} pic INNER JOIN {comments} c ON pic.cid = c.cid WHERE pic.nid = %d AND pic.comment_number = %d AND c.status = %d", $nid, $comment_number, COMMENT_PUBLISHED)))) {
+            $link = theme('project_issue_issue_link', $node, $comment_id, $comment_number, $include_assigned);
           }
           else {
-            $link = theme('project_issue_issue_link', $node);
+            $link = theme('project_issue_issue_link', $node, NULL, NULL, $include_assigned);
           }
           $text = substr_replace($text, $link, $match[1], strlen($match[0]));
           $offset = max($offset, $match[1] + strlen($link));
Index: project_issue.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/project_issue.css,v
retrieving revision 1.23
diff -u -p -r1.23 project_issue.css
--- project_issue.css	31 Jan 2009 05:43:38 -0000	1.23
+++ project_issue.css	2 Feb 2009 06:21:32 -0000
@@ -120,44 +120,59 @@ table.projects .project-project-links a 
   vertical-align: bottom;
 }
 
-/* Issue query results (row coloring based on issue status) */
-.project-issue tr.state-1 {
+/* Issue links from the [#12345] filter. */
+.project-issue-status-info a, .project-issue-status-info .project-issue-assigned-user {
+  background-color: #cdcdcd;
+  -moz-border-radius: 4px; /* Mozilla based browsers */
+  -webkit-border-radius: 4px; /* Webkit based browsers */
+  border-radius: 4px; /* CSS 3 standard */
+  padding: 2px 4px;
+}
+.project-issue-status-info .project-issue-assigned-user {
+  white-space: nowrap;
+}
+
+/* Coloring based on issue status (issue query results and [#12345] links). */
+.project-issue tr.state-1, .project-issue-status-1 a {
   background-color: #fff;
 }
 .project-issue tr.state-1 td.active {
   background-color: #e1e7eb;
 }
-.project-issue tr.state-2 {
+.project-issue tr.state-2, .project-issue-status-2 a {
   background-color: #c0ffc0;
 }
 .project-issue tr.state-2 td.active {
   background-color: #cec;
 }
-.project-issue tr.state-3, .project-issue tr.state-4, .project-issue tr.state-5, .project-issue tr.state-6 {
+.project-issue tr.state-3, .project-issue-status-3 a,
+.project-issue tr.state-4, .project-issue-status-4 a,
+.project-issue tr.state-5, .project-issue-status-5 a,
+.project-issue tr.state-6, .project-issue-status-6 a {
   background-color: #ddf;
 }
 .project-issue tr.state-3 td.active, .project-issue tr.state-4 td.active, .project-issue tr.state-5 td.active, .project-issue tr.state-6 td.active {
   background-color: #cce;
 }
-.project-issue tr.state-7 {
+.project-issue tr.state-7, .project-issue-status-7 a {
   background-color: #ffc9c9;
 }
 .project-issue tr.state-7 td.active {
   background-color: #eeb9b9;
 }
-.project-issue tr.state-8 {
+.project-issue tr.state-8, .project-issue-status-8 a {
   background-color: #ffd;
 }
 .project-issue tr.state-8 td.active {
   background-color: #eed;
 }
-.project-issue tr.state-13 {
+.project-issue tr.state-13, .project-issue-status-13 a {
   background-color: #ffe7dd;
 }
 .project-issue tr.state-13 td.active {
   background-color: #eed7cc;
 }
-.project-issue tr.state-14 {
+.project-issue tr.state-14, .project-issue-status-14 a {
   background-color: #e7ffdd;
 }
 .project-issue tr.state-14 td.active {
