return $this->corps;
}
+ /**
+ * Retrieve the name of the corps which has been done.
+ *
+ * Note: this function first tries getCorps(), and if this field is blank
+ * tries to find an education which degree is "Corps".
+ *
+ * Returns an empty string if nothing has been found.
+ */
+ public function getCorpsName()
+ {
+ $corps = $this->getCorps();
+ if ($corps && $corps->current) {
+ $corpsList = DirEnum::getOptions(DirEnum::CURRENTCORPS);
+ return $corpsList[$corps->current];
+ }
+
+ foreach ($this->getExtraEducations() as $edu) {
+ if (!strcasecmp($edu->degree, 'Corps')) {
+ if ($edu->school_short) {
+ return $edu->school_short;
+ } elseif ($edu->school) {
+ return $edu->school;
+ }
+ }
+ }
+ return '';
+ }
+
/** Networking
*/
private $networks = null;
$corpsList = DirEnum::getOptions(DirEnum::CURRENTCORPS);
foreach ($broken_user_list as $uid => $mails) {
$profile = Profile::get($uid);
- $corps = $profile->getCorps();
- $current_corps = ($corps && $corps->current) ? $corpsList[$corps->current] : '';
+ $current_corps = $profile->getCorpsName();
$jobs = $profile->getJobs();
$companies = array();
foreach ($jobs as $job) {