data MDL-23488 made database activity respect availability and visibility dates

AMOS BEGIN
 CPY [expired,mod_choice],[expired,mod_data]
 CPY [notopenyet,mod_choice],[notopenyet,mod_data]
AMOS END
This commit is contained in:
Andrew Davis 2010-07-29 03:26:02 +00:00
parent eb8d85c1d3
commit 2742ffe7c9
3 changed files with 17 additions and 0 deletions

View file

@ -1946,6 +1946,12 @@ function data_user_can_add_entry($data, $currentgroup, $groupmode) {
return false;
}
//if in the view only time window
$now = time();
if ($now>$data->timeviewfrom && $now<$data->timeviewto) {
return false;
}
if (!$groupmode or has_capability('moodle/site:accessallgroups', $context)) {
return true;
}