[svn r10974] bugfix: correct survey link in mail, filling survey as non course member

skala
Patrick Cool 18 years ago
parent f26cf77db6
commit 551c600bdc
  1. 16
      main/survey/fillsurvey.php
  2. 11
      main/survey/survey.lib.php
  3. 3
      main/survey/survey_invite.php

@ -37,14 +37,18 @@ require ('../inc/global.inc.php');
// including additional libraries
//require_once (api_get_path(LIBRARY_PATH)."/survey.lib.php");
require_once('survey.lib.php');
require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
// getting all the course information
$_course = CourseManager::get_course_information($_GET['course']);
// Database table definitions
$table_survey = Database :: get_course_table(TABLE_SURVEY);
$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
$table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
$table_survey = Database :: get_course_table(TABLE_SURVEY, $_course['db_name']);
$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION, $_course['db_name']);
$table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION, $_course['db_name']);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION);
$table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION, $_course['db_name']);
// breadcrumbs
// $interbreadcrumb[] = array ("url" => 'survey_list.php', 'name' => get_lang('SurveyList'));
@ -205,8 +209,10 @@ Display :: display_footer();
*/
function store_answer($user, $survey_id, $question_id, $option_id)
{
global $_course;
// table definition
$table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER);
$table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER, $_course['db_name']);
$sql = "INSERT INTO $table_survey_answer (user, survey_id, question_id, option_id) VALUES (
'".mysql_real_escape_string($user)."',

@ -47,7 +47,10 @@ class survey_manager
*/
function get_survey($survey_id)
{
$tbl_survey = Database :: get_course_table(TABLE_SURVEY);
global $_course;
// table definition
$tbl_survey = Database :: get_course_table(TABLE_SURVEY, $_course['db_name']);
$sql = "SELECT * FROM $tbl_survey WHERE survey_id='".mysql_real_escape_string($survey_id)."'";
$result = api_sql_query($sql, __FILE__, __LINE__);
@ -219,9 +222,11 @@ class survey_manager
*/
function save_question($form_content)
{
global $_course;
// table definitions
$table_survey = Database :: get_course_table(TABLE_SURVEY);
$tbl_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
$table_survey = Database :: get_course_table(TABLE_SURVEY, $_course['db_name']);
$tbl_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION, $_course['db_name']);
// storing a new question
if ($form_content['question_id'] == '' OR !is_numeric($form_content['question_id']))

@ -168,6 +168,7 @@ function save_invitations($users_array, $invitation_title, $invitation_text)
{
global $_user;
global $_course;
global $_configuration;
// Database table definition
$table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION);
@ -193,7 +194,7 @@ function save_invitations($users_array, $invitation_title, $invitation_text)
$result = api_sql_query($sql, __FILE__, __LINE__);
// replacing the **link** part with a valid link for the user
$survey_link = 'http://fillsurvey.php?course='.$_course['code'].'&invitationcode='.$invitation_code;
$survey_link = $_configuration['root_web'].$_configuration['code_append'].'survey/'.'fillsurvey.php?course='.$_course['sysCode'].'&invitationcode='.$invitation_code;
$invitation_text = str_ireplace('**link**', $survey_link ,$invitation_text, $replace_count);
if ($replace_count < 1)
{

Loading…
Cancel
Save