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) 2010-2011 Alain Peyrat - Alcatel-Lucent
9 * Copyright 2012, Franck Villaume - TrivialDev
10 * http://fusionforge.org
12 * This file is part of FusionForge. FusionForge is free software;
13 * you can redistribute it and/or modify it under the terms of the
14 * GNU General Public License as published by the Free Software
15 * Foundation; either version 2 of the Licence, or (at your option)
18 * FusionForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 require_once('../env.inc.php');
29 require_once $gfcommon.'include/pre.php';
30 require_once $gfcommon.'docman/DocumentManager.class.php';
31 require_once $gfcommon.'docman/Document.class.php';
32 require_once $gfcommon.'docman/DocumentFactory.class.php';
33 require_once $gfcommon.'docman/DocumentGroup.class.php';
34 require_once $gfcommon.'docman/DocumentGroupFactory.class.php';
35 require_once $gfcommon.'docman/include/DocumentGroupHTML.class.php';
36 require_once $gfcommon.'docman/include/utils.php';
37 require_once $gfcommon.'include/TextSanitizer.class.php'; // to make the HTML input by the user safe to store
39 /* are we using docman ? */
40 if (!forge_get_config('use_docman'))
41 exit_disabled('home');
43 session_require_perm('docman', $group_id, 'read');
45 /* get informations from request or $_POST */
46 $group_id = getIntFromRequest('group_id');
52 $g = group_get_object($group_id);
53 if (!$g || !is_object($g))
56 /* is this group using docman ? */
57 if (!$g->usesDocman())
61 exit_error($g->getErrorMessage(), 'docman');
63 $dirid = getIntFromRequest('dirid');
67 $childgroup_id = getIntFromRequest('childgroup_id');
69 /* everything sounds ok, now let do the job */
70 $action = getStringFromRequest('action');
73 case "addsubdocgroup":
79 case "enforcereserve":
80 case "forcereindexenginesearch":
85 case "monitordirectory":
90 case "updatecreateonline":
91 case "updateenginesearch":
92 case "updatewebdavinterface":
93 case "validatefile": {
94 include ($gfcommon."docman/actions/$action.php");
99 if (session_loggedin()) {
100 $u =& user_get_object(user_getid());
101 if (!$u || !is_object($u)) {
102 exit_error(_('Could Not Get User'));
103 } elseif ($u->isError()) {
104 exit_error($u->getErrorMessage(), 'my');
109 html_use_simplemenu();
111 use_javascript('scripts/DocManController.js');
112 use_javascript('/js/sortable.js');
114 $title = _('Documents for ').$g->getPublicName();
116 site_project_header(array('title'=>$title, 'group'=>$group_id, 'toptab'=>'docman'));
119 include ($gfcommon.'docman/views/menu.php');
123 include ($gfcommon.'docman/views/views.php');
126 site_project_footer(array());