{**************************************************************************}
{* *}
-{* Copyright (C) 2003-2006 Polytechnique.org *}
+{* Copyright (C) 2003-2010 Polytechnique.org *}
{* http://opensource.polytechnique.org/ *}
{* *}
{* This program is free software; you can redistribute it and/or modify *}
{* *}
{**************************************************************************}
+{assign var=dead value=$profile->deathdate}
+{if $smarty.session.auth ge AUTH_COOKIE}
+ {assign var=withAuth value=true}
+ {assign var=user value=$profile->owner()}
+ {if $user == null}
+ {assign var=hasowner value=false}
+ {assign var=registered value=false}
+ {else}
+ {assign var=hasowner value=true}
+ {if $user->state neq 'pending'}
+ {assign var=registered value=true}
+ {else}
+ {assign var=registered value=false}
+ {/if}
+ {/if}
+{else}
+ {* Without auth, all profiles appear as registered and with owner *}
+ {assign var=hasowner value=true}
+ {assign var=registered value=true}
+ {assign var=withAuth value=false}
+{/if}
-{if !$c.inscrit || $c.dcd}<div class='grayed'>{/if}
-<div class="contact" {if $c.inscrit}{min_auth level='cookie'}title="fiche mise à jour le {$c.date|date_format}"{/min_auth}{/if}>
-
- <div class="nom">
- {if $c.sexe}•{/if}
- {if !$c.dcd && $c.inscrit}<a href="{rel}/profile/{$c.forlife}" class="popup2">{/if}
- {if $c.nom_usage}{$c.nom_usage} {$c.prenom}<br />({$c.nom}){else}{$c.nom} {$c.prenom}{/if}
- {if !$c.dcd && $c.inscrit}</a>{/if}
- </div>
- <div class="appli">
- {if $c.iso3166}
- <img src='{rel}/images/flags/{$c.iso3166}.gif' alt='{$c.nat}' height='11' title='{$c.nat}' />
+<div class="contact {if !$registered || $dead }grayed{/if}"
+ {if $registered}title="fiche mise à jour le {$profile->last_change|date_format}"{/if}>
+ <div class="identity">
+ {if $withAuth}
+ <div class="photo">
+ <img src="photo/{$profile->hrid()}" alt="{$profile->directory_name}" />
+ </div>
{/if}
- (X {$c.promo}{if $c.app0text}, {applis_fmt type=$c.app0type text=$c.app0text url=$c.app0url}
- {/if}{if $c.app1text}, {applis_fmt type=$c.app1type text=$c.app1text url=$c.app1url}{/if})
- {if $c.dcd}décédé{if $c.sexe}e{/if} le {$c.deces|date_format}{/if}
- {min_auth level="cookie"}
- {if !$c.dcd && !$c.wasinscrit}
- <a href="{rel}/marketing/public/{$c.user_id}" class='popup'>clique ici si tu connais son adresse email !</a>
- {/if}
- {/min_auth}
+
+ <div class="nom">
+ {if $profile->isFemale()}•{/if}
+ {if !$dead && $registered}<a href="profile/{$profile->hrid()}" class="popup2">{/if}
+ {$profile->directory_name}
+ {if !$dead && $registered}</a>{/if}
+ </div>
+
+ <div class="edu">
+ {foreach from=$profile->nationalities() item=country key=code}
+ <img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />
+ {/foreach}
+ {$profile->promo()}{*
+ *}{foreach from=$profile->getExtraEducations(4) item=edu}, {display_education edu=$edu profile=$profile full=false}{/foreach}{*
+ *}{if $dead}, {"décédé"|sex:"décédée":$profile} le {$profile->deathdate|date_format}{/if}
+ </div>
</div>
- <div class="bits">
- {min_auth level="cookie"}
- {if !$c.wasinscrit && !$c.dcd}
- {if $show_action eq ajouter}
- <a href="{rel}/carnet/notifs/add_nonins/{$c.user_id}">{*
- *}<img src="{rel}/images/ajouter.gif" alt="Ajouter à la liste de mes surveillances" title="Ajouter à la liste de mes surveillances" /></a>
- {else}
- <a href="{rel}/carnet/notifs/del_nonins/{$c.user_id}">{*
- *}<img src="{rel}/images/retirer.gif" alt="Retirer de la liste de mes surveillances" title="Retirer de la liste de mes surveillances" /></a>
- {/if}
- {elseif $c.wasinscrit}
- <a href="{rel}/profile/{$c.forlife}" class="popup2">{*
- *}<img src="{rel}/images/loupe.gif" alt="Afficher la fiche" title="Afficher la fiche" /></a>
- {if !$c.dcd}
- <a href="{rel}/vcard/{$c.forlife}.vcf">{*
- *}<img src="{rel}/images/vcard.png" alt="Afficher la carte de visite" title="Afficher la carte de visite" /></a>
- <a href="{rel}/carnet/contacts?action={$show_action}&user={$c.forlife}">{*
- *}<img src="{rel}/images/{$show_action}.gif" alt="{if $show_action eq "ajouter"}Ajouter à mes{else}Retirer de mes{/if} contacts"
- title="{if $show_action eq "ajouter"}Ajouter à mes{else}Retirer de mes{/if} contacts" /></a>
+ {if $withAuth}
+ <div class="noprint bits">
+ {if $registered || (!$dead && $hasowner)}
+ <div>
+ {if !$registered && !$dead && $hasowner}
+ {if !$smarty.session.user->isWatchedUser($profile)}
+ <a href="carnet/notifs/add_nonins/{$user->login()}?token={xsrf_token}">{*
+ *}{icon name=add title="Ajouter à la liste de mes surveillances"}</a>
+ {else}
+ <a href="carnet/notifs/del_nonins/{$user->login()}?token={xsrf_token}">{*
+ *}{icon name=cross title="Retirer de la liste de mes surveillances"}</a>
+ {/if}
+ {elseif $registered}
+ <a href="profile/{$profile->hrid()}" class="popup2">{*
+ *}{icon name=user_suit title="Afficher la fiche"}</a>
+ {if !$dead}
+ <a href="vcard/{$profile->hrid()}.vcf">{*
+ *}{icon name=vcard title="Afficher la carte de visite"}</a>
+ <a href="mailto:{$user->bestEmail()}">{*
+ *}{icon name=email title="Envoyer un email"}</a>
+ {if !$smarty.session.user->isContact($profile)}
+ <a href="carnet/contacts?action=ajouter&user={$profile->hrid()}&token={xsrf_token}">{*
+ *}{icon name=add title="Ajouter à mes contacts"}</a>
+ {else}
+ <a href="carnet/contacts?action=retirer&user={$profile->hrid()}&token={xsrf_token}">{*
+ *}{icon name=cross title="Retirer de mes contacts"}</a>
+ {/if}
+ {/if}
{/if}
+ </div>
{/if}
- {/min_auth}
- {perms level='admin'}
- {if !$c.wasinscrit && !$c.dcd}
- <a href="{rel}/marketing/private/{$c.user_id}">{*
- *}<img src="{rel}/images/admin.png" alt='admin' title="marketter user" /></a>
- {elseif $c.wasinscrit}
- <a href="{rel}/admin/utilisateurs.php?login={$c.forlife}">{*
- *}<img src="{rel}/images/admin.png" alt='admin' title="administrer user" /></a>
+ {if hasPerm('admin') && $hasowner}
+ <div>
+ [{if $registered && !$dead}
+ <a href="marketing/private/{$user->login()}">{*
+ *}{icon name=email title="marketter user"}</a>
{/if}
- <a href="http://www.polytechniciens.com/index.php?page=AX_FICHE_ANCIEN&anc_id={$c.matricule_ax}">{*
- *}<img src="{rel}/images/ax.png" alt='AX' title="fiche AX" /></a>
- {/perms}
+ <a href="admin/user/{$user->login()}">{*
+ *}{icon name=wrench title="administrer user"}</a>
+ <a href="profile/ax/{$user->login()}">{*
+ *}{icon name=user_gray title="fiche AX"}</a>]
+ </div>
+ {/if}
</div>
+ {/if}
<div class="long">
- {if $c.wasinscrit}
- {if $c.web || $c.mobile || $c.countrytxt || $c.city || $c.region || $c.entreprise || $c.freetext}
+ {if !$dead}
+ {assign var=address value=$profile->getMainAddress()}
+ {assign var=web value=$profile->getWebSite()}
+ {assign var=job value=$profile->getMainJob()}
+ {if $web || $profile->mobile || ($address && $address->country) || $job || !$registered || $user->lost}
<table cellspacing="0" cellpadding="0">
- {if $c.web}
+ {if $web}
<tr>
- <td class="lt">Page web:</td>
- <td class="rt"><a href="{$c.web}">{$c.web}</a></td>
+ <td class="lt">{$web.name} :</td>
+ <td class="rt"><a href="{$web.address}">{$web.address}</a></td>
</tr>
{/if}
- {if $c.countrytxt || $c.city}
+ {if $address && $address->country}
<tr>
- <td class="lt">Géographie:</td>
- <td class="rt">{$c.city}{if $c.city && $c.countrytxt}, {/if}{$c.countrytxt}</td>
+ <td class="lt">Géographie :</td>
+ <td class="rt">{if $address->locality}{$address->locality}, {/if}{$address->country}</td>
</tr>
{/if}
- {if $c.mobile}
+ {if $profile->mobile && !$dead}
<tr>
- <td class="lt">Mobile:</td>
- <td class="rt">{$c.mobile}</td>
+ <td class="lt">Mobile :</td>
+ <td class="rt">{$profile->mobile}</td>
</tr>
{/if}
- {if $c.entreprise}
+ {if $job}
<tr>
- <td class="lt">Profession:</td>
+ <td class="lt">Profession :</td>
<td class="rt">
- {$c.entreprise} {if $c.secteur}({$c.secteur}){/if}
- {if $c.fonction}<br />{$c.fonction}{/if}
+ {if $job->company->url|default:$job->user_site}<a href="{$job->company->url|default:$job->user_site}">{$job->company->name}</a>{else}{$job->company->name}{/if}
+ {if $job->subsubsector} ({$job->subsubsector}){/if}{if $job->description}<br />{$job->description}{/if}
</td>
</tr>
{/if}
- {if $c.freetext}
+ {if $withAuth}
+ {if !$registered && $hasowner}
+ <tr>
+ <td class="smaller" colspan="2">
+ {"Ce"|sex:"Cette":$profile} camarade n'est pas {"inscrit"|sex:"inscrite":$profile}.
+ <a href="marketing/public/{$user->login()}" class='popup'>Si tu connais son adresse email,
+ <strong>n'hésite pas à nous la transmettre !</strong></a>
+ </td>
+ </tr>
+ {elseif $user->state neq 'disabled' && $user->lost}
<tr>
- <td class="lt">Commentaire:</td>
- <td class="rt">{$c.freetext|nl2br}</td>
+ <td class="smaller" colspan="2">
+ {"Ce"|sex:"Cette":$profile} camarade n'a plus d'adresse de redirection valide.
+ <a href="marketing/broken/{$user->login()}">
+ Si tu en connais une, <strong>n'hésite pas à nous la transmettre</strong>.
+ </a>
+ </td>
</tr>
{/if}
+ {/if}
</table>
{/if}
{/if}
</div>
-
</div>
-{if !$c.inscrit || $c.dcd}</div>{/if}
-{* vim:set et sw=2 sts=2 sws=2: *}
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}