<?php
/***************************************************************************
- * Copyright (C) 2003-2010 Polytechnique.org *
+ * Copyright (C) 2003-2011 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* Each of these consts contains the basename of the class (its full name
* being DE_$basename).
*/
- const NAMETYPES = 'nametypes';
- const NAMES = 'names';
-
const BINETS = 'binets';
const GROUPESX = 'groupesx';
const SECTIONS = 'sections';
const EDUDEGREES = 'educationdegrees';
const EDUFIELDS = 'educationfields';
- const CORPS = 'corps';
+ const CURRENTCORPS = 'currentcorps';
+ const ORIGINCORPS = 'origincorps';
const CORPSRANKS = 'corpsranks';
const NATIONALITIES = 'nationalities';
}
// }}}
-// {{{ class DE_NameTypes
-// returns 'system' names ('lastname', 'lastname_marital', ...)
-class DE_NameTypes extends DirEnumeration
-{
- public $capabilities = 0x005; // self::HAS_OPTIONS | self::SAVE_IN_SESSION;
-
- protected $from = 'profile_name_enum';
- protected $valfield = 'type';
-}
-// }}}
-
-// {{{ class DE_Names
-// returns 'system' names ('lastname', 'lastname_marital', ...)
-class DE_Names extends DirEnumeration
-{
- public $capabilities = 0x005; // self::HAS_OPTIONS | self::SAVE_IN_SESSION;
-
- protected $from = 'profile_name_enum';
- protected $idfield = 'type';
- protected $valfield = 'name';
-}
-// }}}
-
/** GROUPS
*/
// {{{ class DE_Binets
// {{{ class DE_EducationSchools
class DE_EducationSchools extends DirEnumeration
{
+ protected $ac_beginwith = false;
protected $idfield = 'profile_education_enum.id';
protected $valfield = 'profile_education_enum.name';
protected $valfield2 = 'profile_education_enum.abbreviation';
}
// }}}
-// {{{ 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
class DE_Nationalities extends DirEnumeration
{
protected $idfield = 'geoloc_countries.iso_3166_1_a2';
- protected $valfield = 'geoloc_countries.nationalityFR';
- protected $valfield2 = 'geoloc_countries.nationality';
+ protected $valfield = 'geoloc_countries.nationality';
+ protected $valfield2 = 'geoloc_countries.nationalityEn';
protected $from = 'geoloc_countries';
protected $join = 'INNER JOIN profiles ON (geoloc_countries.iso_3166_1_a2 IN (profiles.nationality1, profiles.nationality2, profiles.nationality3))';
protected $ac_join = 'INNER JOIN profile_addresses ON (geoloc_countries.iso_3166_1_a2 = profile_addresses.countryId)';
protected $ac_unique = 'profile_addresses.pid';
+ protected $ac_where = 'profile_addresses.type = \'home\'';
}
// }}}