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 (forge_check_global_perm('forge_admin')) {
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 .= _('Insert Error')._(': ').db_error();
55 $feedback .= _('Category Inserted');
57 } elseif (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 .= _('Insert Error')._(': ').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>';
94 <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 <strong><?php echo _('New Category Name')._(':'); ?></strong>
100 <input type="text" name="cat_name" value="" size="15" maxlength="30" />
102 <p class="warning">Once you add a category, it cannot be deleted</p>
104 <input type="submit" name="submit" value="SUBMIT"></p>
108 people_footer(array());
110 } elseif (getStringFromRequest('people_skills')) {
112 Show people_groups and blank row
114 people_header(array('title'=>_('Add/Change People Skills')));
117 List of possible people_groups for this group
119 $result=db_query_params('SELECT skill_id,name FROM people_skill', array());
121 if ($result && db_numrows($result) > 0) {
122 ShowResultSet($result,"Existing Skills","people_skills");
125 echo "\n<h2>"._('No Skills Found').'</h2>';
128 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="post">
130 <input type="hidden" name="people_skills" value="y" />
131 <input type="hidden" name="post_changes" value="y" />
132 <input type="hidden" name="form_key" value="<?php echo form_generate_key();?>">
133 <strong><?php echo _('New Skill Name')._(':'); ?></strong>
134 <input type="text" name="skill_name" value="" size="15" maxlength="30" />
136 <p class="warning">Once you add a skill, it cannot be deleted</p>
138 <input type="submit" name="submit" value="SUBMIT"></p>
142 people_footer(array());
149 people_header(array('title'=>_('People Administration')));
152 <a href="'.getStringFromServer('PHP_SELF').'?people_cat=1">Add Job Categories</a><br />';
153 // echo "\nAdd categories of bugs like, 'mail module','gant chart module','interface', etc<p>";
155 echo "\n<a href=\"".getStringFromServer('PHP_SELF')."?people_skills=1\">Add Job Skills</a><br />";
156 // echo "\nAdd Groups of bugs like 'future requests','unreproducible', etc<p>";
158 people_footer(array());
162 exit_permission_denied('home');