Merge branch 'master' into fusionax
[platal.git] / templates / profile / profile.tpl
index 4d91800..9487465 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -41,7 +41,7 @@ function chgMainWinLoc(strPage)
 
 <div id="fiche">
   <div id="photo" class="part">
-    {if $photo_url}<img alt="Photo de {$x.forlife}" src="{$photo_url}" width="{$x.x}"/>{/if}
+    {if $photo_url}<img alt="Photo de {$user->login()}" src="{$photo_url}" width="{$x.x}"/>{/if}
     {if $logged && ( $x.section|smarty:nodefaults || $x.binets_join|smarty:nodefaults || $x.gpxs_join|smarty:nodefaults)}
       <h2>À l'X...</h2>
       {if $x.section}<div><em class="intitule">Section&nbsp;: </em><span>{$x.section}</span></div>{/if}
@@ -71,26 +71,26 @@ function chgMainWinLoc(strPage)
   </div>
   <div id="fiche_identite" class="part">
     <div class="civilite">
-      {if $x.sexe}&bull;{/if}
+      {if $user->isFemale()}&bull;{/if}
       <span {if $x.name_tooltip neq ""}class="hinted" title="{$x.name_tooltip}"{/if}>{$x.name_display}</span>
       {if $logged}
       {if $x.nickname} (alias {$x.nickname}){/if}
       {/if}
       {if $logged}
