- #1445: Add job entry year -JAC
* Search:
+ - #911: Adds search on corps -JAC
- #990: Adds search on broken redirections -JAC
* XnetList:
const EDUDEGREES = 'educationdegrees';
const EDUFIELDS = 'educationfields';
- const CORPS = 'corps';
+ const CURRENTCORPS = 'currentcorps';
+ const ORIGINCORPS = 'origincorps';
const CORPSRANKS = 'corpsranks';
const NATIONALITIES = 'nationalities';
}
// }}}
-// {{{ class DE_Corps
-class DE_Corps extends DirEnumeration
+// {{{ class DE_CurrentCorps
+class DE_CurrentCorps extends DirEnumeration
{
protected $idfield = 'profile_corps_enum.id';
protected $valfield = 'profile_corps_enum.name';
protected $valfield2 = 'profile_corps_enum.abbrev';
protected $from = 'profile_corps_enum';
+ protected $where = 'WHERE profile_corps_enum.still_exists = 1';
protected $ac_unique = 'profile_corps.pid';
protected $ac_join = 'INNER JOIN profile_corps ON (profile_corps.current_corpsid = profile_corps_enum.id)';
}
// }}}
+//
+// {{{ class DE_OriginCorps
+class DE_OriginCorps extends DirEnumeration
+{
+ protected $idfield = 'profile_corps_enum.id';
+ protected $valfield = 'profile_corps_enum.name';
+ protected $valfield2 = 'profile_corps_enum.abbrev';
+ protected $from = 'profile_corps_enum';
+
+ protected $ac_unique = 'profile_corps.pid';
+ protected $ac_join = 'INNER JOIN profile_corps ON (profile_corps.original_corpsid = profile_corps_enum.id)';
+}
+// }}}
// {{{ class DE_CorpsRanks
class DE_CorpsRanks extends DirEnumeration
$this->requireProfiles();
$this->pc = true;
if ($type == UFC_Corps::CURRENT) {
- $pce['pcec'] = 'current_corpsid';
+ $this->pce['pcec'] = 'current_corpsid';
return 'pcec';
} else if ($type == UFC_Corps::ORIGIN) {
- $pce['pceo'] = 'original_corpsid';
+ $this->pce['pceo'] = 'original_corpsid';
return 'pceo';
}
}
const ORIGIN = 2;
private $corps;
+ private $id;
private $type;
- public function __construct($corps, $type = self::CURRENT)
+ public function __construct($corps, $id = null, $type = self::CURRENT)
{
$this->corps = $corps;
+ $this->id = $id;
$this->type = $type;
}
* pcec for profile_corps_enum - current
*/
$sub = $uf->addCorpsFilter($this->type);
- $cond = $sub . '.abbreviation = ' . $corps;
- $cond .= ' AND ' . $uf->getVisibilityCondition($sub . '.corps_pub');
+ if (is_null($this->id)) {
+ $cond = $sub . '.abbreviation = ' . $this->corps;
+ } else {
+ $cond = $sub . '.id = ' . $this->id;
+ }
+ // XXX(x2006barrois): find a way to get rid of that hardcoded
+ // reference to 'pc'.
+ $cond .= ' AND ' . $uf->getVisibilityCondition('pc.corps_pub');
return $cond;
}
}
class UFC_Corps_Rank extends UserFilterCondition
{
private $rank;
- public function __construct($rank)
+ private $id;
+
+ public function __construct($rank, $id = null)
{
$this->rank = $rank;
+ $this->id = $id;
}
public function buildCondition(PlFilter $uf)
* pcr for profile_corps_rank
*/
$sub = $uf->addCorpsRankFilter();
- $cond = $sub . '.abbreviation = ' . $rank;
+ if (is_null($this->id)) {
+ $cond = $sub . '.abbreviation = ' . $this->rank;
+ } else {
+ $cond = $sub . '.id = ' . $this->id;
+ }
// XXX(x2006barrois): find a way to get rid of that hardcoded
// reference to 'pc'.
$cond .= ' AND ' . $uf->getVisibilityCondition('pc.corps_pub');
new UFBF_JobCv('cv', 'CV'),
new UFBF_JobTerms('jobterm', 'Mots-clefs'),
+ new UFBF_OriginCorps('origin_corps', 'Corps d\'origine'),
+ new UFBF_CurrentCorps('current_corps', 'Corps actuel'),
+ new UFBF_CorpsRank('corps_rank', 'Grade'),
+
new UFBF_Nationality('nationaliteTxt', 'nationalite', 'Nationalité'),
new UFBF_Binet('binetTxt', 'binet', 'Binet'),
new UFBF_Group('groupexTxt', 'groupex', 'Groupe X'),
}
// }}}
+// {{{ class UFBF_OriginCorps
+class UFBF_OriginCorps extends UFBF_Index
+{
+ protected $direnum = DirEnum::ORIGINCORPS;
+
+ protected function buildUFC(UserFilterBuilder $ufb)
+ {
+ return new UFC_Corps(null, $this->val, UFC_Corps::ORIGIN);
+ }
+}
+// }}}
+
+// {{{ class UFBF_CurrentCorps
+class UFBF_CurrentCorps extends UFBF_Index
+{
+ protected $direnum = DirEnum::CURRENTCORPS;
+
+ protected function buildUFC(UserFilterBuilder $ufb)
+ {
+ return new UFC_Corps(null, $this->val, UFC_Corps::CURRENT);
+ }
+}
+// }}}
+
+// {{{ class UFBF_CorpsRank
+class UFBF_CorpsRank extends UFBF_Index
+{
+ protected $direnum = DirEnum::CORPSRANKS;
+
+ protected function buildUFC(UserFilterBuilder $ufb)
+ {
+ return new UFC_Corps_Rank(null, $this->val);
+ }
+}
+// }}}
+
// {{{ class UFBF_Comment
class UFBF_Comment extends UFBF_Text
{
$networks[0] = '-';
ksort($networks);
$page->assign('networking_types', $networks);
+ $origin_corps_list = DirEnum::getOptions(DirEnum::CURRENTCORPS);
+ $current_corps_list = DirEnum::getOptions(DirEnum::ORIGINCORPS);
+ $corps_rank_list = DirEnum::getOptions(DirEnum::CORPSRANKS);
+ $origin_corps_list[0] = '-';
+ $current_corps_list[0] = '-';
+ $corps_rank_list[0] = '-';
+ ksort($origin_corps_list);
+ ksort($current_corps_list);
+ ksort($corps_rank_list);
+ $page->assign('origin_corps_list', $origin_corps_list);
+ $page->assign('current_corps_list', $current_corps_list);
+ $page->assign('corps_rank_list', $corps_rank_list);
if (!Env::has('rechercher') && $model != 'geoloc') {
$this->form_prepare();
</td>
</tr>
<tr>
+ <td>Corps d'origine</td>
+ <td>
+ <select name="origin_corps">
+ {foreach from=$origin_corps_list key=id item=corps}
+ <option value="{$id}" {if $smarty.request.origin_corps eq $id}selected="selected"{/if}>{$corps}</option>
+ {/foreach}
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>Corps actuel</td>
+ <td>
+ <select name="current_corps">
+ {foreach from=$current_corps_list key=id item=corps}
+ <option value="{$id}" {if $smarty.request.current_corps eq $id}selected="selected"{/if}>{$corps}</option>
+ {/foreach}
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>Grade</td>
+ <td>
+ <select name="corps_rank">
+ {foreach from=$corps_rank_list key=id item=corps}
+ <option value="{$id}" {if $smarty.request.corps_rank eq $id}selected="selected"{/if}>{$corps}</option>
+ {/foreach}
+ </select>
+ </td>
+ </tr>
+ <tr>
<td>Commentaire contient</td>
<td><input type="text" name="free" size="32" value="{$smarty.request.free}" /></td>
</tr>