Index: modules/project/issue.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project/issue.inc,v
retrieving revision 1.128
diff -u -r1.128 issue.inc
--- modules/project/issue.inc	10 Oct 2005 15:50:19 -0000	1.128
+++ modules/project/issue.inc	11 Oct 2005 12:35:45 -0000
@@ -72,6 +72,62 @@
         return project_issue_subscribe();
       }
       break;
+    case t('issues'):
+      if (arg(3) == 'subscribe') {
+        $project = project_project_retrieve(arg(1));
+        if ($GLOBALS['user']->uid && $project->nid && node_access('view', $project)) {
+          return project_issue_subscribe($project);
+        }
+        else {
+          return project_issue_subscribe();
+        }
+        break;
+      }
+      elseif (arg(3) =='statistics') {
+        $project = project_project_retrieve(arg(1));
+        if ($project->nid && node_access('view', $project)) {
+          return project_issue_statistics($project);
+        }
+        else {
+          return project_issue_statistics();
+        }
+        break;
+      }
+      elseif (arg(3) == 'submit') {
+        $project = project_project_retrieve(arg(1));
+        // We assume that a user may create issues for projects that he may view.
+        if ($project->nid && node_access('view', $project)) {
+          drupal_goto("node/add/project_issue/$project->uri");
+        }
+        else {
+          drupal_goto("node/add/project_issue");
+        }
+        break;
+      }
+      elseif (arg(3) == 'search') {
+        $project = project_project_retrieve(arg(1));
+        if ($project->nid && node_access('view', $project)) {
+          return project_issue_query($project);
+        }
+        else {
+          return project_issue_query();
+        }
+        break;
+      }
+      else {
+        $project = project_project_retrieve(arg(1));
+        if ($project->nid && node_access('view', $project)) {
+          $query = new StdClass();
+          $query->projects = array($project->nid);
+
+          return project_issue_query_result($query);
+        }
+        else {
+          return project_issue_query_result();
+        }
+        break;
+      }
+
     case 'user':
        $_GET['users'] = $GLOBALS['user']->uid;
     default:
@@ -235,6 +291,12 @@
     $output = theme('table', $headers, $rows);
   }
 
+  // set breadcrumbs
+  $breadcrumb = array(l(t('Home'), NULL));
+  $breadcrumb[] = l(t($project->title), 'node/'. $project->nid);
+  $breadcrumb[] = l(t('issues'), 'node/'. $project->nid .'/issues');
+  drupal_set_breadcrumb($breadcrumb);
+
   $output .= form_submit(t('Subscribe'));
   return form($output);
 }
@@ -446,7 +508,7 @@
       $breadcrumb[] = array('path' => 'project/'. $term->name, 'title' => $term->name);
     }
     $breadcrumb[] = array('path' => 'node/'. $project->nid, 'title' => $project->title);
-    $breadcrumb[] = array('path' => 'project/issues/'. $project->uri, 'title' => t('issues'));
+    $breadcrumb[] = array('path' => 'node/'. $project->nid .'/issues', 'title' => t('issues'));
     $breadcrumb[] = array('path' => 'node/'. $node->nid);
     menu_set_location($breadcrumb);
 
