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 $childgroup_id = getIntFromRequest('childgroup_id');
40 if (!forge_check_perm('docman', $childgroup_id, 'approve')) {
41 $return_msg = _('Document Manager Action Denied.');
42 session_redirect($redirecturl.'&warning_msg='.urlencode($return_msg));
44 $redirecturl .= '&childgroup_id='.$childgroup_id;
45 $g = group_get_object($childgroup_id);
48 $arr_fileid = explode(',',getStringFromRequest('fileid'));
49 $return_msg = _('Document(s)').' ';
50 foreach ($arr_fileid as $fileid) {
51 if (!empty($fileid)) {
52 $d = new Document($g, $fileid);
53 $return_msg .= $d->getFilename().' ';
56 session_redirect($redirecturl.'&error_msg='.urlencode($d->getErrorMessage()));
59 session_redirect($redirecturl.'&error_msg='.urlencode($d->getErrorMessage()));
61 $warning_msg = _('No action to perform');
62 session_redirect($redirecturl.'&warning_msg='.urlencode($warning_msg));
65 $return_msg .= _('moved to trash successfully.');
66 session_redirect($redirecturl.'&feedback='.urlencode($return_msg));