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 * Copyright 2012, Jean-Christophe Masson - French National Education Department
10 * http://fusionforge.org/
12 * This file is part of FusionForge. FusionForge is free software;
13 * you can redistribute it and/or modify it under the terms of the
14 * GNU General Public License as published by the Free Software
15 * Foundation; either version 2 of the Licence, or (at your option)
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 along
24 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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';
36 $group_id = getIntFromGet('group_id');
39 $group = group_get_object($group_id);
40 if (!$group || !is_object($group)) {
42 } elseif ($group->isError()) {
43 exit_error($group->getErrorMessage(),'mail');
46 $mlFactory = new MailingListFactory($group);
47 if (!$mlFactory || !is_object($mlFactory)) {
48 exit_error(_('Could Not Get MailingListFactory'),'mail');
49 } elseif ($mlFactory->isError()) {
50 exit_error($mlFactory->getErrorMessage(),'mail');
54 'title' => sprintf(_('Mailing Lists for %s'), $group->getPublicName())
57 plugin_hook ("blocks", "mail index");
59 $mlArray = $mlFactory->getMailingLists();
61 if ($mlFactory->isError()) {
62 echo $HTML->error_msg(sprintf(_('Unable to get the list %s: %s'), $group->getPublicName(), $mlFactory->getErrorMessage()));
67 $mlCount = count($mlArray);
69 echo $HTML->information(sprintf(_('No Lists found for %s'), $group->getPublicName()));
70 echo '<p>'._('Project administrators use the admin link to request mailing lists.').'</p>';
75 echo '<p>' . _('Choose a list to browse, search, and post messages.') . '</p>';
77 $tableHeaders = array(
83 echo $HTML->listTableTop($tableHeaders);
85 for ($j = 0; $j < $mlCount; $j++) {
86 $currentList =& $mlArray[$j];
87 if (!$currentList->isPermissionDeniedError()) {
89 if ($currentList->isError()) {
90 echo '<td colspan="4">'.$currentList->getErrorMessage().'</td>';
91 } elseif ($currentList->getStatus() == MAIL__MAILING_LIST_IS_REQUESTED) {
92 echo '<td class="halfwidth" colspan="2"><strong>'.$currentList->getName().'</strong></td>'.
93 '<td class="onequarterwidth">'.htmlspecialchars($currentList->getDescription()). '</td>'.
94 '<td class="onequarterwidth align-center">'._('Not activated yet').'</td>';
96 echo '<td class="onequarterwidth">'.
97 '<strong><a href="'.$currentList->getArchivesUrl().'">' .
98 sprintf(_('%s Archives'), $currentList->getName()).'</a></strong></td>'.
99 '<td class="onequarterwidth align-center"><a href="mailto:'.$currentList->getListEmail().'">'.$currentList->getListEmail(). '</a></td>'.
100 '<td class="onequarterwidth">'.htmlspecialchars($currentList->getDescription()). '</td>'.
101 '<td class="onequarterwidth align-center"><a href="'.$currentList->getExternalInfoUrl().'">'._('Subscribe/Unsubscribe/Preferences').'</a>'.
108 echo $HTML->listTableBottom();