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 * http://fusionforge.org/
10 * This file is part of FusionForge.
12 * FusionForge is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
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
23 * along with FusionForge; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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)) {
39 exit_error(_('Could Not Get Group'),'home');
40 } elseif ($Group->isError()) {
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 '<div class="error">'.sprintf(_('Unable to get the list %s : %s'), $Group->getPublicName(), $mlFactory->getErrorMessage()) .'</div>';
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></tr>';
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></tr>';
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());