-      &nbsp;{if !$x.dcd}<a href="vcard/{$x.forlife}.vcf">{*
+      &nbsp;{if !$x.dcd}<a href="vcard/{$user->login()}.vcf">{*
         *}{icon name=vcard title="Afficher la carte de visite"}</a>{/if}
       {if !$x.is_contact}
-      <a href="javascript:chgMainWinLoc('carnet/contacts?action=ajouter&amp;user={$x.forlife}&amp;token={xsrf_token}')">
+      <a href="javascript:chgMainWinLoc('carnet/contacts?action=ajouter&amp;user={$user->login()}&amp;token={xsrf_token}')">
         {icon name=add title="Ajouter à mes contacts"}</a>
       {else}
-      <a href="javascript:chgMainWinLoc('carnet/contacts?action=retirer&amp;user={$x.forlife}&amp;token={xsrf_token}')">
+      <a href="javascript:chgMainWinLoc('carnet/contacts?action=retirer&amp;user={$user->login()}&amp;token={xsrf_token}')">
         {icon name=cross title="Retirer de mes contacts"}</a>
       {/if}
       {if hasPerm('admin')}
-      <a href="javascript:chgMainWinLoc('admin/user/{$x.forlife}')">
+      <a href="javascript:chgMainWinLoc('admin/user/{$user->login()}')">
         {icon name=wrench title="administrer user"}</a>
       {/if}
-      {if $x.forlife eq $smarty.session.forlife}
+      {if $user->login() eq $smarty.session.hruid}
       <a href="javascript:chgMainWinLoc('profile/edit')">{icon name="user_edit" title="Modifier ma fiche"}</a>
       {/if}
       {/if}
@@ -106,26 +106,26 @@ function chgMainWinLoc(strPage)
       {if $logged}
       <div class='email'>
         {if $x.dcd}
-        Décédé{if $x.sexe}e{/if} le {$x.deces|date_format}
+        Décédé{if $user->isFemale()}e{/if} le {$x.deces|date_format}
         {elseif !$x.actif}
         Ce{if $c.sexe}tte{/if} camarade n'a plus d'adresse de redirection valide,<br />
-        <a href="marketing/broken/{$x.forlife}" class="popup">clique ici si tu connais son adresse email !</a>
+        <a href="marketing/broken/{$user->login()}" class="popup">clique ici si tu connais son adresse email !</a>
         {elseif !$x.inscrit}
         Cette personne n'est pas inscrite à Polytechnique.org,<br />
-        <a href="marketing/public/{$x.user_id}" class="popup">clique ici si tu connais son adresse email !</a>
+        <a href="marketing/public/{$user->login()}" class="popup">clique ici si tu connais son adresse email !</a>
         {else}
         {if $virtualalias}
         <a href="mailto:{$virtualalias}">{$virtualalias}</a><br />
         {/if}
-        <a href="mailto:{$x.bestalias}@{#globals.mail.domain#}">{$x.bestalias}@{#globals.mail.domain#}</a>
-        {if $x.bestalias neq $x.forlife}<br />
-        <a href="mailto:{$x.forlife}@{#globals.mail.domain#}">{$x.forlife}@{#globals.mail.domain#}</a>
+        <a href="mailto:{$user->bestEmail()}">{$user->bestEmail()}</a>
+        {if $user->bestEmail() neq $user->forlifeEmail()}<br />
+        <a href="mailto:{$user->forlifeEmail()}">{$user->forlifeEmail()}</a>
         {/if}
         {/if}
       </div>
       {/if}
       {if $x.tels}
-        {display_phones tels=$x.tels}
+        {display_phones tels=$x.tels dcd=$x.dcd}
       {/if}
       <div class='spacer'></div>
     </div>
@@ -140,21 +140,31 @@ function chgMainWinLoc(strPage)
       {if $x.iso3166_3}
       <img src='images/flags/{$x.iso3166_3}.gif' alt='{$x.nationalite3}' height='11' title='{$x.nationalite3}' />&nbsp;
       {/if}
-      X {$x.promo}
-      {if ($x.promo_sortie-3 > $x.promo)}
-        - X {math equation="a-b" a=$x.promo_sortie b=3}
+      {$user->promo()}
+      {if $logged && $x.is_referent}
+      [<a href="referent/{$x.forlife}" class='popup2'>Ma fiche référent</a>]
       {/if}
       {if $x.education}
-        &nbsp;-&nbsp;Formation&nbsp;: {$x.education|smarty:nodefaults}
+        &nbsp;-&nbsp;Formation&nbsp;:
+        <ul>
+        {foreach from=$x.education item="edu"}
+          <li>{$edu|smarty:nodefaults}</li>
+        {/foreach}
+        </ul>
       {/if}
-      {if $logged && $x.is_referent}
-      [<a href="referent/{$x.forlife}" class='popup2'>Ma fiche référent</a>]
+      {if $x.corps}
+        {$x.corps|smarty:nodefaults}
       {/if}
     </div>
   </div>
   {if $x.adr}
   <div class="part">
     <h2>Contact&nbsp;: </h2>
+    {if $x.dcd}
+      {assign var=address_name value="Dernière adresse"}
+    {else}
+      {assign var=address_name value="Adresse"}
+    {/if}
     {foreach from=$x.adr item="address" name=adresses}
       {if $smarty.foreach.adresses.iteration is even}
         {assign var=pos value="right"}
@@ -162,13 +172,13 @@ function chgMainWinLoc(strPage)
         {assign var=pos value="left"}
       {/if}
       {if $address.active}
-      {include file="geoloc/address.tpl" address=$address titre_div=true titre="Mon adresse actuelle&nbsp;:"
+      {include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" actuelle&nbsp;:"
                for="`$x.prenom` `$x.nom`" pos=$pos}
       {elseif $address.secondaire}
-      {include file="geoloc/address.tpl" address=$address titre_div=true titre="Adresse secondaire&nbsp;:"
+      {include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" secondaire&nbsp;:"
                for="`$x.prenom` `$x.nom`" pos=$pos}
       {else}
-      {include file="geoloc/address.tpl" address=$address titre_div=true titre="Adresse principale&nbsp;:"
+      {include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" principale&nbsp;:"
                for="`$x.prenom` `$x.nom`" pos=$pos}
       {/if}
       {if $smarty.foreach.adresses.iteration is even}<div class="spacer"></div>{/if}
@@ -210,7 +220,7 @@ function chgMainWinLoc(strPage)
   <div class="part">
     <small>
     Cette fiche est publique et visible par tout internaute,<br />
-    vous pouvez aussi voir <a href="profile/private/{$x.forlife}?display=light">celle&nbsp;réservée&nbsp;aux&nbsp;X</a>.
+    vous pouvez aussi voir <a href="profile/private/{$user->login()}?display=light">celle&nbsp;réservée&nbsp;aux&nbsp;X</a>.
     </small>
   </div>
   {elseif $view eq 'ax'}