From: Stéphane Jacob Date: Tue, 12 Apr 2011 16:47:25 +0000 (+0200) Subject: Add job entry year (Closes #1445). X-Git-Tag: xorg/1.1.1~106 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=0863d3089139bfd9e212d334cd0922f435025310;p=platal.git Add job entry year (Closes #1445). Signed-off-by: Stéphane Jacob --- diff --git a/ChangeLog b/ChangeLog index 8fb9376..29e38c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ Bug/Wish: * Emails: - #1459: Lists and administrates aliases on main domain -JAC + * Profile: + - #1445: Add job entry year -JAC + From 1.1.0 branch: * Search: diff --git a/modules/profile/jobs.inc.php b/modules/profile/jobs.inc.php index b343ade..d8d27c8 100644 --- a/modules/profile/jobs.inc.php +++ b/modules/profile/jobs.inc.php @@ -68,7 +68,7 @@ class ProfileSettingJob implements ProfileSetting $jobs = XDB::fetchAllAssoc('SELECT j.id, j.jobid, je.name, j.description, j.email AS w_email, j.email_pub AS w_email_pub, - j.url AS w_url, j.pub + j.url AS w_url, j.pub, j.entry_year AS w_entry_year FROM profile_job AS j LEFT JOIN profile_job_enum AS je ON (j.jobid = je.id) WHERE j.pid = {?} @@ -183,6 +183,11 @@ class ProfileSettingJob implements ProfileSetting } $job['w_phone'] = Phone::formatFormArray($job['w_phone'], $s, $maxPublicity); + if ($job['w_entry_year'] && strlen($job['w_entry_year']) != 4) { + $job['w_entry_year_error'] = true; + $success = false; + } + unset($job['removed']); unset($job['new']); } @@ -272,16 +277,16 @@ class ProfileSettingJob implements ProfileSetting foreach ($value as $id => &$job) { if (($job['pub'] != 'private' || $deletePrivate) && (isset($job['name']) && $job['name'])) { if (isset($job['jobid']) && $job['jobid']) { - XDB::execute('INSERT INTO profile_job (pid, id, description, email, + XDB::execute('INSERT INTO profile_job (pid, id, description, email, entry_year, url, pub, email_pub, jobid) - VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})', - $page->pid(), $id, $job['description'], $job['w_email'], + VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})', + $page->pid(), $id, $job['description'], $job['w_email'], $job['w_entry_year'], $job['w_url'], $job['pub'], $job['w_email_pub'], $job['jobid']); } else { - XDB::execute('INSERT INTO profile_job (pid, id, description, email, + XDB::execute('INSERT INTO profile_job (pid, id, description, email, entry_year, url, pub, email_pub) - VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?})', - $page->pid(), $id, $job['description'], $job['w_email'], + VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})', + $page->pid(), $id, $job['description'], $job['w_email'], $job['w_entry_year'], $job['w_url'], $job['pub'], $job['w_email_pub']); $request = new EntrReq(S::user(), $page->profile, $id, $job['name'], $job['hq_acronym'], $job['hq_url'], $job['hq_email'], $job['hq_fixed'], $job['hq_fax'], $job['hq_address']); diff --git a/templates/profile/jobs.job.tpl b/templates/profile/jobs.job.tpl index 58c2aef..8150c41 100644 --- a/templates/profile/jobs.job.tpl +++ b/templates/profile/jobs.job.tpl @@ -175,6 +175,14 @@ name="{$jobpref}[w_url]" value="{$job.w_url}" /> + + Année d'entrée + + + (avec 4 chiffres, par exemple 1983) + +
diff --git a/upgrade/1.1.1/04_jobs.sql b/upgrade/1.1.1/04_jobs.sql new file mode 100644 index 0000000..4d0187e --- /dev/null +++ b/upgrade/1.1.1/04_jobs.sql @@ -0,0 +1,3 @@ +ALTER TABLE profile_job ADD COLUMN entry_year CHAR(4) DEFAULT NULL; + +-- vim:set syntax=mysql: