diff --git a/main/survey/surveyUtil.class.php b/main/survey/surveyUtil.class.php index e03ade5869..1b14bd327e 100755 --- a/main/survey/surveyUtil.class.php +++ b/main/survey/surveyUtil.class.php @@ -480,16 +480,18 @@ class SurveyUtil } $ch_type = 'ch_'.$question['type']; - /** @var survey_question $display */ - $display = new $ch_type(); - - $url = api_get_self(); - $form = new FormValidator('question', 'post', $url); - $form->addHtml('
'); - $form->addHtml($question['survey_question']); - $display->render($form, $question, $finalAnswer); - $form->addHtml('
'); - $form->display(); + if (class_exists($ch_type)) { + /** @var survey_question $display */ + $display = new $ch_type(); + + $url = api_get_self(); + $form = new FormValidator('question', 'post', $url); + $form->addHtml('
'); + $form->addHtml($question['survey_question']); + $display->render($form, $question, $finalAnswer); + $form->addHtml('
'); + $form->display(); + } } } } diff --git a/main/survey/survey_invitation.php b/main/survey/survey_invitation.php index 150d4b006b..be2a50f663 100755 --- a/main/survey/survey_invitation.php +++ b/main/survey/survey_invitation.php @@ -63,24 +63,25 @@ if ($survey_data['anonymous'] == 1) { ); $answered_data = []; } +$url = api_get_self().'?survey_id='.$survey_id.'&'.api_get_cidreq(); if (!isset($_GET['view']) || $_GET['view'] == 'invited') { echo get_lang('ViewInvited').' | '; } else { - echo ' '. + echo ' '. get_lang('ViewInvited').' |'; } if ($_GET['view'] == 'answered') { echo get_lang('ViewAnswered').' | '; } else { - echo ' '. + echo ' '. get_lang('ViewAnswered').' |'; } if ($_GET['view'] == 'unanswered') { echo get_lang('ViewUnanswered'); } else { - echo ' '. + echo ' '. get_lang('ViewUnanswered').''; } @@ -118,11 +119,13 @@ while ($row = Database::fetch_assoc($res)) { } else { echo ''.$row['user'].''; } - echo ' '.api_get_local_time($row['invitation_date']).''; + echo ' '.Display::dateToStringAgoAndLongDate($row['invitation_date']).''; echo ' '; if (in_array($row['user'], $answered_data) && !api_get_configuration_value('hide_survey_reporting_button')) { - echo ''. + echo ''. get_lang('ViewAnswers').''; } else { echo '-'; @@ -136,5 +139,4 @@ while ($row = Database::fetch_assoc($res)) { // Closing the table echo ''; -// Footer Display::display_footer(); diff --git a/main/survey/survey_invite.php b/main/survey/survey_invite.php index d9dd60d2e0..e7cbb3356c 100755 --- a/main/survey/survey_invite.php +++ b/main/survey/survey_invite.php @@ -237,11 +237,12 @@ if ($form->validate()) { // Counting the number of people that are invited $total_invited = SurveyUtil::update_count_invited($survey_data['code']); $total_count = $count_course_users + $counter_additional_users; + $invitationUrl = api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?survey_id='.$survey_data['survey_id'].'&'.api_get_cidreq(); if ($total_invited > 0) { - $message = ''. + $message = ''. $survey_data['answered'].' '; $message .= get_lang('HaveAnswered').' '; - $message .= ''. + $message .= ''. $total_invited.' '; $message .= get_lang('WereInvited'); echo Display::return_message($message, 'normal', false);