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