X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/6e023fcc8768de908976357682d951d9f9a42226..25d6ffc5f17d0e016c2ebb5b51a222665834e9e4:/WEB-INF/lib/ttReportHelper.class.php diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 01929320..e2bb8ddb 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -962,11 +962,34 @@ 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)); + + $less_or_equal = ttStartsWith($condition, '<='); + if ($less_or_equal) $condition = trim(str_replace('<=', '', $condition)); + + $not_equal = ttStartsWith($condition, '<>'); + if ($not_equal) $condition = trim(str_replace('<>', '', $condition)); + + $greater = ttStartsWith($condition, '>'); + if ($greater) $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; + if ($not_equal && count($items) <> $count_required) return true; return false; }