X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=templates%2Fprofile%2Fprofile.tpl;h=95667c1f3340041f5718d15f1f7183171146506b;hb=8127963d297fab1ccb03df8f69cc9ddcdc645036;hp=9d0a9b516b0a3c3b004f86a7e70cff63f4dec9b5;hpb=93d42b4fcc6f055a428c9b63e386ac62c918d08a;p=platal.git diff --git a/templates/profile/profile.tpl b/templates/profile/profile.tpl index 9d0a9b5..95667c1 100644 --- a/templates/profile/profile.tpl +++ b/templates/profile/profile.tpl @@ -42,9 +42,9 @@ function chgMainWinLoc(strPage)
{assign var=photo value=$profile->getPhoto(false)} - {if $photo}Photo de {$profile->fullName()}{/if} + {if $photo}Photo de {$profile->fullName()}{/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(true,true)|smarty:nodefaults))}

À l'X…

{if $profile->section}
Section : {$profile->section}
{/if} @@ -52,25 +52,24 @@ function chgMainWinLoc(strPage) {if $binets|@count}
Binet{if count($binets) > 1}s{/if} : {', '|implode:$profile->getBinetsNames()}
{/if} - {if $owner} - {assign var=groups value=$owner->groupNames(true)} + {if $owner && $view eq 'private'} + {assign var=groups value=$owner->groups(true,true)} {if $groups|@count}
Groupe{if count($groups) > 1}s{/if} et institution{if count($groups) > 1}s{/if} X :
- {foreach from=$groups item=group key=gk}{if $gk != 0}, {/if}{$group.nom}{/foreach} + {foreach from=$groups item=group name=groups}{if !$smarty.foreach.groups.first}, {/if}{$group.nom}{/foreach}
{/if} {/if} {/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}

Sur le web...

{foreach from=$networking item=network} - {$network.name} - {if $network.filter == 'web'} - {$network.address} - {elseif $network.link != ''} - {$network.address} + {$network.name} + {if $network.link} + {$network.address} {else} {$network.address} {/if} @@ -88,10 +87,7 @@ function chgMainWinLoc(strPage)
{if $profile->isFemale()}•{/if} - name_tooltip neq ""}class="hinted" title="{$profile->name_tooltip}"{/if}>{$profile->shortName()} - {if $logged} - {if $profile->nickname} (alias {$profile->nickname}){/if} - {/if} + {if $view eq 'private'}{$profile->private_name}{else}{$profile->public_name}{/if} {if $logged}  {if !$profile->isDead()}{* @@ -110,24 +106,28 @@ function chgMainWinLoc(strPage) {icon name=wrench title="administrer user"} {/if} - {if $owner->login() eq $smarty.session.hruid} + {if $smarty.session.user->isMyProfile($profile)} {icon name="user_edit" title="Modifier ma fiche"} + {elseif hasPerm('admin') || $smarty.session.user->canEdit($profile)} + + {icon name=user_edit title="modifier la fiche"} + {/if} - {/if}
- {if $logged} + {if $logged && $view eq 'private'}
Fiche mise à jour
le {$profile->last_change|date_format}
{/if} - {assign var=phones value=$profile->getPhones(0)} - {if $logged || count($phones) > 0} + {* 121634816 is Profile::PHONE_LINK_PROFILE | Profile::PHONE_TYPE_ANY = 0x7400000 *} + {assign var=phones value=$profile->getPhones(121634816)} + {if ($logged && $view eq 'private') || count($phones) > 0}
- {if $logged} + {if $logged && $view eq 'private'} {/if} {if count($phones) > 0} +
{display_phones tels=$phones dcd=$profile->isDead()} +
{/if}
+ {else} +
{/if}
- {foreach from=$profile->nationalities() item=nat} - {$nat}  + {foreach from=$profile->nationalities() item=country key=code} + {$code}  {/foreach} {$profile->promo()} @@ -166,26 +170,29 @@ function chgMainWinLoc(strPage) [Ma fiche référent] {/if} - {assign var=educations value=$profile->getEducations(64)} + {assign var=educations value=$profile->getEducations(32)} {if count($educations) > 0}  - Formation :
    {foreach from=$educations item=edu} -
  • {display_education edu=$edu profile=$profile}
  • +
  • {display_education edu=$edu profile=$profile full=true}
  • {/foreach}
{/if} {assign var=corps value=$profile->getCorps()} {if $corps && ($corps->current || $corps->original)} -
    +
      {if $corps->current} -
    • {$corps->current_name} {$corps->current_rank} +
    • + Corps actuel : {$corps->current_name} + {if $corps->current_rank}({$corps->current_rank}){/if} +
    • {/if} - {if $corps->original} -
    • {$corps->original_name} + {if $corps->current != $corps->original && $corps->original} +
    • Corps d'origine : {$corps->original_name}
    • {/if} -
    +
{/if}
@@ -208,13 +215,13 @@ function chgMainWinLoc(strPage) {/if} {if $address->hasFlag('current')} {include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" actuelle :" - 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 :" - 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 :" - for="`$profile->firstname` `$profile->lastname`" pos=$pos} + for="`$profile->firstname` `$profile->lastname`" pos=$pos phones=null} {/if} {if $smarty.foreach.addresses.iteration is even}
{/if} {/foreach} @@ -228,8 +235,11 @@ function chgMainWinLoc(strPage) {foreach from=$jobs item="job" key="i"} {if $i neq 0}
{/if} {include file="include/emploi.tpl" job=$job} + {assign var=jobPhones value=$job->phones()} {if $job->address()} - {include file="geoloc/address.tpl" address=$job->address titre="Adresse : " for=$job->company->name pos="left"} + {include file="geoloc/address.tpl" address=$job->address() titre="Adresse : " for=$job->company->name pos="left" phones=$jobPhones} + {elseif $jobPhones|@count neq 0} + {display_phones tels=$jobPhones} {/if}
 
{/foreach}