[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gforge-commits] gforge/www/mail/admin index.php,1.12,1.13
From: |
gsmet |
Subject: |
[Gforge-commits] gforge/www/mail/admin index.php,1.12,1.13 |
Date: |
Wed, 31 Mar 2004 11:11:05 -0600 |
Update of /cvsroot/gforge/gforge/www/mail/admin
In directory db.perdue.net:/tmp/cvs-serv28854/www/mail/admin
Modified Files:
index.php
Log Message:
* fixed some localization problems
* fixed french translation
* fixed ML creation cronjob
* updated ML UI
Index: index.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/mail/admin/index.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- index.php 15 Jan 2004 10:31:33 -0000 1.12
+++ index.php 31 Mar 2004 17:11:03 -0000 1.13
@@ -4,7 +4,7 @@
* GForge Mailing Lists Facility
*
* Portions Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2003 (c) Guillaume Smet
+ * The rest Copyright 2003-2004 (c) Guillaume Smet - Open Wide
*
* @version $Id$
*/
@@ -51,7 +51,7 @@
}
} elseif (getStringFromPost('change_status') == 'y') {
- $mailingList = new MailingList($Group,
getIntFromPost('group_list_id'));
+ $mailingList = new MailingList($Group,
getIntFromGet('group_list_id'));
if(!$mailingList || !is_object($mailingList)) {
exit_error($Language->getText('general',
'error'), $Language->getText('mail_admin', 'error_getting_list'));
@@ -97,22 +97,21 @@
$Language->getText('mail_admin_addlist',
'existing_mailing_lists')
);
- echo $HTML->listTableTop($tableHeaders);
-
$mlCount = count($mlArray);
- for ($j = 0; $j < $mlCount; $j++) {
- $currentList =& $mlArray[$j];
- if ($currentList->isError()) {
- echo '<tr '. $HTML->boxGetAltRowStyle($j) .
'><td>';
- echo $currentList->getErrorMessage();
- echo '</td></tr>';
- } else {
- echo '<tr '. $HTML->boxGetAltRowStyle($j) .
'><td>'.$currentList->getName().'</td></tr>';
+ if($mlCount > 0) {
+ echo $HTML->listTableTop($tableHeaders);
+ for ($j = 0; $j < $mlCount; $j++) {
+ $currentList =& $mlArray[$j];
+ if ($currentList->isError()) {
+ echo '<tr '.
$HTML->boxGetAltRowStyle($j) . '><td>';
+ echo $currentList->getErrorMessage();
+ echo '</td></tr>';
+ } else {
+ echo '<tr '.
$HTML->boxGetAltRowStyle($j) . '><td>'.$currentList->getName().'</td></tr>';
+ }
}
+ echo $HTML->listTableBottom();
}
-
- echo $HTML->listTableBottom();
-
?>
<form method="post" action="<?php echo
getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id ?>">
<input type="hidden" name="post_changes" value="y" />
@@ -129,111 +128,98 @@
<strong><span style="color:red"><?php echo
$Language->getText('mail_admin_addlist', 'warning'); ?></span></strong></p>
<p>
<input type="submit" name="submit" value="<?php echo
$Language->getText('mail_admin_addlist', 'form_addlist'); ?>" /></p>
- </form>
+ </form>
<?php
-
- } elseif(getIntFromGet('change_status')) {
-
- $mlFactory = new MailingListFactory($Group);
-
- if(!$mlFactory || !is_object($mlFactory) ||
$mlFactory->isError()) {
- exit_error($Language->getText('general','error'),
$mlFactory->getErrorMessage());
- }
+ mail_footer(array());
+ } elseif(getIntFromGet('change_status') &&
getIntFromGet('group_list_id')) {
+ $mailingList = new MailingList($Group,
getIntFromGet('group_list_id'));
+
+ if(!$mailingList || !is_object($mailingList)) {
+ exit_error($Language->getText('general', 'error'),
$Language->getText('mail_admin', 'error_getting_list'));
+ } elseif($mailingList->isError()) {
+ exit_error($Language->getText('general', 'error'),
$mailingList->getErrorMessage());
+ }
- mail_header(array(
+ mail_header(array(
'title' => $Language->getText('mail_admin_updatelist',
'pagetitle'),
'pagename' => 'mail_admin_updatelist'
));
-
- $mlArray =& $mlFactory->getMailingLists(true);
- $mlCount = count($mlArray);
-
- if($mlCount == 0) {
- echo '<p>'.$Language->getText('mail_admin_updatelist',
'no_list_found').'</p>';
- } else {
- echo '<p>'.$Language->getText('mail_admin_updatelist',
'information', array($GLOBALS['sys_name'])).'</p>';
-
- $tableHeaders = array();
- $tableHeaders[] =
$Language->getText('mail_admin_updatelist', 'list');
- $tableHeaders[] =
$Language->getText('mail_admin_updatelist', 'status');
- $tableHeaders[] = '';
- $tableHeaders[] = '';
-
- echo $HTML->listTableTop($tableHeaders);
-
- for ($i = 0; $i < $mlCount; $i++) {
- $currentList =& $mlArray[$i];
- ?>
- <tr <?php echo
$HTML->boxGetAltRowStyle($i); ?>>
- <td><?php echo
$currentList->getName(); ?></td>
- <td colspan="3">
- <form action="<?php
echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id ?>"
method="post">
- <input
type="hidden" name="post_changes" value="y" />
- <input
type="hidden" name="change_status" value="y" />
- <input
type="hidden" name="group_list_id" value="<?php echo $currentList->getID(); ?>"
/>
- <input
type="hidden" name="group_id" value="<?php echo $group_id; ?>" />
- <table width="100%">
- <tr>
- <td>
-
<div style="font-size:smaller">
-
<strong><?php echo $Language->getText('mail_admin_updatelist',
'form_ispublic'); ?></strong><br />
-
<input type="radio" name="is_public" value="<?php echo
MAIL__MAILING_LIST_IS_PUBLIC; ?>"<?php echo ($currentList->isPublic() ==
MAIL__MAILING_LIST_IS_PUBLIC ? ' checked="checked"' : ''); ?> /> <?php echo
$Language->getText('general', 'yes'); ?><br />
-
<input type="radio" name="is_public" value="<?php echo
MAIL__MAILING_LIST_IS_PRIVATE; ?>"<?php echo ($currentList->isPublic() ==
MAIL__MAILING_LIST_IS_PRIVATE ? ' checked="checked"' : ''); ?> /> <?php echo
$Language->getText('general', 'no'); ?><br />
-
<input type="radio" name="is_public" value="<?php echo
MAIL__MAILING_LIST_IS_DELETED; ?>"<?php echo ($currentList->isPublic() ==
MAIL__MAILING_LIST_IS_DELETED ? ' checked="checked"' : ''); ?> /> <?php echo
$Language->getText('general', 'deleted'); ?><br />
-
</div>
- </td>
- <td
align="right">
-
<div style="font-size:smaller">
-
<input type="submit" name="submit" value="<?php echo
$Language->getText('mail_admin_updatelist', 'form_updatelist'); ?>" />
-
</div>
- </td>
- <td
align="center">
-
<a href="<?php echo $currentList->getExternalAdminUrl(); ?>">
-
<?php echo $Language->getText('mail_admin_updatelist',
'admin_in_mailman'); ?>
-
</a>
- </td>
- </tr>
- <tr <?php echo
$HTML->boxGetAltRowStyle($i); ?>>
- <td colspan="3">
- <strong><?php
echo $Language->getText('mail_admin_updatelist', 'form_description');
?></strong><br />
-
<input type="text" name="description" value="<?php echo
inputSpecialChars($currentList->getDescription()); ?>" size="40" maxlength="80"
/><br />
- </td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
- <?php
- }
-
- echo $HTML->listTableBottom();
-
+ ?>
+ <h3><?php echo $mailingList->getName(); ?></h3>
+ <form method="post" action="<?php echo
getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id;
?>&group_list_id=<?php echo $mailingList->getID(); ?>">
+ <input type="hidden" name="post_changes" value="y" />
+ <input type="hidden" name="change_status" value="y" />
+ <p>
+ <strong><?php echo
$Language->getText('mail_admin_updatelist', 'form_ispublic'); ?></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
$Language->getText('general', '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
$Language->getText('general', 'no'); ?><br />
+ <input type="radio" name="is_public" value="<?php echo
MAIL__MAILING_LIST_IS_DELETED; ?>"<?php echo ($mailingList->isPublic() ==
MAIL__MAILING_LIST_IS_DELETED ? ' checked="checked"' : ''); ?> /> <?php echo
$Language->getText('general', 'deleted'); ?>
+ </p>
+ <p><strong><?php echo
$Language->getText('mail_admin_updatelist', 'form_description'); ?></strong><br
/>
+ <input type="text" name="description" value="<?php echo
inputSpecialChars($mailingList->getDescription()); ?>" size="40" maxlength="80"
/><br /></p>
+ <p>
+ <input type="submit" name="submit" value="<?php echo
$Language->getText('mail_admin_updatelist', 'form_updatelist'); ?>" /></p>
+ </form>
+ <?php
+ mail_footer(array());
+ } else {
+ $mlFactory = new MailingListFactory($Group);
+ if (!$mlFactory || !is_object($mlFactory) ||
$mlFactory->isError()) {
+ exit_error($Language->getText('general', 'error'),
$mlFactory->getErrorMessage());
}
- } else {
- /*
- Show main page for choosing
- either add or update
- */
mail_header(array(
'title' => $Language->getText('mail_admin',
'pagetitle'),
'pagename' => 'mail_admin')
);
- ?>
- <ul>
- <li>
- <a href="<?php echo
getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id;
?>&add_list=1"><?php echo $Language->getText('mail_admin', 'add_list');
?></a>
- </li>
+
+ $mlArray =& $mlFactory->getMailingLists();
+
+ if ($mlFactory->isError()) {
+ echo '<p>'.$Language->getText('general', 'error').'
'.$Language->getText('mail', 'unable_to_get_lists',
array($Group->getPublicName())) .'</p>';
+ echo $mlFactory->getErrorMessage();
+ mail_footer(array());
+ exit;
+ }
+ echo '<p>'.$Language->getText('mail_admin_updatelist',
'information', array($GLOBALS['sys_name'])).'</p>';
+ echo '<ul>
<li>
- <a href="<?php echo
getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id;
?>&change_status=1"><?php echo $Language->getText('mail_admin',
'update_list'); ?></a>
+ <a
href="'.getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&add_list=1">'.$Language->getText('mail_admin',
'add_list').'</a>
</li>
- </ul>
- <?php
+ </ul>';
+ $mlCount = count($mlArray);
+ if($mlCount > 0) {
+ $tableHeaders = array(
+ $Language->getText('mail_common',
'mailing_list'),
+ '',
+ ''
+ );
+ echo $HTML->listTableTop($tableHeaders);
+ for ($i = 0; $i < $mlCount; $i++) {
+ $currentList =& $mlArray[$i];
+ if ($currentList->isError()) {
+ echo '<tr '.
$HTML->boxGetAltRowStyle($i) .'><td colspan="3">';
+ echo $currentList->getErrorMessage();
+ echo '</td></tr>';
+ } else {
+ echo '<tr '.
$HTML->boxGetAltRowStyle($i) . '><td width="60%">'.
+
'<strong>'.$currentList->getName().'</strong><br />'.
+
htmlspecialchars($currentList->getDescription()).'</td>'.
+ '<td width="20%" align="center"><a
href="'.getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&group_list_id='.$currentList->getID().'&change_status=1">'.$Language->getText('mail_admin',
'update_list').'</a></td>'.
+ '<td width="20%" align="center">';
+ if($currentList->getStatus() !=
MAIL__MAILING_LIST_IS_CREATED) {
+ echo
$Language->getText('mail_common', 'list_not_activated');
+ } else {
+ echo '<a
href="'.$currentList->getExternalAdminUrl().'">'.$Language->getText('mail_admin',
'admin_in_mailman').'</a></td>';
+ }
+ echo '</tr>';
+ }
+ }
+ echo $HTML->listTableBottom();
+ }
+ mail_footer(array());
}
-
- mail_footer(array());
-
} else {
exit_no_group();
}
-?>
\ No newline at end of file
+?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gforge-commits] gforge/www/mail/admin index.php,1.12,1.13,
gsmet <=
- Prev by Date:
[Gforge-commits] gforge/www/frs/admin editrelease.php, 1.2, 1.3 showreleases.php, 1.1, 1.2
- Next by Date:
[Gforge-commits] gforge/www/mail index.php,1.8,1.9
- Previous by thread:
[Gforge-commits] gforge/www/frs/admin editrelease.php, 1.2, 1.3 showreleases.php, 1.1, 1.2
- Next by thread:
[Gforge-commits] gforge/www/mail index.php,1.8,1.9
- Index(es):