Marketing module rewritten (mostly)
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 4 Jul 2006 22:41:19 +0000 (22:41 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 4 Jul 2006 22:41:19 +0000 (22:41 +0000)
it has to be tested, and URI's to be optimised a bit more.

git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@374 839d8a87-29fc-0310-9880-83ba4fa771e5

20 files changed:
ChangeLog
classes/Platal.php
hooks/tmp.inc.php
htdocs/marketing/index.php [deleted file]
htdocs/marketing/private.php [deleted file]
htdocs/marketing/promo.php [deleted file]
htdocs/marketing/public.php [deleted file]
htdocs/marketing/relance.php [deleted file]
htdocs/marketing/this_week.php [deleted file]
htdocs/marketing/volontaire.php [deleted file]
install.d/marketing.files
templates/include/form.valid.mark.tpl
templates/include/minifiche.tpl
templates/marketing/index.tpl
templates/marketing/private.tpl
templates/marketing/promo.tpl
templates/marketing/public.tpl
templates/marketing/relance.tpl
templates/marketing/this_week.tpl
templates/marketing/volontaire.tpl

index 934038d..841a5a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,9 @@ New:
     * Emails:
         - Switch to the new URI scheme.                                     -MC
 
+    * Marketing:
+        - Switch to the new URI scheme.                                     -MC
+
     * Search:
         - Switch to the new URI scheme.                                     -MC
 
index 719591b..fe55885 100644 (file)
@@ -68,10 +68,15 @@ class Platal
             return PL_NOT_FOUND;
         }
 
+        $hook = $this->__hooks[$p];
+
+        if (!is_callable($hook['hook'])) {
+            return PL_NOT_FOUND;
+        }
+
         $args = array_merge(array(&$page),
             explode('/', substr($this->path, strlen($p) + 1)));
 
-        $hook = $this->__hooks[$p];
         if ($hook['auth'] > Session::get('auth', AUTH_PUBLIC)) {
             $_SESSION['session']->doAuth($page);
         }
