? 231713_1_pi_install.patch
? 231713_4_pi_install.patch
? 231713_pi_install.patch
? project_issue_code_cleanup.patch
Index: /Applications/MAMP/htdocs/project_testing/drupal/sites/all/modules/project_issue/issue.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/issue.inc,v
retrieving revision 1.305
diff -u -p -r1.305 issue.inc
--- issue.inc	15 Mar 2008 20:19:34 -0000	1.305
+++ issue.inc	21 Mar 2008 01:37:30 -0000
@@ -1019,7 +1019,9 @@ function theme_project_issue_summary($cu
 
   $output = '<div id="project-summary-container" class="clear-block">';
   $output .= '<div id="project-issue-summary-table" class="summary">'. theme('table', array(), $rows) .'</div>';
-  $output .= '<div id="project-issue-summary-links">'. theme('item_list', $summary_links, t('Jump to:'), 'ul', array('class' => 'internal-links')) .'</div>';
+  if (!empty($summary_links)) {
+    $output .= '<div id="project-issue-summary-links">'. theme('item_list', $summary_links, t('Jump to:'), 'ul', array('class' => 'internal-links')) .'</div>';
+  }
   $output .= '</div>';
 
   return $output;
@@ -1036,16 +1038,18 @@ function theme_project_issue_summary($cu
 function project_issue_internal_links($node) {
   $links = array();
 
-  // Link to the first unread, or most recent comment.
-  if (comment_num_new($node->nid)) {
-    // There are unread replies; link to first unread comment.
-    $links[] = l(t('First unread comment'), "node/$node->nid", array(), NULL, 'new');
-  }
-  else {
-    // No unread replies; link to most recent comment.
-    $comment_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.cid DESC", $node->nid, 0, 1));
-    if ($comment_cid) {
-      $links[] = l(t('Most recent comment'), "node/$node->nid", array(), NULL, "comment-$comment_cid");
+  if ($node->comment != COMMENT_NODE_DISABLED) {
+    // Link to the first unread, or most recent comment.
+    if (comment_num_new($node->nid)) {
+      // There are unread replies; link to first unread comment.
+      $links[] = l(t('First unread comment'), "node/$node->nid", array(), NULL, 'new');
+    }
+    else {
+      // No unread replies; link to most recent comment.
+      $comment_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.cid DESC", $node->nid, 0, 1));
+      if ($comment_cid) {
+        $links[] = l(t('Most recent comment'), "node/$node->nid", array(), NULL, "comment-$comment_cid");
+      }
     }
   }
 
@@ -1056,7 +1060,7 @@ function project_issue_internal_links($n
   }
 
   // Link straight to comment form.
-  if (user_access('post comments') || user_access('post comments without approval')) {
+  if ($node->comment == COMMENT_NODE_READ_WRITE && (user_access('post comments') || user_access('post comments without approval'))) {
     // TODO: This conditional needs to be ripped out in D6.
     $comment_form_location = isset($node->comment_form_location) ? $node->comment_form_location : variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE);
 
