More merge updates (promo).
authorStéphane Jacob <sj@m4x.org>
Mon, 14 Nov 2011 09:39:04 +0000 (10:39 +0100)
committerStéphane Jacob <sj@m4x.org>
Mon, 14 Nov 2011 09:39:04 +0000 (10:39 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
modules/fusionax.php
upgrade/1.1.4/16_promo.sql [new file with mode: 0644]

index d631dc3..a3309c3 100644 (file)
@@ -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 (file)
index 0000000..9c4111e
--- /dev/null
@@ -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:;