d493cf50800caf20594b920db81ed36a00c6d219
[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
65       {if $c.eduname0}, {education_fmt name=$c.eduname0 url=$c.eduurl0 degree=$c.edudegree0
66                                      grad_year=$c.edugrad_year0 field=$c.edufield0 program=$c.eduprogram0 sexe=$c.sexe}{*
67       *}{/if}{if $c.eduname1}, {education_fmt name=$c.eduname1 url=$c.eduurl1 degree=$c.edudegree1
68                                      grad_year=$c.edugrad_year1 field=$c.edufield1 program=$c.eduprogram1 sexe=$c.sexe}{*
69       *}{/if}{if $c.eduname2}, {education_fmt name=$c.eduname2 url=$c.eduurl2 degree=$c.edudegree2
70                                      grad_year=$c.edugrad_year2 field=$c.edufield2 program=$c.eduprogram2 sexe=$c.sexe}{*
71       *}{/if}{if $c.eduname3}, {education_fmt name=$c.eduname3 url=$c.eduurl3 degree=$c.edudegree3
72                                      grad_year=$c.edugrad_year3 field=$c.edufield3 program=$c.eduprogram3 sexe=$c.sexe}{*
73       *}{/if}{if $c.dcd}, décédé{if $c.sexe}e{/if} le {$c.deces|date_format}{/if}
74     </div>
75   </div>
76
77   {if $withAuth}
78   <div class="noprint bits">
79     <div>
80       {if $registered && !$dead}
81         {if $show_action eq ajouter}
82     <a href="carnet/notifs/add_nonins/{$user->login()}?token={xsrf_token}">{*
83     *}{icon name=add title="Ajouter à la liste de mes surveillances"}</a>
84         {else}
85     <a href="carnet/notifs/del_nonins/{$user->login()}?token={xsrf_token}">{*
86     *}{icon name=cross title="Retirer de la liste de mes surveillances"}</a>
87         {/if}
88       {elseif $user->state neq 'pending'}
89     <a href="profile/{$profile->hrid()}" class="popup2">{*
90     *}{icon name=user_suit title="Afficher la fiche"}</a>
91         {if !$dead}
92     <a href="vcard/{$profile->hrid()}.vcf">{*
93     *}{icon name=vcard title="Afficher la carte de visite"}</a>
94     <a href="mailto:{$user->bestEmail()}">{*
95     *}{icon name=email title="Envoyer un email"}</a>
96           {if !$smarty.session.user->isContact($user)}
97     <a href="carnet/contacts?action=ajouter&amp;user={$user->login()}&amp;token={xsrf_token}">{*
98     *}{icon name=add title="Ajouter à mes contacts"}</a>
99           {else}
100     <a href="carnet/contacts?action=retirer&amp;user={$user->login()}&amp;token={xsrf_token}">{*
101     *}{icon name=cross title="Retirer de mes contacts"}</a>
102           {/if}
103         {/if}
104       {/if}
105     </div>
106
107     {if hasPerm('admin')}
108     <div>
109       [{if $registered && !$dead}
110       <a href="marketing/private/{$user->login()}">{*
111         *}{icon name=email title="marketter user"}</a>
112       {/if}
113       <a href="admin/user/{$user->login()}">{*
114       *}{icon name=wrench title="administrer user"}</a>
115       <a href="http://www.polytechniciens.com/?page=AX_FICHE_ANCIEN&amp;anc_id={$profile->ax_id}">{*
116       *}{icon name=user_gray title="fiche AX"}</a>]
117     </div>
118     {/if}
119   </div>
120   {/if}
121
122   <div class="long">
123   {if !$dead}
124     {if $c.web || $c.mobile || $c.countrytxt || $c.city || $c.region || $c.entreprise || (!$c.dcd && !$c.actif )}
125     <table cellspacing="0" cellpadding="0">
126       {if $c.web}
127       <tr>
128         <td class="lt">Page web&nbsp;:</td>
129         <td class="rt"><a href="{$c.web}">{$c.web}</a></td>
130       </tr>
131       {/if}
132       {if $c.countrytxt || $c.city}
133       <tr>
134         <td class="lt">Géographie&nbsp;:</td>
135         <td class="rt">{$c.city}{if $c.city && $c.countrytxt}, {/if}{$c.countrytxt}</td>
136       </tr>
137       {/if}
138       {if $c.mobile && !$dead}
139       <tr>
140         <td class="lt">Mobile&nbsp;:</td>
141         <td class="rt">{$c.mobile}</td>
142       </tr>
143       {/if}
144       {if $c.entreprise}
145       <tr>
146         <td class="lt">Profession&nbsp;:</td>
147         <td class="rt">
148           {if $c.job_web}<a href="{$c.job_web}">{$c.entreprise}</a>{else}{$c.entreprise}{/if}
149           {if $c.secteur} ({$c.secteur}){/if}{if $c.fonction}<br />{$c.fonction}{/if}
150         </td>
151       </tr>
152       {/if}
153       {if $withAuth}
154       {if !$registered}
155       <tr>
156         <td class="smaller" colspan="2">
157           {"Ce"|sex:"Cette":$user} camarade n'est pas {"inscrit"|sex:"inscrite":$user}.
158           <a href="marketing/public/{$user->login()}" class='popup'>Si tu connais son adresse email,
159           <strong>n'hésite pas à nous la transmettre !</a>
160         </td>
161       </tr>
162       {elseif $user->state neq 'disabled' && $user->lost}
163       <tr>
164         <td class="smaller" colspan="2">
165           {"Ce"|sex:"Cette":$user} camarade n'a plus d'adresse de redirection valide.
166           <a href="marketing/broken/{$user->login()}">
167             Si tu en connais une, <strong>n'hésite pas à nous la transmettre</strong>.
168           </a>
169         </td>
170       </tr>
171       {/if}
172       {/if}
173     </table>
174     {/if}
175   {/if}
176   </div>
177 </div>
178
179 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}