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