Fixed double notifications, hopefully.
authorNik Okuntseff <support@anuko.com>
Sat, 10 Sep 2016 23:08:58 +0000 (23:08 +0000)
committerNik Okuntseff <support@anuko.com>
Sat, 10 Sep 2016 23:08:58 +0000 (23:08 +0000)
WEB-INF/templates/footer.tpl
cron.php

index 793494d..c9af24b 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.9.30.3529 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.9.31.3530 | 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>
index 345ddd3..9212e55 100644 (file)
--- a/cron.php
+++ b/cron.php
@@ -46,6 +46,7 @@ import('ttReportHelper');
 
 $mdb2 = getConnection();
 $now = mktime();
+$now = 1473548400;
 
 $sql = "select * from tt_cron where $now >= next 
   and status = 1 and report_id is not null and email is not null";
@@ -71,7 +72,8 @@ while ($val = $res->fetchRow()) {
     echo "Error while emailing report...<br>";
 
   // Calculate next execution time.
-  $next = tdCron::getNextOccurrence($val['cron_spec'], $now); 
+  $next = tdCron::getNextOccurrence($val['cron_spec'], $now + 60); // +60 sec is here to get us correct $next when $now is close to existing "next".
+                                                                   // This is because the accuracy of tdcron class appears to be 1 minute.
 
   // Update last and next values in tt_cron.
   $sql = "update tt_cron set last = $now, next = $next where id = ".$val['id'];