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 (C) 2011 Alain Peyrat - Alcatel-Lucent
9 * http://fusionforge.org
11 * This file is part of FusionForge. FusionForge is free software;
12 * you can redistribute it and/or modify it under the terms of the
13 * GNU General Public License as published by the Free Software
14 * Foundation; either version 2 of the Licence, or (at your option)
17 * FusionForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 /* please do not add require here : use www/docman/index.php to add require */
28 /* global variables used */
29 global $g; //group object
30 global $dirid; //id of doc_group
31 global $group_id; // id of group
33 $urlredirect = '/docman/?group_id='.$group_id;
35 // plugin projects-hierarchy handler
36 $childgroup_id = getIntFromRequest('childgroup_id');
38 $g = group_get_object($childgroup_id);
39 $urlredirect .= '&childgroup_id='.$childgroup_id;
42 if (!forge_check_perm('docman', $g->getID(), 'approve')) {
43 $return_msg = _('Document Manager Action Denied.');
44 session_redirect('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid.'&warning_msg='.urlencode($return_msg));
47 $dg = new DocumentGroup($g, $dirid);
50 session_redirect($urlredirect.'&view=listfile&dirid='.$dirid.'&error_msg='.urlencode($dg->getErrorMessage()));
53 if (!$dg->delete($dirid, $g->getID()))
54 session_redirect($urlredirect.'&view=listfile&dirid='.$dirid.'&error_msg='.urlencode($dg->getErrorMessage()));
56 if ($dg->getState() != 2) {
57 $parentId = $dg->getParentID();
61 $view='listtrashfile';
64 $return_msg = sprintf(_('Document folder %s deleted successfully.'),$dg->getName());
65 session_redirect($urlredirect.'&view='.$view.'&dirid='.$parentId.'&feedback='.urlencode($return_msg));