+
+ // isDateLocked checks whether a specifc date is locked for modifications.
+ function isDateLocked($date)
+ {
+ if ($this->isPluginEnabled('lk') && $this->lock_spec) {
+ // Override for managers.
+ if ($this->canManageTeam()) return false;
+
+ require_once(LIBRARY_DIR.'/tdcron/class.tdcron.php');
+ require_once(LIBRARY_DIR.'/tdcron/class.tdcron.entry.php');
+
+ // Calculate the last occurrence of a lock.
+ $last = tdCron::getLastOccurrence($this->lock_spec, mktime());
+ $lockdate = new DateAndTime(DB_DATEFORMAT, strftime('%Y-%m-%d', $last));
+ if ($date->before($lockdate)) {
+ return true;
+ }
+ }
+ return false;
+ }