Merge commit 'origin/fusionax' into account
[platal.git] / templates / profile / general.tpl
index 9c2e580..4e3bdc4 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  *}
 {*                                                                        *}
 {**************************************************************************}
 
-{include file="profile/general.name.tpl display_name=$display_name tooltip_name=$tooltip_name prenom=$prenom
-  nom=$nom sort_name=$sort_name yourself=$yourself search_names=$search_names}
+<table class="bicol" style="margin-bottom: 1em" summary="Profil : Noms">
+  <tr>
+    <th colspan="3">Noms</th>
+  </tr>
+  <tr>
+    <td class="titre">
+      {icon name="flag_green" title="site public"}&nbsp;Affichage public
+    </td>
+    <td id="public_name">
+      {$public_name}
+    </td>
+    <td rowspan="2">
+      <a href="javascript:toggleNamesAdvanced();">
+        {icon name="page_edit" title="Plus de détail"}
+      </a>
+    </td>
+  </tr>
+  <tr>
+    <td class="titre">
+      {icon name="flag_red" title="site privé"}&nbsp;Affichage privé
+    </td>
+    <td id="private_name">
+      {$private_name}
+    </td>
+  </tr>
+  <tr>
+    <td>
+      <span class="titre">Comment t'appeller</span><br />
+      <span class="smaller">sur le site, dans la lettre mensuelle...</span>
+    </td>
+    <td>
+      <input type="text" name="yourself" value="{$yourself}" size="25"/>
+    </td>
+    <td></td>
+  </tr>
+  <tr class="names_advanced" {if !$errors.search_names}style="display: none"{/if}>
+    <td colspan="3">
+      <span class="titre">Gestion de tes noms, prénoms, surnoms...</span>
+      <span class="smaller">Ils déterminent la façon dont ton nom apparaît sur les annuaires
+      en ligne et papier et ta fiche apparaitra quand on cherche un de ces noms. Pour plus
+      d'explications sur l'icône suivante
+      <a href="profile/name_info" class="popup3">{icon name="information" title="Plus d'infos"}</a>.</span><br/>
+      <div class="small center">Si un de tes noms commence par une particule,
+      coche la case en bout de ligne.</div>
+    </td>
+  </tr>
+  {foreach from=$search_names item=sn key=id}
+    {include file="profile/general.searchname.tpl" i=$id sn=$sn
+    class="names_advanced" style="display: none" error_name=$errors.search_names}
+  {/foreach}
+  <tr class="names_advanced" id="searchname" {if !$errors.search_names}style="display: none"{/if}>
+    <td colspan="2">
+      <div id="sn_add" class="center">
+        <a href="javascript:addSearchName();">
+          {icon name=add title="Ajouter un nom"} Ajouter un nom
+        </a>
+      </div>
+    </td>
+  </tr>
+</table>
 
 <table class="bicol" style="margin-bottom: 1em"
   summary="Profil&nbsp;: Informations générales">
     </td>
     <td>
       {if !$promo_choice}
-        <span class="nom">{$promo_display}</span>
+        <span class="nom">{$promo}</span>
+        <input type="hidden" name="promo" value="{$promo}"/>
       {else}
-        <select name="promo_display">
+        <select name="promo">
         {foreach from=$promo_choice item="promo_to_display"}
-          <option value="{$promo_to_display}" {if $promo_to_display eq $promo_display}selected="selected"{/if}>{$promo_to_display}</option>
+          <option value="{$promo_to_display}" {if $promo_to_display eq $promo}selected="selected"{/if}>{$promo_to_display}</option>
         {/foreach}
         </select>
       {/if}
     <td>
       <span class="titre">Date de naissance</span>
     </td>
-    <td><input type="text" {if $errors.naissance}class="error"{/if} name="naissance" value="{$naissance}" /></td>
+    <td><input type="text" {if $errors.birthdate}class="error"{/if} name="birthdate" value="{$birthdate}" /></td>
   </tr>
   <tr>
     <td>
       <span class="titre">Nationalité</span>
     </td>
     <td>
-      <select name="nationalite">
-        {select_nat valeur=$nationalite pad=1}
+      <select name="nationality1">
+        {select_nat valeur=$nationality1 pad=1}
       </select>
       <a href="javascript:addNationality();">{icon name=add title="Ajouter une nationalité"}</a>
     </td>
   </tr>
-  <tr id="nationalite2" {if !$nationalite2}style="display: none"{/if}>
+  <tr id="nationality2" {if !$nationality2}style="display: none"{/if}>
     <td></td>
     <td>
-      <select name="nationalite2">
-        {select_nat valeur=$nationalite2 pad=1}
+      <select name="nationality2">
+        {select_nat valeur=$nationality2 pad=1}
       </select>
       <a href="javascript:delNationality('2');">{icon name=cross title="Supprimer cette nationalité"}</a>
     </td>
   </tr>
-  <tr id="nationalite3" {if !$nationalite3}style="display: none"{/if}>
+  <tr id="nationality3" {if !$nationality3}style="display: none"{/if}>
     <td></td>
     <td>
