3 * FusionForge Documentation Manager
5 * Copyright 2010-2011, Franck Villaume - Capgemini
6 * Copyright 2013, Franck Villaume - TrivialDev
7 * http://fusionforge.org
9 * This file is part of FusionForge. FusionForge is free software;
10 * you can redistribute it and/or modify it under the terms of the
11 * GNU General Public License as published by the Free Software
12 * Foundation; either version 2 of the Licence, or (at your option)
15 * FusionForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 /* please do not add require here : use www/docman/index.php to add require */
26 /* global variables used */
27 global $g; //group object
28 global $dirid; //id of doc_group
29 global $group_id; // id of group
30 global $LUSER; // User object
32 if (!forge_check_perm('docman', $group_id, 'approve')) {
33 $return_msg = _('Document Manager Action Denied.');
34 session_redirect('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid.'&warning_msg='.urlencode($return_msg));
37 $arr_fileid = explode(',', getStringFromRequest('fileid'));
38 $return_msg = _('Document(s)').' ';
39 foreach ($arr_fileid as $fileid) {
40 $d = new Document($g, $fileid);
41 $return_msg .= $d->getFilename().' ';
43 session_redirect('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid.'&error_msg='.urlencode($d->getErrorMessage()));
45 if (!$d->setReservedBy('1', $LUSER->getID()))
46 session_redirect('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid.'&error_msg='.urlencode($d->getErrorMessage()));
49 $return_msg .= _('reserved successfully.');
50 session_redirect('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid.'&feedback='.urlencode($return_msg));