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 * 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 /* please do not add require here : use www/docman/index.php to add require */
27 /* global variables used */
28 global $g; //group object
29 global $dirid; //id of doc_group
30 global $group_id; // id of group
32 $redirecturl = '/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid;
33 if (!forge_check_perm('docman', $group_id, 'approve')) {
34 $return_msg = _('Document Manager Action Denied.');
35 session_redirect($redirecturl.'&warning_msg='.urlencode($return_msg));
38 // plugin projects-hierarchy handler
39 $childgroup_id = getIntFromRequest('childgroup_id');
41 if (!forge_check_perm('docman', $childgroup_id, 'approve')) {
42 $return_msg = _('Document Manager Action Denied.');
43 session_redirect($redirecturl.'&warning_msg='.urlencode($return_msg));
45 $redirecturl .= '&childgroup_id='.$childgroup_id;
46 $g = group_get_object($childgroup_id);
49 $arr_fileid = explode(',',getStringFromRequest('fileid'));
50 $return_msg = _('Document(s)').' ';
51 foreach ($arr_fileid as $fileid) {
52 if (!empty($fileid)) {
53 $d = new Document($g, $fileid);
54 $return_msg .= $d->getFilename().' ';
57 session_redirect($redirecturl.'&error_msg='.urlencode($d->getErrorMessage()));
60 session_redirect($redirecturl.'&error_msg='.urlencode($d->getErrorMessage()));
62 $warning_msg = _('No action to perform');
63 session_redirect($redirecturl.'&warning_msg='.urlencode($warning_msg));
66 $return_msg .= _('moved to trash successfully.');
67 session_redirect($redirecturl.'&feedback='.urlencode($return_msg));