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 $group_id; // id of the group
31 global $g; // the group object
32 global $dirid; // the selected directory
34 if (!forge_check_perm('docman', $group_id, 'read')) {
35 $return_msg= _('Document Manager Access Denied');
36 session_redirect('/docman/?group_id='.$group_id.'&warning_msg='.urlencode($return_msg));
39 echo '<div id="documenttree" style="height:100%">';
40 $dm = new DocumentManager($g);
41 $dm->getTree($dirid, $linkmenu);
42 if ($g->usesPlugin('projects-hierarchy')) {
43 $projectsHierarchy = plugin_get_object('projects-hierarchy');
44 $projectIDsArray = $projectsHierarchy->getFamily($group_id, 'child', true, 'validated');
46 if (isset($projectIDsArray) && is_array($projectIDsArray)) {
47 foreach ($projectIDsArray as $key=>$projectID) {
48 $groupObject = group_get_object($projectID);
49 if ($groupObject->usesDocman() && $projectsHierarchy->getDocmanStatus($groupObject->getID())
50 && forge_check_perm('docman', $groupObject->getID(), 'read')) {
52 echo '<h5>'._('Child project: ').util_make_link('/docman/?group_id='.$groupObject->getID(),$groupObject->getPublicName(), array('class'=>'tabtitle', 'title'=>_('Browse document manager in this project'))).'</h5>';
53 $dm = new DocumentManager($groupObject);
54 $dm->getTree($dirid, $linkmenu);