Skip to content

Commit

Permalink
Add report survey page BT#15553
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed May 16, 2019
1 parent cc9003b commit a5ee47e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
49 changes: 49 additions & 0 deletions main/mySpace/survey_report.php
@@ -0,0 +1,49 @@
<?php
/* For licensing terms, see /license.txt */

$cidReset = true;

require_once __DIR__.'/../inc/global.inc.php';

// the section (for the tabs)
$this_section = SECTION_TRACKING;

$csv_content = [];
$nameTools = get_lang('MySpace');

$allowToTrack = api_is_platform_admin(true, true);
if (!$allowToTrack) {
api_not_allowed(true);
}

$form = new FormValidator('survey');
$form->addSelectAjax(
'user_id',
get_lang('User'),
[],
[
'url' => api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=get_user_like',
]
);
$form->addButtonSearch();

$userInfo = [];
if ($form->validate()) {
$userId = $form->exportValue('user_id');
$userInfo = api_get_user_info($userId);
}

Display::display_header($nameTools);
echo '<div class="actions">';
echo MySpace::getTopMenu();
echo '</div>';
echo MySpace::getAdminActions();

if (!empty($userInfo)) {
echo Display::page_subheader($userInfo['complete_name']);
echo SurveyManager::surveyReport($userInfo);
echo SurveyManager::surveyReport($userInfo, 1);

}

Display::display_footer();
1 change: 0 additions & 1 deletion main/survey/survey.lib.php
Expand Up @@ -2410,7 +2410,6 @@ public static function surveyReport($userInfo, $answered = 0)
$mainUrl = api_get_path(WEB_CODE_PATH).'survey/survey.php?';
$content = '';
if (!empty($invitations)) {

$table = new HTML_Table(['class' => 'table']);
$table->setHeaderContents(0, 0, get_lang('SurveyName'));
$table->setHeaderContents(0, 1, get_lang('Course'));
Expand Down

0 comments on commit a5ee47e

Please sign in to comment.