@@ -614,7 +676,7 @@
   $result = db_query('SELECT * FROM {project_issue_state} ORDER BY weight');
   $default_state = variable_get('project_issue_default_state', 1);
   while ($state = db_fetch_object($result)) {
-    $rows[] = array($state->sid, 
+    $rows[] = array($state->sid,
                     form_textfield(NULL, 'status][' . $state->sid .'][name', $state->name, 20, 255),
                     form_weight(NULL, 'status][' . $state->sid .'][weight', $state->weight, 15),
                     form_checkbox('', 'status][' . $state->sid .'][author_has', 1, $state->author_has),
@@ -644,13 +706,13 @@
         array('data' => t('Default')),
         array('data' => t('Operations'))
       );
-    
+
       $output = '<div>' . theme('table', $header, project_issue_admin_states()) . '</div>';
       $output .= form_submit(t('Save'));
- 
+
       return form($output);
       break;
-  }      
+  }
 }
 
 function project_issue_admin_save_states() {
@@ -723,6 +785,15 @@
 }
 
 function project_issue_query_result($query = NULL, $format = 'html', $search = true) {
+  // set breadcrumbs
+  if ($project = project_project_retrieve(arg(1))) {
+    $breadcrumb = array(l(t('Home'), NULL));
+    $breadcrumb[] = l(t('projects'), '/project');
+    $breadcrumb[] = l(t($project->title), 'node/'. $project->nid);
+    $breadcrumb[] = l(t('issues'), 'node/'. $project->nid .'/issues');
+    drupal_set_breadcrumb($breadcrumb);
+  }
+
   $query = project_issue_query_parse($query);
 
   $categories = array(0 => t('<all>')) + project_issue_category();
Index: modules/project/project.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project/project.inc,v
retrieving revision 1.56
diff -u -r1.56 project.inc
--- modules/project/project.inc	3 Oct 2005 15:48:10 -0000	1.56
+++ modules/project/project.inc	11 Oct 2005 12:56:18 -0000
@@ -178,85 +178,59 @@
     $breadcrumb[] = array('path' => 'node/'. $node->nid, 'title' => $node->title);
     $breadcrumb = project_project_set_location($node, $breadcrumb);
     menu_set_location($breadcrumb);
-    
+
+    // download section
     if ($releases = project_release_load($node)) {
       list($rid, $version) = each($releases);
       $release = project_release_load($rid);
 
-      // Download section
-      $links = array();
-      
+      $output .= '<dl> <dt>';
       if ($release->version == 'cvs') {
-        $links[] = '<a href="' . $release->path . '">' . t('Download latest release (%version)', array('%version' => $release->version)) . '</a>';
+        $output .= l(t('Download latest release (%version)', array('%version' => $release->version)), $release->path);
       }
       else {
-        $links[] = '<a href="' . $release->path . '">' . t('Download latest release (%version, %date)', array('%version' => $release->version, '%date' => format_date($release->created, 'small')))  . '</a>';
+        $output .= l(t('Download latest release (%version, %date)', array('%version' => $release->version, '%date' => format_date($release->created, 'small'))), $release->path);
       }
       if ($release->changes) {
-        $links[] = l(t('Read release notes'), 'node/'. $node->nid .'/release', null, null, 'version-'. $release->version);
-      }
-      if (count($releases) > 1) {
-        $links[] = l(t('View older releases'), 'node/'. $node->nid .'/release');
+        $output .= '<dd>'.$release->changes.'</dl>';
       }
     }
-    if (node_access('update', $node) && !variable_get('project_release_directory', '')) {
-      $links[] = l(t('Add new release'), 'node/'. $node->nid .'/release/add');
-    }
-    if ($links) {
-      $output .= theme('item_list', $links, t('Releases'));
-    }
-    
+
     // Misc section
     $links = array();
-    
+
     foreach (array('documentation' => t('Read documentation'), 'license' => t('Read license'), 'changelog' => t('Read complete log of changes'), 'demo' => t('Try out a demonstration'), 'screenshots' => t('Look at screenshots')) as $uri => $name) {
       if (!empty($node->$uri)) {
         $links[] = sprintf('<a href="%s">%s</a>', $node->$uri, $name);
       }
     }
-    
-    if ($links) {
-      $output .= theme('item_list', $links, t('Resources'));
-    }
-    
-    // Support section
-    $links = array();
-    
-    $links[] = l(t('Support forum'), variable_get('project_support_forum', 'forum/18'));
-    
-    if ($node->issues) {
-      #$output .= '<p>'. t('If you think you have found a bug please check the list of existing bugs reported, if you do not find it please submit a new bug report. Remember to provide as much information as possible to make it easier for the developers to fix the issue.') .'</p>';
-      $links[] = l(t('View pending bug reports'), 'project/issues/'. $node->uri, null, 'categories=bug', null);
-      $links[] = l(t('View pending feature requests'), 'project/issues/'. $node->uri, null, 'categories=feature', null);
-      $links[] = l(t('Report new bug'), 'node/add/project_issue/'. $node->uri .'/bug');
-      $links[] = l(t('Request new feature'), 'node/add/project_issue/'. $node->uri .'/feature');
-    }
-    
+
     if ($links) {
       $output .= theme('item_list', $links, t('Support'));
     }
-    
+
     // Developer section
     $links = array();
-    
+
     if ($node->issues) {
       #$output .= '<p>'. t('If you think you have found a bug please check the list of existing bugs reported, if you do not find it please submit a new bug report. Remember to provide as much information as possible to make it easier for the developers to fix the issue.') .'</p>';
       $links[] = l(t('View pending patches'), 'project/issues/'. $node->uri, null, 'states=8', null);
       $links[] = l(t('View available tasks'), 'project/issues/'. $node->uri, null, 'categories=task', null);
       $links[] = l(t('View all issues'), 'project/issues/'. $node->uri);
     }
-    
+
+    // CVS options
     if ($node->cvs) {
       $links[] = sprintf('<a href="%s">%s</a>', $node->cvs, t('Browse the CVS repository'));
     }
-    
+
     if (module_exist('cvs')) {
       $links[] = l(t('View CVS messages'), 'project/cvs/'. $node->nid);
       $links[] = l(t('Developers'), 'project/developers/'. $node->nid);
     }
-    
+
     if ($links) {
-      $output .= theme('item_list', $links, t('Development'));
+      $output .= theme('item_list', $links, t('Resources'));
     }
     $node->body .= $output;
   }
