X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttTimeHelper.class.php;h=a66652b70a2edd0c8d45e0a55f0621ae3e5004ba;hb=14a6ab5e563acb66d090c6c291b5d51b1a31fae7;hp=4e10f4ed749b8d9d89faf9ba8a474d22beb878e0;hpb=54bb71ed8e6b7f79e3b26bc1c8a70a95793950c8;p=timetracker.git 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; + } }