index d3fd8f1..9d44d0d 100644 (file)
@@ -23,27 +23,27 @@ function tmp_menu()
 {
     global $globals;
 
-    $globals->menu->addPrivateEntry(XOM_CUSTOM,   10, 'Mon profil',            'profil.php');
-    $globals->menu->addPrivateEntry(XOM_CUSTOM,   20, 'Mes contacts',          'carnet/mescontacts.php');
-    $globals->menu->addPrivateEntry(XOM_CUSTOM,   30, 'Mon carnet',            'carnet/');
-    $globals->menu->addPrivateEntry(XOM_CUSTOM,   40, 'Mon mot de passe',      'motdepasse.php');
-    $globals->menu->addPrivateEntry(XOM_CUSTOM,   50, 'Mes préférences',       'preferences.php');
+    $globals->menu->addPrivateEntry(XOM_CUSTOM,   10, 'Mon profil',         'profil.php');
+    $globals->menu->addPrivateEntry(XOM_CUSTOM,   20, 'Mes contacts',       'carnet/mescontacts.php');
+    $globals->menu->addPrivateEntry(XOM_CUSTOM,   30, 'Mon carnet',         'carnet/');
+    $globals->menu->addPrivateEntry(XOM_CUSTOM,   40, 'Mon mot de passe',   'motdepasse.php');
+    $globals->menu->addPrivateEntry(XOM_CUSTOM,   50, 'Mes préférences',    'preferences.php');
 
-    $globals->menu->addPrivateEntry(XOM_GROUPS,   10, 'Trombi/Site promo',          'trombipromo.php');
-    $globals->menu->addPrivateEntry(XOM_GROUPS,   20, 'Conseil Pro.',          'referent.php');
+    $globals->menu->addPrivateEntry(XOM_GROUPS,   10, 'Trombi/Site promo',  'trombipromo.php');
+    $globals->menu->addPrivateEntry(XOM_GROUPS,   20, 'Conseil Pro.',       'referent.php');
     if ($globals->geoloc->use_map())
-        $globals->menu->addPrivateEntry(XOM_GROUPS,   10, 'Planisphère',          'geoloc/');
-    $globals->menu->addPrivateEntry(XOM_GROUPS,   30, 'Groupes X',             'http://www.polytechnique.net/plan.php');
+        $globals->menu->addPrivateEntry(XOM_GROUPS,   10, 'Planisphère',    'geoloc/');
+    $globals->menu->addPrivateEntry(XOM_GROUPS,   30, 'Groupes X',          'http://www.polytechnique.net/plan.php');
 
-    $globals->menu->addPrivateEntry(XOM_INFOS,    10, 'Documentations',        'Docs/');
-    $globals->menu->addPrivateEntry(XOM_INFOS,    20, 'Nous contacter',        'Docs/NousContacter');
-    $globals->menu->addPrivateEntry(XOM_INFOS,    30, 'Carrières',                'Docs/Emploi');
+    $globals->menu->addPrivateEntry(XOM_INFOS,    10, 'Documentations',     'Docs/');
+    $globals->menu->addPrivateEntry(XOM_INFOS,    20, 'Nous contacter',     'Docs/NousContacter');
+    $globals->menu->addPrivateEntry(XOM_INFOS,    30, 'Carrières',          'Docs/Emploi');
 
-    $globals->menu->addPrivateEntry(XOM_ADMIN,    00, 'Marketing',           'marketing/');
-    $globals->menu->addPrivateEntry(XOM_ADMIN,    10, 'Administration',      'admin/');
-    $globals->menu->addPrivateEntry(XOM_ADMIN,    20, 'Clear cache',         'clear_all_cache.php');
-    $globals->menu->addPrivateEntry(XOM_ADMIN,    30, 'Trackers',            'http://trackers.polytechnique.org');
-    $globals->menu->addPrivateEntry(XOM_ADMIN,    40, 'Support',             'http://support.polytechnique.org');
+    $globals->menu->addPrivateEntry(XOM_ADMIN,    00, 'Marketing',          'marketing');
+    $globals->menu->addPrivateEntry(XOM_ADMIN,    10, 'Administration',     'admin/');
+    $globals->menu->addPrivateEntry(XOM_ADMIN,    20, 'Clear cache',        'clear_all_cache.php');
+    $globals->menu->addPrivateEntry(XOM_ADMIN,    30, 'Trackers',           'http://trackers.polytechnique.org');
+    $globals->menu->addPrivateEntry(XOM_ADMIN,    40, 'Support',            'http://support.polytechnique.org');
 
     $globals->menu->addPublicEntry(XOM_US,    00, 'Me connecter !',         'login.php');
     $globals->menu->addPublicEntry(XOM_US,    10, 'M\'inscrire',            'register/');
diff --git a/htdocs/marketing/index.php b/htdocs/marketing/index.php
deleted file mode 100644 (file)
index d908c7b..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 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                *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-new_admin_page('marketing/index.tpl');
-$page->assign('xorg_title','Polytechnique.org - Marketing');
-
-# Quelques statistiques
-
-$res   = $globals->xdb->query(
-          "SELECT COUNT(*) AS vivants,
-                  COUNT(NULLIF(perms='admin' OR perms='user', 0)) AS inscrits,
-                  100*COUNT(NULLIF(perms='admin' OR perms='user', 0))/COUNT(*) AS ins_rate,
-                  COUNT(NULLIF(promo >= 1972, 0)) AS vivants72,
-                  COUNT(NULLIF(promo >= 1972 AND (perms='admin' OR perms='user'), 0)) AS inscrits72,
-                  100 * COUNT(NULLIF(promo >= 1972 AND (perms='admin' OR perms='user'), 0)) /
-                      COUNT(NULLIF(promo >= 1972, 0)) AS ins72_rate,
-                  COUNT(NULLIF(FIND_IN_SET('femme', flags), 0)) AS vivantes,
-                  COUNT(NULLIF(FIND_IN_SET('femme', flags) AND (perms='admin' OR perms='user'), 0)) AS inscrites,
-                  100 * COUNT(NULLIF(FIND_IN_SET('femme', flags) AND (perms='admin' OR perms='user'), 0)) /
-                      COUNT(NULLIF(FIND_IN_SET('femme', flags), 0)) AS inse_rate
-             FROM auth_user_md5
-            WHERE deces = 0");
-$stats = $res->fetchOneAssoc();
-$page->assign('stats', $stats);
-
-$res   = $globals->xdb->query("SELECT count(*) FROM auth_user_md5 WHERE date_ins > ".date('Ymd000000', strtotime('1 week ago')));
-$page->assign('nbInsSem', $res->fetchOneCell());
-
-$res = $globals->xdb->query("SELECT count(*) FROM register_pending WHERE hash != 'INSCRIT'");
-$page->assign('nbInsEnCours', $res->fetchOneCell());
-
-$res = $globals->xdb->query("SELECT count(*) FROM register_marketing");
-$page->assign('nbInsMarket', $res->fetchOneCell());
-
-$res = $globals->xdb->query("SELECT count(*) FROM register_mstats WHERE TO_DAYS(NOW()) - TO_DAYS(success) <= 7");
-$page->assign('nbInsMarkOK', $res->fetchOneCell());
-
-$page->run();
-?>
diff --git a/htdocs/marketing/private.php b/htdocs/marketing/private.php
deleted file mode 100644 (file)
index cb9e976..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 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                *
- ***************************************************************************/
-
-require_once('xorg.inc.php');
-new_admin_page('marketing/private.tpl');
-
-$uid = Env::get('uid');
-$res = $globals->xdb->query("SELECT nom, prenom, promo, matricule FROM auth_user_md5 WHERE user_id={?} AND perms='pending'", $uid);
-
-if (list($nom, $prenom, $promo, $matricule) = $res->fetchOneRow()) {
-    require_once('register.inc.php');
-    $matricule_X = get_X_mat($matricule);
-    $page->gassign('nom');
-    $page->gassign('prenom');
-    $page->gassign('promo');
-    $page->gassign('matricule');
-    $page->assign('matricule_X',$matricule_X);
-} else {
-    $page->kill('uid invalide');
-}
-
-if (Env::has('del')) {
-    $globals->xdb->execute('DELETE FROM register_marketing WHERE uid={?} AND email={?}', $uid, Env::get('del'));
-}
-
-if (Env::has('rel') && !Env::has('valider')) {
-    require_once('marketing.inc.php');
-    list($to, $title, $text) = mark_text_mail($uid, Env::get('rel'));
-    $from = mark_from_mail($uid, Env::get('rel'));
-    $page->assign('rel_from_user', $from);
-    $page->assign('rel_from_staff', "\"Equipe Polytechnique.org\" <register@polytechnique.org>");
-    $page->assign('rel_to', $to);
-    $page->assign('rel_title', $title);
-    $page->assign('rel_text', $text);
-}
-
-if (Env::get('valider') == 'Envoyer') {
-    require_once('marketing.inc.php');
-    mark_send_mail($uid, Env::get('rel'), Env::get('from'), Env::get('to'), Env::get('title'), Env::get('message'));
-    $page->trig("Mail envoyé");
-}
-
-if (Env::has('relance')) {
-    require_once('marketing.inc.php');
-    if (relance($uid)) {
-        $page->trig('relance faite');
-    }
-}
-
-if (Env::get('action') == 'ajouter') {
-    $globals->xdb->execute(
-        "INSERT INTO register_marketing
-                 SET uid = {?}, sender = {?}, email = {?},
-                     date = NOW(), type = {?}",
-        $uid, Session::get('uid'), Env::get('email'), Env::get('type')); 
-}
-
-$res = $globals->xdb->iterator(
-        "SELECT  r.*, a.alias
-           FROM  register_marketing AS r
-     INNER JOIN  aliases            AS a ON (r.sender=a.id AND a.type = 'a_vie')
-          WHERE  uid={?}
-       ORDER BY  date", $uid);
-$page->assign('addr', $res);
-
-$res = $globals->xdb->query("SELECT date, relance FROM register_pending WHERE uid = {?}", $uid);
-if (list($pending, $relance) = $res->fetchOneCell()) {
-    $page->gassign('pending');
-    $page->gassign('relance');
-}
-
-
-$page->run();
-
-// vim:set et sw=4 sws=4 sts=4:
-?>
diff --git a/htdocs/marketing/promo.php b/htdocs/marketing/promo.php
deleted file mode 100644 (file)
index f5110fb..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 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                *
- ***************************************************************************/
-
-
-require_once("xorg.inc.php");
-new_admin_page('marketing/promo.tpl');
-
-$promo = (integer) (isset($_REQUEST["promo"]) ? $_REQUEST["promo"] : $_SESSION["promo"]);
-$page->assign('promo', $promo);
-
-$sql = "SELECT  u.user_id, u.nom, u.prenom, u.last_known_email, u.matricule_ax,
-                IF(MAX(m.last)>p.relance, MAX(m.last), p.relance) AS dern_rel, p.email
-          FROM  auth_user_md5      AS u
-     LEFT JOIN  register_pending   AS p ON p.uid = u.user_id
-     LEFT JOIN  register_marketing AS m ON m.uid = u.user_id
-         WHERE  u.promo = {?} AND u.deces = 0 AND u.perms='pending'
-      GROUP BY  u.user_id
-      ORDER BY  nom, prenom";
-$page->assign('nonins', $globals->xdb->iterator($sql, $promo));
-
-$page->run();
-
-?>
diff --git a/htdocs/marketing/public.php b/htdocs/marketing/public.php
deleted file mode 100644 (file)
index b7191d9..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 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                *
- ***************************************************************************/
-
-require_once('xorg.inc.php');
-new_skinned_page('marketing/public.tpl', AUTH_COOKIE);
-
-if (! Env::has('num')) { exit; }
-
-$uid = Env::get('num');
-
-$res = $globals->xdb->query("SELECT nom, prenom, promo FROM auth_user_md5 WHERE user_id={?} AND perms='pending'", $uid);
-
-if (list($nom, $prenom, $promo) = $res->fetchOneRow()) {
-    $page->assign('prenom', $prenom);
-    $page->assign('nom', $nom);
-    $page->assign('promo', $promo);
-
-    if (Env::has('valide')) {
-        require_once('xorg.misc.inc.php');
-
-        $email = trim(Env::get('mail'));
-        $res   = $globals->xdb->query('SELECT COUNT(*) FROM register_marketing WHERE uid={?} AND email={?}', $uid, $email);
-
-        if (!isvalid_email_redirection($email)) {
-            $page->trig("Email invalide !");
-        } elseif ($res->fetchOneCell()) {
-            $page->assign('already', true);
-        } else {
-            $page->assign('ok', true);
-            $globals->xdb->execute(
-                    "INSERT INTO  register_marketing (uid,sender,email,date,last,nb,type,hash)
-                          VALUES  ({?}, {?}, {?}, NOW(), 0, 0, {?}, '')",
-                    $uid, Session::getInt('uid'), $email, Env::get('origine'));
-            require_once('validations.inc.php');
-            $req = new MarkReq(Session::getInt('uid'), $uid, $email, Env::get('origine')=='user');
-            $req->submit();
-        }
-    }
-}
-
-$page->run();
-?>
diff --git a/htdocs/marketing/relance.php b/htdocs/marketing/relance.php
deleted file mode 100644 (file)
index 66b8ea4..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 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                *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-new_admin_page('marketing/relance.tpl');
-
-/* une relance a été demandée - on envoit les mails correspondants */
-if (Post::has('relancer')) {
-    $res   = $globals->xdb->query("SELECT COUNT(*) FROM auth_user_md5 WHERE deces=0");
-    $nbdix = $res->fetchOneCell();
-
-    $sent  = Array();
-    foreach (array_keys($_POST['relance']) as $uid) {
-        if ($tmp = relance($uid, $nbdix)) {
-            $sent[] = $tmp.' a été relancé';
-        }
-    }
-    $page->assign('sent', $sent);
-}
-
-$sql = "SELECT  r.date, r.relance, r.uid, u.promo, u.nom, u.prenom
-          FROM  register_pending AS r
-    INNER JOIN  auth_user_md5    AS u ON r. uid = u.user_id
-         WHERE  hash!='INSCRIT'
-      ORDER BY  date DESC";
-$page->assign('relance', $globals->xdb->iterator($sql));
-
-$page->run();
-?>
diff --git a/htdocs/marketing/this_week.php b/htdocs/marketing/this_week.php
deleted file mode 100644 (file)
index 48c8455..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 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                *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-new_admin_page('marketing/this_week.tpl');
-
-$sort = Get::get('sort') == 'promo' ? 'promo' : 'date_ins';
-
-$sql = "SELECT  a.alias AS forlife, u.date_ins, u.promo, u.nom, u.prenom
-          FROM  auth_user_md5  AS u
-    INNER JOIN  aliases        AS a ON (u.user_id = a.id AND a.type='a_vie')
-         WHERE  u.date_ins > ".date("Ymd000000", strtotime ('1 week ago'))."
-      ORDER BY  u.$sort DESC";
-$page->assign('ins', $globals->xdb->iterator($sql));
-
-$page->run();
-?>
diff --git a/htdocs/marketing/volontaire.php b/htdocs/marketing/volontaire.php
deleted file mode 100644 (file)
index 45ea698..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 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                *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-new_admin_page('marketing/volontaire.tpl');
-
-$res = $globals->xdb->query(
-        "SELECT
-       DISTINCT  a.promo
-           FROM  register_marketing AS m
-     INNER JOIN  auth_user_md5      AS a  ON a.user_id = m.uid
-       ORDER BY  a.promo");
-$page->assign('promos', $res->fetchColumn());
-
-
-if (Env::has('promo')) {
-    $sql = "SELECT  a.nom, a.prenom, a.user_id,
-                    m.email, sa.alias AS forlife
-              FROM  register_marketing AS m
-        INNER JOIN  auth_user_md5      AS a  ON a.user_id = m.uid AND a.promo = {?}
-        INNER JOIN  aliases            AS sa ON (m.sender = sa.id AND sa.type='a_vie')
-          ORDER BY  a.nom";
-    $page->assign('addr', $globals->xdb->iterator($sql, Env::get('promo')));
-}
-$page->run();
-?>
index 1086f37..eeb87fe 100644 (file)
@@ -1,11 +1 @@
-htdocs/marketing/index.php
-htdocs/marketing/promo.php
-htdocs/marketing/public.php
-htdocs/marketing/relance.php
-htdocs/marketing/volontaire.php
 templates/mails/marketing.relance.tpl
-templates/marketing/index.tpl
-templates/marketing/promo.tpl
-templates/marketing/public.tpl
-templates/marketing/relance.tpl
-templates/marketing/volontaire.tpl
index ad65feb..482f2c5 100644 (file)
@@ -23,7 +23,7 @@
 
 <tr class="pair">
   <td class="titre">Marketing sur</td>
-  <td><a href='{rel}/marketing/private.php?uid={$valid->m_id}'>{$valid->m_prenom} {$valid->m_nom} ({$valid->m_promo})</a></td>
+  <td><a href='{rel}/marketing/private/{valid->m_id}'>{$valid->m_prenom} {$valid->m_nom} ({$valid->m_promo})</a></td>
 </tr>
 <tr class="pair">
   <td class="titre">Mail deviné</td>
index 0d23f07..ee4da66 100644 (file)
@@ -40,7 +40,7 @@
     {if $c.dcd}décédé{if $c.sexe}e{/if} le {$c.deces|date_format}{/if}
     {min_auth level="cookie"}
     {if !$c.dcd && !$c.wasinscrit}
-    <a href="{rel}/marketing/public.php?num={$c.user_id}" class='popup'>clique ici si tu connais son adresse email !</a>
+    <a href="{rel}/marketing/public/{$c.user_id}" class='popup'>clique ici si tu connais son adresse email !</a>
     {/if}
     {/min_auth}
   </div>
@@ -70,7 +70,7 @@
 
     {perms level='admin'}
       {if !$c.wasinscrit && !$c.dcd}
-        <a href="{rel}/marketing/private.php?uid={$c.user_id}">{*
+        <a href="{rel}/marketing/private/{$c.user_id}">{*
           *}<img src="{rel}/images/admin.png" alt='admin' title="marketter user" /></a>
       {elseif $c.wasinscrit}
         <a href="{rel}/admin/utilisateurs.php?login={$c.forlife}">{*
index c7ba536..1b81b89 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
-
-
-<h1>
-  Marketing Polytechnique.org
-</h1>
+<h1>Marketing Polytechnique.org</h1>
 
 <table class="bicol" cellpadding="3" summary="Système">
   <tr>
@@ -34,9 +30,9 @@
     <td>
       <a href="{rel}/search?nonins=1">Chercher un non inscrit</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
-      <a href="promo.php">Marketing promo</a>
+      <a href="{rel}/marketing/promo">Marketing promo</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
-      <a href="volontaire.php">Addresses données par les inscrits</a>
+      <a href="{rel}/marketing/volontaire">Addresses données par les inscrits</a>
     </td>
   </tr>
 </table>
@@ -63,8 +59,8 @@ Soit un pourcentage d'inscrites de : {$stats.inse_rate} % <br />
 </p>
 
 <p>
-Nombre d'<a href="this_week.php">inscrits depuis le début de la semaine</a> : {$nbInsSem}<br />
-Nombre d'<a href="relance.php">inscriptions en cours</a> (2ème phase non terminée) : {$nbInsEnCours} <br />
+Nombre d'<a href="{rel}/marketing/this_week">inscrits depuis le début de la semaine</a> : {$nbInsSem}<br />
+Nombre d'<a href="{rel}/marketing/relance">inscriptions en cours</a> (2ème phase non terminée) : {$nbInsEnCours} <br />
 Nombre d'envois marketing effectués n'ayant pas abouti : {$nbInsMarket}<br />
 Nombre d'envois marketing ayant abouti cette semaine : {$nbInsMarkOK}
 </p>
index e82270d..0549d73 100644 (file)
@@ -20,7 +20,6 @@
 {*                                                                        *}
 {**************************************************************************}
 
-
 <h1>Marketing de {$prenom} {$nom}</h1>
 
 <h2>Matricules</h2>
@@ -46,13 +45,13 @@ sa derni
 {/if}
 </p>
 
-<p>[<a href='?uid={$smarty.request.uid}relance=1'>le relancer</a>]</p>
+<p>[<a href='{rel}/{$smarty.request.p}?relance=1'>le relancer</a>]</p>
 
 {/if}
 
 <h2>Adresses connues</h2>
 
-<form action="{$smarty.request.PHP_SELF}" method="post">
+<form action="{rel}/{$smarty.request.uid}" method="post">
 <table class="bicol" cellpadding="0" cellspacing="0">
   <tr>
     <th>Adresse</th>
@@ -70,8 +69,8 @@ sa derni
     <td>{$a.last|date_format|default:'-'}</td>
     <td class='center'>{$a.nb|default:"-"}</td>
     <td class='action'>
-      <a href='?uid={$smarty.request.uid}&amp;del={$a.email}'>del</a><br />
-      <a href='?uid={$smarty.request.uid}&amp;rel={$a.email}'>relance</a>
+      <a href='{rel}/{$smarty.request.p}?del={$a.email}'>del</a><br />
+      <a href='{rel}/{$smarty.request.p}?rel={$a.email}'>relance</a>
     </td>
   </tr>
   {/iterate}
@@ -90,7 +89,6 @@ sa derni
       </select>
     </td>
     <td class='action'>
-      <input type='hidden' name='uid' value='{$smarty.request.uid}' />
       <input type='submit' name='action' value='ajouter' />
     </td>
   </tr>
@@ -98,7 +96,7 @@ sa derni
 </form>
 
 {if $rel_to}
-<form action="{$smarty.request.PHP_SELF}" method="post">
+<form action="{rel}/{$smarty.reqeust.p}" method="post">
   <table class="bicol">
     <tr class="pair">
       <th colspan="2">Edition du mail de relance</th>
@@ -129,7 +127,6 @@ sa derni
     </tr>
   </table>
   <div class="center">
-    <input type="hidden" name="uid" value="{$smarty.request.uid}" />
     <input type="hidden" name="email" value="{$smarty.request.rel}" />
     <input type="reset" value="Recommencer" />
     <input type="submit" name="valider" value="Envoyer" />
index e15ec3c..66c4b50 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
-
-
 <table style="margin-left: auto; margin-right: auto">
   <tr>
     <td>
-      <form action="?" method="get">
+      <form action="{rel}/marketing/promo" method="get">
         <div>
           <input type="hidden" name="promo" value="{$promo-10}" />
           <input type="submit" value="&lt;&lt;" />
@@ -33,7 +31,7 @@
       </form>
     </td>
     <td>
-      <form action="?" method="get">
+      <form action="{rel}/marketing/promo" method="get">
         <div>
           <input type="hidden" name="promo" value="{$promo-1}" />
           <input type="submit" value="&lt;" />
@@ -41,7 +39,7 @@
       </form>
     </td>
     <td>
-      <form action="?" method="get">
+      <form action="{rel}/marketing/promo" method="get">
         <div>
           Promotion : <input type="text" name="promo" value="{$promo}" size="4" maxlength="4" />
           <input type="submit" value="GO" />
@@ -49,7 +47,7 @@
       </form>
     </td>
     <td>
-      <form action="?" method="get">
+      <form action="{rel}/marketing/promo" method="get">
         <div>
           <input type="hidden" name="promo" value="{$promo+1}" />
           <input type="submit" value="&gt;" />
@@ -57,7 +55,7 @@
       </form>
     </td>
     <td>
-      <form action="?" method="get">
+      <form action="{rel}/marketing/promo" method="get">
         <div>
           <input type="hidden" name="promo" value="{$promo+10}" />
           <input type="submit" value="&gt;&gt;" />
@@ -75,7 +73,7 @@
   </a>
 </div>
 
-<form action="{$smarty.server.PHP_SELF}" method="post">
+<form action="{rel}/marketing/promo" method="post">
   <table class="bicol" summary="liste des inscriptions non confirmées">
     <tr>
       <th>Nom</th>
@@ -97,7 +95,7 @@
         {/if}
       </td>
       <td class="center">
-        <a href="private.php?uid={$it.user_id}">{*
+        <a href="{rel}/marketing/private/{$it.user_id}">{*
           *}<img src="{rel}/images/admin.png" alt='Marketing' title="Marketing" /></a>
         <a href="http://www.polytechniciens.com/index.php?page=AX_FICHE_ANCIEN&amp;anc_id={$it.matricule_ax}">{*
           *}<img src="{rel}/images/ax.png" alt='AX' title="fiche AX" /></a>
index e85405b..062c090 100644 (file)
@@ -73,7 +73,7 @@ peut sans aucun doute l'aider 
   {$nom} inscrit, nous t'enverrons un email pour te prévenir que son inscription a réussi.
 </p>
 
-<form method="post" action="{$smarty.server.PHP_SELF}">
+<form method="post" action="{rel}/{$smarty.request.p}">
   <table class="bicol" summary="Fiche camarade">
     <tr class="impair"><td>Nom :</td><td>{$nom}</td></tr>
     <tr class="pair"><td>Prénom :</td><td>{$prenom}</td></tr>
@@ -94,7 +94,6 @@ peut sans aucun doute l'aider 
   </table>
   <div>
     <br />
-    <input type="hidden" name="num" value="{$smarty.request.num}" />
     <input type="submit" name="valide" value="Valider" />
   </div>
 </form>
index a731904..7b2e1ab 100644 (file)
@@ -27,7 +27,7 @@
 <p>{$l}</p>
 {/foreach}
 
-<form action="{$smarty.server.PHP_SELF}" method="post">
+<form action="{rel}/marketing/relance" method="post">
   <table class="bicol" summary="liste des inscriptions non confirmées">
     <tr>
       <th>Date</th>
index 681176f..637c1be 100644 (file)
@@ -28,8 +28,8 @@
 </p>
 
 <div class="right">
-  [<a href="{$smarty.server.PHP_SELF}?sort=date_ins">par date</a>]
-  [<a href="{$smarty.server.PHP_SELF}?sort=promo">par promo</a>]
+  [<a href="{rel}/marketing/this_week?sort=date_ins">par date</a>]
+  [<a href="{rel}/marketing/this_week?sort=promo">par promo</a>]
 </div>
 
 <table class="tinybicol">
@@ -42,7 +42,7 @@
   <tr class="{cycle values="impair,pair"}">
     <td class="center">{$in.date_ins|date_format:"%x %X"}</td>
     <td class="center">
-      <a href="promo.php?promo={$in.promo}">{$in.promo}</a>
+      <a href="{rel}/marketing/promo/{$in.promo}">{$in.promo}</a>
     </td>
     <td>
       <a href="{"fiche.php"|url}?user={$in.forlife}" class="popup2">
@@ -53,8 +53,8 @@
 </table>
 
 <div class="right">
-  [<a href="{$smarty.server.PHP_SELF}?sort=date_ins">par date</a>]
-  [<a href="{$smarty.server.PHP_SELF}?sort=promo">par promo</a>]
+  [<a href="{rel}/marketing/this_week?sort=date_ins">par date</a>]
+  [<a href="{rel}/marketing/this_week?sort=promo">par promo</a>]
 </div>
 
 
index d75c2d5..50ff7b7 100644 (file)
@@ -27,14 +27,14 @@ Choix de la promo :
 </p>
 <p>
 {foreach from=$promos item=p}
-<a href="?promo={$p}">{$p}</a>
+<a href="{rel}/marketing/volontaire?promo={$p}">{$p}</a>
 {cycle values=",,,,,,,,,,,,,,<br />"}
 {/foreach}
 </p>
 
 {if $addr}
 
-<p>[<a href="promo.php?promo={$smarty.get.promo}">Marketing promo pour la promo {$smarty.get.promo}</a>]</p>
+<p>[<a href="{rel}/marketing/promo/{$smarty.get.promo}">Marketing promo pour la promo {$smarty.get.promo}</a>]</p>
 
 {if $addr->total()}
 <h2>Marketing volontaire</h2>
@@ -46,7 +46,7 @@ Choix de la promo :
   </tr>
   {iterate from=$addr item=it}
   <tr class="{cycle values="pair,impair"}">
-    <td><a href="private.php?uid={$it.user_id}">{$it.nom} {$it.prenom}</a></td>
+    <td><a href="{rel}/marketing/private/{$it.user_id}">{$it.nom} {$it.prenom}</a></td>
     <td>{$it.email}</td>
     <td>{$it.forlife}</td>
   </tr>