Skip to content

Commit

Permalink
data MDL-23488 made available from/to work
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Davis committed Sep 13, 2010
1 parent 9398995 commit 656f1a9
Show file tree
Hide file tree
Showing 3 changed files with 266 additions and 245 deletions.
2 changes: 2 additions & 0 deletions lang/en_utf8/data.php
Expand Up @@ -87,6 +87,7 @@
$string['errormustbeteacher'] = 'You need to be a teacher to use this page!';
$string['example'] = 'Database module example';
$string['excel'] = 'Excel';
$string['expired'] = 'Sorry, this activity closed on {$a} and is no longer available';
$string['export'] = 'Export';
$string['exportaszip'] = 'Export as zip';
$string['exportdatabaserecords'] = 'Export Database records';
Expand Down Expand Up @@ -180,6 +181,7 @@
$string['nosingletemplate'] = 'Single template is not yet defined';
$string['notapproved'] = 'Entry is not approved yet.';
$string['notinjectivemap'] = 'Not an injective map';
$string['notopenyet'] = 'Sorry, this activity is not available until {$a}';
$string['number'] = 'Number';
$string['numberrssarticles'] = 'RSS articles';
$string['numnotapproved'] = 'Pending';
Expand Down
7 changes: 7 additions & 0 deletions mod/data/lib.php
Expand Up @@ -1683,6 +1683,13 @@ function data_user_can_add_entry($data, $currentgroup, $groupmode) {
if (!has_capability('mod/data:writeentry', $context) and !has_capability('mod/data:manageentries',$context)) {
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;
}
Expand Down

0 comments on commit 656f1a9

Please sign in to comment.