}
}
+ /** Get the prefix to use for all 'stat' pages of this NL.
+ */
+ public function statPrefix($enforce_xnet = true, $with_group = true)
+ {
+ if (!empty($GLOBALS['IS_XNET_SITE'])) {
+ if ($with_group) {
+ return $this->group . '/stat/nl';
+ } else {
+ return 'stat/nl';
+ }
+ }
+ switch ($this->group) {
+ case self::GROUP_XORG:
+ return 'stat/newsletter';
+ case self::GROUP_AX:
+ return 'ax/stat';
+ case self::GROUP_EP:
+ return 'epletter/stat';
+ default:
+ // Don't display groups NLs on X.org
+ assert(!$enforce_xnet);
+ }
+ }
+
/** Get links for nl pages.
*/
public function adminLinks()
{
return array(
'index' => array('link' => $this->prefix(), 'title' => 'Archives'),
- 'admin' => array('link' => $this->adminPrefix(), 'title' => 'Administrer')
+ 'admin' => array('link' => $this->adminPrefix(), 'title' => 'Administrer'),
+ 'stats' => array('link' => $this->statPrefix(), 'title' => 'Statistiques')
);
}
'ax/admin/edit/cancel' => $this->make_hook('admin_nl_cancel', AUTH_PASSWD, 'user'),
'ax/admin/edit/delete' => $this->make_hook('admin_nl_delete', AUTH_PASSWD, 'user'),
'ax/admin/categories' => $this->make_hook('admin_nl_cat', AUTH_PASSWD, 'user'),
+ 'ax/stat' => $this->make_hook('stat_nl', AUTH_PASSWD, 'user')
);
}
'epletter/admin/edit/cancel' => $this->make_hook('admin_nl_cancel', AUTH_PASSWD, 'user'),
'epletter/admin/edit/delete' => $this->make_hook('admin_nl_delete', AUTH_PASSWD, 'user'),
'epletter/admin/categories' => $this->make_hook('admin_nl_cat', AUTH_PASSWD, 'user'),
+ 'epletter/stat' => $this->make_hook('stat_nl', AUTH_PASSWD, 'user')
);
}
'admin/newsletter/categories' => $this->make_hook('admin_nl_cat', AUTH_PASSWD, 'admin'),
'admin/newsletter/edit' => $this->make_hook('admin_nl_edit', AUTH_PASSWD, 'admin'),
'admin/newsletter/edit/delete' => $this->make_hook('admin_nl_delete', AUTH_PASSWD, 'admin'),
+ 'stat/newsletter' => $this->make_hook('stat_nl', AUTH_PASSWD, 'admin')
// Automatic mailing is disabled for X.org NL
// 'admin/newsletter/edit/cancel' => $this->make_hook('cancel', AUTH_PASSWD, 'admin'),
// 'admin/newsletter/edit/valid' => $this->make_hook('valid', AUTH_PASSWD, 'admin'),
$table_editor->on_delete(null, null);
$table_editor->apply($page, $action, $id);
}
+
+ function handler_stat_nl($page)
+ {
+ $nl = $this->getNl();
+ if (!$nl) {
+ return PL_NOT_FOUND;
+ }
+ if (!$nl->mayEdit()) {
+ return PL_FORBIDDEN;
+ }
+
+ $page->setTitle('Statistiques - Newsletter');
+ $page->changeTpl('newsletter/statistics.tpl');
+ $page->assign_by_ref('nl', $nl);
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
'%grp/admin/nl/edit/cancel' => $this->make_hook('admin_nl_cancel', AUTH_PASSWD, 'groupadmin'),
'%grp/admin/nl/edit/valid' => $this->make_hook('admin_nl_valid', AUTH_PASSWD, 'groupadmin'),
'%grp/admin/nl/categories' => $this->make_hook('admin_nl_cat', AUTH_PASSWD, 'groupadmin'),
+ '%grp/stat' => $this->make_hook('stat_nl', AUTH_PASSWD, 'groupadmin')
);
}
{/foreach}
</table>
-{if $nl->mayEdit()}
-<p>Il y a actuellement {$nl->subscriberCount()} inscrits aux envois, parmi lesquels {$nl->lostSubscriberCount()} n'ont aucune redirection active.</p>
-{/if}
-
-
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2011 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+{include file="newsletter/header.tpl" current="stats"}
+
+<p>Il y a actuellement {$nl->subscriberCount()} inscrits aux envois, parmi lesquels {$nl->lostSubscriberCount()} n'ont aucune redirection active.</p>
+
+
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}