* Copyright 1999-2001 (c) VA Linux Systems
* Copyright 2003-2004 (c) Guillaume Smet - Open Wide
* Copyright 2010 (c) Franck Villaume - Capgemini
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
* http://fusionforge.org/
*
* This file is part of FusionForge.
$feedback = getStringFromRequest('feedback');
if ($group_id) {
- $Group =& group_get_object($group_id);
- if (!$Group || !is_object($Group) || $Group->isError()) {
+ $group = group_get_object($group_id);
+ if (!$group || !is_object($group) || $group->isError()) {
exit_no_group();
}
- session_require_perm ('project_admin', $Group->getID()) ;
+ session_require_perm ('project_admin', $group->getID()) ;
//
// Post Changes to database
//
if (getStringFromRequest('add_list') == 'y') {
- if (check_email_available($Group, $Group->getUnixName() . '-' . getStringFromPost('list_name'), $error_msg)) {
- $mailingList = new MailingList($Group);
+ if (check_email_available($group, $group->getUnixName() . '-' . getStringFromPost('list_name'), $error_msg)) {
+ $mailingList = new MailingList($group);
if (!form_key_is_valid(getStringFromRequest('form_key'))) {
exit_form_double_submit('mail');
// Change status
//
} elseif (getStringFromPost('change_status') == 'y') {
- $mailingList = new MailingList($Group, getIntFromGet('group_list_id'));
+ $mailingList = new MailingList($group, getIntFromGet('group_list_id'));
if(!$mailingList || !is_object($mailingList)) {
exit_error(_('Error getting the list'),'mail');
// Reset admin password
//
if (getIntFromRequest('reset_pw') == 1) {
- $mailingList = new MailingList($Group, getIntFromGet('group_list_id'));
+ $mailingList = new MailingList($group, getIntFromGet('group_list_id'));
if(!$mailingList || !is_object($mailingList)) {
exit_error(_('Error getting the list'),'mail');
// Form to add list
//
if(getIntFromGet('add_list')) {
- mail_header(array(
- 'title' => _('Add a Mailing List')));
- printf(_('<p>Lists are named in this manner:<br /><strong>projectname-listname@%1$s</strong></p><p>It will take <span class="important">6-24 Hours</span> for your list to be created.</p>'), forge_get_config('lists_host'));
+ mail_header(array('title' => _('Add a Mailing List')));
+ print '<p>';
+ printf(_('Lists are named in this manner:<br /><strong>projectname-listname@%1$s</strong>'), forge_get_config('lists_host'));
+ print '</p>';
+
+ print '<p>';
+ print _('It will take <span class="important">6-24 Hours</span> for your list to be created.');
+ print '</p>';
- $mlFactory = new MailingListFactory($Group);
+ $mlFactory = new MailingListFactory($group);
if (!$mlFactory || !is_object($mlFactory) || $mlFactory->isError()) {
exit_error($mlFactory->getErrorMessage(),'mail');
}
$mlArray =& $mlFactory->getMailingLists();
if ($mlFactory->isError()) {
- echo '<h1>'._('Error').' '._('Unable to get the lists') .'</h1>';
- echo '<div class="error">'.$mlFactory->getErrorMessage().'</div>';
+ echo '<p class="error">'._('Error').' '._('Unable to get the lists') .$mlFactory->getErrorMessage().'</p>';
mail_footer(array());
exit;
}
<input type="hidden" name="add_list" value="y" />
<input type="hidden" name="form_key" value="<?php echo form_generate_key();?>" />
<p><strong><?php echo _('Mailing List Name:'); ?></strong><br />
- <strong><?php echo $Group->getUnixName(); ?>-<input type="text" name="list_name" value="" size="10" maxlength="12" />@<?php echo forge_get_config('lists_host'); ?></strong><br /></p>
+ <strong><?php echo $group->getUnixName(); ?>-<input type="text" name="list_name" value="" size="10" maxlength="12" />@<?php echo forge_get_config('lists_host'); ?></strong><br /></p>
<p>
<strong><?php echo _('Is Public?'); ?></strong><br />
<input type="radio" name="is_public" value="<?php echo MAIL__MAILING_LIST_IS_PUBLIC; ?>" checked="checked" /> <?php echo _('Yes'); ?><br />
// Form to modify list
//
} elseif(getIntFromGet('change_status') && getIntFromGet('group_list_id')) {
- $mailingList = new MailingList($Group, getIntFromGet('group_list_id'));
+ $mailingList = new MailingList($group, getIntFromGet('group_list_id'));
if(!$mailingList || !is_object($mailingList)) {
exit_error(_('Error getting the list'),'mail');
<p>
<strong><?php echo _('Is Public?'); ?></strong><br />
<input type="radio" name="is_public" value="<?php echo MAIL__MAILING_LIST_IS_PUBLIC; ?>"<?php echo ($mailingList->isPublic() == MAIL__MAILING_LIST_IS_PUBLIC ? ' checked="checked"' : ''); ?> /> <?php echo _('Yes'); ?><br />
- <input type="radio" name="is_public" value="<?php echo MAIL__MAILING_LIST_IS_PRIVATE; ?>"<?php echo ($mailingList->isPublic() == MAIL__MAILING_LIST_IS_PRIVATE ? ' checked="checked"' : ''); ?> /> <?php echo _('No'); ?><br />
+ <input type="radio" name="is_public" value="<?php echo MAIL__MAILING_LIST_IS_PRIVATE; ?>"<?php echo ($mailingList->isPublic() == MAIL__MAILING_LIST_IS_PRIVATE ? ' checked="checked"' : ''); ?> /> <?php echo _('No'); ?>
</p>
<p><strong><?php echo _('Description:'); ?></strong><br />
<input type="text" name="description" value="<?php echo inputSpecialChars($mailingList->getDescription()); ?>" size="40" maxlength="80" /><br /></p>
//
// Show lists
//
- $mlFactory = new MailingListFactory($Group);
+ $mlFactory = new MailingListFactory($group);
if (!$mlFactory || !is_object($mlFactory) || $mlFactory->isError()) {
exit_error($mlFactory->getErrorMessage(),'mail');
}
'title' => _('Mailing List Administration'))
);
- $mlArray =& $mlFactory->getMailingLists();
+ $mlArray = $mlFactory->getMailingLists();
if ($mlFactory->isError()) {
- echo '<h1>'._('Error').' '.sprintf(_('Unable to get the list %s'), $Group->getPublicName()) .'</h1>';
+ echo '<p>'._('Error').' '.sprintf(_('Unable to get the list %s'), $group->getPublicName()) .'</p>';
echo '<div class="error">'.$mlFactory->getErrorMessage().'</div>';
mail_footer(array());
exit;
echo '<tr '. $HTML->boxGetAltRowStyle($i) . '><td width="60%">'.
'<strong>'.$currentList->getName().'</strong><br />'.
htmlspecialchars($currentList->getDescription()).'</td>'.
- '<td width="15%" style="text-align:center"><a href="'.getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&group_list_id='.$currentList->getID().'&change_status=1">'._('Update').'</a></td>' ;
- echo '<td width="15%" style="text-align:center">';
+ '<td style="text-align:center"><a href="'.getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&group_list_id='.$currentList->getID().'&change_status=1">'._('Update').'</a></td>' ;
+ echo '<td style="text-align:center">';
if($currentList->getStatus() == MAIL__MAILING_LIST_IS_REQUESTED) {
echo _('Not activated yet');
} else {
- echo '<a href="'.$currentList->getExternalAdminUrl().'">'._('Administrate').'</a></td>';
+ echo '<a href="'.$currentList->getExternalAdminUrl().'">'._('Administration').'</a>';
}
- echo '<td width="15%" style="text-align:center">';
+ echo '</td>';
+ echo '<td style="text-align:center">';
if($currentList->getStatus() == MAIL__MAILING_LIST_IS_CONFIGURED) {
print '<a href="'.getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&group_list_id='.$currentList->getID().'&reset_pw=1">'._('Reset admin password').'</a></td>' ;