mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
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:
parent
eb8d85c1d3
commit
2742ffe7c9
3 changed files with 17 additions and 0 deletions
|
@ -368,6 +368,15 @@
|
|||
}
|
||||
|
||||
|
||||
//if data activity closed dont let students in
|
||||
if (!has_capability('mod/data:manageentries', $context)) {
|
||||
$timenow = time();
|
||||
if (!empty($data->timeavailablefrom) && $data->timeavailablefrom > $timenow) {
|
||||
print_error('notopenyet', 'data', null, userdate($data->timeavailablefrom));
|
||||
} else if (!empty($data->timeavailableto) && $timenow > $data->timeavailableto) {
|
||||
print_error('expired', 'data', null, userdate($data->timeavailableto));
|
||||
}
|
||||
}
|
||||
|
||||
/// Print the tabs
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue