X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/862774685f3a45de5b783627a66fc8b65839d7c7..55c8f6a2bce9518c28337b18823b8300d1875ab8:/WEB-INF/lib/ttUser.class.php diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 78fee50d..a14f7cdd 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -172,4 +172,20 @@ class ttUser { } return $result; } + + // isDateLocked checks whether a specifc date is locked for modifications. + function isDateLocked($date) + { + if ($this->isPluginEnabled('lk')) { + // Determine lock date. Entries earlier than lock date cannot be created or modified. + $lockdate = 0; + if ($this->lock_interval > 0) { + $lockdate = new DateAndTime(); + $lockdate->decDay($this->lock_interval); + } + if($lockdate && $date->before($lockdate)) + return true; + } + return false; + } }