--- a/mod/scheduler/exportlib.php +++ b/mod/scheduler/exportlib.php @@ -131,8 +131,10 $pfields = profile_get_custom_fields(); foreach ($pfields as $id => $field) { - $type = $field->datatype; - $result[] = new scheduler_profile_field('profile_'.$type, $id, $type); + if ($field->visible === PROFILE_VISIBLE_ALL || is_siteadmin()) { + $type = $field->datatype; + $result[] = new scheduler_profile_field('profile_'.$type, $id, $type); + } } $result[] = new scheduler_attended_field();