X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/d528413f57480455efce71f40082eb682f2d8d48..903dae76e54a4e0c081532a8113c00ef1b56a1b5:/WEB-INF/lib/ttTimeHelper.class.php diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 4e10f4ed..a66652b7 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -748,4 +748,18 @@ class ttTimeHelper { return $result; } + + // canAdd determines if we can add a record in case there is a limit. + static function canAdd() { + $mdb2 = getConnection(); + $sql = "select param_value from tt_site_config where param_name = 'exp_date'"; + $res = $mdb2->query($sql); + $val = $res->fetchRow(); + if (!$val) return true; // No expiration date. + + if (strtotime($val['param_value']) > time()) + return true; // Expiration date exists but not reached. + + return false; + } }