@@ -266,14 +240,16 @@
   $node = node_load(array('nid' => arg(1)));
 
   // Breadcrumb navigation
-  $breadcrumb[] = array('path' => 'node/'. $node->nid .'/', 'title' => $node->title);
-  $breadcrumb[] = array('path' => 'node/'. arg(1) .'/release', 'title' => t('Releases'));
-  $breadcrumb = project_project_set_location($node, $breadcrumb);
-
-  menu_set_location($breadcrumb);
+  $breadcrumb = array(l(t('Home'), NULL), l(t('Projects'), 'project'));
+  $taxonomy_terms = taxonomy_node_get_terms($node->nid);
+  if (function_exists('taxonomy_node_get_terms') && $term = reset($taxonomy_terms)) {
+    $breadcrumb[] = l($term->name, 'project', NULL, "tid=$term->tid");
+  }
+  $breadcrumb[] = l($node->title, "node/$node->nid");
+  drupal_set_breadcrumb($breadcrumb);
 
   $output = project_release_list($node);
-
+  if ($output=='') $output = t('There are no releases for this project');
   drupal_set_title(check_plain($node->title));
   return $output;
 }
Index: modules/project/project.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project/project.module,v
retrieving revision 1.211
diff -u -r1.211 project.module
--- modules/project/project.module	5 Oct 2005 16:59:31 -0000	1.211
+++ modules/project/project.module	11 Oct 2005 12:48:12 -0000
@@ -229,6 +229,7 @@
     $access = user_access('access projects');
 
     $items[] = array('path' => 'project', 'title' => t('projects'), 'callback' => 'project_page_overview', 'access' => $access, 'type' => MENU_NORMAL_ITEM);
+    $items[] = array('path' => 'project/user', 'title' => t('my projects'), 'callback' => 'project_page_user', 'access' => $GLOBALS['user']->uid && $access, 'type' => MENU_NORMAL_ITEM);
 
     // Project browsing pages
     if (module_exist('taxonomy')) {
@@ -245,7 +246,7 @@
                            'type' => $i == 0 ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
                            'weight' => $term->weight,
                            'callback arguments' => array($term->name));
