From caa04db802a6ad12650360cf36fd2a730b7d69fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 14 Nov 2011 10:39:04 +0100 Subject: [PATCH] More merge updates (promo). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/fusionax.php | 6 ++++-- upgrade/1.1.4/16_promo.sql | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 upgrade/1.1.4/16_promo.sql diff --git a/modules/fusionax.php b/modules/fusionax.php index d631dc3..a3309c3 100644 --- a/modules/fusionax.php +++ b/modules/fusionax.php @@ -267,10 +267,12 @@ class FusionAxModule extends PLModule f.promotion_etude AS promo_etude_ax, pe.grad_year AS promo_sortie_xorg FROM profiles AS p INNER JOIN profile_display AS pd ON (p.pid = pd.pid) - INNER JOIN profile_education AS pe ON (p.pid = pe.pid) + INNER JOIN profile_education AS pe ON (p.pid = pe.pid AND FIND_IN_SET('primary', pe.flags)) INNER JOIN fusionax_anciens AS f ON (p.ax_id = f.ax_id) WHERE (f.groupe_promo = 'X' AND pd.promo != CONCAT('X', f.promotion_etude) - AND !(f.promotion_etude = pe.entry_year + 1 AND pe.grad_year = pe.entry_year + 4)) + AND !(f.promotion_etude = pe.entry_year + 1 AND pe.grad_year = pe.entry_year + 4) + AND !(f.promotion_etude = pe.entry_year + 2 AND pe.grad_year = pe.entry_year + 5) + AND f.promotion_etude != 0) OR (f.groupe_promo = 'D' AND f.promotion_etude != pe.grad_year) OR (f.groupe_promo = 'M' AND f.promotion_etude != pe.entry_year) GROUP BY p.pid"); diff --git a/upgrade/1.1.4/16_promo.sql b/upgrade/1.1.4/16_promo.sql new file mode 100644 index 0000000..9c4111e --- /dev/null +++ b/upgrade/1.1.4/16_promo.sql @@ -0,0 +1,14 @@ +-- Updates promo for oranjes who only stated their orajisation to AX. +-- WARNING: this does not affect the display of their promotion anywhere. It will just allow them to attend events to both promotions. +-- Also they will not need to require a validation if they want to change promo on the site. + +UPDATE profile_education + SET grad_year = grad_year + 1 + WHERE FIND_IN_SET('primary', flags) AND pid IN (41342, 41581, 41670, 42220, 43438, 43529, 43699); + +-- Same as before but double orajisation. +UPDATE profile_education + SET grad_year = grad_year + 2 + WHERE FIND_IN_SET('primary', flags) AND pid IN (41441, 42307); + +-- vim:set syntax=mysql:; -- 2.1.4