const FETCH_MENTOR_TERMS = 0x000400;
const FETCH_DELTATEN = 0x000800;
const FETCH_PARTNER = 0x001000;
+ const FETCH_SKILL = 0x002000;
+ const FETCH_LANGUAGE = 0x004000;
const FETCH_MINIFICHES = 0x00012D; // FETCH_ADDRESSES | FETCH_EDU | FETCH_JOBS | FETCH_NETWORKING | FETCH_PHONES
- const FETCH_ALL = 0x001FFF; // OR of FETCH_*
+ const FETCH_ALL = 0x007FFF; // OR of FETCH_*
static public $descriptions = array(
'search_names' => 'Noms',
}
}
+ /* Skills */
+ private $skills = null;
+ public function setSkills(ProfileSkills $skills)
+ {
+ $this->skills = $skills;
+ }
+ public function getSkills()
+ {
+ if ($this->skills == null && !$this->fetched(self::FETCH_SKILL)) {
+ $this->setSkills($this->getProfileField(self::FETCH_SKILL));
+ }
+
+ if ($this->skills == null) {
+ return array();
+ } else {
+ return $this->skills->skills;
+ }
+ }
+
+ /* Languades */
+ private $languages = null;
+ public function setLanguages(ProfileLanguages $languages)
+ {
+ $this->languages = $languages;
+ }
+ public function getLanguages()
+ {
+ if ($this->languages == null && !$this->fetched(self::FETCH_LANGUAGE)) {
+ $this->setLanguages($this->getProfileField(self::FETCH_LANGUAGE));
+ }
+
+ if ($this->languages == null) {
+ return array();
+ } else {
+ return $this->languages->languages;
+ }
+ }
+
/** DeltaTen
*/
Profile::FETCH_MENTOR_COUNTRY => 'ProfileMentoringCountries',
Profile::FETCH_JOB_TERMS => 'ProfileJobTerms',
Profile::FETCH_MENTOR_TERMS => 'ProfileMentoringTerms',
+ Profile::FETCH_SKILL => 'ProfileSkills',
+ Profile::FETCH_LANGUAGE => 'ProfileLanguages',
Profile::FETCH_PARTNER => 'ProfilePartnerSharing',
);
}
}
// }}}
+// {{{ class ProfileSkills [ Field ]
+class ProfileSkills extends ProfileField
+{
+ public $skills = array();
+
+ public function __construct(PlInnerSubIterator $it)
+ {
+ $this->pid = $it->value();
+ while ($skill = $it->next()) {
+ $this->skills[$skill['cid']] = $skill;
+ }
+ }
+
+ public static function fetchData(array $pids, Visibility $visibility)
+ {
+ $data = XDB::iterator('SELECT ps.cid, pse.text_fr, ps.level, ps.pid
+ FROM profile_skills AS ps
+ INNER JOIN profile_skill_enum AS pse ON (pse.id = ps.cid)
+ WHERE ps.pid IN {?}
+ ORDER BY ' . XDB::formatCustomOrder('ps.pid', $pids),
+ $pids);
+ return PlIteratorUtils::subIterator($data, PlIteratorUtils::arrayValueCallback('pid'));
+ }
+}
+// }}}
+// {{{ class ProfileLanguages [ Field ]
+class ProfileLanguages extends ProfileField
+{
+ public $languages = array();
+
+ public function __construct(PlInnerSubIterator $it)
+ {
+ static $levels = array(
+ 1 => 'connaissance basique',
+ 2 => 'maîtrise des bases',
+ 3 => 'maîtrise limitée',
+ 4 => 'maîtrise générale',
+ 5 => 'bonne maîtrise',
+ 6 => 'maîtrise complète'
+ );
+
+ $this->pid = $it->value();
+ while ($language = $it->next()) {
+ $this->languages[$language['lid']] = $language;
+ $this->languages[$language['lid']]['level'] = $levels[$language['level']];
+ }
+ }
+
+ public static function fetchData(array $pids, Visibility $visibility)
+ {
+ $data = XDB::iterator('SELECT ps.lid, pse.language, ps.level, ps.pid
+ FROM profile_langskills AS ps
+ INNER JOIN profile_langskill_enum AS pse ON (pse.iso_639_2b = ps.lid)
+ WHERE ps.pid IN {?}
+ ORDER BY ' . XDB::formatCustomOrder('ps.pid', $pids),
+ $pids);
+ return PlIteratorUtils::subIterator($data, PlIteratorUtils::arrayValueCallback('pid'));
+ }
+}
+// }}}
// {{{ class ProfilePartnerSharing [ Field ]
class ProfilePartnerSharing extends ProfileField
{
{assign var=terms value=$profile->getMentoringTerms()}
{assign var=countries value=$profile->getMentoringCountries()}
+{assign var=skills value=$profile->getSkills()}
+{assign var=languages value=$profile->getLanguages()}
<div id="fiche">
<div id="fiche_referent">
<div id="fiche_identite">
</div>
<div class="spacer"></div>
+ {if $skills|count || $languages|count}
+ <div class="part">
+ <h2>Compétences :</h2>
+ {if $skills|count}
+ <div style="float: left">
+ <em>Professionnelles :</em><br />
+ <ul>
+ {foreach from=$skills item="skill"}
+ <li>{$skill.text_fr} ({$skill.level})</li>
+ {/foreach}
+ </ul>
+ </div>
+ {/if}
+ {if $languages|count}
+ <div {if $skills|count}style="float: right"{/if}>
+ <em>Linguistiques :</em><br />
+ <ul>
+ {foreach from=$languages item="language"}
+ <li>{$language.language} ({$language.level})</li>
+ {/foreach}
+ </ul>
+ </div>
+ {/if}
+ <div class="spacer"> </div>
+ </div>
+ {/if}
+
{if $profile->mentor_expertise != '' || $terms|count || $countries|count }
- <div id="part">
+ <div class="part">
<h2>Informations de référent :</h2>
{if $profile->mentor_expertise}
<div class="rubrique_referent">