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