';
$rows = array();
$rows[] = array('Project:', check_plain($project->title));
if ($release->version) {
@@ -1088,7 +1088,7 @@ function theme_project_issue_query($form
array('data' => drupal_render($form['submit']), 'colspan' => 3)
);
- $output = '
';
+ $output = '
';
$output .= theme('table', array(), $rows);
$output .= '
';
$output .= drupal_render($form);
@@ -1189,7 +1189,7 @@ function project_issue_admin_states_page
function project_issue_admin_save_states() {
// Check for and apply changes or additions to project issue status options.
- $edit = $_POST['edit'];
+ $edit = $_POST;
if (isset($edit['default_state'])) {
variable_set('project_issue_default_state', $edit['default_state']);
}
@@ -1284,18 +1284,37 @@ function project_issue_query_result($que
}
if ($project) {
- drupal_set_title(t('issues for %name', array('%name' => theme('placeholder', $project->title))));
+ drupal_set_title(t('issues for %name', array('%name' => $project->title)));
$releases = project_release_get_releases($project, 0);
$query->projects = $project->nid;
$links = array();
if (user_access('create project issues')) {
- $links[] = l(t('submit'), "node/add/project_issue/$project->uri", array('title' => t('Submit a new issue for %project.', array('%project' => check_plain($project->uri)))));
+ $links[] = array(
+ 'title' => t('Submit'),
+ 'href' => "node/add/project_issue/$project->uri",
+ 'attributes' => array('title' => t('Submit a new issue for @project.', array('@project' => $project->uri))),
+ );
}
- $links[] = l(t('statistics'), "project/issues/statistics/$project->uri", array('title' => t('See statistics about %project issues.', array('%project' => check_plain($project->uri)))));
+ $links[] = array(
+ 'title' => t('Statistics'),
+ 'href' => "project/issues/statistics/$project->uri",
+ 'attributes' => array('title' => t('See statistics about @project issues.', array('@project' => $project->uri))),
+ );
if ($user->uid) {
- $links[] = l(t('subscribe'), "project/issues/subscribe/$project->uri", array('title' => t('Receive email updates about issues for %project.', array('%project' => check_plain($project->uri)))));
+ $links[] = array(
+ 'title' => t('Subscribe'),
+ 'href' => "project/issues/subscribe/$project->uri",
+ 'attributes' => array('title' => t('Receive email updates about @project issues.', array('@project' => $project->uri))),
+ );
+ }
+ $links[] = array(
+ 'title' => t('Advanced search'),
+ 'href' => "project/issues/search/$project->uri",
+ 'attributes' => array('title' => t('Use the advanced search page to find %project issues.', array('@project' => $project->uri))),
+ );
+ if (user_access('create project issues')) {
+
}
- $links[] = l(t('advanced search'), "project/issues/search/$project->uri", array('title' => t('Use the advanced search page to find %project issues.', array('%project' => check_plain($project->uri)))));
}
else {
// only set a more descriptive title if we're not looking at "my
@@ -1305,13 +1324,29 @@ function project_issue_query_result($que
}
$links = array();
if (user_access('create project issues')) {
- $links[] = l(t('submit'), "node/add/project_issue", array('title' => t('Submit a new issue.')));
+ $links[] = array(
+ 'title' => t('Submit'),
+ 'href' => "node/add/project_issue",
+ 'attributes' => array('title' => t('Submit a new issue.')),
+ );
}
- $links[] = l(t('statistics'), "project/issues/statistics", array('title' => t('See statistics about issues.')));
+ $links[] = array(
+ 'title' => t('Statistics'),
+ 'href' => "project/issues/statistics",
+ 'attributes' => array('title' => t('See statistics about issues.')),
+ );
if ($user->uid) {
- $links[] = l(t('subscribe'), "project/issues/subscribe", array('title' => t('Receive email updates about issues.')));
+ $links[] = array(
+ 'title' => t('Subscribe'),
+ 'href' => "project/issues/subscribe",
+ 'attributes' => array('title' => t('Receive email updates about issues.')),
+ );
}
- $links[] = l(t('advanced search'), "project/issues/search/", array('title' => t('Use the advanced search page for finding issues.')));
+ $links[] = array(
+ 'title' => t('Advanced search'),
+ 'href' => "project/issues/search/",
+ 'attributes' => array('title' => t('Use the advanced search page for finding issues.')),
+ );
}
$header = array();
@@ -1465,7 +1500,7 @@ function project_issue_query_result($que
$rows[] = array(array('data' => t('No issues found.'), 'colspan'=> 8));
}
- $output = '
';
+ $output = '
';
$output .= '
';
$output .= $group;
$output .= '
';
@@ -1501,7 +1536,7 @@ function project_issue_query_url($query
}
/**
- * Parses $_POST['edit'] or $_GET and creates the appropriate query
+ * Parses $_POST or $_GET and creates the appropriate query
* object based on whatever choices a user has made to filter the
* issue queue. This function *MUST* return a valid $query object,
* since the rest of project_issue_query_result() assumes that $query
@@ -1520,8 +1555,8 @@ function project_issue_query_url($query
*/
function project_issue_query_parse($query = NULL) {
$fields = array('projects', 'text', 'attachment', 'summary', 'comment', 'categories', 'components', 'versions', 'states', 'priorities', 'users', 'assigned', 'submitted', 'participated');
- if ($_SERVER['REQUEST_METHOD'] == 'POST' && is_array($_POST['edit'])) {
- foreach ($_POST['edit'] as $key => $value) {
+ if ($_SERVER['REQUEST_METHOD'] == 'POST' && is_array($_POST)) {
+ foreach ($_POST as $key => $value) {
if (!empty($value) && in_array($key, $fields)) {
$query->$key = !is_array($value) ? explode(',', $value) : $value;
}
Index: modules/project_issue/mail.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/mail.inc,v
retrieving revision 1.65
diff -u -p -r1.65 mail.inc
--- modules/project_issue/mail.inc 18 Dec 2006 09:11:08 -0000 1.65
+++ modules/project_issue/mail.inc 20 Dec 2006 06:32:10 -0000
@@ -237,8 +237,8 @@ function project_mail_notify($node) {
}
// Create link to related node
- $links = t('Issue status update for %link', array('%link' => "\n". url("node/$node->nid", NULL, NULL, 1))) ."\n";
- $links .= t('Post a follow up: %link', array('%link' => "\n". url("project/comments/add/$node->nid", NULL, NULL, 1))) ."\n";
+ $links = t('Issue status update for !link', array('!link' => "\n". url("node/$node->nid", NULL, NULL, 1))) ."\n";
+ $links .= t('Post a follow up: !link', array('!link' => "\n". url("project/comments/add/$node->nid", NULL, NULL, 1))) ."\n";
// Mail summary (status values)
foreach ($fields as $field => $text) {
Index: modules/project_issue/project_issue.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/project_issue.css,v
retrieving revision 1.6
diff -u -p -r1.6 project_issue.css
--- modules/project_issue/project_issue.css 18 Dec 2006 09:11:08 -0000 1.6
+++ modules/project_issue/project_issue.css 20 Dec 2006 06:32:10 -0000
@@ -6,13 +6,13 @@
padding-top: 0.5em;
}
-.node-form .project .options fieldset .form-item {
+.project-issue .node-form .options fieldset .form-item {
float: left;
padding-right: 0.8em;
margin: 0.05em 0.1em;
}
-.node-form .project fieldset:after {
+.project-issue .node-form fieldset:after {
content: ".";
display: block;
height: 0;
@@ -20,7 +20,7 @@
visibility: hidden;
}
-.node-form .project .options fieldset {display: inline-table;}
+.project-issue .node-form .options fieldset {display: inline-table;}
table.projects {
width: 100%;
cvs diff: modules/project_issue/project_issue.info is a new entry, no comparison available
Index: modules/project_issue/project_issue.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/project_issue.module,v
retrieving revision 1.10
diff -u -p -r1.10 project_issue.module
--- modules/project_issue/project_issue.module 20 Dec 2006 01:09:34 -0000 1.10
+++ modules/project_issue/project_issue.module 20 Dec 2006 06:32:10 -0000
@@ -1,5 +1,5 @@
project_issues
@@ -14,8 +14,6 @@ if (file_exists("$path/issue.inc")) {
function project_issue_help($section) {
switch ($section) {
- case 'admin/modules#description':
- return t('Provides issues tracking for the project.module.');
case 'admin/help#project_issue':
$help = t('
Mailhandler support
'.
'
Basic mail format:
'.
@@ -33,7 +31,7 @@ function project_issue_help($section) {
return $help;
case 'node/add#project_issue':
return t('Add a new issue (bug report, feature request, etc) to an existing project.');
- case 'admin/settings/project_issue/status':
+ case 'admin/project/project-issue-status':
return t('
Use this page to add new status options for project issues or to change or delete existing options.
- Adding
- To add a new status option, put its name in one of the blank places at the bottom of the form and assign it a weight.
- Updating
- When renaming existing issues, keep in mind that issues with the existing name will receive the new one.
@@ -48,7 +46,11 @@ function project_issue_help($section) {
function project_issue_node_info() {
return array(
- 'project_issue' => array('name' => t('issue'), 'base' => 'project_issue'),
+ 'project_issue' => array(
+ 'name' => t('Issue'),
+ 'module' => 'project_issue',
+ 'description' => t('An issue that can be tracked, such as a bug report, feature request, or task.'),
+ ),
);
}
@@ -69,7 +71,7 @@ function project_issue_perm() {
/**
* Callback for the main settings page.
*/
-function project_issue_settings() {
+function project_issue_settings_form() {
$project_directory = file_create_path(variable_get('project_directory_issues', 'issues'));
if (!file_check_directory($project_directory)) {
$error['project_directory_issues'] = theme('error', t('Directory does not exist, or is not writable.'));
@@ -84,7 +86,7 @@ function project_issue_settings() {
'#description' => t("Subdirectory in the directory '%dir' where attachment to issues will be stored.", array('%dir' => variable_get('file_directory_path', 'files') . '/')),
);
- if (module_exist('mailhandler')) {
+ if (module_exists('mailhandler')) {
// TODO: move this stuff to mailhandler.module ?
$items = array(t(''));
$result = db_query('SELECT mail FROM {mailhandler} ORDER BY mail');
@@ -98,7 +100,7 @@ function project_issue_settings() {
'#options' => $items,
);
}
- return $form;
+ return system_settings_form($form);
}
function project_issue_cron() {
@@ -128,7 +130,10 @@ function project_issue_link($type, $node
case 'node':
if ($node->type == 'project_issue') {
if (user_access('create project issues')) {
- $links[] = l(t('follow up'), "project/comments/add/$node->nid");
+ $links['project_issue_follow_up'] = array(
+ 'title' => t('follow up'),
+ 'href' => "project/comments/add/$node->nid",
+ );
}
}
break;
@@ -141,67 +146,60 @@ function project_issue_menu($may_cache)
global $user;
if ($may_cache) {
- // Authenticated user pages:
+ // Anonymous user pages:
// Issues
$access = user_access('access project issues');
$items[] = array(
'path' => 'project/issues',
- 'title' => t('issues'),
+ 'title' => t('Issues'),
'callback' => 'project_issue_page',
'access' => $access,
'type' => MENU_NORMAL_ITEM,
);
$items[] = array(
- 'path' => 'project/issues/user',
- 'title' => t('my issues'),
- 'callback' => 'project_issue_page',
- 'access' => $GLOBALS['user']->uid && $access,
- 'type' => MENU_NORMAL_ITEM,
- );
- $items[] = array(
- 'path' => 'project/issues/subscribe',
- 'title' => t('subscribe'),
- 'callback' => 'project_issue_page',
- 'access' => $GLOBALS['user']->uid && $access,
- 'type' => MENU_NORMAL_ITEM,
- );
- $items[] = array(
'path' => 'project/issues/add',
- 'title' => t('submit'),
+ 'title' => t('Submit'),
'callback' => 'project_issue_page',
'access' => $access,
'type' => MENU_NORMAL_ITEM,
);
$items[] = array(
'path' => 'project/issues/statistics',
- 'title' => t('statistics'),
+ 'title' => t('Statistics'),
'callback' => 'project_issue_page',
'access' => $access,
'type' => MENU_NORMAL_ITEM,
);
$items[] = array(
'path' => 'project/issues/search',
- 'title' => t('search'),
+ 'title' => t('Search'),
'callback' => 'project_issue_search_page',
'access' => $access,
'type' => MENU_NORMAL_ITEM,
);
- if (module_exist('search')) {
+ if (module_exists('search')) {
$items[] = array(
'path' => 'search/issues',
- 'title' => t('issues'),
+ 'title' => t('Issues'),
'callback' => 'project_issue_search_page',
'access' => $access,
'type' => MENU_LOCAL_TASK,
'weight' => 4,
);
}
+ $items[] = array(
+ 'path' => 'project/issues/subscribe',
+ 'title' => t('Subscribe'),
+ 'callback' => 'project_issue_page',
+ 'access' => $GLOBALS['user']->uid && $access,
+ 'type' => MENU_NORMAL_ITEM,
+ );
// "My projects" page (which shows all issues for all your projects)
$items[] = array(
'path' => 'project/user',
- 'title' => t('my projects'),
+ 'title' => t('My projects'),
'callback' => 'project_issue_user_page',
'access' => $user->uid && $access,
'type' => MENU_NORMAL_ITEM,
@@ -211,61 +209,86 @@ function project_issue_menu($may_cache)
$access = user_access('create project issues');
$items[] = array(
'path' => 'node/add/project_issue',
- 'title' => t('issue'),
+ 'title' => t('Issue'),
'callback' => 'node_page',
'access' => $access,
'type' => MENU_NORMAL_ITEM,
'weight' => 1,
);
- // Administer issue status settings
- $access = user_access('administer projects');
- $items[] = array(
- 'path' => 'admin/settings/project_issue/status',
- 'title' => t('status options'),
- 'callback' => 'project_issue_admin_states_page',
- 'access' => $access,
- 'type' => MENU_NORMAL_ITEM,
- );
- $items[] = array(
- 'path' => 'admin/settings/project_issue/status/save',
- 'title' => t('save'),
- 'callback' => 'project_issue_admin_states_page',
- 'access' => $access,
- 'type' => MENU_CALLBACK,
- );
- $items[] = array(
- 'path' => 'admin/settings/project_issue/status/delete',
- 'title' => t('delete'),
- 'callback' => 'project_issue_admin_states_page',
- 'access' => $access,
- 'type' => MENU_CALLBACK,
- );
-
- // Comments
+ // Reply to issues
$access = user_access('create project issues');
$items[] = array(
'path' => 'project/comments',
- 'title' => t('comments'),
+ 'title' => t('Comments'),
'callback' => 'project_comment_page',
'access' => $access,
'type' => MENU_CALLBACK,
);
}
else {
+ // Authenticated users
+
+ $items[] = array(
+ 'path' => 'project/issues/user',
+ 'title' => t('My issues'),
+ 'callback' => 'project_issue_page',
+ 'access' => $GLOBALS['user']->uid && $access,
+ 'type' => MENU_NORMAL_ITEM,
+ );
+
// Issues subtab on project node edit tab.
if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));
if ($node->type == 'project_project' && node_access('update', $node)) {
$items[] = array(
'path' => 'node/'. arg(1) .'/edit/issues',
- 'title' => t('issues'),
+ 'title' => t('Issues'),
'callback' => 'project_issue_project_edit_issues',
'type' => MENU_LOCAL_TASK,
);
}
}
- theme_add_style(drupal_get_path('module', 'project_issue') .'/project_issue.css');
+
+ // Administrative pages
+ $access = user_access('administer projects');
+ $items[] = array(
+ 'path' => 'admin/project/project-issue-settings',
+ 'title' => t('Project issue settings'),
+ 'description' => t('Specify where attachments to issues should be stored on your site.'),
+ 'callback' => 'drupal_get_form',
+ 'callback arguments' => array('project_issue_settings_form'),
+ 'type' => MENU_NORMAL_ITEM,
+ 'weight' => 1,
+ 'access' => $access,
+ );
+
+ // Administer issue status settings
+ $items[] = array(
+ 'path' => 'admin/project/project-issue-status',
+ 'title' => t('Project issue status options'),
+ 'description' => t('Configure what issue status values should be used on your site.'),
+ 'callback' => 'project_issue_admin_states_page',
+ 'weight' => 1,
+ 'access' => $access,
+ 'type' => MENU_NORMAL_ITEM,
+ );
+ $items[] = array(
+ 'path' => 'admin/project/project-issue-status/save',
+ 'title' => t('Save'),
+ 'callback' => 'project_issue_admin_states_page',
+ 'access' => $access,
+ 'type' => MENU_CALLBACK,
+ );
+ $items[] = array(
+ 'path' => 'admin/project/project-issue-status/delete',
+ 'title' => t('Delete'),
+ 'callback' => 'project_issue_admin_states_page',
+ 'access' => $access,
+ 'type' => MENU_CALLBACK,
+ );
+
+ drupal_add_css(drupal_get_path('module', 'project_issue') .'/project_issue.css');
}
return $items;
}
@@ -284,7 +307,13 @@ function project_issue_project_edit_issu
elseif (empty($node->components)) {
$node->components = "Code\nDocumentation\nMiscellaneous\nUser interface";
}
+ return drupal_get_form('project_issue_project_edit_form', $node);
+}
+/**
+ * Form builder for the issues subtab on the edit tab for project nodes.
+ */
+function project_issue_project_edit_form($node) {
/* Issue properties */
$form['issue'] = array(
'#type' => 'fieldset',
@@ -392,7 +421,7 @@ function project_issue_project_edit_issu
'#weight' => 45,
);
- return drupal_get_form('project_issue_project_edit_form', $form);
+ return $form;
}
/**
@@ -511,16 +540,31 @@ function project_issue_user_page($arg =
}
foreach ($projects as $node) {
$issue_links = array(
- l(t('view'), "project/issues/$node->nid"),
- l(t('search'), "project/issues/search/$node->nid"),
- l(t('submit'), "node/add/project_issue/$node->nid"),
+ array(
+ 'title' => t('View'),
+ 'href' => "project/issues/$node->nid"
+ ),
+ array(
+ 'title' => t('Search'),
+ 'href' => "project/issues/search/$node->nid",
+ ),
+ array(
+ 'title' => t('Submit'),
+ 'href' => "node/add/project_issue/$node->nid",
+ ),
);
if ($node->is_admin) {
$project_links = array(
- l(t('edit'), "node/$node->nid/edit"),
+ array(
+ 'title' => t('Edit'),
+ 'href' => "node/$node->nid/edit",
+ ),
);
- if (module_exist('project_release')) {
- $project_links[] = l(t('add release'), "node/add/project_release/$node->nid");
+ if (module_exists('project_release')) {
+ $project_links[] = array(
+ 'title' => t('Add release'),
+ 'href' => "node/add/project_release/$node->nid",
+ );
}
}
$row = array(