Index: project_issue/issue.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/issue.inc,v
retrieving revision 1.339
diff -u -p -r1.339 issue.inc
--- project_issue/issue.inc	22 Feb 2009 01:01:46 -0000	1.339
+++ project_issue/issue.inc	3 Mar 2009 23:43:07 -0000
@@ -1337,6 +1337,33 @@ function project_issue_delete_state_conf
   }
 }
 
+function project_issue_admin_components_form() {
+  $defaults = serialize(array(t('Code'), t('Documentation'), t('Miscellaneous'), t('User interface')));
+  $defaults = variable_get('project_issue_default_components', $defaults);
+  $components = unserialize($defaults);
+
+  $form['components'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Default components'),
+    '#default_value' => implode("\n", $components),
+    '#rows' => 10,
+    '#required' => TRUE,
+    '#description' => t("Enter the default list of components that new projects will have.  The project owner will be able to change this list on the project's edit/issues page.")
+  );
+
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Save'),
+  );
+
+  return $form;
+}
+
+function project_issue_admin_components_form_submit($form, &$form_state) {
+  $components = serialize(explode("\n", str_replace("\r", '', $form_state['values']['components'])));
+  variable_set('project_issue_default_components', $components);
+}
+
 /**
  * Return the HTML to use for the links at the top of issue query pages.
  *
Index: project_issue/project_issue.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/project_issue.module,v
retrieving revision 1.146
diff -u -p -r1.146 project_issue.module
--- project_issue/project_issue.module	26 Feb 2009 23:05:48 -0000	1.146
+++ project_issue/project_issue.module	3 Mar 2009 23:43:08 -0000
@@ -117,6 +117,17 @@ function project_issue_menu() {
     'type' => MENU_CALLBACK,
   );
 
+  // Administer issue component settings
+  $items['admin/project/project-issue-components'] = array(
+    'title' => 'Project issue component options',
+    'description' => 'Configure the default set of components for new projects.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('project_issue_admin_components_form'),
+    'access arguments' => array('administer projects'),
+    'type' => MENU_NORMAL_ITEM,
+    'weight' => 1,
+  );
+
   // Issues subtab on project node edit tab.
   $items['node/%project_node/edit/issues'] = array(
     'title' => 'Issues',
@@ -1197,7 +1208,8 @@ function project_issue_project_insert($n
   // they'd use the "issues" subtab of the project edit tab (since none
   // of these fields are present on the initial project add form).
   $node->project_issue['issues'] = 1;
-  $node->project_issue['components'] = serialize(array(t('Code'), t('Documentation'), t('Miscellaneous'), t('User interface')));
+  $default_components = serialize(array(t('Code'), t('Documentation'), t('Miscellaneous'), t('User interface')));
+  $node->project_issue['components'] = variable_get('project_issue_default_components', $default_components);
   db_query("INSERT INTO {project_issue_projects} (nid, issues, components) VALUES (%d, %d, '%s')", $node->nid, $node->project_issue['issues'], $node->project_issue['components']);
 }
 
