| 1 | {**************************************************************************} |
| 2 | {* *} |
| 3 | {* Copyright (C) 2003-2011 Polytechnique.org *} |
| 4 | {* http://opensource.polytechnique.org/ *} |
| 5 | {* *} |
| 6 | {* This program is free software; you can redistribute it and/or modify *} |
| 7 | {* it under the terms of the GNU General Public License as published by *} |
| 8 | {* the Free Software Foundation; either version 2 of the License, or *} |
| 9 | {* (at your option) any later version. *} |
| 10 | {* *} |
| 11 | {* This program is distributed in the hope that it will be useful, *} |
| 12 | {* but WITHOUT ANY WARRANTY; without even the implied warranty of *} |
| 13 | {* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} |
| 14 | {* GNU General Public License for more details. *} |
| 15 | {* *} |
| 16 | {* You should have received a copy of the GNU General Public License *} |
| 17 | {* along with this program; if not, write to the Free Software *} |
| 18 | {* Foundation, Inc., *} |
| 19 | {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} |
| 20 | {* *} |
| 21 | {**************************************************************************} |
| 22 | |
| 23 | {assign var=dead value=$profile->deathdate} |
| 24 | {if $smarty.session.auth ge AUTH_COOKIE} |
| 25 | {assign var=withAuth value=true} |
| 26 | {assign var=user value=$profile->owner()} |
| 27 | {if $user == null} |
| 28 | {assign var=hasowner value=false} |
| 29 | {assign var=registered value=false} |
| 30 | {else} |
| 31 | {assign var=hasowner value=true} |
| 32 | {if $user->state neq 'pending'} |
| 33 | {assign var=registered value=true} |
| 34 | {else} |
| 35 | {assign var=registered value=false} |
| 36 | {/if} |
| 37 | {/if} |
| 38 | {else} |
| 39 | {* Without auth, all profiles appear as registered and with owner *} |
| 40 | {assign var=hasowner value=true} |
| 41 | {assign var=registered value=true} |
| 42 | {assign var=withAuth value=false} |
| 43 | {/if} |
| 44 | |
| 45 | <div class="contact {if !$registered || $dead }grayed{/if}" |
| 46 | {if $registered}title="fiche mise à jour le {$profile->last_change|date_format}"{/if}> |
| 47 | <div class="nom"> |
| 48 | {if $profile->isFemale()}•{/if} |
| 49 | {if !$dead && $registered}<a href="profile/{$profile->hrid()}" class="popup2">{/if} |
| 50 | {$profile->full_name} |
| 51 | {if !$dead && $registered}</a>{/if} |
| 52 | </div> |
| 53 | <div class="autre"> |
| 54 | {foreach from=$profile->nationalities() item=country key=code} |
| 55 | <img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' /> |
| 56 | {/foreach} |
| 57 | {$profile->promo()}{* |
| 58 | *}{if $dead}, {"décédé"|sex:"décédée":$profile} le {$profile->deathdate|date_format}{/if} |
| 59 | {if $withAuth} |
| 60 | {if $registered || (!$dead && $hasowner)} |
| 61 | {if !$registered && !$dead && $hasowner} |
| 62 | {if !$smarty.session.user->isWatchedUser($profile)} |
| 63 | <a href="carnet/notifs/add_nonins/{$user->login()}?token={xsrf_token}">{* |
| 64 | *}{icon name=add title="Ajouter à la liste de mes surveillances"}</a> |
| 65 | {else} |
| 66 | <a href="carnet/notifs/del_nonins/{$user->login()}?token={xsrf_token}">{* |
| 67 | *}{icon name=cross title="Retirer de la liste de mes surveillances"}</a> |
| 68 | {/if} |
| 69 | {elseif $registered} |
| 70 | {if !$dead} |
| 71 | <a href="vcard/{$profile->hrid()}.vcf">{* |
| 72 | *}{icon name=vcard title="Afficher la carte de visite"}</a> |
| 73 | {if !$smarty.session.user->isContact($profile)} |
| 74 | <a href="carnet/contacts?action=ajouter&user={$profile->hrid()}&token={xsrf_token}">{* |
| 75 | *}{icon name=add title="Ajouter à mes contacts"}</a> |
| 76 | {else} |
| 77 | <a href="carnet/contacts?action=retirer&user={$profile->hrid()}&token={xsrf_token}">{* |
| 78 | *}{icon name=cross title="Retirer de mes contacts"}</a> |
| 79 | {/if} |
| 80 | {/if} |
| 81 | {/if} |
| 82 | {/if} |
| 83 | {/if} |
| 84 | </div> |
| 85 | <div class="long"> |
| 86 | {if !$dead} |
| 87 | {assign var=address value=$profile->getMainAddress()} |
| 88 | {if $profile->mobile || ($address && $address->country)} |
| 89 | <table cellspacing="0" cellpadding="0"> |
| 90 | {if $address && $address->country} |
| 91 | <tr> |
| 92 | <td class="lt">Géographie :</td> |
| 93 | <td class="rt">{if $address->locality}{$address->locality}, {/if}{$address->country}</td> |
| 94 | </tr> |
| 95 | {/if} |
| 96 | {if $profile->mobile && !$dead} |
| 97 | <tr> |
| 98 | <td class="lt">Mobile :</td> |
| 99 | <td class="rt">{$profile->mobile}</td> |
| 100 | </tr> |
| 101 | {/if} |
| 102 | </table> |
| 103 | {/if} |
| 104 | {/if} |
| 105 | </div> |
| 106 | </div> |
| 107 | |
| 108 | {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} |