X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Faxletter%2Faxletter.inc.php;h=eed37b61122c2f81d374b030da04189680eed1b0;hb=efe597c5795234724bc3df508bd628f9860a9c32;hp=386eb268e5b481b5677ab1f3946dd847c6258d51;hpb=787bb3d745141f2f85bd947ad7dd775d2c63f908;p=platal.git diff --git a/modules/axletter/axletter.inc.php b/modules/axletter/axletter.inc.php index 386eb26..eed37b6 100644 --- a/modules/axletter/axletter.inc.php +++ b/modules/axletter/axletter.inc.php @@ -1,6 +1,6 @@ _head = ' ,'; if (!is_array($id)) { @@ -45,7 +45,7 @@ class AXLetter extends MassMailer } else { $res = XDB::query("SELECT * FROM axletter - WHERE id = {?} OR shortname = {?}", $id, $id); + WHERE id = {?} OR short_name = {?}", $id, $id); } if (!$res->numRows()) { $this->_id = null; @@ -99,7 +99,9 @@ class AXLetter extends MassMailer protected function getAllRecipients() { - return "SELECT ni.user_id, IF(ni.user_id = 0, ni.email, a.alias) AS alias, + global $globals; + return "SELECT ni.user_id, IF(ni.user_id = 0, NULL, u.hruid) AS hruid, + IF(ni.user_id = 0, ni.email, CONCAT(a.alias, '@{$globals->mail->domain}')) AS alias, IF(ni.user_id = 0, ni.prenom, u.prenom) AS prenom, IF(ni.user_id = 0, ni.nom, IF(u.nom_usage='', u.nom, u.nom_usage)) AS nom, FIND_IN_SET('femme', IF(ni.user_id = 0, ni.flag, u.flags)) AS sexe, @@ -111,7 +113,7 @@ class AXLetter extends MassMailer LEFT JOIN aliases AS a ON(u.user_id=a.id AND FIND_IN_SET('bestalias',a.flags)) LEFT JOIN emails AS e ON(e.uid=u.user_id AND e.flags='active') WHERE ni.last < {?} AND {$this->subscriptionWhere()} - AND (e.email IS NOT NULL OR ni.user_id = 0) + AND (e.email IS NOT NULL OR FIND_IN_SET('googleapps', u.mail_storage) OR ni.user_id = 0) GROUP BY u.user_id"; } @@ -223,16 +225,16 @@ class AXLetter extends MassMailer static public function listSent() { - $res = XDB::query("SELECT IF(shortname IS NULL, id, shortname) as id, date, subject AS titre + $res = XDB::query("SELECT IF(short_name IS NULL, id, short_name) as id, date, subject AS titre FROM axletter - WHERE NOT (FIND_IN_SET('new', bits)) + WHERE NOT FIND_IN_SET('new', bits) AND NOT FIND_IN_SET('invalid', bits) ORDER BY date DESC"); return $res->fetchAllAssoc(); } static public function listAll() { - $res = XDB::query("SELECT IF(shortname IS NULL, id, shortname) as id, date, subject AS titre + $res = XDB::query("SELECT IF(short_name IS NULL, id, short_name) as id, date, subject AS titre FROM axletter ORDER BY date DESC"); return $res->fetchAllAssoc();