Fixes module 'admin' (handler 'user') when no login is provided.
[platal.git] / templates / include / minifiche.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2009 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=profile value=$user->profile()}
24 {assign var=dead    value=$profile->deathdate}
25 {if $user->state neq 'pending'}
26 {assign var=registered value=true}
27 {else}
28 {assign var=registered value=false}
29 {/if}
30 {if $smarty.session.auth ge AUTH_COOKIE}
31 {assign var=withAuth value=true}
32 {else}
33 {assign var=withAuth value=false}
34 {/if}
35
36
37 <div class="contact {if (!$registered && $withAuth) || $dead }grayed{/if}"
38      {if $registered && $withAuth}title="fiche mise à jour le {$profile->last_change|date_format}"{/if}>
39   <div class="identity">
40     {if $withAuth}
41     <div class="photo">
42       <img src="photo/{$profile->hrid()}" alt="{$profile->directory_name}" />
43     </div>
44     {/if}
45
46     <div class="nom">
47       {if $profile->isFemale()}&bull;{/if}
48       {if !$dead && (!$registered || $withAuth)}<a href="profile/{$profile->hrid}" class="popup2">{/if}
49       {$profile->full_name}
50       {if !$dead && (!$registered || $withAuth)}</a>{/if}
51     </div>
52
53     <div class="edu">
54       {if $profile->nationality1}
55       <img src='images/flags/{$profile->nationality1}.gif' alt='{$profile->nationality1}' height='11' title='{$profile->nationality1}' />&nbsp;
56       {/if}
57       {if $profile->nationality2}
58       <img src='images/flags/{$profile->nationality2}.gif' alt='{$profile->nationality2}' height='11' title='{$profile->nationality2}' />&nbsp;
59       {/if}
60       {if $profile->nationality3}
61       <img src='images/flags/{$profile->nationality3}.gif' alt='{$profile->nationality3}' height='11' title='{$profile->nationality3}' />&nbsp;
62       {/if}
63       {$profile->promo()}{*
64       *}{iterate from=$profile->getExtraEducations(4) item=edu}, {education_fmt edu=$edu profile=$profile}{/iterate}{*
65       *}{if $dead}, {"décédé"|sex:"décédée":$user} le {$orfile->deathdate|date_format}{/if}
66     </div>
67   </div>
68
69   {if $withAuth}
70   <div class="noprint bits">
71     <div>
72       {if !$registered && !$dead}
73         {if $show_action eq 'ajouter'}
74     <a href="carnet/notifs/add_nonins/{$user->login()}?token={xsrf_token}">{*
75     *}{icon name=add title="Ajouter à la liste de mes surveillances"}</a>
76         {else}
77     <a href="carnet/notifs/del_nonins/{$user->login()}?token={xsrf_token}">{*
78     *}{icon name=cross title="Retirer de la liste de mes surveillances"}</a>
79         {/if}
80       {elseif $registered}
81     <a href="profile/{$profile->hrid()}" class="popup2">{*
82     *}{icon name=user_suit title="Afficher la fiche"}</a>
83         {if !$dead}
84     <a href="vcard/{$profile->hrid()}.vcf">{*
85     *}{icon name=vcard title="Afficher la carte de visite"}</a>
86     <a href="mailto:{$user->bestEmail()}">{*
87     *}{icon name=email title="Envoyer un email"}</a>
88           {if !$smarty.session.user->isContact($user)}
89     <a href="carnet/contacts?action=ajouter&amp;user={$user->login()}&amp;token={xsrf_token}">{*
90     *}{icon name=add title="Ajouter à mes contacts"}</a>
91           {else}
92     <a href="carnet/contacts?action=retirer&amp;user={$user->login()}&amp;token={xsrf_token}">{*
93     *}{icon name=cross title="Retirer de mes contacts"}</a>
94           {/if}
95         {/if}
96       {/if}
97     </div>
98
99     {if hasPerm('admin')}
100     <div>
101       [{if $registered && !$dead}
102       <a href="marketing/private/{$user->login()}">{*
103         *}{icon name=email title="marketter user"}</a>
104       {/if}
105       <a href="admin/user/{$user->login()}">{*
106       *}{icon name=wrench title="administrer user"}</a>
107       <a href="http://www.polytechniciens.com/?page=AX_FICHE_ANCIEN&amp;anc_id={$profile->ax_id}">{*
108       *}{icon name=user_gray title="fiche AX"}</a>]
109     </div>
110     {/if}
111   </div>
112   {/if}
113
114   <div class="long">
115   {if !$dead}
116     {assign var=address value=$profile->getMainAddress()}
117     {assign var=web     value=$profile->getWebSite()}
118     {assign var=job     value=$profile->getMailJob()}
119     {if $web || $profile->mobile || $address.country || $job || (!$dead && !$registered)}
120     <table cellspacing="0" cellpadding="0">
121       {if $web}
122       <tr>
123         <td class="lt">Page web&nbsp;:</td>
124         <td class="rt"><a href="{$web}">{$web}</a></td>
125       </tr>
126       {/if}
127       {if $address.country}
128       <tr>
129         <td class="lt">Géographie&nbsp;:</td>
130         <td class="rt">{if $address.locality}{$address.locality}, {/if}{$address.country}</td>
131       </tr>
132       {/if}
133       {if $profile->mobile && !$dead}
134       <tr>
135         <td class="lt">Mobile&nbsp;:</td>
136         <td class="rt">{$profile->mobile}</td>
137       </tr>
138       {/if}
139       {if $job}
140       <tr>
141         <td class="lt">Profession&nbsp;:</td>
142         <td class="rt">
143           {if $job.url|default:$job.user_site}<a href="{$job.url|default:$job.user_site}">{$job.name}</a>{else}{$job.name}{/if}
144           {if $job.subsubsector}&nbsp;({$job.subsubsector}){/if}{if $job.description}<br />{$job.description}{/if}
145         </td>
146       </tr>
147       {/if}
148       {if $withAuth}
149       {if !$registered}
150       <tr>
151         <td class="smaller" colspan="2">
152           {"Ce"|sex:"Cette":$user} camarade n'est pas {"inscrit"|sex:"inscrite":$user}.
153           <a href="marketing/public/{$user->login()}" class='popup'>Si tu connais son adresse email,
154           <strong>n'hésite pas à nous la transmettre !</a>
155         </td>
156       </tr>
157       {elseif $user->state neq 'disabled' && $user->lost}
158       <tr>
159         <td class="smaller" colspan="2">
160           {"Ce"|sex:"Cette":$user} camarade n'a plus d'adresse de redirection valide.
161           <a href="marketing/broken/{$user->login()}">
162             Si tu en connais une, <strong>n'hésite pas à nous la transmettre</strong>.
163           </a>
164         </td>
165       </tr>
166       {/if}
167       {/if}
168     </table>
169     {/if}
170   {/if}
171   </div>
172 </div>
173
174 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}