Prevents impossible grad years to be stored.
[platal.git] / templates / profile / profile.tpl
index 411a59f..0525acd 100644 (file)
@@ -44,7 +44,7 @@ function chgMainWinLoc(strPage)
     {assign var=photo value=$profile->getPhoto(false)}
     {if $photo}<img alt="Photo de {$profile->fullName()}" src="photo/{$profile->hrid()}" width="{$photo->width()}"/>{/if}
 
-    {if $logged && ( $profile->section|smarty:nodefaults || $profile->getBinets()|smarty:nodefaults || ($owner && $owner->groups()|smarty:nodefaults))}
+    {if $logged && $view eq 'private' && ( $profile->section|smarty:nodefaults || $profile->getBinets()|smarty:nodefaults || ($owner && $owner->groups()|smarty:nodefaults))}
       <h2>À l'X&hellip;</h2>
       {if $profile->section}<div><em class="intitule">Section&nbsp;: </em><span>{$profile->section}</span></div>{/if}
 
@@ -52,7 +52,7 @@ function chgMainWinLoc(strPage)
       {if $binets|@count}<div><em class="intitule">Binet{if count($binets) > 1}s{/if}&nbsp;: </em>
       <span>{', '|implode:$profile->getBinetsNames()}</span></div>{/if}
 
-      {if $owner}
+      {if $owner && $view eq 'private'}
         {assign var=groups value=$owner->groupNames(true)}
         {if $groups|@count}<div><em class="intitule">Groupe{if count($groups) > 1}s{/if} et institution{if count($groups) > 1}s{/if} X&nbsp;: </em>
         <span><br/>
@@ -66,11 +66,9 @@ function chgMainWinLoc(strPage)
     {if count($networking) > 0}
       <h2>Sur le web...</h2>
       {foreach from=$networking item=network}
-        <img style="width: auto; padding: 0" src="profile/networking/{$network.network_type}" alt="{$network.name}" title="{$network.name}"/>
-        {if $network.filter == 'web'}
-          <a href="{$network.address}">{$network.address}</a>
-        {elseif $network.link != ''}
-          <a href="{$network.link}">{$network.address}</a>
+        <img style="width: auto; padding: 0" src="profile/networking/{$network.nwid}" alt="{$network.name}" title="{$network.name}"/>
+        {if $network.link}
+          <a href="{$network.link|replace:'%s':$network.address}">{$network.address}</a>
         {else}
           {$network.address}
         {/if}
@@ -117,7 +115,7 @@ function chgMainWinLoc(strPage)
       {/if}
     </div>
 
-    {if $logged}
+    {if $logged && $view eq 'private'}
     <div class='maj'>
       Fiche mise à jour<br />
       le {$profile->last_change|date_format}
@@ -126,9 +124,9 @@ function chgMainWinLoc(strPage)
 
     {* 121634816 is Profile::PHONE_LINK_PROFILE | Profile::PHONE_TYPE_ANY = 0x7400000 *}
     {assign var=phones value=$profile->getPhones(121634816)}
-    {if $logged || count($phones) > 0}
+    {if ($logged && $view eq 'private') || count($phones) > 0}
     <div class="contact">
-      {if $logged}
+      {if $logged && $view eq 'private'}
       <div class='email'>
         {if $profile->isDead()}
         Décédé{if $profile->isFemale()}e{/if} le {$profile->deathdate|date_format}
@@ -232,7 +230,12 @@ function chgMainWinLoc(strPage)
       {if $i neq 0}<hr />{/if}
       {include file="include/emploi.tpl" job=$job}
       {if $job->address()}
-        {include file="geoloc/address.tpl" address=$job->address titre="Adresse&nbsp;: " for=$job->company->name pos="left"}
+        {include file="geoloc/address.tpl" address=$job->address() titre="Adresse&nbsp;: " for=$job->company->name pos="left"}
+      {elseif $job->company->address}
+        {include file="geoloc/address.tpl" address=$job->company->address titre="Addresse&nbsp;: " for=$job->company->name pos="left"}
+      {/if}
+      {if $job->phones()}
+        {display_phones tels=$job->phones()}
       {/if}
       <div class="spacer">&nbsp;</div>
     {/foreach}