{**************************************************************************}
{* *}
-{* Copyright (C) 2003-2010 Polytechnique.org *}
+{* Copyright (C) 2003-2011 Polytechnique.org *}
{* http://opensource.polytechnique.org/ *}
{* *}
{* This program is free software; you can redistribute it and/or modify *}
<script type="text/javascript">//<![CDATA[
function chgMainWinLoc(strPage)
{
- strPage = platal_baseurl + strPage;
+ strPage = $.plURL(strPage);
if (parent.opener) {
try {
parent.opener.document.location = strPage;
document.location = strPage;
}
}
+
+$($.closeOnEsc);
+
//]]></script>
{/literal}
-
<div id="fiche">
<div id="photo" class="part">
- {if $photo_url}<img alt="Photo de {$user->login()}" src="{$photo_url}" width="{$x.x}"/>{/if}
- {if $logged && ( $x.section|smarty:nodefaults || $x.binets_join|smarty:nodefaults || $x.gpxs_join|smarty:nodefaults)}
+ {assign var=photo value=$profile->getPhoto(false)}
+ {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->isVisible(#Visibility::EXPORT_AX#) && ( $profile->section|smarty:nodefaults || $profile->getBinets()|smarty:nodefaults || ($owner && $owner->groups(true,true)|smarty:nodefaults))}
<h2>À l'X…</h2>
- {if $x.section}<div><em class="intitule">Section : </em><span>{$x.section}</span></div>{/if}
- {if $x.binets_join}<div><em class="intitule">Binet{if count($x.binets) > 1}s{/if} : </em>
- <span>{$x.binets_join}</span></div>{/if}
- {if $x.gpxs_join}<div><em class="intitule">Groupe{if count($x.gpxs) > 1}s{/if} et institution{if count($x.gpxs) > 1}s{/if} X : </em>
- <span><br/>{$x.gpxs_join|smarty:nodefaults}</span></div>{/if}
+ {if $profile->section}<div><em class="intitule">Section : </em><span>{$profile->section}</span></div>{/if}
+
+ {assign var=binets value=$profile->getBinets()}
+ {if $binets|@count}<div><em class="intitule">Binet{if count($binets) > 1}s{/if} : </em>
+ <span>{', '|implode:$profile->getBinetsNames()}</span></div>{/if}
+
+ {if $owner && $view->isVisible(#Visibility::EXPORT_AX#)}
+ {assign var=groups value=$owner->groups(true,true)}
+ {if $groups|@count}<div><em class="intitule">Groupe{if count($groups) > 1}s{/if} et institution{if count($groups) > 1}s{/if} X : </em>
+ <span><br/>
+ {foreach from=$groups item=group name=groups}
+ {if !$smarty.foreach.groups.first}, {/if}
+ <span title="{$group.nom}"><a href="{if $group.site}{$group.site}{else}http://www.polytechnique.net/{$group.nom}{/if}">{$group.nom}</a></span>
+ {/foreach}
+ </span></div>{/if}
+ {/if}
+
{/if}
- {if $x.freetext}
- <h2>Commentaires :</h2>
- <span>{$x.freetext|miniwiki|smarty:nodefaults}</span>
+
+ {assign var=networking value=$profile->getNetworking(#Profile::NETWORKING_ALL#)}
+ {if count($networking) > 0}
+ <h2>Sur le web...</h2>
+ {foreach from=$networking item=network}
+ <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}
+ <br/>
+ {/foreach}
{/if}
+
+ {if $profile->freetext}
+ <h2>Commentaires :</h2>
+ <span>{$profile->freetext|miniwiki|smarty:nodefaults}</span>
+ {/if}
+
</div>
+
<div id="fiche_identite" class="part">
<div class="civilite">
- {if $user->isFemale()}•{/if}
- {$user->fullName()}{if $x.nom_usage neq ""} ({$x.nom}){/if}
- {if $logged}
- {if $x.nickname} (alias {$x.nickname}){/if}
- {/if}
- {if $x.web} <a href="{$x.web}">{icon name="world_go" title="Site Web"}</a>{/if}
+ {if $profile->isFemale()}•{/if}
+ {if $view->isVisible(#Visibility::EXPORT_PRIVATE#)}{$profile->private_name}{else}{$profile->public_name}{/if}
+
{if $logged}
- {if !$x.dcd}<a href="vcard/{$user->login()}.vcf">{*
- *}{icon name=vcard title="Afficher la carte de visite"}</a>{/if}
- {if !$x.is_contact}
- <a href="javascript:chgMainWinLoc('carnet/contacts?action=ajouter&user={$user->login()}&token={xsrf_token}')">
- {icon name=add title="Ajouter à mes contacts"}</a>
- {else}
- <a href="javascript:chgMainWinLoc('carnet/contacts?action=retirer&user={$user->login()}&token={xsrf_token}')">
- {icon name=cross title="Retirer de mes contacts"}</a>
- {/if}
- {if hasPerm('admin')}
- <a href="javascript:chgMainWinLoc('admin/user/{$user->login()}')">
- {icon name=wrench title="administrer user"}</a>
- {/if}
- {if $user->login() eq $smarty.session.hruid}
- <a href="javascript:chgMainWinLoc('profile/edit')">{icon name="user_edit" title="Modifier ma fiche"}</a>
- {/if}
+ {if !$profile->isDead()}<a href="vcard/{$owner->login()}.vcf">{*
+ *}{icon name=vcard title="Afficher la carte de visite"}</a>{/if}
+
+ {if !$smarty.session.user->isContact($profile)}
+ <a href="javascript:chgMainWinLoc('carnet/contacts?action=ajouter&user={$owner->login()}&token={xsrf_token}')">
+ {icon name=add title="Ajouter à mes contacts"}</a>
+ {else}
+ <a href="javascript:chgMainWinLoc('carnet/contacts?action=retirer&user={$owner->login()}&token={xsrf_token}')">
+ {icon name=cross title="Retirer de mes contacts"}</a>
+ {/if}
+
+ {if hasPerm('admin')}
+ <a href="javascript:chgMainWinLoc('admin/user/{$owner->login()}')">
+ {icon name=wrench title="administrer user"}</a>
+ {/if}
+
+ {if $smarty.session.user->isMyProfile($profile)}
+ <a href="javascript:chgMainWinLoc('profile/edit')">{icon name="user_edit" title="Modifier ma fiche"}</a>
+ {elseif hasPerm('admin') || $smarty.session.user->canEdit($profile)}
+ <a href="javascript:chgMainWinLoc('profile/edit/{$profile->hrpid}')">
+ {icon name=user_edit title="modifier la fiche"}
+ </a>
+ {/if}
{/if}
</div>
- {if $logged}
+
+ {if $logged && $view->isVisible(#Visibility::EXPORT_AX#) && $owner && $owner->state eq 'active'}
<div class='maj'>
Fiche mise à jour<br />
- le {$x.date|date_format}
+ le {$profile->last_change|date_format}
</div>
{/if}
- {if $logged || $x.mobile}
+
+ {* 121634816 is Profile::PHONE_LINK_PROFILE | Profile::PHONE_TYPE_ANY = 0x7400000 *}
+ {assign var=phones value=$profile->getPhones(121634816)}
+ {if ($logged && $view->isVisible(#Visibility::EXPORT_AX#)) || count($phones) > 0}
<div class="contact">
- {if $logged}
+ {if $logged && $view->isVisible(#Visibility::EXPORT_AX#)}
<div class='email'>
- {if $x.dcd}
- Décédé{if $user->isFemale()}e{/if} le {$x.deces|date_format}
- {elseif !$x.actif}
- Ce{if $c.sexe}tte{/if} camarade n'a plus d'adresse de redirection valide,<br />
- <a href="marketing/broken/{$user->login()}" class="popup">clique ici si tu connais son adresse email !</a>
- {elseif !$x.inscrit}
+ {if $profile->isDead()}
+ Décédé{if $profile->isFemale()}e{/if} le {$profile->deathdate|date_format}
+ {elseif $owner && $owner->lost}
+ Ce{if $profile->isFemale()}tte{/if} camarade n'a plus d'adresse de redirection valide,<br />
+ <a href="marketing/broken/{$owner->login()}" class="popup">clique ici si tu connais son adresse email !</a>
+ {elseif $owner && $owner->state != 'active'}
Cette personne n'est pas inscrite à Polytechnique.org,<br />
- <a href="marketing/public/{$user->login()}" class="popup">clique ici si tu connais son adresse email !</a>
+ <a href="marketing/public/{$owner->login()}" class="popup">clique ici si tu connais son adresse email !</a>
{else}
- {if $virtualalias}
+ {if $virtualalias && $view->isVisible(#Visibility::EXPORT_PRIVATE#)}
<a href="mailto:{$virtualalias}">{$virtualalias}</a><br />
{/if}
- <a href="mailto:{$user->bestEmail()}">{$user->bestEmail()}</a>
- {if $user->bestEmail() neq $user->forlifeEmail()}<br />
- <a href="mailto:{$user->forlifeEmail()}">{$user->forlifeEmail()}</a>
+ <a href="mailto:{$owner->bestEmail()}">{$owner->bestEmail()}</a>
+ {if $owner->bestEmail() neq $owner->forlifeEmail()}<br />
+ <a href="mailto:{$owner->forlifeEmail()}">{$owner->forlifeEmail()}</a>
{/if}
{/if}
</div>
{/if}
- {if $x.mobile}
- <div class="mob">
- <em class="intitule">{if $x.dcd}Dernier m{else}M{/if}obile : </em>{$x.mobile}
+ {if count($phones) > 0}
+ <div style="float: right">
+ {display_phones tels=$phones dcd=$profile->isDead()}
</div>
{/if}
<div class='spacer'></div>
</div>
+ {else}
+ <div class='spacer'></div>
{/if}
+
<div class='formation'>
- {if $x.iso3166}
- <img src='images/flags/{$x.iso3166}.gif' alt='{$x.nationalite}' height='11' title='{$x.nationalite}' />
- {/if}
- X {$user->promo()}
- {if $x.promo_sortie && ($x.promo_sortie-3 > $x.promo)}
- - X {math equation="a-b" a=$x.promo_sortie b=3}
+ {foreach from=$profile->nationalities() item=country key=code}
+ <img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />
+ {/foreach}
+
+ {$profile->promo('details')}
+
+ {if $logged && $view->isVisible(#Visibility::EXPORT_AX#) && $profile->mentor_expertise}
+ [<a href="referent/{$profile->hrid()}" class='popup2'>Ma fiche référent</a>]
{/if}
- {if $x.applis_join}
- - Formation : {$x.applis_join|smarty:nodefaults}
+
+ {assign var=educations value=$profile->getEducations(32)}
+ {if count($educations) > 0}
+ <ul>
+ {foreach from=$educations item=edu}
+ <li>{display_education edu=$edu profile=$profile full=true}</li>
+ {/foreach}
+ </ul>
{/if}
- {if $logged && $x.is_referent}
- [<a href="referent/{$user->login()}" class='popup2'>Ma fiche référent</a>]
+
+ {assign var=corps value=$profile->getCorps()}
+ {if $corps && ($corps->current || $corps->original)}
+ <ul>
+ {if $corps->current}
+ <li>
+ Corps actuel : {$corps->current_name}
+ {if $corps->current_rank}({$corps->current_rank}){/if}
+ </li>
+ {/if}
+ {if $corps->current != $corps->original && $corps->original}
+ <li>Corps d'origine : {$corps->original_name}</li>
+ {/if}
+ </ul>
{/if}
+
</div>
</div>
- {if $x.adr}
+
+ {assign var=addr value=$profile->getAddresses(3)}
+ {if count($addr) > 0}
<div class="part">
<h2>Contact : </h2>
- {if $x.dcd}
+ {if $profile->isDead()}
{assign var=address_name value="Dernière adresse"}
{else}
{assign var=address_name value="Adresse"}
{/if}
- {foreach from=$x.adr item="address" name=adresses}
- {if $smarty.foreach.adresses.iteration is even}
+ {foreach from=$addr item="address" name=addresses}
+ {if $smarty.foreach.addresses.iteration is even}
{assign var=pos value="right"}
{else}
{assign var=pos value="left"}
{/if}
- {if $address.active}
+ {if $address->hasFlag('current')}
{include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" actuelle :"
- for="`$x.prenom` `$x.nom`" pos=$pos}
- {elseif $address.secondaire}
+ 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="`$x.prenom` `$x.nom`" 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="`$x.prenom` `$x.nom`" pos=$pos}
+ for="`$profile->firstname` `$profile->lastname`" pos=$pos phones=null}
{/if}
- {if $smarty.foreach.adresses.iteration is even}<div class="spacer"></div>{/if}
+ {if $smarty.foreach.addresses.iteration is even}<div class="spacer"></div>{/if}
{/foreach}
</div>
{/if}
- {if $x.adr_pro}
+
+ {assign var=jobs value=$profile->getJobs(2)}
+ {if count($jobs) > 0}
<div class="part">
<h2>Informations professionnelles :</h2>
- {foreach from=$x.adr_pro item="address" key="i"}
+ {foreach from=$jobs item="job" key="i"}
{if $i neq 0}<hr />{/if}
- {include file="include/emploi.tpl" address=$address}
- {include file="geoloc/address.tpl" address=$address titre="Adresse : " for=$address.entreprise pos="left"}
+ {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" phones=$jobPhones}
+ {elseif $jobPhones|@count neq 0}
+ {display_phones tels=$jobPhones}
+ {/if}
<div class="spacer"> </div>
{/foreach}
</div>
{/if}
- {if $x.medals}
- <div class="part">
- <h2>Distinctions : </h2>
- {foreach from=$x.medals item=m}
- <div class="medal_frame">
- <img src="profile/medal/thumb/{$m.id}" height="50px" alt="{$m.medal}" title="{$m.medal}" style='float: left;' />
- <div class="medal_text">
- {$m.medal}<br />{$m.grade}
+
+ {assign var=medals value=$profile->getMedals()}
+ {if count($medals) > 0}
+ <div class="part">
+ <h2>Distinctions : </h2>
+ {foreach from=$medals item=m}
+ <div class="medal_frame">
+ <img src="profile/medal/thumb/{$m.mid}" height="50px" alt="{$m.text}" title="{$m.text}" style='float: left;' />
+ <div class="medal_text">
+ {$m.text}{if $m.level} ({$m.level}){/if}<br />{$m.grade}
+ </div>
</div>
+ {/foreach}
+ <div class="spacer"> </div>
</div>
- {/foreach}
- <div class="spacer"> </div>
- </div>
{/if}
- {if $logged && $x.cv}
+
+ {if $logged && $profile->cv}
<div class="part">
<h2>Curriculum Vitae :</h2>
- {$x.cv|miniwiki:title|smarty:nodefaults}
+ {$profile->cv|miniwiki:title|smarty:nodefaults}
</div>
{/if}
- {if $view eq 'public'}
+
+ {if $view->level() eq #Visibility::VIEW_PUBLIC#}
<div class="part">
<small>
Cette fiche est publique et visible par tout internaute,<br />
- vous pouvez aussi voir <a href="profile/private/{$user->login()}?display=light">celle réservée aux X</a>.
+ vous pouvez aussi voir <a href="profile/private/{$profile->hrid()}?display=light">celle réservée aux X</a>.
</small>
</div>
- {elseif $view eq 'ax'}
+ {elseif $view->level() eq #Visibility::VIEW_AX#}
<div class="part">
<small>
Cette fiche est privée et ne recense que les informations transmises à l'AX.
</small>
</div>
{/if}
+
<div class="spacer"></div>
</div>