Take directory_* permissions into account when accessing a profile.
[platal.git] / templates / profile / profile.tpl
index df3cf2c..ed73b0b 100644 (file)
@@ -42,7 +42,7 @@ function chgMainWinLoc(strPage)
 <div id="fiche">
   <div id="photo" class="part">
     {assign var=photo value=$profile->getPhoto(false)}
-    {if $photo}<img alt="Photo de {$profile->fullName()}" src="photo/{$profile->hrid()}" width="{$photo->width()}"/>{/if}
+    {if $photo}<img alt="Photo de {$profile->fullName()}" src="photo/{$profile->hrid()}{if $with_pending_pic}/req{/if}" width="{$photo->width()}"/>{/if}
 
     {if $logged && $view eq 'private' && ( $profile->section|smarty:nodefaults || $profile->getBinets()|smarty:nodefaults || ($owner && $owner->groups()|smarty:nodefaults))}
       <h2>À l'X&hellip;</h2>
@@ -62,7 +62,8 @@ function chgMainWinLoc(strPage)
 
     {/if}
 
-    {assign var=networking value=$profile->getNetworking(0)}
+    {* 458752 stands for 0x70000 = Profile::NETWORKING_ALL *}
+    {assign var=networking value=$profile->getNetworking(458752)}
     {if count($networking) > 0}
       <h2>Sur le web...</h2>
       {foreach from=$networking item=network}
@@ -86,10 +87,7 @@ function chgMainWinLoc(strPage)
   <div id="fiche_identite" class="part">
     <div class="civilite">
       {if $profile->isFemale()}&bull;{/if}
-        <span {if $profile->name_tooltip neq ""}class="hinted" title="{$profile->name_tooltip}"{/if}>{$profile->shortName()}</span>
-      {if $logged}
-        {if $profile->nickname} (alias {$profile->nickname}){/if}
-      {/if}
+        {if $view eq 'private'}{$profile->private_name}{else}{$profile->public_name}{/if}
 
       {if $logged}
         &nbsp;{if !$profile->isDead()}<a href="vcard/{$owner->login()}.vcf">{*
@@ -154,11 +152,13 @@ function chgMainWinLoc(strPage)
       {/if}
       <div class='spacer'></div>
     </div>
+    {else}
+    <div class='spacer'></div>
     {/if}
 
     <div class='formation'>
-      {foreach from=$profile->nationalities() item=nat}
-        <img src='images/flags/{$nat}.gif' alt='{$nat}' height='11' title='{$nat}' />&nbsp;
+      {foreach from=$profile->nationalities() item=country key=code}
+      <img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />&nbsp;
       {/foreach}
 
       {$profile->promo()}
@@ -179,14 +179,17 @@ function chgMainWinLoc(strPage)
 
       {assign var=corps value=$profile->getCorps()}
       {if $corps && ($corps->current || $corps->original)}
-      <ul>
+        <ul>
         {if $corps->current}
-          <li>Corps actuel&nbsp;: {$corps->current_name} {$corps->current_rank}</li>
+          <li>
+            Corps actuel&nbsp;: {$corps->current_name}
+            {if $corps->current_rank}({$corps->current_rank}){/if}
+          </li>
         {/if}
-        {if $corps->original}
+        {if $corps->current != $corps->original && $corps->original}
           <li>Corps d'origine&nbsp;: {$corps->original_name}</li>
         {/if}
-      </ul>
+        </ul>
       {/if}
 
     </div>
@@ -209,13 +212,13 @@ function chgMainWinLoc(strPage)
       {/if}
       {if $address->hasFlag('current')}
       {include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" actuelle&nbsp;:"
-               for="`$profile->firstname` `$profile->lastname`" pos=$pos}
+               for="`$profile->firstname` `$profile->lastname`" pos=$pos phones=null}
       {elseif $address->hasFlag('secondary')}
       {include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" secondaire&nbsp;:"
-               for="`$profile->firstname` `$profile->lastname`" pos=$pos}
+               for="`$profile->firstname` `$profile->lastname`" pos=$pos phones=null}
       {else}
       {include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" principale&nbsp;:"
-               for="`$profile->firstname` `$profile->lastname`" pos=$pos}
+               for="`$profile->firstname` `$profile->lastname`" pos=$pos phones=null}
       {/if}
       {if $smarty.foreach.addresses.iteration is even}<div class="spacer"></div>{/if}
     {/foreach}
@@ -229,11 +232,11 @@ function chgMainWinLoc(strPage)
     {foreach from=$jobs item="job" key="i"}
       {if $i neq 0}<hr />{/if}
       {include file="include/emploi.tpl" job=$job}
-      {assign var=phones value=$job->phones()}
+      {assign var=jobPhones value=$job->phones()}
       {if $job->address()}
-        {include file="geoloc/address.tpl" address=$job->address() titre="Adresse&nbsp;: " for=$job->company->name pos="left" phones=$phones}
-      {elseif $phones}
-        {display_phones tels=$phones}
+        {include file="geoloc/address.tpl" address=$job->address() titre="Adresse&nbsp;: " for=$job->company->name pos="left" phones=$jobPhones}
+      {elseif $jobPhones|@count neq 0}
+        {display_phones tels=$jobPhones}
       {/if}
       <div class="spacer">&nbsp;</div>
     {/foreach}