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. FusionForge is free software;
12 * you can redistribute it and/or modify it under the terms of the
13 * GNU General Public License as published by the Free Software
14 * Foundation; either version 2 of the Licence, or (at your option)
17 * FusionForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 require_once('../env.inc.php');
28 require_once $gfcommon.'include/pre.php';
29 require_once $gfwww.'mail/../mail/mail_utils.php';
31 require_once $gfcommon.'mail/MailingList.class.php';
32 require_once $gfcommon.'mail/MailingListFactory.class.php';
34 $group_id = getIntFromGet('group_id');
37 $group = group_get_object($group_id);
38 if (!$group || !is_object($group)) {
40 } elseif ($group->isError()) {
41 exit_error($group->getErrorMessage(),'mail');
44 $mlFactory = new MailingListFactory($group);
45 if (!$mlFactory || !is_object($mlFactory)) {
46 exit_error(_('Could Not Get MailingListFactory'),'mail');
47 } elseif ($mlFactory->isError()) {
48 exit_error($mlFactory->getErrorMessage(),'mail');
52 'title' => sprintf(_('Mailing Lists for %1$s'), $group->getPublicName())
55 plugin_hook ("blocks", "mail index");
57 $mlArray = $mlFactory->getMailingLists();
59 if ($mlFactory->isError()) {
60 echo '<p class="error">'.sprintf(_('Unable to get the list %s : %s'), $group->getPublicName(), $mlFactory->getErrorMessage()) .'</p>';
65 $mlCount = count($mlArray);
67 echo '<p>'.sprintf(_('No Lists found for %1$s'), $group->getPublicName()) .'</p>';
68 echo '<p>'._('Project administrators use the admin link to request mailing lists.').'</p>';
73 echo '<p>' . _('Choose a list to browse, search, and post messages.') . '</p>';
75 $tableHeaders = array(
80 echo $HTML->listTableTop($tableHeaders);
82 for ($j = 0; $j < $mlCount; $j++) {
83 $currentList =& $mlArray[$j];
84 echo '<tr '. $HTML->boxGetAltRowStyle($j) .'>';
85 if ($currentList->isError()) {
86 echo '<td colspan="3">'.$currentList->getErrorMessage().'</td>';
87 } else if($currentList->getStatus() == MAIL__MAILING_LIST_IS_REQUESTED) {
88 echo '<td width="33%">'.
89 '<strong>'.$currentList->getName().'</strong></td>'.
90 '<td width="33%">'.htmlspecialchars($currentList->getDescription()). '</td>'.
91 '<td width="33%" style="text-align:center">'._('Not activated yet').'</td>';
93 echo '<td width="33%">'.
94 '<strong><a href="'.$currentList->getArchivesUrl().'">' .
95 sprintf(_('%1$s Archives'), $currentList->getName()).'</a></strong></td>'.
96 '<td>'.htmlspecialchars($currentList->getDescription()). '</td>'.
97 '<td width="33%" style="text-align:center"><a href="'.$currentList->getExternalInfoUrl().'">'._('Subscribe/Unsubscribe/Preferences').'</a>'.
103 echo $HTML->listTableBottom();
105 mail_footer(array());