? internal_links.patch
? theme_summary.patch
? theme_summary_b.patch
Index: issue.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/project_issue/issue.inc,v
retrieving revision 1.272
diff -u -p -r1.272 issue.inc
--- issue.inc	31 Oct 2007 18:53:16 -0000	1.272
+++ issue.inc	3 Nov 2007 02:40:26 -0000
@@ -833,9 +833,10 @@ function project_issue_view($node, $teas
     $rows[] = array(t('Status:'), project_issue_state($node->sid));
 
     $node->content['project_issue_summary'] = array(
-      '#value' => '<div class="summary">'. theme('table', array(), $rows) .'</div>',
+      '#value' => theme('project_issue_summary', $rows, project_issue_internal_links($node)),
       '#weight' => -5,
     );
+
     $node->content['project_issue_header'] = array(
       '#value' => '<div class="header">'. t('Description') .'</div>',
       '#weight' => -3,
@@ -846,6 +847,65 @@ function project_issue_view($node, $teas
   return $node;
 }
 
+function theme_project_issue_summary($summary_table_rows, $summary_links) {
+  $output = '<div id="project-summary-container" class="clear-block">';
+  $output .= '<div id="project-issue-summary-table" class="summary">'. theme('table', array(), $summary_table_rows) .'</div>';
+  $output .= '<div id="project-issue-summary-links">'. theme('links', $summary_links, array('class' => 'internal-links')) .'</div>';
+  $output .= '</div>';
+
+  return $output;
+}
+
+/**
+ * Generates internal page links for issue followup pages.
+ *
+ * @param $node
+ *   The issue node.
+ * @return
+ *   An array of internal page links.
+ */
+function project_issue_internal_links($node) {
+  $links = array();
+  // Link for most recent followup.
+  $followup_cid = db_result(db_query_range("SELECT pic.cid FROM {project_issue_comments} pic INNER JOIN {node} n on pic.nid = n.nid WHERE n.status = 1 AND n.nid = %d ORDER BY pic.timestamp DESC", $node->nid, 0, 1));
+  if ($followup_cid) {
+    $links['recent_followup'] = array(
+      'title'     => t('Most recent followup'),
+      'href'      => "node/$node->nid",
+      'fragment'  => "comment-$followup_cid",
+    );
+  }
+  // Link for most recent patch.
+  $file_cid = db_result(db_query_range("SELECT cu.cid FROM {comment_upload_files} cu INNER JOIN {node} n on cu.nid = n.nid WHERE n.status = 1 AND n.nid = %d ORDER BY cu.fid DESC", $node->nid, 0, 1));
+  if ($file_cid) {
+    $links['recent_attachment'] = array(
+      'title'     => t('Most recent attachment'),
+      'href'      => "node/$node->nid",
+      'fragment'  => "comment-$file_cid",
+    );
+  }
+
+  // Link straight to comment form.
+  $comment_form_location = isset($node->comment_form_location) ? $node->comment_form_location : variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE);
+  // Comment form isn't on the page, link to the comment reply page.
+  if ($comment_form_location == COMMENT_FORM_SEPARATE_PAGE) {
+    $links['post_followup'] = array(
+      'title'     => t('Post a followup'),
+      'href'      => "comment/reply/$node->nid",
+    );
+  }
+  // Comment form is on the page, generate an internal page link for it.
+  else {
+    $links['post_followup'] = array(
+      'title'     => t('Post a followup'),
+      'href'      => "node/$node->nid",
+      'fragment'  => "comment-form",
+    );
+  }
+
+  return $links;
+}
+
 function project_issue_load($node) {
   $project = db_fetch_object(db_query(db_rewrite_sql('SELECT pi.* FROM {project_issues} pi WHERE pi.nid = %d', 'pi'), $node->nid));
 
Index: project_issue.css
===================================================================
RCS file: /cvs/drupal/contributions/modules/project_issue/project_issue.css,v
retrieving revision 1.13
diff -u -p -r1.13 project_issue.css
--- project_issue.css	30 Sep 2007 04:19:19 -0000	1.13
+++ project_issue.css	3 Nov 2007 02:40:26 -0000
@@ -1,6 +1,17 @@
 /* $Id: project_issue.css,v 1.13 2007/09/30 04:19:19 thehunmonkgroup Exp $ */
 /* $Name:  $ */
 
+/* Summary content */
+#project-issue-summary-table {
+  float: left;
+}
+#project-issue-summary-links {
+  float: right;
+}
+#project-issue-summary-links ul.internal-links li {
+  list-style-type: none;
+}
+
 /* Viewing issue nodes */
 .project-issue .header {
   font-weight: bold;
@@ -27,6 +38,10 @@
   border: 0;
 }
 
+#project-issue-internal-link li {
+  display: inline;
+}
+
 /* Issue node and comment followup form UI */
 .project-issue .node-form .inline-options fieldset .form-item {
   float: left;
