wish 329 and bug 328, amelioration de la gestion de la fiche publique
authorPascal Corpet <pascal.corpet@m4x.org>
Sat, 16 Jul 2005 20:21:19 +0000 (20:21 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:29:28 +0000 (23:29 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-763

htdocs/fiche.php
include/user.func.inc.php
templates/fiche.tpl
templates/include/emploi.tpl
templates/profil.tpl

index 9931089..671c2ae 100644 (file)
@@ -75,8 +75,8 @@ if($user['x'] < 160){
 }
 
 // manage the public fiche
-$page->assign('logged', logged());
-if (!logged()) {
+$page->assign('logged', logged() && !Env::has('public'));
+if (!logged() || Env::has('public')) {
     // hide the orange status
     $user['promo_sortie'] = $user['promo'] + 3;
     if ($user['mobile_pub'] != 'public') $user['mobile'] = '';
@@ -141,7 +141,7 @@ foreach($user['adr_pro'] as $i=>$pro) {
     if ($pro['entreprise'] == '' && $pro['fonction'] == ''
         && $pro['secteur'] == '' && $pro['poste'] == ''
         && $pro['adr1'] == '' && $pro['adr2'] == '' && $pro['adr3'] == ''
-        && $pro['postcode'] == '' && $pro['city'] == '' && $pro['country'] == ''
+        && $pro['postcode'] == '' && $pro['city'] == '' && $pro['country'] == '00'
         && $pro['tel'] == '' && $pro['fax'] == '' && $pro['mobile'] == ''
         && $pro['email'] == '')
         unset($user['adr_pro'][$i]);
index a90fcd3..9d02f5d 100644 (file)
@@ -183,7 +183,7 @@ function &get_user_details($login, $from_uid = '')
     $sql  = "SELECT  e.entreprise, s.label as secteur , ss.label as sous_secteur , f.fonction_fr as fonction,
                      e.poste, e.adr1, e.adr2, e.adr3, e.postcode, e.city,
                      gp.pays AS countrytxt, gr.name AS region, e.tel, e.fax, e.mobile, e.entrid,
-                     e.pub, e.tel_pub, e.email, e.email_pub, e.web
+                     e.pub, e.adr_pub, e.tel_pub, e.email, e.email_pub, e.web
                FROM  entreprises AS e
           LEFT JOIN  emploi_secteur AS s ON(e.secteur = s.id)
           LEFT JOIN  emploi_ss_secteur AS ss ON(e.ss_secteur = ss.id AND e.secteur = ss.secteur)
index a886db2..3d1126d 100644 (file)
@@ -34,7 +34,7 @@ function chgMainWinLoc( strPage ) {
       <div class="civilite">
         {if $x.sexe}&bull;{/if}
         {$x.prenom} {if $x.nom_usage eq ""}{$x.nom}{else}{$x.nom_usage} ({$x.nom}){/if}
-        {min_auth level="cookie"}
+        {if $logged}
         {if $x.nickname} (aka {$x.nickname}){/if}&nbsp;
         <a href="vcard.php/{$x.forlife}.vcf?x={$x.forlife}">
           <img src="images/vcard.png" alt="Afficher la carte de visite" title="Afficher la carte de visite"/>
@@ -53,17 +53,17 @@ function chgMainWinLoc( strPage ) {
           <img src="images/admin.png" alt='admin' title="administrer user" />
         </a>
         {/perms}
-        {/min_auth}
+        {/if}
       </div>
-      {min_auth level="cookie"}
+      {if $logged}
       <div class='maj'>
         Fiche mise à jour<br />
         le {$x.date|date_format}
       </div>
-      {/min_auth}
-      {if $logged || $c.mobile}
+      {/if}
+      {if $logged || $x.mobile}
       <div class="contact">
-        {min_auth level="cookie"}
+        {if $logged}
         <div class='email'>
           {if $x.dcd}
           Décédé{if $x.sexe}e{/if} le {$x.deces|date_format}
@@ -79,7 +79,7 @@ function chgMainWinLoc( strPage ) {
           {/if}
           {/if}
         </div>
-        {/min_auth}
+        {/if}
         <div class="mob">
           {if $x.mobile}<em class="intitule">Mobile : </em>{$x.mobile}<br />{/if}
         </div>
@@ -97,20 +97,20 @@ function chgMainWinLoc( strPage ) {
         {if $x.applis_join}
           &nbsp;-&nbsp;Formation&nbsp;: {$x.applis_join|smarty:nodefaults}
         {/if}
-        {min_auth level="cookie"}
+        {if $logged}
         {if $x.is_referent}
         [<a href="fiche_referent.php?user={$x.forlife}" class='popup2'>Ma fiche référent</a>]
         {/if}
-        {/min_auth}
+        {/if}
       </div>
     </td>
     <td rowspan="4" id='photo'>
       {if $photo_url}<img alt="Photo de {$x.forlife}" src="{$photo_url}" width="{$x.x}" height="{$x.y}" />{/if}
-      {min_auth level="cookie"}
+      {if $logged}
       {if $x.section}<div><em class="intitule">Section : </em><span>{$x.section}</span></div>{/if}
       {if $x.binets_join}<div><em class="intitule">Binet(s) : </em><span>{$x.binets_join}</span></div>{/if}
       {if $x.gpxs_join}<div><em class="intitule">Groupe(s) X : </em><span>{$x.gpxs_join|smarty:nodefaults}</span></div>{/if}
-      {/min_auth}
+      {/if}
       {if $x.web}<div><em class="intitule">Site Web : </em><a href="{$x.web}" class='popup'>{$x.web}</a></div>{/if}
       {if $x.freetext}<div><em class="intitule">Commentaires : </em><br /><span>{$x.freetext|nl2br}</span></div>{/if}
     </td>
@@ -165,7 +165,7 @@ function chgMainWinLoc( strPage ) {
     </td>
   </tr>
   {/if}
-  {min_auth level="cookie"}
+  {if $logged}
   {if $x.cv}
   <tr>
     <td>
@@ -174,7 +174,7 @@ function chgMainWinLoc( strPage ) {
     </td>
   </tr>
   {/if}
-  {/min_auth}
+  {/if}
 </table>
 
 
index 9f7b197..0392a81 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 {if $address.entreprise || $address.secteur || $address.fonction ||
-  $address.poste || $address.fonction}
+  $address.poste || $address.fonction || $address.email || $address.web}
       <div class="adresse">
        <table>
-        {if $address.entreprise}
+        {if $address.entreprise || $address.web}
         <tr>
           <td><em>Ent/Org: </em></td>
           <td><strong>{$address.entreprise}{if $address.web} [<a href='{$address.web}'>site</a>]{/if}</strong></td>
index 5c9cecd..6367def 100644 (file)
@@ -29,8 +29,9 @@
 <p class="erreur">{$e}</p>
 {/foreach}
 
-<p>Tu peux consulter <a href="{"fiche.php"|url}?user={$smarty.session.forlife}" class="popup2">l'état actuel de ta fiche</a>
-tel qu'elle apparaîtra pour un camarade.</p>
+<p>Tu peux consulter <a href="{rel}/fiche.php?user={$smarty.session.forlife}" class="popup2">l'état actuel de ta fiche</a>
+tel qu'elle apparaîtra pour un camarade,
+ou <a href="{rel}/fiche.php?user={$smarty.session.forlife}&amp;public=1" class="popup2">tel</a> qu'elle apparaîtra à tout le monde.</p>
 
 <form action="{$smarty.server.PHP_SELF}" method="post" id="prof_annu">
   <table class="cadre_a_onglet" cellpadding="0" cellspacing="0" style="width: 98%; margin-left:1%;">