Merge branch 'account'
[platal.git] / templates / profile / profile.tpl
CommitLineData
0337d704 1{**************************************************************************}
2{* *}
9f5bd98e 3{* Copyright (C) 2003-2010 Polytechnique.org *}
0337d704 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{literal}
4d8e2051 24<script type="text/javascript">//<![CDATA[
555fde86 25function chgMainWinLoc(strPage)
26{
27 strPage = platal_baseurl + strPage;
2c326273 28 if (parent.opener) {
007c44cb 29 try {
30 parent.opener.document.location = strPage;
31 window.close();
32 } catch(e) {
33 window.open(strPage);
34 }
2c326273 35 } else {
36 document.location = strPage;
37 }
0337d704 38}
4d8e2051 39//]]></script>
0337d704 40{/literal}
41
03a6316f 42<div id="fiche">
43 <div id="photo" class="part">
5f8ad70d
RB
44 {assign var=photo value=$p->getPhoto(false)}
45 {if $photo}<img alt="Photo de {$p->fullName()}" src="photo/{$p->hrid()}" width="{$photo->width()}"/>{/if}
46
47 {if $logged && ( $p->section|smarty:nodefaults || $p->getBinets()|smarty:nodefaults || ($o && $o->groups()|smarty:nodefaults))}
6e828e47 48 <h2>À l'X&hellip;</h2>
5f8ad70d
RB
49 {if $p->section}<div><em class="intitule">Section&nbsp;: </em><span>{$p->section}</span></div>{/if}
50
51 {assign var=binets value=$p->getBinets()}
52 {if $binets|@count}<div><em class="intitule">Binet{if count($binets) > 1}s{/if}&nbsp;: </em>
53 <span>{', '|implode:$p->getBinetsNames()}</span></div>{/if}
54
55 {if $o}
56 {assign var=groups value=$o->groupNames(true)}
57 {if $groups|@count}<div><em class="intitule">Groupe{if count($groups) > 1}s{/if} et institution{if count($groups) > 1}s{/if} X&nbsp;: </em>
58 <span><br/>
59 {foreach from=$groups item=group key=gk}{if $gk != 0}, {/if}<span title="{$group.nom}"><a href="{$group.site}">{$group.nom}</a></span>{/foreach}
60 </span></div>{/if}
61 {/if}
62
03a6316f 63 {/if}
5f8ad70d
RB
64
65 {assign var=networking value=$p->getNetworking(0)}
66 {if count($networking) > 0}
92c3f9e5 67 <h2>Sur le web...</h2>
5f8ad70d
RB
68 {foreach from=$networking item=network}
69 <img style="width: auto; padding: 0" src="profile/networking/{$network.network_type}" alt="{$network.name}" title="{$network.name}"/>
d1a2252a
GB
70 {if $network.filter == 'web'}
71 <a href="{$network.address}">{$network.address}</a>
dc6378df
GB
72 {elseif $network.link != ''}
73 <a href="{$network.link}">{$network.address}</a>
d1a2252a
GB
74 {else}
75 {$network.address}
76 {/if}
77 <br/>
78 {/foreach}
79 {/if}
5f8ad70d
RB
80
81 {if $p->freetext}
82 <h2>Commentaires&nbsp;:</h2>
83 <span>{$p->freetext|miniwiki|smarty:nodefaults}</span>
581c3341 84 {/if}
5f8ad70d 85
03a6316f 86 </div>
5f8ad70d 87
03a6316f 88 <div id="fiche_identite" class="part">
89 <div class="civilite">
5f8ad70d
RB
90 {if $p->isFemale()}&bull;{/if}
91 <span {if $p->name_tooltip neq ""}class="hinted" title="{$p->name_tooltip}"{/if}>{$p->shortName()}</span>
03a6316f 92 {if $logged}
5f8ad70d 93 {if $p->nickname} (alias {$p->nickname}){/if}
581c3341 94 {/if}
5f8ad70d 95
581c3341 96 {if $logged}
5f8ad70d
RB
97 &nbsp;{if !$p->isDead()}<a href="vcard/{$o->login()}.vcf">{*
98 *}{icon name=vcard title="Afficher la carte de visite"}</a>{/if}
99
100 {if !$smarty.session.user->isContact($p)}
101 <a href="javascript:chgMainWinLoc('carnet/contacts?action=ajouter&amp;user={$o->login()}&amp;token={xsrf_token}')">
102 {icon name=add title="Ajouter à mes contacts"}</a>
103 {else}
104 <a href="javascript:chgMainWinLoc('carnet/contacts?action=retirer&amp;user={$o->login()}&amp;token={xsrf_token}')">
105 {icon name=cross title="Retirer de mes contacts"}</a>
106 {/if}
107
108 {if hasPerm('admin')}
109 <a href="javascript:chgMainWinLoc('admin/user/{$o->login()}')">
110 {icon name=wrench title="administrer user"}</a>
111 {/if}
112
113 {if $o->login() eq $smarty.session.hruid}
114 <a href="javascript:chgMainWinLoc('profile/edit')">{icon name="user_edit" title="Modifier ma fiche"}</a>
115 {/if}
116
03a6316f 117 {/if}
118 </div>
5f8ad70d 119
03a6316f 120 {if $logged}
121 <div class='maj'>
122 Fiche mise à jour<br />
5f8ad70d 123 le {$p->last_change|date_format}
03a6316f 124 </div>
125 {/if}
5f8ad70d
RB
126
127 {assign var=phones value=$p->getPhones(0)}
128 {if $logged || count($phones) > 0}
03a6316f 129 <div class="contact">
130 {if $logged}
131 <div class='email'>
5f8ad70d
RB
132 {if $p->isDead()}
133 Décédé{if $p->isFemale()}e{/if} le {$p->deathdate|date_format}
134 {elseif $o && $o->lost}
135 Ce{if $p->isFemale()}tte{/if} camarade n'a plus d'adresse de redirection valide,<br />
136 <a href="marketing/broken/{$o->login()}" class="popup">clique ici si tu connais son adresse email&nbsp;!</a>
137 {elseif $o && $o->state != 'active'}
03a6316f 138 Cette personne n'est pas inscrite à Polytechnique.org,<br />
5f8ad70d 139 <a href="marketing/public/{$o->login()}" class="popup">clique ici si tu connais son adresse email&nbsp;!</a>
0337d704 140 {else}
03a6316f 141 {if $virtualalias}
142 <a href="mailto:{$virtualalias}">{$virtualalias}</a><br />
0337d704 143 {/if}
5f8ad70d
RB
144 <a href="mailto:{$o->bestEmail()}">{$o->bestEmail()}</a>
145 {if $o->bestEmail() neq $o->forlifeEmail()}<br />
146 <a href="mailto:{$o->forlifeEmail()}">{$o->forlifeEmail()}</a>
c6db254a 147 {/if}
0337d704 148 {/if}
149 </div>
0337d704 150 {/if}
5f8ad70d
RB
151 {if count($phones) > 0}
152 {display_phones tels=$phones dcd=$p->isDead()}
6261a1b5 153 {/if}
03a6316f 154 <div class='spacer'></div>
155 </div>
156 {/if}
5f8ad70d 157
03a6316f 158 <div class='formation'>
5f8ad70d
RB
159 {foreach from=$p->nationalities() item=nat}
160 <img src='images/flags/{$nat}.gif' alt='{$nat}' height='11' title='{$nat}' />&nbsp;
161 {/foreach}
162
163 {$p->promo()}
164
165 {if $logged && $p->mentor_expertise}
166 [<a href="referent/{$p->hrid()}" class='popup2'>Ma fiche référent</a>]
03a6316f 167 {/if}
5f8ad70d
RB
168
169 {assign var=educations value=$p->getEducations(64)}
170 {if count($educations) > 0}
c7eac294
SJ
171 &nbsp;-&nbsp;Formation&nbsp;:
172 <ul>
5f8ad70d
RB
173 {foreach from=$educations item=edu}
174 <li>{display_education edu=$edu profile=$p}</li>
c7eac294
SJ
175 {/foreach}
176 </ul>
03a6316f 177 {/if}
5f8ad70d
RB
178
179 {assign var=corps value=$p->getCorps()}
180 {if $corps && ($corps->current || $corps->original)}
181 <ul>
182 {if $corps->current}
183 <li>{$corps->current_name} {$corps->current_rank}
184 {/if}
185 {if $corps->original}
186 <li>{$corps->original_name}
187 {/if}
188 </ul>
078dc884 189 {/if}
5f8ad70d 190
03a6316f 191 </div>
192 </div>
5f8ad70d
RB
193
194 {assign var=addr value=$p->getAddresses(3)}
195 {if count($addr) > 0}
03a6316f 196 <div class="part">
e8439508 197 <h2>Contact&nbsp;: </h2>
5f8ad70d 198 {if $p->isDead()}
44c7ed76
SJ
199 {assign var=address_name value="Dernière adresse"}
200 {else}
201 {assign var=address_name value="Adresse"}
202 {/if}
5f8ad70d
RB
203 {foreach from=$addr item="address" name=addresses}
204 {if $smarty.foreach.addresses.iteration is even}
6261a1b5 205 {assign var=pos value="right"}
206 {else}
207 {assign var=pos value="left"}
208 {/if}
5f8ad70d 209 {if $address->hasFlag('current')}
44c7ed76 210 {include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" actuelle&nbsp;:"
5f8ad70d
RB
211 for="`$p->firstname` `$p->lastname`" pos=$pos}
212 {elseif $address->hasFlag('secondary')}
44c7ed76 213 {include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" secondaire&nbsp;:"
5f8ad70d 214 for="`$p->firstname` `$p->lastname`" pos=$pos}
03a6316f 215 {else}
44c7ed76 216 {include file="geoloc/address.tpl" address=$address titre_div=true titre=$address_name|@cat:" principale&nbsp;:"
5f8ad70d 217 for="`$p->firstname` `$p->lastname`" pos=$pos}
03a6316f 218 {/if}
5f8ad70d 219 {if $smarty.foreach.addresses.iteration is even}<div class="spacer"></div>{/if}
03a6316f 220 {/foreach}
221 </div>
0337d704 222 {/if}
5f8ad70d
RB
223
224 {assign var=jobs value=$p->getJobs(2)}
225 {if count($jobs) > 0}
03a6316f 226 <div class="part">
e8439508 227 <h2>Informations professionnelles&nbsp;:</h2>
5f8ad70d 228 {foreach from=$jobs item="job" key="i"}
16f20f22 229 {if $i neq 0}<hr />{/if}
5f8ad70d
RB
230 {include file="include/emploi.tpl" job=$job}
231 {if $job->address()}
232 {include file="geoloc/address.tpl" address=$job->address titre="Adresse&nbsp;: " for=$job->company->name pos="left"}
233 {/if}
16f20f22 234 <div class="spacer">&nbsp;</div>
03a6316f 235 {/foreach}
236 </div>
0337d704 237 {/if}
5f8ad70d
RB
238
239 {assign var=medals value=$p->getMedals()}
240 {if count($medals) > 0}
241 <div class="part">
242 <h2>Distinctions&nbsp;: </h2>
243 {foreach from=$medals item=m}
244 <div class="medal_frame">
245 <img src="profile/medal/thumb/{$m.mid}" height="50px" alt="{$m.text}" title="{$m.text}" style='float: left;' />
246 <div class="medal_text">
247 {$m.text}<br />{$m.grade}
248 </div>
03a6316f 249 </div>
5f8ad70d
RB
250 {/foreach}
251 <div class="spacer">&nbsp;</div>
03a6316f 252 </div>
0337d704 253 {/if}
5f8ad70d
RB
254
255 {if $logged && $p->cv}
03a6316f 256 <div class="part">
e8439508 257 <h2>Curriculum Vitae&nbsp;:</h2>
5f8ad70d 258 {$p->cv|miniwiki:title|smarty:nodefaults}
03a6316f 259 </div>
0337d704 260 {/if}
5f8ad70d 261
24f4c06a 262 {if $view eq 'public'}
03a6316f 263 <div class="part">
581c3341 264 <small>
03a6316f 265 Cette fiche est publique et visible par tout internaute,<br />
5f8ad70d 266 vous pouvez aussi voir <a href="profile/private/{$p->hrid()}?display=light">celle&nbsp;réservée&nbsp;aux&nbsp;X</a>.
581c3341 267 </small>
03a6316f 268 </div>
24f4c06a
FB
269 {elseif $view eq 'ax'}
270 <div class="part">
271 <small>
272 Cette fiche est privée et ne recense que les informations transmises à l'AX.
273 </small>
274 </div>
0337d704 275 {/if}
5f8ad70d 276
03a6316f 277 <div class="spacer"></div>
278</div>
0337d704 279
a7de4ef7 280{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}