3 * Copyright 2004 (c) GForge LLC
4 * Copyright 2006 (c) Fabien Regnier - Sogeti
5 * Copyright 2010-2011, Franck Villaume - Capgemini
7 * This file is part of FusionForge.
9 * FusionForge is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 require_once '../../env.inc.php';
25 require_once $gfcommon.'include/pre.php';
27 $user = session_get_user(); // get the session user
29 if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) {
30 exit_error("Invalid User", "Cannot Process your request for this user.");
33 $type = getStringFromRequest('type');
34 global $pluginExtSubProj;
35 $pluginExtSubProj = plugin_get_object('extsubproj');
38 exit_error("Cannot Process your request: No TYPE specified", 'home'); // you can create items in Base.tab and customize this messages
43 if (!session_loggedin()) {
46 $id = getStringFromRequest('id');
48 exit_error("Cannot Process your request: No ID specified", 'home');
50 $group = group_get_object($id);
52 exit_error("Invalid Project", 'home');
54 if (!$group->usesPlugin($pluginExtSubProj->name)) {//check if the group has the projects-hierarchy plugin active
55 exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'), $pluginExtSubProj->name), 'home');
57 session_require_perm('project_admin', $id);
59 $action = getStringFromRequest('action');
64 case "projectsHierarchyDocman":
67 case "validateRelationship": {
68 include($gfplugins.$pluginExtSubProj->name.'/actions/'.$action.'.php');
72 $pluginExtSubProj->redirect($_SERVER['HTTP_REFERER'], 'error_msg', _('Unknown action.'));
79 if (!session_loggedin()) {
82 session_require_global_perm('forge_admin');
83 $action = getStringFromRequest('action');
86 case 'updateGlobalConf': {
88 include($gfplugins.$pluginExtSubProj->name.'/actions/'.$action.'.php');
92 // do nothing, see getGlobalAdminView() below
97 $pluginExtSubProj->getHeader('globaladmin');
98 $pluginExtSubProj->getGlobalAdminView();
99 $pluginExtSubProj->getFooter('globaladmin');
104 if (!session_loggedin()) {
105 exit_not_logged_in();
107 $id = getStringFromRequest('group_id');
108 session_require_perm('project_admin', $id);
110 exit_error("Cannot Process your request: No ID specified", 'home');
112 $group = group_get_object($id);
114 exit_error("Invalid Project", 'home');
116 if (!$group->usesPlugin($pluginExtSubProj->name)) {//check if the group has the projects-hierarchy plugin active
117 exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'), $pluginExtSubProj->name), 'home');
119 $action = getStringFromRequest('action');
122 case 'delExtSubProj':
123 case 'addExtSubProj': {
125 include($gfplugins.$pluginExtSubProj->name.'/actions/'.$action.'.php');
129 $pluginExtSubProj->redirect($_SERVER['HTTP_REFERER'], 'error_msg', _('Unknown action.'));
134 // params needed by site_project_header() inside getHeader()
136 'toptab' => $pluginExtSubProj->name,
138 $pluginExtSubProj->getHeader('admin', $params);
139 $pluginExtSubProj->getProjectAdminView();
140 $pluginExtSubProj->getFooter('admin');
144 exit_error("No TYPE specified", 'home');
151 // c-file-style: "bsd"