X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttReportHelper.class.php;h=71cee91478a094a8485ce051545cc04456027650;hb=cf9315882cd37786cc8ba5d13bf6381b935d1600;hp=56a4aa805ad379edadbf3e22fd6cbbc6e9a4b288;hpb=db2ca21db73a2ea52155510e1e0300541d6b9ef6;p=timetracker.git diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 56a4aa80..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) {