closes #207
authorx2000habouzit <x2000habouzit>
Wed, 17 Nov 2004 11:11:59 +0000 (11:11 +0000)
committerx2000habouzit <x2000habouzit>
Wed, 17 Nov 2004 11:11:59 +0000 (11:11 +0000)
ChangeLog
htdocs/vcard.php
templates/fiche.tpl
templates/vcard.tpl

index 7392590..3c08739 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,10 @@ New :
 
 Bug/Wish :
 
+       * Bestalias:
+               - #207 : enable for the user the choice of his prefered alias.          -MC
+               - #207 : use only the bestalias and the forlife in vcard and fiche.     -MC
+
 
 Fixes (from 0.9.2 branch) :
 
index 9aebe3b..e543fd6 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: vcard.php,v 1.14 2004-10-21 13:12:06 x2000habouzit Exp $
+        $Id: vcard.php,v 1.15 2004-11-17 11:11:59 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -65,7 +65,7 @@ $vcard = mysql_fetch_assoc($result);
 $page->assign_by_ref('vcard', $vcard);
 mysql_free_result($result);
 
-$page->mysql_assign("SELECT alias FROM aliases WHERE id={$vcard['user_id']} AND type!='a_vie' AND type!='homonyme'",'aliases');
+$page->mysql_assign("SELECT alias FROM aliases WHERE id={$vcard['user_id']} AND FIND_IN_SET('bestalias',flags)",'best');
 
 $adr = $globals->db->query(
         "SELECT statut,adr1,adr2,adr3,cp,ville,gp.pays,gr.name,tel,fax,
index d3a45b0..7ab8732 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: fiche.tpl,v 1.25 2004-11-13 15:56:35 x2000habouzit Exp $
+        $Id: fiche.tpl,v 1.26 2004-11-17 11:12:00 x2000habouzit Exp $
  ***************************************************************************}
 
 {literal}
@@ -53,8 +53,11 @@ function chgMainWinLoc( strPage ) {
   </div>
   <div class='right' style="font-size: smaller; width:100%">(Fiche mise à jour le {$date|date_format:"%d %B %Y"})</div>
   <div>
-    <a href="mailto:{$bestalias}@polytechnique.org">{$bestalias}@polytechnique.org</a><br />
+    <a href="mailto:{$bestalias}@polytechnique.org">{$bestalias}@polytechnique.org</a>
+    {if $bestalias neq $forlife}
+    <br />
     <a href="mailto:{$forlife}@polytechnique.org">{$forlife}@polytechnique.org</a>
+    {/if}
   </div>
   <div>{if $nationalite}<em>{$nationalite}</em> - {/if}X {$promo}&nbsp;-&nbsp;Formation&nbsp;: {$applis|smarty:nodefaults}</div>
   {if $mobile}<div><em class="intitule">Mobile : </em>{$mobile}</div>{/if}
index e29241e..5bfa058 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: vcard.tpl,v 1.5 2004-10-29 15:46:57 x2000habouzit Exp $
+        $Id: vcard.tpl,v 1.6 2004-11-17 11:12:00 x2000habouzit Exp $
  ***************************************************************************}
 BEGIN:VCARD
 VERSION:3.0
@@ -27,10 +27,8 @@ FN;ENCODING=QUOTED-PRINTABLE:{"`$vcard.prenom` `$vcard.epouse` (`$vcard.nom`)"|q
 FN;ENCODING=QUOTED-PRINTABLE:{"`$vcard.prenom` `$vcard.nom`"|qp_enc}
 {/if}
 N;ENCODING=QUOTED-PRINTABLE:{$vcard.nom|qp_enc};{$vcard.prenom|qp_enc};{$vcard.epouse|qp_enc};;
+EMAIL;TYPE=internet:{$best[0].alias}@polytechnique.org
 EMAIL;TYPE=internet:{$vcard.forlife}@polytechnique.org
-{foreach from=$aliases item=a}
-EMAIL;TYPE=internet:{$a.alias}@polytechnique.org
-{/foreach}
 {if $vcard.mobile}
 TEL;TYPE=cell;ENCODING=QUOTED-PRINTABLE:{$vcard.mobile|qp_enc}
 {/if}