More improvements in the Danish file.
[timetracker.git] / WEB-INF / lib / ttReportHelper.class.php
index ae90374..71cee91 100644 (file)
@@ -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;