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 * Copyright 2013-2016,2021, 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 /* please do not add require here : use www/docman/index.php to add require */
29 /* global variables used */
30 global $g; // Group object
31 global $group_id; // id of the group
32 global $dirid; // id of doc_group
33 global $dgf; // document directory factory of this group
34 global $dm; // the Document Manager object
37 global $childgroup_id;
39 $actionurl = DOCMAN_BASEURL.$group_id.'&action=editdocgroup';
41 // plugin projects-hierarchy support
43 $g = group_get_object($childgroup_id);
44 $actionurl .= '&childgroup_id='.$childgroup_id;
47 if (!forge_check_perm('docman', $g->getID(), 'approve')) {
48 $warning_msg = _('Document Manager Access Denied');
49 session_redirect(DOCMAN_BASEURL.$group_id);
52 $dg = new DocumentGroup($g, $dirid);
54 $error_msg = $dg->getErrorMessage();
55 session_redirect(DOCMAN_BASEURL.$group_id);
58 echo html_ao('div', array('class' => 'docmanDivIncluded'));
59 echo $HTML->openForm(array('name' => 'editgroup', 'action' => $actionurl, 'method' => 'post'));
60 echo html_e('input', array('type' => 'hidden', 'name' => 'dirid', 'value' => $dirid));
61 echo $HTML->listTableTop();
62 $cells[][] = _('Folder Name');
63 $cells[][] = '<input required="required" type="text" name="groupname" value="'.$dg->getName().'" />';
64 $cells[][] = ' ';
65 $cells[][] = _('Status');
66 $cells[][] = doc_get_state_box($dg->getState(), array(2, 3, 4)); /** no direct deleted, pending, hidden status */
67 $cells[][] = ' ';
68 $cells[][] = _('belongs to');
69 if ($dg->getState() == 2) {
70 $newdgf = new DocumentGroupFactory($g);
71 $cells[][] = $dm->showSelectNestedGroups($newdgf->getNested(array(1, 5)), 'parent_dirid', true, false);
72 $labelSubmit = _('Restore');
74 $cells[][] = $dm->showSelectNestedGroups($dgf->getNested(array(1, 5)), 'parent_dirid', true, $dg->getParentID(), array($dg->getID()));
75 $labelSubmit = _('Edit');
77 $cells[][] = '<input type="submit" value="'.$labelSubmit.'" name="submit" />';
78 echo $HTML->multiTableRow(array(), $cells);
79 echo $HTML->listTableBottom();
80 echo html_e('p', array(), _('Folder name will be used as a title, so it should be formatted correspondingly.'), false);
81 echo $HTML->closeForm();
82 echo html_ac(html_ap() - 1);