* @version 2.0 */ global $CFG, $USER; require_once $CFG->dirroot . "/blocks/ilp/lib.php"; //get the user id if it is not set then we will pass the global $USER->id $user_id = $PARSER->optional_param('user_id', $USER->id, PARAM_INT); //get the id of the report $report_id = $PARSER->required_param('report_id', PARAM_INT); if (!isset($context)) { print_error('contextnotset'); } $dbc = new ilp_db(); //get all of the users roles in the current context and save the id of the roles into //an array $role_ids = array(); $authuserrole = $dbc->get_role_by_name(ILP_AUTH_USER_ROLE); if (!empty($authuserrole)) { $role_ids[] = $authuserrole->id; } if ($roles = get_user_roles($context, $USER->id)) { foreach ($roles as $role) { $role_ids[] = $role->roleid; } } //REPORT CAPABILITIES $access_report_createreports = 0; $access_report_editreports = 0; $access_report_deletereports = 0; $access_report_viewreports = 0; $access_report_viewilp = 0; $access_report_viewotherilp = 0;