3 * FusionForge Documentation Manager
5 * Copyright 2000, Quentin Cregan/Sourceforge
6 * Copyright 2002-2003, Tim Perdue/GForge, LLC
7 * Copyright 2010-2011, Franck Villaume - Capgemini
8 * Copyright 2011,2014, Franck Villaume - TrivialDev
9 * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
10 * http://fusionforge.org
12 * This file is part of FusionForge. FusionForge is free software;
13 * you can redistribute it and/or modify it under the terms of the
14 * GNU General Public License as published by the Free Software
15 * Foundation; either version 2 of the Licence, or (at your option)
18 * FusionForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 /* please do not add require here : use www/docman/index.php to add require */
29 /* global variables used */
30 global $g; // group object
31 global $dirid; // id of doc_group
32 global $group_id; // id of group
35 $urlredirect = '/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid;
37 $urlredirect = '/docman/?group_id='.$group_id;
40 // plugin projects-hierarchy handler
41 $childgroup_id = getIntFromRequest('childgroup_id');
43 $g = group_get_object($childgroup_id);
44 $urlredirect .= '&childgroup_id='.$childgroup_id;
47 if (!forge_check_perm('docman', $g->getID(), 'approve')) {
48 $warning_msg = _('Document Manager Action Denied.');
49 session_redirect($urlredirect);
52 $groupname = trim(getStringFromRequest('groupname'));
54 $dg = new DocumentGroup($g);
56 if ($dg->isError() || !$dg->create($groupname, $dirid)) {
57 $error_msg = $dg->getErrorMessage();
58 session_redirect($urlredirect);
62 $feedback = _('Document subfolder successfully created.');
63 session_redirect($urlredirect);
66 $feedback = _('Document folder successfully created.');
67 session_redirect($urlredirect.'&view=listfile&dirid='.$dg->getID());