From eccb9b829f572bc352257f6a41a4c2b4472fa30a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Mon, 22 Mar 2010 22:54:11 +0100 Subject: [PATCH] Fix referent display MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- modules/profile.php | 21 ++++++--------------- templates/profile/fiche_referent.tpl | 32 ++++++++++++++++++-------------- 2 files changed, 24 insertions(+), 29 deletions(-) diff --git a/modules/profile.php b/modules/profile.php index 40bff74..8423d29 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -538,28 +538,19 @@ class ProfileModule extends PLModule } } - function handler_referent(&$page, $user) + function handler_referent(&$page, $pf) { $page->changeTpl('profile/fiche_referent.tpl', SIMPLE); - $user = Profile::get($user); - if (!$user) { + $pf = Profile::get($pf); + if (!$pf) { return PL_NOT_FOUND; } - $page->assign_by_ref('user', $user); - $page->assign('cv', MiniWiki::WikiToHTML($user->cv, true)); - //TODO: waiting for job refactoring to be done - //$page->assign('adr_pro', get_user_details_pro($user->id())); + $page->assign_by_ref('profile', $pf); ///// recuperations infos referent - //expertise - $res = XDB::query('SELECT expertise - FROM profile_mentor - WHERE pid = {?}', $user->id()); - $page->assign('expertise', $res->fetchOneCell()); - // Sectors $sectors = $subSectors = Array(); $res = XDB::iterRow( @@ -567,7 +558,7 @@ class ProfileModule extends PLModule FROM profile_mentor_sector AS m LEFT JOIN profile_job_sector_enum AS s ON(m.sectorid = s.id) LEFT JOIN profile_job_subsector_enum AS ss ON(m.sectorid = ss.sectorid AND m.subsectorid = ss.id) - WHERE pid = {?}", $user->id()); + WHERE pid = {?}", $pf->id()); while (list($sector, $subSector) = $res->next()) { $sectors[] = $sector; $subSectors[] = $subSector; @@ -580,7 +571,7 @@ class ProfileModule extends PLModule "SELECT gc.countryFR FROM profile_mentor_country AS m LEFT JOIN geoloc_countries AS gc ON (m.country = gc.iso_3166_1_a2) - WHERE pid = {?}", $user->id()); + WHERE pid = {?}", $pf->id()); $page->assign('pays', $res->fetchColumn()); $page->addJsLink('close_on_esc.js'); diff --git a/templates/profile/fiche_referent.tpl b/templates/profile/fiche_referent.tpl index bf787ee..4b7bc04 100644 --- a/templates/profile/fiche_referent.tpl +++ b/templates/profile/fiche_referent.tpl @@ -21,17 +21,19 @@ {**************************************************************************} {javascript name=ajax} +{assign var=sectors value=$profile->getMentoringSectors()} +{assign var=countries value=$profile->getMentoringCountries()}
- {$user->fullName()}
- {$user->promo()} -  {$user->bestEmail()} + {$profile->fullName()}
+ {$profile->promo()} -  {$profile->displayEmail()}
- {if $expertise != '' || $sectors|count || $pays|count } + {if $expertise != '' || $sectors|count || $countries|count }

Informations de référent :

{if $expertise} @@ -45,12 +47,12 @@ Secteurs :
    {foreach from=$sectors item="sector" key="i"} -
  • {$sector}{if $subSector.$i != ''} ({$subSector.$i}){/if}
  • +
  • {$sector.sector}{if $sector.subsector != ''} ({$sector.subsector}){/if}
  • {/foreach}
{/if} - {if $pays|count} + {if $countries|count}
Pays :
    @@ -64,20 +66,22 @@
{/if} + {assign var=jobs value=$profile->getJobs(2)}
- {foreach from=$adr_pro item="address" key="i"} -

{$address.entreprise}

- {include file="include/emploi.tpl" address=$address} - {include file="geoloc/address.tpl" address=$address titre="Adresse : " for=$address.entreprise} - -
 
- {/foreach} + {foreach from=$jobs item="job"} +

{$job->company->name}

+ {include file="include/emploi.tpl" job=$job} + {if $job->address()} + {include file="geoloc/address.tpl" address=$job->address titre="Adresse : " for=$job->company->name} + {/if} +
 
+ {/foreach}
- {if $cv} + {if $profile->cv}

Curriculum Vitae :

-
{$cv|smarty:nodefaults}
+
{$profile->cv|smarty:nodefaults}
{/if} -- 2.1.4