Added <> handler to conditions.
authorNik Okuntseff <support@anuko.com>
Thu, 25 Oct 2018 18:47:30 +0000 (18:47 +0000)
committerNik Okuntseff <support@anuko.com>
Thu, 25 Oct 2018 18:47:30 +0000 (18:47 +0000)
WEB-INF/lib/common.lib.php
WEB-INF/lib/ttReportHelper.class.php
WEB-INF/templates/footer.tpl

index d1ad384..4337710 100644 (file)
@@ -319,7 +319,7 @@ function ttValidCondition($val, $emptyValid = true)
   if (stristr($val, '<script>') || stristr($val, '<script '))
     return false;
 
-  if (!preg_match("/^count\s?(=|[<>]=?)\s?\d+$/", $val))
+  if (!preg_match("/^count\s?(=|[<>]=?|<>)\s?\d+$/", $val))
     return false;
 
   return true;
index 14683e0..e2bb8dd 100644 (file)
@@ -967,12 +967,15 @@ class ttReportHelper {
     $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));
 
+    $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));
 
@@ -986,6 +989,7 @@ class ttReportHelper {
     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;
   }
index 3ba0f22..7167ac7 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.17.100.4323 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.17.100.4324 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>