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 echo '<ul id="'.$g->getUnixname().'-tree">';
42 $dm->getTree($dirid, $linkmenu);
45 <script type="text/javascript">//<![CDATA[
46 jQuery(document).ready(function() {
47 if (typeof(jQuery(\'#'.$g->getUnixname().'-tree\').simpleTreeMenu) != "undefined") {
48 jQuery(\'#'.$g->getUnixname().'-tree\').simpleTreeMenu();
53 if ($g->usesPlugin('projects-hierarchy')) {
54 $projectsHierarchy = plugin_get_object('projects-hierarchy');
55 $projectIDsArray = $projectsHierarchy->getFamily($group_id, 'child', true, 'validated');
57 if (isset($projectIDsArray) && is_array($projectIDsArray)) {
58 foreach ($projectIDsArray as $key=>$projectID) {
59 $groupObject = group_get_object($projectID);
60 if ($groupObject->usesDocman() && $projectsHierarchy->getDocmanStatus($groupObject->getID())
61 && forge_check_perm('docman', $groupObject->getID(), 'read')) {
63 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>';
64 $dm = new DocumentManager($groupObject);
65 echo '<ul id="'.$groupObject->getUnixname().'-tree">';
66 $dm->getTree($dirid, $linkmenu);
69 <script type="text/javascript">//<![CDATA[
70 jQuery(document).ready(function() {
71 if (typeof(jQuery(\'#'.$g->getUnixname().'-tree\').simpleTreeMenu) != "undefined") {
72 jQuery(\'#'.$groupObject->getUnixname().'-tree\').simpleTreeMenu();
80 if (isset($childgroup_id) && $childgroup_id) {
81 $groupObject = group_get_object($childgroup_id);
83 <script type="text/javascript">//<![CDATA[
84 jQuery(document).ready(function() {
85 if (typeof(jQuery(\'#'.$g->getUnixname().'-tree\').simpleTreeMenu) != "undefined") {
86 jQuery(\'#'.$groupObject->getUnixname().'-tree\').simpleTreeMenu(\'expandToNode\', jQuery(\'#leaf-'.$dirid.'\'));
93 <script type="text/javascript">//<![CDATA[
94 jQuery(document).ready(function() {
95 if (typeof(jQuery(\'#'.$g->getUnixname().'-tree\').simpleTreeMenu) != "undefined") {
96 jQuery(\'#'.$g->getUnixname().'-tree\').simpleTreeMenu(\'expandToNode\', jQuery(\'#leaf-'.$dirid.'\'));