X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/05b0f8e4762b8a2ca2002a8f7545b7ff68cc3925..faab3aece19a445dd7e2e42d82f47e701d32366f:/WEB-INF/lib/ttReportHelper.class.php 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;