3 * Mailing Lists Facility
5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2003-2004 (c) Guillaume Smet - Open Wide
7 * Copyright 2010 (c) Franck Villaume - Capgemini
8 * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
9 * http://fusionforge.org/
11 * This file is part of FusionForge.
13 * FusionForge is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
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
24 * along with FusionForge; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 require_once('../env.inc.php');
29 require_once $gfcommon.'include/pre.php';
30 require_once $gfwww.'mail/../mail/mail_utils.php';
32 require_once $gfcommon.'mail/MailingList.class.php';
33 require_once $gfcommon.'mail/MailingListFactory.class.php';
35 $group_id = getIntFromGet('group_id');
38 $group = group_get_object($group_id);
39 if (!$group || !is_object($group)) {
41 } elseif ($group->isError()) {
42 exit_error($group->getErrorMessage(),'mail');
45 $mlFactory = new MailingListFactory($group);
46 if (!$mlFactory || !is_object($mlFactory)) {
47 exit_error(_('Could Not Get MailingListFactory'),'mail');
48 } elseif ($mlFactory->isError()) {
49 exit_error($mlFactory->getErrorMessage(),'mail');
53 'title' => sprintf(_('Mailing Lists for %1$s'), $group->getPublicName())
56 plugin_hook ("blocks", "mail index");
58 $mlArray =& $mlFactory->getMailingLists();
60 if ($mlFactory->isError()) {
61 echo '<p class="error">'.sprintf(_('Unable to get the list %s : %s'), $group->getPublicName(), $mlFactory->getErrorMessage()) .'</p>';
66 $mlCount = count($mlArray);
68 echo '<p>'.sprintf(_('No Lists found for %1$s'), $group->getPublicName()) .'</p>';
69 echo '<p>'._('Project administrators use the admin link to request mailing lists.').'</p>';
74 echo '<p>' . _('Choose a list to browse, search, and post messages.') . '</p>';
76 $tableHeaders = array(
81 echo $HTML->listTableTop($tableHeaders);
83 for ($j = 0; $j < $mlCount; $j++) {
84 $currentList =& $mlArray[$j];
85 echo '<tr '. $HTML->boxGetAltRowStyle($j) .'>';
86 if ($currentList->isError()) {
87 echo '<td colspan="3">'.$currentList->getErrorMessage().'</td>';
88 } else if($currentList->getStatus() == MAIL__MAILING_LIST_IS_REQUESTED) {
89 echo '<td width="33%">'.
90 '<strong>'.$currentList->getName().'</strong></td>'.
91 '<td width="33%">'.htmlspecialchars($currentList->getDescription()). '</td>'.
92 '<td width="33%" style="text-align:center">'._('Not activated yet').'</td>';
94 echo '<td width="33%">'.
95 '<strong><a href="'.$currentList->getArchivesUrl().'">' .
96 sprintf(_('%1$s Archives'), $currentList->getName()).'</a></strong></td>'.
97 '<td>'.htmlspecialchars($currentList->getDescription()). '</td>'.
98 '<td width="33%" style="text-align:center"><a href="'.$currentList->getExternalInfoUrl().'">'._('Subscribe/Unsubscribe/Preferences').'</a>'.
104 echo $HTML->listTableBottom();
106 mail_footer(array());