From: Pierre Habouzit (MadCoder Date: Fri, 14 Jan 2005 23:54:51 +0000 (+0000) Subject: and now, a 4 line change to add Birthdays !!!! X-Git-Tag: xorg/old~433 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=9a958cc4ee16a225da40c0d987381f3848761489;p=platal.git and now, a 4 line change to add Birthdays !!!! git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-323 --- diff --git a/include/notifs.inc.php b/include/notifs.inc.php index d080b0d..4842ce2 100644 --- a/include/notifs.inc.php +++ b/include/notifs.inc.php @@ -19,9 +19,10 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -define("WATCH_FICHE", 1); -define("WATCH_INSCR", 2); -define("WATCH_DEATH", 3); +define('WATCH_FICHE', 1); +define('WATCH_INSCR', 2); +define('WATCH_DEATH', 3); +define('WATCH_BIRTH', 4); // {{{ function inscription_notifs_base @@ -64,7 +65,7 @@ function _select_notifs_base($table, $mail, $where) 'contact_sql' => '1' ), 'watch_promo' => Array('wfield' => 'promo', 'ufield' => 'promo', 'need_contact' => true, - 'freq_sql' => ' AND wc.frequent=0', + 'freq_sql' => ' AND ( wc.type = "basic" OR wc.type="near" AND (w.promo <= u.promo+1 AND w.promo >= u.promo-1) )', 'contact_sql' => 'NOT (c.contact IS NULL)' ), 'watch_nonins' => Array('wfield' => 'ni_id', 'ufield' => 'user_id', 'need_contact' => false, diff --git a/upgrade/0.9.4/60_watch.sql b/upgrade/0.9.4/60_watch.sql new file mode 100644 index 0000000..44cb1f7 --- /dev/null +++ b/upgrade/0.9.4/60_watch.sql @@ -0,0 +1,4 @@ +alter table watch_cat add column type enum('basic', 'near', 'often') not null default 'basic'; +update watch_cat set type='often' where frequent=1; +alter table watch_cat drop column frequent; +insert into watch_cat (id, short, mail, type) values(4, 'Anniversaires', 'Ces camarades ont feté leur anniversaire cette semaine', 'near');