-  
+
           if ($releases) {
             $j = 0;
             if (variable_get('project_release_overview', -1) == -1) {
@@ -293,16 +294,15 @@
     $access = user_access('create project issues');
     $items[] = array('path' => 'node/add/project_issue', 'title' => t('issue'), 'callback' => 'node_page', 'access' => $access, 'type' => MENU_NORMAL_ITEM, 'weight' => 1);
 
+    // Comments
+    $items[] = array('path' => 'project/comments', 'title' => t('comments'), 'callback' => 'project_comment_page', 'access' => $access, 'type' => MENU_CALLBACK);
+
     // Administer issue status settings
     $access = user_access('administer projects');
     $items[] = array('path' => 'admin/settings/project/status', 'title' => t('status options'), 'callback' => 'project_issue_admin_states_page', 'access' => $access, 'type' => MENU_NORMAL_ITEM);
     $items[] = array('path' => 'admin/settings/project/status/save', 'title' => t('save'), 'callback' => 'project_issue_admin_states_page', 'access' => $access, 'type' => MENU_CALLBACK);
     $items[] = array('path' => 'admin/settings/project/status/delete', 'title' => t('delete'), 'callback' => 'project_issue_admin_states_page', 'access' => $access, 'type' => MENU_CALLBACK);
 
-    // Comments
-    $access = user_access('create project issues');
-    $items[] = array('path' => 'project/comments', 'title' => t('comments'), 'callback' => 'project_comment_page', 'access' => $access, 'type' => MENU_CALLBACK);
-
     // Releases
     if (variable_get('project_release_directory', '')) {
       $access = user_access('administer projects');
@@ -313,18 +313,29 @@
     if (arg(0) == 'node' && is_numeric(arg(1))) {
       $node = node_load(array('nid' => arg(1)));
       if ($node->type == 'project_project') {
-        $items[] = array('path' => 'node/'. arg(1) .'/release', 'title' => t('releases'), 'callback' => 'project_project_releases', 'access' => node_access('view', $node), 'weight' => 0, 'type' => MENU_CALLBACK);
+        // issue Page Tabs
+        $access = user_access('access project issues');
+        $items[] = array('path' => 'node/'.arg(1).'/issues', 'title' => t('issue tracking'),'callback' => 'project_issue_page', 'access' => $access, 'weight' => '5', 'type' => MENU_LOCAL_TASK);
+        $items[] = array('path' => 'node/'.arg(1).'/issues/'.$node->uri, 'title' => t('issues'),'callback' => 'project_issue_page', 'access' => $access, 'weight' => '0', 'type' => MENU_DEFAULT_LOCAL_TASK);
+        $items[] = array('path' => 'node/'.arg(1).'/issues/submit', 'title' => t('submit'), 'callback' => 'project_issue_page', 'access' => $access, 'weight' => '5', 'type' =>  MENU_LOCAL_TASK);
+        $items[] = array('path' => 'node/'.arg(1).'/issues/statistics', 'title' => t('statistics'), 'callback' => 'project_issue_page', 'access' => $access, 'weight' => '6', 'type' =>  MENU_LOCAL_TASK);
+        $items[] = array('path' => 'node/'.arg(1).'/issues/subscribe', 'title' => t('subscribe'), 'callback' => 'project_issue_page', 'access' => $GLOBALS['user']->uid && $access, 'weight' => '6', 'type' => MENU_LOCAL_TASK);
+        $items[] = array('path' => 'node/'.arg(1).'/issues/search', 'title' => t('search'), 'callback' => 'project_issue_page', 'weight' => '6', 'access' => $access, 'type' => MENU_LOCAL_TASK);
+
+        // release Page Tabs
+        $access = node_access('view', $node);
+        $items[] = array('path' => 'node/'. arg(1) .'/release', 'title' => t('downloads'), 'callback' => 'project_project_releases', 'access' => node_access('view', $node), 'weight' => 4, 'type' => MENU_LOCAL_TASK);
+        // if (node_access('update', $node)) {
+          $items[] = array('path' => 'node/'. arg(1) .'/release/overview', 'title' => t('overview'), 'callback' => 'project_project_releases', 'access' => node_access('view', $node), 'weight' => 0, 'type' => MENU_DEFAULT_LOCAL_TASK);
+        // }
+        // if (!variable_get('project_release_directory', '')) {
+          $access = node_access('update', $node);
+          $items[] = array('path' => 'node/'. arg(1) .'/release/add', 'title' => t('add'), 'callback' => 'project_release_submit', 'access' => $access, 'weight' => 1, 'type' => MENU_LOCAL_TASK);
+        // }
 
-        if (node_access('update', $node)) {
-          $items[] = array('path' => 'node/'. arg(1) .'/release/overview', 'title' => t('overview'), 'callback' => 'project_project_releases', 'access' => node_access('view', $node), 'weight' => 0, 'type' => MENU_CALLBACK);
-        }
-
-        if (!variable_get('project_release_directory', '')) {
-          $items[] = array('path' => 'node/'. arg(1) .'/release/add', 'title' => t('add'), 'callback' => 'project_release_submit', 'access' => node_access('update', $node), 'weight' => 1, 'type' => MENU_CALLBACK);
-        }
         if (arg(2) == 'release' && is_numeric(arg(4))) {
-          $items[] = array('path' => 'node/'. arg(1) .'/release/edit/'. arg(4), 'title' => t('edit'), 'callback' => 'project_release_submit', 'access' => node_access('update', $node), 'weight' => 1, 'type' => MENU_CALLBACK);
-          $items[] = array('path' => 'node/'. arg(1) .'/release/delete/'. arg(4), 'title' => t('edit'), 'callback' => 'project_release_submit', 'access' => node_access('update', $node), 'weight' => 1, 'type' => MENU_CALLBACK);
+          $items[] = array('path' => 'node/'. arg(1) .'/release/edit/'. arg(4), 'title' => t('edit'), 'callback' => 'project_release_submit', 'access' => node_access('update', $node), 'weight' => 1, 'type' => MENU_LOCAL_TASK);
+          $items[] = array('path' => 'node/'. arg(1) .'/release/delete/'. arg(4), 'title' => t('delete'), 'callback' => 'project_release_submit', 'access' => node_access('update', $node), 'weight' => 1, 'type' => MENU_LOCAL_TASK);
         }
       }
     }
@@ -493,7 +504,7 @@
  *
  * $project has the following fields:
  * - title: Title
- * - nid: Node id 
+ * - nid: Node id
  * - body: Filtered description
  * - term: String with the selected term name
  * - version: String with the version
