Events associated to hidden activities are now invisible in calendar, using new field 'visible' in table 'event' which is updated each time a course module is hidden or unhidden.

This commit is contained in:
gustav_delius
2004-05-05 07:07:56 +00:00
parent b0942cf145
commit dcd338ffdc
12 changed files with 108 additions and 76 deletions
+13
View File
@@ -493,6 +493,19 @@ function main_upgrade($oldversion=0) {
if ($oldversion < 2004043001) { /// Add hiddentopics field to control hidden topics behaviour
table_column("course", "", "hiddensections", "integer", "2", "unsigned", "0", "not null", "visible");
}
if ($oldversion < 2004050400) { /// add a visible field for events
table_column("event", "", "visible", "tinyint", "1", "", "1", "not null", "timeduration");
if ($events = get_records('event')) {
foreach($events as $event) {
if ($moduleid = get_field('modules', 'id', 'name', $event->modulename)) {
if (get_field('course_modules', 'visible', 'module', $moduleid, 'instance', $event->instance) == 0) {
set_field('event', 'visible', 0, 'id', $event->id);
}
}
}
}
}
return $result;