|
|
|
@ -141,8 +141,13 @@ if (Database::num_rows($result) < 1) { |
|
|
|
$survey_invitation = Database::fetch_array($result, 'ASSOC'); |
|
|
|
$survey_invitation = Database::fetch_array($result, 'ASSOC'); |
|
|
|
|
|
|
|
|
|
|
|
// Now we check if the user already filled the survey |
|
|
|
// Now we check if the user already filled the survey |
|
|
|
if ( !isset($_POST['finish_survey']) && |
|
|
|
if ( |
|
|
|
($isAnonymous && isset($_SESSION['surveyuser'])) || |
|
|
|
!isset($_POST['finish_survey']) && |
|
|
|
|
|
|
|
( |
|
|
|
|
|
|
|
$isAnonymous && |
|
|
|
|
|
|
|
isset($_SESSION['surveyuser']) && |
|
|
|
|
|
|
|
SurveyUtil::isSurveyAnsweredFlagged($survey_invitation['survey_code'], $survey_invitation['c_id']) |
|
|
|
|
|
|
|
) || |
|
|
|
($survey_invitation['answered'] == 1 && !isset($_GET['user_id'])) |
|
|
|
($survey_invitation['answered'] == 1 && !isset($_GET['user_id'])) |
|
|
|
) { |
|
|
|
) { |
|
|
|
Display :: display_error_message(get_lang('YouAlreadyFilledThisSurvey'), false); |
|
|
|
Display :: display_error_message(get_lang('YouAlreadyFilledThisSurvey'), false); |
|
|
|
@ -523,6 +528,9 @@ if (isset($_POST['finish_survey'])) { |
|
|
|
$survey_invitation['user'], |
|
|
|
$survey_invitation['user'], |
|
|
|
$survey_invitation['survey_code'] |
|
|
|
$survey_invitation['survey_code'] |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SurveyUtil::flagSurveyAsAnswered($survey_invitation['survey_code'], $survey_invitation['c_id']); |
|
|
|
|
|
|
|
|
|
|
|
unset($_SESSION['paged_questions']); |
|
|
|
unset($_SESSION['paged_questions']); |
|
|
|
unset($_SESSION['page_questions_sec']); |
|
|
|
unset($_SESSION['page_questions_sec']); |
|
|
|
Display :: display_footer(); |
|
|
|
Display :: display_footer(); |
|
|
|
|