cleaning, need to write the page that does marketing ops for ONE user
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Mon, 10 Jan 2005 15:33:03 +0000 (15:33 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:27:22 +0000 (23:27 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-262

14 files changed:
htdocs/marketing/search.php [deleted file]
htdocs/marketing/volontaire.php
htdocs/search.php
include/select_user.inc.php [deleted file]
templates/marketing/index.tpl
templates/marketing/recap.tpl [deleted file]
templates/marketing/search.tpl [deleted file]
templates/marketing/utilisateurs_edit.tpl [deleted file]
templates/marketing/utilisateurs_inscrire.tpl [deleted file]
templates/marketing/utilisateurs_marketing.tpl [deleted file]
templates/marketing/utilisateurs_recherche.tpl [deleted file]
templates/marketing/utilisateurs_select.tpl [deleted file]
templates/marketing/volontaire.tpl
templates/search.quick.form.tpl

diff --git a/htdocs/marketing/search.php b/htdocs/marketing/search.php
deleted file mode 100644 (file)
index b5d4db9..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2004 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");
-$id_actions = array('Mailer');
-require_once("select_user.inc.php");
-
-//actions possible une fois un X désigné par son matricule
-switch (Env::get('submit')) {
-    case "Mailer":
-       $res = $globals->xdb->query("SELECT user_id FROM auth_user_md5 where matricule={?} AND perms!='pending'", Env::getInt('xmat'));
-       if ($row = $res->fetchOneAssoc()) {
-            exit_error("Le matricule existe d&eacute;j&agrave; dans la table auth_user_md5.");
-        }
-  
-       $res = $globals->xdb->query('SELECT * FROM auth_user_md5 WHERE matricule={?}', Env::getInt('xmat'));
-       $row = $res->fetchOneAssoc();
-
-        new_admin_page('marketing/search.tpl');
-
-        $page->assign('row', $myrow);
-
-       $prenom = $myrow["prenom"];
-       $nom    = $myrow["nom"];
-       $promo  = $myrow["promo"];
-       $from   = "Equipe Polytechnique.org <register@polytechnique.org>";
-
-        $page->run();
-       break;
-
-    case "Envoyer le mail":
-        require_once('xorg.misc.inc.php');
-       
-        $res = $globals->xdb->query("SELECT user_id FROM auth_user_md5 where matricule={?} AND perms!='pending'", Env::getInt('xmat'));
-       if ($row = $res->fetchOneAssoc()) {
-            exit_error("Le matricule existe d&eacute;j&agrave; dans la table auth_user_md5.");
-        }
-
-       if (!isvalid_email_redirection(Env::get('mail'))) {
-            exit_error("L'email n'est pas valide.");
-        }
-               
-       $res = $globals->xdb->query(
-            "SELECT prenom,nom,promo,FIND_IN_SET('femme', flags) FROM auth_user_md5 WHERE matricule={?}",
-            $_REQUEST['xmat']);
-       if (!list($prenom,$nom,$promo,$femme) = $res->fetchOneRow()) {
-            exit_error("Le matricule n'a pas été trouvé dans table auth_user_md5.");
-        }
-                       
-       // calcul de l'envoyeur
-        list($envoyeur) = explode('@', $_REQUEST["from"]);
-
-       $prenom_envoyeur=strtok($envoyeur,".");
-       $prenom_envoyeur=ucfirst($prenom_envoyeur);
-       $nom_envoyeur=strtok(" ");
-       $nom_env1=strtok($nom_envoyeur,"-");
-       $nom_env2=strtok(" ");
-       if($nom_env2) {
-            $envoyeur=$prenom_envoyeur." ".$nom_env1." ".ucfirst($nom_env2);
-       } else {
-            $envoyeur=$prenom_envoyeur." ".ucfirst($nom_env1);
-       }
-
-       $nom_envoyeur=ucfirst($nom_envoyeur);
-                       
-       // tirage aléatoire de UID et mot de passe
-       $user_id = rand_url_id(12);
-       $date    = date("Y-m-j");
-
-       // decompte du nombre d'utilisateurs;
-       $res = $globals->xdb->query("SELECT COUNT(*) FROM auth_user_md5");
-        $num_users = $res->fetchOneCell();
-                       
-       // calcul du login
-       $mailorg = make_forlife($prenom,$nom,$promo);
-                       
-       $globals->xdb->execute("UPDATE auth_user_md5 SET last_known_email={?} WHERE matricule={?}", Env::get('mail'), Env::get('xmat'));
-        $globals->xdb->execute("INSERT INTO envoidirect SET matricule={?}, uid={?}, email={?}, sender={?},date_envoi={?}",
-                Env::get('xmat'), $user_id, Env::get('mail'), Env::get('sender'), $date);
-       // pas d'erreur pour l'insert
-
-       // envoi du mail à l'utilisateur
-       require_once('xorg.mailer.inc.php');
-       $mymail = new XOrgMailer('marketing.utilisateur.tpl');
-
-       $mymail->assign('from', $_REQUEST["from"]);
-       $mymail->assign('to', $_REQUEST["mail"]);
-       $mymail->assign('femme', $femme);
-       $mymail->assign('baseurl', $globals->baseurl);
-       $mymail->assign('user_id', $user_id);
-       $mymail->assign('num_users', $num_users);
-       $mymail->assign('mailorg', $mailorg);
-       $mymail->assign('envoyeur', $envoyeur);
-       $mymail->send();
-       
-       new_admin_page('marketing/utilisateurs_marketing.tpl');
-       $page->run();
-       break;
-}
-
-?>
index 2aac200..bcc9c7b 100644 (file)
 require_once("xorg.inc.php");
 new_admin_page('marketing/volontaire.tpl');
 
-// traitement des paramètres éventuels
-if (!empty($_GET["del"])) {
-    $globals->xdb->execute("DELETE FROM marketing WHERE id ={?}" , Get::get('del'));
-    $page->trig("Entrée effacée");
-}
-if (!empty($_GET["done"])) {
-    $globals->xdb->execute("UPDATE marketing SET flags = CONCAT(flags,',envoye') WHERE id = {?}", Get::get('done'));
-    $page->trig("Entrée mise à jour");
-}
-
-$sql = "SELECT  m.id, m.expe, m.dest, m.email, 
-                i.promo, i.nom, i.prenom, i.last_known_email, 
-                u.promo AS spromo, u.nom AS snom, u.prenom AS sprenom, a.alias AS forlife,
-                FIND_IN_SET('mail_perso', m.flags) AS mailperso
-          FROM  marketing     AS m
-    INNER JOIN  auth_user_md5 AS i  ON i.matricule = m.dest
-    INNER JOIN  auth_user_md5 AS u ON u.user_id = m.expe
-    INNER JOIN  aliases       AS a ON (u.user_id = a.id AND a.type='a_vie')
-         WHERE  NOT FIND_IN_SET('envoye', m.flags)";
-$page->assign('neuves', $globals->xdb->iterator($sql));
-
-$sql = "SELECT  a.promo, a.nom, a.prenom,
-                m.email, a.perms!='pending' AS inscrit,
-                sa.promo AS spromo, sa.nom AS snom, sa.prenom AS sprenom
-          FROM  marketing     AS m
-    INNER JOIN  auth_user_md5 AS a  ON a.matricule = m.dest
-    INNER JOIN  auth_user_md5 AS sa ON sa.user_id = m.expe
-         WHERE  FIND_IN_SET('envoye', m.flags)";
-$page->assign('used', $globals->xdb->iterator($sql));
-
 $res = $globals->xdb->query(
-        "SELECT  COUNT(a.perms != 'pending') AS j,
-                 COUNT(i.matricule) AS i,
-                 100 * COUNT(a.nom) / COUNT(i.matricule) as rate
-           FROM  marketing     AS m
-     INNER JOIN  auth_user_md5 AS i  ON i.matricule = m.dest
-     INNER JOIN  auth_user_md5 AS sa ON sa.user_id = m.expe
-     LEFT  JOIN  auth_user_md5 AS a  ON (a.matricule = m.dest AND a.perms!='pending')
-          WHERE  FIND_IN_SET('envoye', m.flags)");
-$page->assign('rate', $res->fetchOneAssoc());
+        "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,
+                    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 da10360..15d0d97 100644 (file)
@@ -35,6 +35,7 @@ if (Env::has('quick')) {
 
     $qSearch = new QuickSearch('quick');
     $fields  = new SFieldGroup(true, array($qSearch));
+
     $offset  = new NumericSField('offset');
     
     if ($qSearch->isempty()) {
@@ -53,7 +54,7 @@ if (Env::has('quick')) {
             LEFT JOIN  contacts       AS c   ON (c.uid='.Session::getInt('uid').' AND c.contact=u.user_id)
             LEFT JOIN  watch_nonins   AS w   ON (w.ni_id=u.user_id AND w.uid='.Session::getInt('uid').')
             '.$globals->search->result_where_statement.'
-                WHERE  '.$fields->get_where_statement().'
+                WHERE  '.$fields->get_where_statement().(logged() && Env::has('nonins') ? ' AND u.perms="pending" AND u.deces=0' : '').'
                HAVING  mark>0
              ORDER BY  '.(logged() && Env::has('mod_date_sort') ? 'date DESC,' :'')
                        .implode(',',array_filter(array($fields->get_order_statement(), 'u.promo DESC, NomSortKey, prenom'))).'
diff --git a/include/select_user.inc.php b/include/select_user.inc.php
deleted file mode 100644 (file)
index 0afcfc2..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2004 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                *
- ***************************************************************************/
-
-if (!Env::has("xmat") || !Env::has("submit")) {
-    if ( !Env::has("xmat") && (!Env::has("prenomR") || !Env::has("nomR")) ) {
-        new_admin_page('marketing/utilisateurs_recherche.tpl');
-        $page->run();
-    }
-
-    if (Env::has("xmat")) {
-       $where = "matricule=".Env::getInt('xmat');
-    } else {
-       $nom    = Env::get('nomR');
-       $prenom = Env::get('prenomR');
-
-       // calcul de la plus longue chaine servant à l'identification
-       $chaine1 = strtok($nom," -'");
-       $chaine2 = strtok(" -'");
-        $chaine  = ( strlen($chaine2) > strlen($chaine1) ) ? $chaine2 : $chaine1;
-
-        $rq = strlen(Env::get("promoR"))==4 ? "AND promo=".Env::getInt("promoR") : "";
-
-       $where = "prenom LIKE '%".addslashes($prenom)."%' AND nom LIKE '%".addslashes($chaine)."%' $rq ORDER BY promo,nom";
-    }
-
-    $res = $globals->xdb->query(
-            "SELECT  matricule,matricule_ax,promo,nom,prenom,comment,appli,flags,last_known_email,deces,user_id
-               FROM  auth_user_md5
-              WHERE  perms NOT IN ('admin','user') AND deces=0 AND $where");
-
-    new_admin_page('marketing/utilisateurs_select.tpl');
-    $page->assign('nonins', $res->fetchAllAssoc());
-    $page->assign('id_actions', $id_actions);
-    $page->run();
-}
-
-function exit_error($err) {
-    global $page;
-    new_admin_page('marketing/utilisateurs_recherche.tpl');
-    $page->assign('err', $err);
-    $page->run();
-}
-?>
index 18674b8..fa883eb 100644 (file)
   </tr>
   <tr class="impair">
     <td>
-      <span class="item">Premier contact : </span>
-      <a href="search.php">Chercher un non inscrit</a> &nbsp;&nbsp;|&nbsp;&nbsp;
-      <a href="promo.php">Marketing promo</a> &nbsp;&nbsp;|&nbsp;&nbsp;
-      <a href="recap.php">Sollicitations faites</a>
-    </td>
-  </tr>
-  <tr class="pair">
-    <td>
-      <span class="item">Emails : </span>
-      <a href="volontaire.php">Utiliser les adresses données par les inscrits</a>
+      <a href="{rel}/search.php?nonins=1">Chercher un non inscrit</a>
+      &nbsp;&nbsp;|&nbsp;&nbsp;
+      <a href="promo.php">Marketing promo</a>
+      &nbsp;&nbsp;|&nbsp;&nbsp;
+      <a href="volontaire.php">Addresses données par les inscrits</a>
     </td>
   </tr>
 </table>
diff --git a/templates/marketing/recap.tpl b/templates/marketing/recap.tpl
deleted file mode 100644 (file)
index 9e33da2..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-{***************************************************************************
- *  Copyright (C) 2003-2004 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                *
- ***************************************************************************}
-
-
-<h1>
-  Liste des sollicités inscrits récemment
-</h1>
-
-
-<table class="bicol" summary="liste des sollicités inscrits">
-  <tr>
-    <th>Date Ins.</th>
-    <th>Par</th>
-    <th>Nom</th>
-    <th>inscription</th>
-  </tr>
-  {iterate from=$recents item=it}
-  <tr class="{cycle values="pair,impair"}">
-    <td>{$it.success|date_format}</td>
-    <td>{$it.sender|lower}</td>
-    <td>
-      <a href="{rel}/fiche.php?user={$it.forlife}" class="popup2">{$it.prenom} {$it.nom}</a>
-      (<a href="promo.php?promo={$it.promo}">{$it.promo}</a>)
-    </td>
-    <td>{$it.date_succes|date_format}</td>
-  </tr>
-  {/iterate}
-</table>
-<p>
-{$recents->total()} Polytechniciens ont été sollicités et se sont inscrits.
-</p>
-
-<h1>
-  Liste des sollicités non inscrits
-</h1>
-
-<table class="bicol" summary="liste des sollicités non inscrits">
-  <tr>
-    <th>Dernier envoi</th>
-    <th>Par</th>
-    <th>Nom</th>
-    <th>Nb mails testés</th>
-  </tr>
-  {iterate from=$notsub item=x}
-  <tr class="{cycle values="pair,impair"}">
-    <td class="center">
-      {if $x.last != '0000-00-00'}{$x.last|date_format:"%d %b %y"}{else}-{/if}
-    </td>
-    <td>{$x.sender|lower}</td>
-    <td>
-      {$x.promo} {$x.nom} {$x.prenom}
-    </td>
-    <td>
-      {$x.nb}
-    </td>
-  </tr>
-  {/iterate}
-</table>
-
-<p>
-{$notsub->total()} Polytechniciens ont été sollicités et ne se sont toujours pas inscrits.
-</p>
-
-
-{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/marketing/search.tpl b/templates/marketing/search.tpl
deleted file mode 100644 (file)
index 7d38a99..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-{***************************************************************************
- *  Copyright (C) 2003-2004 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                *
- ***************************************************************************}
-
-
-
-<h1>Envoyer un mail de pr&eacute;-inscription</h1>
-
-<p>
-Le nom, pr&eacute;nom et promotion sont pris dans la table d'identification.  Le login sera automatiquement
-calcul&eacute; &agrave; partir de ces données.
-</p>
-
-<form action="{$smarty.server.PHP_SELF}" method="get">
-  <table cellpadding="3" class="bicol" summary="Envoyer un mail">
-    <tr>
-      <th colspan="2">
-        Envoyer un mail
-      </th>
-    </tr>
-    <tr>
-      <td class="titre">
-        Prénom :
-      </td>
-      <td>
-        {$row.prenom}
-      </td>
-    </tr>
-    <tr>
-      <td class="titre">
-        Nom :
-      </td>
-      <td>
-        {$row.nom}
-      </td>
-    </tr>
-    <tr>
-      <td class="titre">
-        Promo :
-      </td>
-      <td>
-        {$row.promo}
-      </td>
-    </tr>
-    <tr>
-      <td class="titre">
-        From du mail :
-      </td>
-      <td>
-        <input type="text" size="40" maxlength="60" name="from"
-        value="{$smarty.request.from|default:"`$smarty.session.bestalias`@polytechnique.org"}" />
-      </td>
-    </tr>
-    <tr>
-      <td class="titre">
-        Adresse e-mail devinée :
-      </td>
-      <td>
-        <input type="text" size="40" maxlength="60" name="mail"
-        value="{$smarty.request.mail}" />
-      </td>
-    </tr>
-    <tr>
-      <td colspan="2" class="center">
-        <input type="hidden" name="xmat" value="{$smarty.request.xmat}" />
-        <input type="hidden" name="sender" value="{$smarty.request.sender|default:$smarty.session.uid}" />
-        <input type="submit" name="submit" value="Envoyer le mail" />
-      </td>
-    </tr>
-  </table>
-</form>
-
-
-{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/marketing/utilisateurs_edit.tpl b/templates/marketing/utilisateurs_edit.tpl
deleted file mode 100644 (file)
index ba9b91c..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-{***************************************************************************
- *  Copyright (C) 2003-2004 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                *
- ***************************************************************************}
-
-
-<h1>
-  Editer la base de tous les X
-</h1>
-{if $success eq "1"}
-<p>
-La modification de la table identification a été effectuée.
-</p>
-<p>
-<a href="{$smarty.server.PHP_SELF}">Retour</a>
-</p>
-{else}
-<p>
-<strong>Attention</strong> la table d'identification contenant la liste des polytechniciens sera
-modifiée !! (aucune vérification n'est faite)
-</p>
-<div class="center">
-  <form action="{$smarty.server.PHP_SELF}" method="get">
-    <table class="bicol" summary="Edition de fiche">
-      <tr>
-        <th colspan="2">
-          Editer
-        </th>
-      </tr>
-      <tr>
-        <td class="titre">Prénom :</td>
-        <td>
-          <input type="text" size="40" maxlength="60" value="{$row.prenom}" name="prenomN" />
-        </td>
-      </tr>
-      <tr>
-        <td class="titre">Nom :</td>
-        <td>
-          <input type="text" size="40" maxlength="60" value="{$row.nom}" name="nomN" />
-        </td>
-      </tr>
-      <tr>
-        <td class="titre">Femme :</td>
-        <td>
-          <input type="checkbox" name="flag_femmeN" value="1"{if in_array("femme",explode(",",$row.flags))}checked{/if} />
-        </td>
-      </tr>
-      <tr>
-        <td class="titre">Promo :</td>
-        <td>
-          <input type="text" size="4" maxlength="4" value="{$row.promo}" name="promoN" />
-        </td>
-      </tr>
-      <tr>
-        <td class="titre">Décés :</td>
-        <td>
-          <input type="text" size="10" value="{$row.deces}" name="decesN" />
-        </td>
-      </tr>
-      <tr>
-        <td colspan="2">
-          <a href="http://www.polytechniciens.com/index.php?page=AX_FICHE_ANCIEN&amp;anc_id={$row.matricule_ax}">Voir sa fiche sur le site de l'AX</a>
-        </td>
-      </tr>
-      <tr>
-        <td colspan="2">
-          <input type="hidden" name="xmat" value="{$smarty.request.xmat}" />
-          <input type="submit" value="Modifier la base" name="submit" />
-        </td>
-      </tr>
-    </table>
-  </form>
-</div>
-{/if}
-{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/marketing/utilisateurs_inscrire.tpl b/templates/marketing/utilisateurs_inscrire.tpl
deleted file mode 100644 (file)
index 95cba42..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-{***************************************************************************
- *  Copyright (C) 2003-2004 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                *
- ***************************************************************************}
-
-
-<h1>
-  Inscrire manuellement un X
-</h1>
-{if $success eq "1"}
-<p>
-Paramètres à transmettre:<br />
-Login=<strong>{$mailorg}</strong><br />
-Password=<strong>{$pass_clair}</strong>
-</p>
-<p>
-Pour éditer le profil,
-<a href="../admin/utilisateurs.php?login={$mailorg}">clique sur ce lien.</a>
-</p>
-{else}
-<p>
-Les prénom, nom, promo sont pré-remplis suivant la table d'identification.
-Modifie-les comme tu le souhaites. Une autre solution consiste à éditer
-d'abord la table d'identification (écran précédent) avant d'inscrire cet X.
-</p>
-
-<form action="{$smarty.server.PHP_SELF}" method="get">
-  <table class="bicol" summary="Créer un login">
-    <tr>
-      <th colspan="2">
-        Créer un login
-      </th>
-    </tr>
-    <tr>
-      <td class="titre">Prénom d'inscription</td>
-      <td>
-        <input type="text" size="40" maxlength="60" value="{$row.prenom}" name="prenomN" />
-      </td>
-    </tr>
-    <tr>
-      <td class="titre">Nom d'inscription</td>
-      <td>
-        <input type="text" size="40" maxlength="60" value="{$row.nom}" name="nomN" />
-      </td>
-    </tr>
-    <tr>
-      <td class="titre">Promotion</td>
-      <td>
-        <input type="text" size="4" maxlength="4" value="{$row.promo}" name="promoN" />
-      </td>
-    </tr>
-    <tr>
-      <td class="titre">Login</td>
-      <td>
-        <input type="text" size="40" maxlength="60" value="{$mailorg}" name="mailorg" />
-      </td>
-    </tr>
-    <tr>
-      <td class="titre">Date de naissance</td>
-      <td>
-        <input type="text" size="8" maxlength="8" value="" name="naissanceN" />
-      </td>
-    </tr>
-    <tr>
-      <td colspan="2">
-        <input type="hidden" name="xmat" value="{$smarty.request.xmat}" />
-        <input type="submit" name="submit" value="Creer le login" />
-      </td>
-    </tr>
-  </table>
-</form>
-{/if}
-
-{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/marketing/utilisateurs_marketing.tpl b/templates/marketing/utilisateurs_marketing.tpl
deleted file mode 100644 (file)
index fa486b8..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-{***************************************************************************
- *  Copyright (C) 2003-2004 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                *
- ***************************************************************************}
-
-
-
-<h1>
-  E-mail de pr&eacute;inscription
-</h1>
-<p>
-L'e-mail a &eacute;t&eacute; envoy&eacute; et la pr&eacute;-inscription a
-&eacute;t&eacute; ins&eacute;r&eacute;e en attente de confirmation.
-</p>
-
-
-{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/marketing/utilisateurs_recherche.tpl b/templates/marketing/utilisateurs_recherche.tpl
deleted file mode 100644 (file)
index e6c482a..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-{***************************************************************************
- *  Copyright (C) 2003-2004 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                *
- ***************************************************************************}
-
-
-<h1>
-  Chercher un X non inscrit
-</h1>
-
-{if $err}
-<p class="erreur">{$err}</p>
-{/if}
-
-<p>
-Bien remplir tous les champs pour passer à la page suivante.
-</p>
-
-<p>
-Si un champ est <strong>inconnu ou incertain</strong>, le remplir quand m&ecirc;me avec
-<strong>le caract&egrave;re % (pourcent). La promo peut rester vide.</strong>
-</p>
-
-<form action="{$smarty.server.PHP_SELF}" method="get">
-  <table class="bicol" cellpadding="3" summary="Recherche marketing">
-    <tr>
-      <th colspan="2">
-        Recherche marketing
-      </th>
-    </tr>
-    <tr>
-      <td class="titre">
-        Prénom :
-      </td>
-      <td>
-        <input type="text" size="40" maxlength="60" value="{$smarty.request.prenomR}" name="prenomR" />
-      </td>
-    </tr>
-    <tr>
-      <td class="titre">
-        Nom :
-      </td>
-      <td>
-        <input type="text" size="40" maxlength="60" value="{$smarty.request.nomR}" name="nomR" />
-      </td>
-    </tr>
-    <tr>
-      <td class="titre">
-        Promo :
-      </td>
-      <td>
-        <input type="text" size="4" maxlength="4" value="{$smarty.request.promoR}" name="promoR" />
-      </td>
-    </tr>
-    <tr>
-      <td colspan="2" class="center">
-        <input type="submit" value="Chercher" />
-      </td>
-    </tr>
-  </table>
-</form>
-
-
-{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/marketing/utilisateurs_select.tpl b/templates/marketing/utilisateurs_select.tpl
deleted file mode 100644 (file)
index 4480646..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-{***************************************************************************
- *  Copyright (C) 2003-2004 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                *
- ***************************************************************************}
-
-
-
-<h1>
-  Selectionner un X non inscrit
-</h1>
-
-<p>
-Sélectionne l'X que tu veux inscrire ou &agrave; qui tu veux envoyer le mail de pré-inscription.
-</p>
-
-<form action="{$smarty.server.PHP_SELF}" method="get">
-  <table class="bicol" cellpadding="3" summary="Sélection de l'X non inscrit">
-    <tr>
-      <th>
-        Sélection de l'X non inscrit
-      </th>
-    </tr>
-    <tr>
-      <td>
-        <select name="xmat">
-          {foreach from=$nonins item=x}
-          <option value="{$x.matricule}">{$x.matricule} {$x.prenom} {$x.nom} (X{$x.promo})</option>
-          {/foreach}
-        </select>
-      </td>
-    </tr>
-    <tr>
-      <td class="center">
-        {foreach from=$id_actions item=id_action}
-        <input type="submit" name="submit" value="{$id_action}" />&nbsp;&nbsp;
-        {/foreach}
-      </td>
-    </tr>
-  </table>
-</form>
-
-
-{* vim:set et sw=2 sts=2 sws=2: *}
index 5e6c3a1..09a2be5 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
 
+<h1>Marketing volontaire</h1>
 
+<p>
+Choix de la promo :
+</p>
+<p>
+{foreach from=$promos item=p}
+<a href="?promo={$p}">{$p}</a>
+{cycle values=",,,,,,,,,,,,,,<br />"}
+{/foreach}
+</p>
 
-<h1>
-  Marketing volontaire
-</h1>
-
-<h2>Adresses neuves</h2>
-
-<table class="bicol" cellpadding="3" summary="Adresses neuves">
-  <tr>
-    <th>Camarade concerné</th>
-    <th>Adresse email</th>
-    <th>Camarade "informateur"</th>
-    <th>Dernière adresse connue</th>
-    <th>Lui écrire ?</th>
-  </tr>
-  {iterate from=$neuves item=it}
-  <tr class="{cycle values="pair,impair"}">
-    <td>{$it.nom} {$it.prenom} (X{$it.promo})</td>
-    <td>{$it.email}</td>
-    <td>{$it.snom} {$it.sprenom} (X{$it.spromo})</td>
-    <td>{$it.last_known_email}</td>
-    <td>
-      {if $it.mailperso}
-      <a
-      href="utilisateurs_marketing.php?xmat={$it.dest}&amp;sender={$it.expe}&amp;from={$it.sprenom}%20{$it.snom}%20<{$it.forlife}&#64;polytechnique.org>&amp;mail={$it.email}&amp;submit=Mailer">Perso</a>
-      {else}
-      <a href="utilisateurs_marketing.php?xmat={$it.dest}&amp;sender={$it.expe}&amp;from=Equipe%20Polytechnique.org%20<register&#64;polytechnique.org>&amp;mail={$it.email}&amp;submit=Mailer">Equipe</a>
-      {/if}
-      <a href="{$smarty.server.PHP_SELF}?done={$it.id}">Fait !</a>
-      <a href="{$smarty.server.PHP_SELF}?del={$it.id}">Del</a>
-    </td>
-  </tr>
-  {/iterate}
-</table>
-
-<br />
-<br />
+{if $addr}
 
-<h2>Adresses déjà utilisées</h2>
+<p>[<a href="promo.php?promo={$smarty.get.promo}">Marketing promo pour la promo {$smarty.get.promo}</a>]</p>
 
+{if $addr->total()}
+<h2>Marketing volontaire</h2>
 <table class="bicol" cellpadding="3" summary="Adresses déjà utilisées">
   <tr>
     <th>Camarade concerné</th>
     <th>Adresse email</th>
-    <th>Camarade "informateur"</th>
-    <th>inscrit?</th>
+    <th>"informateur"</th>
   </tr>
-  {iterate from=$used item=it}
+  {iterate from=$addr item=it}
   <tr class="{cycle values="pair,impair"}">
-    <td>{$it.nom} {$it.prenom} (X{$it.promo})</td>
+    <td>{$it.nom} {$it.prenom}</td>
     <td>{$it.email}</td>
-    <td>{$it.snom} {$it.sprenom} (X{$it.spromo})</td>
-    <td>{if $it.inscrit}OUI{else}NON{/if}</td>
+    <td>{$it.forlife}</td>
   </tr>
   {/iterate}
 </table>
-
+{else}
 <p>
-{$rate.j} inscrits sur {$rate.i} sollicités, soit {$rate.rate}% de succès.
+pas d'informations pour les gens de cette promo
 </p>
+{/if}
+{/if}
 
 {* vim:set et sw=2 sts=2 sws=2: *}
index bf20bd4..838476f 100644 (file)
@@ -28,6 +28,9 @@
         {min_auth level='cookie'}
         <input type='checkbox' name='mod_date_sort' {if $smarty.request.mod_date_sort}checked='checked'{/if} />
         mettre les fiches modifiées récemment en premier
+        {if $smarty.request.nonins}
+        <br /><input type='checkbox' name='nonins' readonly="readonly" checked='checked' value='1' /> Chercher uniquement des non inscrits
+        {/if}
         {/min_auth}
       </td>
       <td>