-      <select name="nationalite3">
-        {select_nat valeur=$nationalite3 pad=1}
+      <select name="nationality3">
+        {select_nat valeur=$nationality3 pad=1}
       </select>
       <a href="javascript:delNationality('3');">{icon name=cross title="Supprimer cette nationalité"}</a>
     </td>
   </tr>
   {foreach from=$edus key=eduid item=edu}
     {cycle values="impair, pair" assign=class}
-    {include file="profile/edu.tpl" eduid=$eduid edu=$edu edu_fields=$edu_fields class=$class}
+    {include file="profile/general.edu.tpl" eduid=$eduid edu=$edu edu_fields=$edu_fields class=$class}
   {/foreach}
   {if $edus|@count eq 0}
     {cycle values="impair, pair" assign=class}
-    {include file="profile/edu.tpl" eduid=0 edu=0 class=$class}
+    {include file="profile/general.edu.tpl" eduid=0 edu=0 class=$class}
   {/if}
   {cycle values="impair, pair" assign=class}
   {assign var=eduaddid value=$edus|@count}
   </tr>
  </table>
 
-{if !$no_private_key}
-<table class="bicol"  style="margin-bottom: 1em"
-  summary="Profil&nbsp;: Informations générales">
-  <tr>
-    <th>
-      Synchronisation avec l'AX
-    </th>
-  </tr>
-  <tr>
-    <td class="flags">
-      <input type="checkbox" name="synchro_ax" {if $synchro_ax}checked="checked" {/if}/>
-      {icon name="flag_orange" title="transmis à l'AX"}
-      <span class="texte">
-        Autoriser la synchronisation vers l'AX par des administrateurs ou des scripts automatiques.
-      </span>
-    </td>
-  </tr>
-  <tr>
-    <td>
-      <p>
-        Le service annuaire de l'<a href='http://www.polytechniciens.com'>AX</a> met à jour l'annuaire papier à partir des informations que tu lui fournis. Tu peux choisir ici d'envoyer directement les données de ta fiche Polytechnique.org vers ta <a href="http://www.polytechniciens.com/?page=AX_FICHE_ANCIEN&amp;anc_id={$matricule_ax}">fiche AX</a>.
-      </p>
-      <p>
-        L'opération de synchronisation prend en compte toutes les informations que tu as marquées comme transmises à l'AX (en orange ou en vert). Elle peut alors effacer, modifier ou rajouter des informations sur ta <a href="http://www.polytechniciens.com/?page=AX_FICHE_ANCIEN&amp;anc_id={$matricule_ax}">fiche AX</a> selon ce qui s'y trouve déjà.
-      </p>
-      <p class="center">
-        <a href="profile/edit/general?synchro_ax=confirm" onclick="return confirm('Es-tu sûr de vouloir lancer la synchronisation ?')"><input type="button" value="Synchroniser"/></a>
-      </p>
-    </td>
-  </tr>
-</table>
-{/if}
-
 <table class="bicol"  style="margin-bottom: 1em"
   summary="Profil&nbsp;: Trombinoscope">
   <tr>
   <tr>
     <td {if !$nouvellephoto}colspan="2"{/if} class="center" style="width: 49%">
       <div class="titre">Ta photo actuelle</div>
-      <img src="photo/{$smarty.session.hruid}" alt=" [ PHOTO ] " style="max-height: 250px; margin-top: 1em" />
+      <img src="photo/{$profile->hrid()}" alt=" [ PHOTO ] " style="max-height: 250px; margin-top: 1em" />
     </td>
     {if $nouvellephoto}
     <td class="center" style="width: 49%">
       <div class="titre">Photo en attente de validation</div>
       <div>
-        <a href="profile/{$smarty.session.hruid}?modif=new" class="popup2">
+        <a href="profile/{$profile->hrid()}?modif=new" class="popup2">
           Ta fiche avec cette photo
         </a>
       </div>
-      <img src="photo/{$smarty.session.hruid}/req" alt=" [ PHOTO ] " style="max-height: 250px; margin-top: 1em" />
+      <img src="photo/{$profile->hrid()}/req" alt=" [ PHOTO ] " style="max-height: 250px; margin-top: 1em" />
     </td>
     {/if}
   </tr>
       </div>
     </td>
   </tr>
-<!--  <tr id="networking">
-    <td colspan="2">
-      <div style="float: left; width: 200px;">
-        <span class="titre" style="margin-left:1em;">Type à ajouter</span>
-      </div>
-      <div style="float: left;">
-        <div id="nw_type_ac" style="background-color: white; border: solid 1px black; position: absolute; width: 208px; display: none">TEST</div>
-        <input type="text" size="30" id="nw_type" name="nw_type" onkeyup="updateNetworking()">
-        <span id="nw_add" style="display: none">
-          <a href="javascript:addNetworking();">{icon name=add title="Ajouter cette adresse"}</a>
-        </span>
-      </div>
-    </td>
-  </tr>-->
   <tr class="pair">
     <td>
       <div>