5 * Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2002-2004 (c) GForge Team
9 * This file is part of GForge.
11 * GForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * GForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with GForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 require_once('../../env.inc.php');
27 require_once $gfwww.'include/pre.php';
28 require_once $gfwww.'people/people_utils.php';
30 if (!forge_get_config('use_people')) {
34 $group_id = getIntFromRequest('group_id');
35 $job_id = getIntFromRequest('job_id');
37 if (user_ismember(1,'A')) {
39 if (getStringFromRequest('post_changes')) {
44 if (getStringFromRequest('people_cat')) {
45 $cat_name = getStringFromRequest('cat_name');
46 if (!form_key_is_valid(getStringFromRequest('form_key'))) {
47 exit_form_double_submit();
49 $result=db_query_params('INSERT INTO people_job_category (name) VALUES ($1)', array($cat_name));
52 form_release_key(getStringFromRequest("form_key"));
53 $feedback .= ' Error inserting value ';
56 $feedback .= ' Category Inserted ';
58 } else if (getStringFromRequest('people_skills')) {
59 $skill_name = getStringFromRequest('skill_name');
60 if (!form_key_is_valid(getStringFromRequest('form_key'))) {
61 exit_form_double_submit();
63 $result=db_query_params('INSERT INTO people_skill (name) VALUES ($1)', array($skill_name));
66 form_release_key(getStringFromRequest("form_key"));
67 $feedback .= ' Error inserting value ';
70 $feedback .= ' Skill Inserted ';
78 if (getStringFromRequest('people_cat')) {
80 Show categories and blank row
82 people_header(array ('title'=>'Add/Change Categories'));
85 List of possible categories for this group
87 $result=db_query_params('SELECT category_id,name FROM people_job_category', array());
89 if ($result && db_numrows($result) > 0) {
90 ShowResultSet($result,'Existing Categories','people_cat');
93 <h1>No job categories</h1>';
98 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="post">
99 <input type="hidden" name="people_cat" value="y" />
100 <input type="hidden" name="post_changes" value="y" />
101 <input type="hidden" name="form_key" value="<?php echo form_generate_key();?>">
102 <h4>New Category Name:</h4>
103 <input type="text" name="cat_name" value="" size="15" maxlength="30" /><br />
105 <span class="imporant">Once you add a category, it cannot be deleted</span></p>
107 <input type="submit" name="submit" value="SUBMIT"></p>
111 people_footer(array());
113 } else if (getStringFromRequest('people_skills')) {
115 Show people_groups and blank row
117 people_header(array ('title'=>'Add/Change People Skills'));
120 List of possible people_groups for this group
122 $result=db_query_params('SELECT skill_id,name FROM people_skill', array());
124 if ($result && db_numrows($result) > 0) {
125 ShowResultSet($result,"Existing Skills","people_skills");
128 echo "\n<h2>No Skills Found</h2>";
132 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="post">
133 <input type="hidden" name="people_skills" value="y" />
134 <input type="hidden" name="post_changes" value="y" />
135 <input type="hidden" name="form_key" value="<?php echo form_generate_key();?>">
136 <h4>New Skill Name:</h4>
137 <input type="text" name="skill_name" value="" size="15" maxlength="30" /><br />
139 <span class="important">Once you add a skill, it cannot be deleted</span></p>
141 <input type="submit" name="submit" value="SUBMIT"></p>
145 people_footer(array());
152 people_header(array ('title'=>'People Administration'));
155 <a href="'.getStringFromServer('PHP_SELF').'?people_cat=1">Add Job Categories</a><br />';
156 // echo "\nAdd categories of bugs like, 'mail module','gant chart module','interface', etc<p>";
158 echo "\n<a href=\"".getStringFromServer('PHP_SELF')."?people_skills=1\">Add Job Skills</a><br />";
159 // echo "\nAdd Groups of bugs like 'future requests','unreproducible', etc<p>";
161 people_footer(array());
165 exit_permission_denied();