3 * Project Admin Main Page
5 * This page contains administrative information for the project as well
6 * as allows to manage it. This page should be accessible to all project
7 * members, but only admins may perform most functions.
9 * Copyright 2004 GForge, LLC - Tim Perdue
10 * Copyright 2010, Franck Villaume - Capgemini
11 * Copyright 2010-2011, Alain Peyrat - Alcatel-Lucent
12 * Copyright 2016,2020, Franck Villaume - TrivialDev
13 * http://fusionforge.org
15 * This file is part of FusionForge. FusionForge is free software;
16 * you can redistribute it and/or modify it under the terms of the
17 * GNU General Public License as published by the Free Software
18 * Foundation; either version 2 of the Licence, or (at your option)
21 * FusionForge is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License along
27 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
28 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 require_once '../../env.inc.php';
32 require_once $gfcommon.'include/pre.php';
33 require_once $gfwww.'include/role_utils.php';
34 require_once $gfwww.'project/admin/project_admin_utils.php';
35 require_once $gfcommon.'include/GroupJoinRequest.class.php';
37 $group_id = getIntFromRequest('group_id');
39 session_require_perm ('project_admin', $group_id) ;
41 // get current information
42 $group = group_get_object($group_id);
43 if (!$group || !is_object($group)) {
45 } elseif ($group->isError()) {
46 exit_error($group->getErrorMessage(),'admin');
51 // If this was a submission, make updates
52 if (getStringFromRequest('submit')) {
53 $form_group_name = getStringFromRequest('form_group_name');
54 $form_shortdesc = getStringFromRequest('form_shortdesc');
55 $form_homepage = getStringFromRequest('form_homepage');
56 $logo_image_id = getIntFromRequest('logo_image_id');
57 $use_mail = getStringFromRequest('use_mail');
58 $use_survey = getStringFromRequest('use_survey');
59 $use_forum = getStringFromRequest('use_forum');
60 $use_pm = getStringFromRequest('use_pm');
61 $use_scm = getStringFromRequest('use_scm');
62 $use_news = getStringFromRequest('use_news');
63 $use_docman = getStringFromRequest('use_docman');
64 $use_ftp = getStringFromRequest('use_ftp');
65 $use_tracker = getStringFromRequest('use_tracker');
66 $use_frs = getStringFromRequest('use_frs');
67 $use_stats = getStringFromRequest('use_stats');
68 $use_activity = getStringFromRequest('use_activity');
69 $tags = getStringFromRequest('form_tags');
70 $addTags = getArrayFromRequest('addTags');
71 $new_doc_address = getStringFromRequest('new_doc_address');
72 $send_all_docs = getStringFromRequest('send_all_docs');
73 $new_frs_address = getStringFromRequest('new_frs_address');
74 $send_all_frs = getStringFromRequest('send_all_frs');
76 if (trim($tags) != "") {
79 $tags .= implode(",", $addTags);
81 $res = $group->update(
110 $error_msg .= $group->getErrorMessage();
112 $feedback .= _('Project information updated');
116 project_admin_header(array('title'=>sprintf(_('Project Information for %s'), $group->getPublicName()),'group'=>$group->getID()));
119 <?php echo $HTML->boxTop(_('Misc. Project Information'));
121 if (forge_get_config('use_shell')) {
123 <p><?php echo _('Group shell (SSH) server')._(':') ?> <strong><?php echo forge_get_config('shell_host'); ?></strong></p>
124 <p><?php echo _('Group directory on shell server')._(':') ?><br/><strong><?php echo account_group_homedir($group->getUnixName()); ?></strong></p>
125 <p><?php echo _('Project WWW directory on shell server')._(':') ?><br /><strong><?php echo account_group_homedir($group->getUnixName()).'/htdocs'; ?></strong></p>
127 } //end of use_shell condition
129 echo $HTML->openForm(array('action' => getStringFromServer('PHP_SELF'), 'method' => 'post'));
132 <input type="hidden" name="group_id" value="<?php echo $group->getID(); ?>" />
134 <h2><?php echo _('Descriptive Project Name'); ?></h2>
136 <input type="text" name="form_group_name" value="<?php echo $group->getPublicName(); ?>" size="40" maxlength="40" />
139 <h2><?php echo _('Short Description'); ?></h2>
141 <?php echo _('Maximum 255 characters, HTML will be stripped from this description'); ?>
144 <textarea cols="80" rows="3" name="form_shortdesc">
145 <?php echo $group->getDescription(); ?>
149 <?php if (forge_get_config('use_project_tags')) { ?>
150 <h2><?php echo _('Project tags'); ?></h2>
152 <?php echo _('Add tags (use comma as separator)')._(':') ?><br />
153 <input type="text" name="form_tags" size="100" value="<?php echo $group->getTags(); ?>" />
156 $infos = getAllProjectTags();
159 echo _('Or pick a tag from those used by other projects')._(':');
161 $titleArr = array(_('Tags'), _('Projects'));
162 echo $HTML->listTableTop($titleArr);
164 $unix_name = $group->getUnixName();
165 foreach ($infos as $tag => $plist) {
168 foreach($plist as $project) {
169 $links[] = util_make_link('/projects/'.$project['unix_group_name'].'/',$project['unix_group_name']);
170 if ($project['group_id'] == $group_id) {
171 $disabled = ' disabled="disabled"';
176 echo '<td><input type="checkbox" name="addTags[]" value="'.$tag.'"'.$disabled.' /> ';
178 echo '<s>'.$tag.'</s>';
183 echo '<td>'.implode(' ', $links).'</td>' ;
186 echo $HTML->listTableBottom();
190 if (forge_get_config('use_trove')) {
191 echo html_e('h2', array(), _('Trove Categorization'));
192 echo html_e('p', array(), util_make_link('/project/admin/group_trove.php?group_id='.$group->getID(), '['._('Edit Trove').']'));
195 echo html_e('h2', array(), _('Homepage Link'));
196 echo html_e('p', array(),
197 html_e('input', array('type' => 'url', 'size' => 100, 'name' => 'form_homepage', 'value' => $group->getHomePage(), ' pattern' => "http[s]?://.*")));
199 // This function is used to render checkboxes below
202 return 'checked="checked"';
210 if(forge_get_config('use_mail')) {
212 <input type="hidden" name="use_mail" value="<?php echo ($group->usesMail() ? '1' : '0'); ?>" />
216 if(forge_get_config('use_survey')) {
218 <input type="hidden" name="use_survey" value="<?php echo ($group->usesSurvey() ? '1' : '0'); ?>" />
222 if(forge_get_config('use_activity')) {
224 <input type="hidden" name="use_activity" value="<?php echo ($group->usesActivity() ? '1' : '0'); ?>" />
228 if(forge_get_config('use_forum')) {
230 <input type="hidden" name="use_forum" value="<?php echo ($group->usesForum() ? '1' : '0'); ?>" />
234 if(forge_get_config('use_pm')) {
236 <input type="hidden" name="use_pm" value="<?php echo ($group->usesPM() ? '1' : '0'); ?>" />
240 if(forge_get_config('use_scm')) {
242 <input type="hidden" name="use_scm" value="<?php echo ($group->usesSCM() ? '1' : '0'); ?>" />
246 if(forge_get_config('use_news')) {
248 <input type="hidden" name="use_news" value="<?php echo ($group->usesNews() ? '1' : '0'); ?>" />
252 if ((forge_get_config('use_docman') && $group->usesDocman()) || (forge_get_config('use_frs') && $group->usesFRS())) {
253 echo html_e('h2', array(), _('Notifications setup'));
256 if(forge_get_config('use_docman')) {
258 <input type="hidden" name="use_docman" value="<?php echo ($group->usesDocman() ? '1' : '0'); ?>" />
260 if ($group->usesDocman()) {
263 <?php echo _('If you wish, you can provide default email addresses to which new submissions (documents or folders) will be sent') ?>.<br />
264 <strong><?php echo _('New document or folder Submissions')._(':'); ?></strong><br />
265 <input type="email" name="new_doc_address" value="<?php echo $group->getDocEmailAddress(); ?>" size="40" maxlength="250" />
266 <?php echo _('(send on all updates)') ?>
267 <input type="checkbox" name="send_all_docs" value="1" <?php echo c($group->docEmailAll()); ?> />
273 if(forge_get_config('use_frs')) {
275 <input type="hidden" name="use_frs" value="<?php echo ($group->usesFRS() ? '1' : '0'); ?>" />
277 if ($group->usesFRS()) {
280 <?php echo _('If you wish, you can provide default email addresses to which new FRS (packages, releases or files) will be sent') ?>.<br />
281 <strong><?php echo _('New packages, releases, files Submissions')._(':'); ?></strong><br />
282 <input type="email" name="new_frs_address" value="<?php echo $group->getFRSEmailAddress(); ?>" size="40" maxlength="250" />
283 <?php echo _('(send on all updates)') ?>
284 <input type="checkbox" name="send_all_frs" value="1" <?php echo c($group->frsEmailAll()); ?> />
290 if(forge_get_config('use_ftp')) {
292 <input type="hidden" name="use_ftp" value="<?php echo ($group->usesFTP() ? '1' : '0'); ?>" />
296 if(forge_get_config('use_tracker')) {
298 <input type="hidden" name="use_tracker" value="<?php echo ($group->usesTracker() ? '1' : '0'); ?>" />
303 <input type="hidden" name="use_stats" value="<?php echo ($group->usesStats() ? '1' : '0'); ?>" />
306 <input type="submit" name="submit" value="<?php echo _('Update') ?>" />
310 echo $HTML->closeForm();
311 plugin_hook('hierarchy_views', array($group_id, 'admin'));
313 echo $HTML->boxBottom();
315 project_admin_footer();
319 // c-file-style: "bsd"