Start porting userset to userfilter architecture.
[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 <div class="contact {if ($user->state eq 'pending' && $smarty.session.auth ge AUTH_COOKIE) || $profile->deathdate}grayed{/if}"
25      {if $user->state neq 'pending'}{if $smarty.session.auth ge AUTH_COOKIE}title="fiche mise à jour le {$profile->last_change|date_format}"{/if}{/if}>
26   <div class="identity">
27     {if $smarty.session.auth ge AUTH_COOKIE}
28     <div class="photo">
29       <img src="photo/{$profile->hrid()}"
30            alt="{$profile->directory_name}" />
31     </div>
32     {/if}
33
34     <div class="nom">
35       {if $profile->isFemale()}&bull;{/if}
36       {if !$profile->deathdate && ($user->state neq 'pending' || $smarty.session.auth eq AUTH_PUBLIC)}<a href="profile/{$profile->hrid}" class="popup2">{/if}
37       {$profile->full_name}
38       {if !$profile->deathdate && ($user->state neq 'pending' || $smarty.session.auth eq AUTH_PUBLIC)}</a>{/if}
39     </div>
40
41     <div class="edu">
42       {if $profile->nationality1}
43       <img src='images/flags/{$profile->nationality1}.gif' alt='{$profile->nationality1}' height='11' title='{$profile->nationality1}' />&nbsp;
44       {/if}
45       {if $profile->nationality2}
46       <img src='images/flags/{$profile->nationality2}.gif' alt='{$profile->nationality2}' height='11' title='{$profile->nationality2}' />&nbsp;
47       {/if}
48       {if $profile->nationality3}
49       <img src='images/flags/{$profile->nationality3}.gif' alt='{$profile->nationality3}' height='11' title='{$profile->nationality3}' />&nbsp;
50       {/if}
51       {$profile->promo()}
52       
53       {if $c.eduname0}, {education_fmt name=$c.eduname0 url=$c.eduurl0 degree=$c.edudegree0
54                                      grad_year=$c.edugrad_year0 field=$c.edufield0 program=$c.eduprogram0 sexe=$c.sexe}{*
55       *}{/if}{if $c.eduname1}, {education_fmt name=$c.eduname1 url=$c.eduurl1 degree=$c.edudegree1
56                                      grad_year=$c.edugrad_year1 field=$c.edufield1 program=$c.eduprogram1 sexe=$c.sexe}{*
57       *}{/if}{if $c.eduname2}, {education_fmt name=$c.eduname2 url=$c.eduurl2 degree=$c.edudegree2
58                                      grad_year=$c.edugrad_year2 field=$c.edufield2 program=$c.eduprogram2 sexe=$c.sexe}{*
59       *}{/if}{if $c.eduname3}, {education_fmt name=$c.eduname3 url=$c.eduurl3 degree=$c.edudegree3
60                                      grad_year=$c.edugrad_year3 field=$c.edufield3 program=$c.eduprogram3 sexe=$c.sexe}{*
61       *}{/if}{if $c.dcd}, décédé{if $c.sexe}e{/if} le {$c.deces|date_format}{/if}
62     </div>
63   </div>
64
65   {if $smarty.session.auth ge AUTH_COOKIE}
66   <div class="noprint bits">
67     <div>
68       {if $user->state eq 'pending' && !$profile->deathdate}
69         {if $show_action eq ajouter}
70     <a href="carnet/notifs/add_nonins/{$user->login()}?token={xsrf_token}">{*
71     *}{icon name=add title="Ajouter à la liste de mes surveillances"}</a>
72         {else}
73     <a href="carnet/notifs/del_nonins/{$user->login()}?token={xsrf_token}">{*
74     *}{icon name=cross title="Retirer de la liste de mes surveillances"}</a>
75         {/if}
76       {elseif $user->state neq 'pending'}
77     <a href="profile/{$profile->hrid()}" class="popup2">{*
78     *}{icon name=user_suit title="Afficher la fiche"}</a>
79         {if !$profile->deathdate}
80     <a href="vcard/{$profile->hrid()}.vcf">{*
81     *}{icon name=vcard title="Afficher la carte de visite"}</a>
82     <a href="mailto:{$user->bestEmail()}">{*
83     *}{icon name=email title="Envoyer un email"}</a>
84           {if !$smarty.session.user->isContact($user)}
85     <a href="carnet/contacts?action=ajouter&amp;user={$user->login()}&amp;token={xsrf_token}">{*
86     *}{icon name=add title="Ajouter à mes contacts"}</a>
87           {else}
88     <a href="carnet/contacts?action=retirer&amp;user={$user->login()}&amp;token={xsrf_token}">{*
89     *}{icon name=cross title="Retirer de mes contacts"}</a>
90           {/if}
91         {/if}
92       {/if}
93     </div>
94
95     {if hasPerm('admin')}
96     <div>
97       [{if $user->state eq 'pending' && !$profile->deathdeate}
98       <a href="marketing/private/{$user->login()}">{*
99         *}{icon name=email title="marketter user"}</a>
100       {/if}
101       <a href="admin/user/{$user->login()}">{*
102       *}{icon name=wrench title="administrer user"}</a>
103       <a href="http://www.polytechniciens.com/?page=AX_FICHE_ANCIEN&amp;anc_id={$profile->ax_id}">{*
104       *}{icon name=user_gray title="fiche AX"}</a>]
105     </div>
106     {/if}
107   </div>
108   {/if}
109
110   <div class="long">
111   {if $c.wasinscrit || !$c.dcd}
112     {if $c.web || $c.mobile || $c.countrytxt || $c.city || $c.region || $c.entreprise || $c.freetext || (!$c.dcd && !$c.actif )}
113     <table cellspacing="0" cellpadding="0">
114       {if $c.web}
115       <tr>
116         <td class="lt">Page web&nbsp;:</td>
117         <td class="rt"><a href="{$c.web}">{$c.web}</a></td>
118       </tr>
119       {/if}
120       {if $c.countrytxt || $c.city}
121       <tr>
122         <td class="lt">Géographie&nbsp;:</td>
123         <td class="rt">{$c.city}{if $c.city && $c.countrytxt}, {/if}{$c.countrytxt}</td>
124       </tr>
125       {/if}
126       {if $c.mobile && !$c.dcd}
127       <tr>
128         <td class="lt">Mobile&nbsp;:</td>
129         <td class="rt">{$c.mobile}</td>
130       </tr>
131       {/if}
132       {if $c.entreprise}
133       <tr>
134         <td class="lt">Profession&nbsp;:</td>
135         <td class="rt">
136           {if $c.job_web}<a href="{$c.job_web}">{$c.entreprise}</a>{else}{$c.entreprise}{/if}
137           {if $c.secteur} ({$c.secteur}){/if}{if $c.fonction}<br />{$c.fonction}{/if}
138         </td>
139       </tr>
140       {/if}
141       {if $c.freetext}
142       <tr>
143         <td class="lt">Commentaire&nbsp;:</td>
144         <td class="rt">{$c.freetext|nl2br}</td>
145       </tr>
146       {/if}
147       {if !$c.dcd && (!$c.actif || !$c.wasinscrit) && $smarty.session.auth ge AUTH_COOKIE}
148       <tr>
149         <td class="smaller" colspan="2">
150           {if !$c.wasinscrit}
151           Ce{if $c.sexe}tte{/if} camarade n'est pas inscrit{if $c.sexe}e{/if}.
152           <a href="marketing/public/{$c.hruid}" class='popup'>Si tu connais son adresse email,
153           <strong>n'hésite pas à nous la transmettre !</a>
154           {elseif !$c.actif}
155           Ce{if $c.sexe}tte{/if} camarade n'a plus d'adresse de redirection valide.
156           <a href="marketing/broken/{$c.hruid}">
157             Si tu en connais une, <strong>n'hésite pas à nous la transmettre</strong>.
158           </a>
159           {/if}
160         </td>
161       </tr>
162       {/if}
163     </table>
164     {/if}
165   {/if}
166   </div>
167 </div>
168
169 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}