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