Index: lib.php =================================================================== RCS file: /cvsroot/moodle/moodle/calendar/lib.php,v retrieving revision 1.206.2.5 diff -u -r1.206.2.5 lib.php --- lib.php 12 Nov 2007 06:26:57 -0000 1.206.2.5 +++ lib.php 13 Nov 2007 14:51:33 -0000 @@ -417,13 +417,27 @@ } if($events !== false) { - foreach($events as $event) { if(!empty($event->modulename)) { $mod = get_coursemodule_from_instance($event->modulename, $event->instance); if (!groups_course_module_visible($mod)) { continue; } + + if ($event->modulename == 'assignment'){ + $context = get_context_instance(CONTEXT_COURSE, $event->course); + + if(!calendar_edit_event_allowed($event)){//cannot manage entries, eg. student + + if(!$assignment = get_record('assignment','id',$event->id)){ + error("assignment ID was incorrect"); + } + + if ($assignment->var3){//force not to show description before availability + $event->description = get_string('notavailableyet', 'assignment'); + } + } + } } if($processed >= $display->maxevents) { @@ -519,6 +533,7 @@ } else { echo ''; } + echo format_text($event->description, FORMAT_HTML); if (calendar_edit_event_allowed($event)) { echo '
';