5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2002-2004 (c) GForge Team
7 * Copyright (C) 2010 Alain Peyrat - Alcatel-Lucent
8 * http://fusionforge.org/
10 * This file is part of FusionForge. FusionForge is free software;
11 * you can redistribute it and/or modify it under the terms of the
12 * GNU General Public License as published by the Free Software
13 * Foundation; either version 2 of the Licence, or (at your option)
16 * FusionForge 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 along
22 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 require_once('../../env.inc.php');
27 require_once $gfcommon.'include/pre.php';
28 require_once $gfwww.'people/people_utils.php';
30 if (!forge_get_config('use_people')) {
31 exit_disabled('home');
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('admin');
49 $result=db_query_params('INSERT INTO people_job_category (name) VALUES ($1)', array($cat_name));
51 form_release_key(getStringFromRequest("form_key"));
52 $error_msg .= _(' Error inserting value: ').db_error();
55 $feedback .= _('Category Inserted');
57 } else if (getStringFromRequest('people_skills')) {
58 $skill_name = getStringFromRequest('skill_name');
59 if (!form_key_is_valid(getStringFromRequest('form_key'))) {
60 exit_form_double_submit('admin');
62 $result=db_query_params('INSERT INTO people_skill (name) VALUES ($1)', array($skill_name));
64 form_release_key(getStringFromRequest("form_key"));
65 $error_msg .= _('Error inserting value: ').db_error();
68 $feedback .= _('Skill Inserted');
76 if (getStringFromRequest('people_cat')) {
78 Show categories and blank row
80 people_header(array ('title'=>'Add/Change Categories'));
83 List of possible categories for this group
85 $result=db_query_params('SELECT category_id,name FROM people_job_category', array());
87 if ($result && db_numrows($result) > 0) {
88 ShowResultSet($result,'Existing Categories','people_cat');
90 echo '<p class="error">No job categories</p>';
95 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="post">
96 <input type="hidden" name="people_cat" value="y" />
97 <input type="hidden" name="post_changes" value="y" />
98 <input type="hidden" name="form_key" value="<?php echo form_generate_key();?>">
99 <h4>New Category Name:</h4>
100 <input type="text" name="cat_name" value="" size="15" maxlength="30" /><br />
101 <div class="warning">Once you add a category, it cannot be deleted</div>
103 <input type="submit" name="submit" value="SUBMIT"></p>
107 people_footer(array());
109 } else if (getStringFromRequest('people_skills')) {
111 Show people_groups and blank row
113 people_header(array ('title'=>'Add/Change People Skills'));
116 List of possible people_groups for this group
118 $result=db_query_params('SELECT skill_id,name FROM people_skill', array());
120 if ($result && db_numrows($result) > 0) {
121 ShowResultSet($result,"Existing Skills","people_skills");
124 echo "\n<h2>No Skills Found</h2>";
128 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="post">
129 <input type="hidden" name="people_skills" value="y" />
130 <input type="hidden" name="post_changes" value="y" />
131 <input type="hidden" name="form_key" value="<?php echo form_generate_key();?>">
132 <h4>New Skill Name:</h4>
133 <input type="text" name="skill_name" value="" size="15" maxlength="30" /><br />
134 <div class="warning">Once you add a skill, it cannot be deleted</div>
136 <input type="submit" name="submit" value="SUBMIT"></p>
140 people_footer(array());
147 people_header(array ('title'=>'People Administration'));
150 <a href="'.getStringFromServer('PHP_SELF').'?people_cat=1">Add Job Categories</a><br />';
151 // echo "\nAdd categories of bugs like, 'mail module','gant chart module','interface', etc<p>";
153 echo "\n<a href=\"".getStringFromServer('PHP_SELF')."?people_skills=1\">Add Job Skills</a><br />";
154 // echo "\nAdd Groups of bugs like 'future requests','unreproducible', etc<p>";
156 people_footer(array());
160 exit_permission_denied('home');