X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/9b51878cb6636d768f5938615090c67f397a6558..93472f16bca36138fb4f227b262fe0a96a246776:/WEB-INF/lib/ttReportHelper.class.php diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 01929320..14683e0b 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -962,11 +962,30 @@ class ttReportHelper { { $items = ttReportHelper::getItems($options); - $condition = str_replace('count', '', $condition); - $count_required = (int) trim(str_replace('>', '', $condition)); + $condition = trim(str_replace('count', '', $condition)); - if (count($items) > $count_required) - return true; // Condition ok. + $greater_or_equal = ttStartsWith($condition, '>='); + if ($greater_or_equal) $condition = trim(str_replace('>=', '', $condition)); + + $greater = ttStartsWith($condition, '>'); + if ($greater) $condition = trim(str_replace('>', '', $condition)); + + $less_or_equal = ttStartsWith($condition, '<='); + if ($less_or_equal) $condition = trim(str_replace('<=', '', $condition)); + + $less = ttStartsWith($condition, '<'); + if ($less) $condition = trim(str_replace('<', '', $condition)); + + $equal = ttStartsWith($condition, '='); + if ($equal) $condition = trim(str_replace('=', '', $condition)); + + $count_required = (int) $condition; + + if ($greater && count($items) > $count_required) return true; + if ($greater_or_equal && count($items) >= $count_required) return true; + if ($less && count($items) < $count_required) return true; + if ($less_or_equal && count($items) <= $count_required) return true; + if ($equal && count($items) == $count_required) return true; return false; }