X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttReportHelper.class.php;h=71cee91478a094a8485ce051545cc04456027650;hb=cf9315882cd37786cc8ba5d13bf6381b935d1600;hp=ae90374c134a6ba9b716785b9a8b04b082599370;hpb=05b0f8e4762b8a2ca2002a8f7545b7ff68cc3925;p=timetracker.git diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index ae90374c..71cee914 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -1300,6 +1300,20 @@ class ttReportHelper { return $body; } + // checkFavReportCondition - checks whether it is okay to send fav report. + static function checkFavReportCondition($report, $condition) + { + $items = ttReportHelper::getFavItems($report); + + $condition = str_replace('count', '', $condition); + $count_required = intval(trim(str_replace('>', '', $condition))); + + if (count($items) > $count_required) + return true; // Condition ok. + + return false; + } + // prepareFavReportBody - prepares an email body for a favorite report. static function prepareFavReportBody($report) { @@ -1574,7 +1588,7 @@ class ttReportHelper { $mailer->setContentType('text/html'); $mailer->setSender(SENDER); $mailer->setReceiver($email); - $mailer->setSendType(MAIL_MODE); + $mailer->setMailMode(MAIL_MODE); if (!$mailer->send($report['name'], $body)) return false;