Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x

pull/3213/head
Yannick Warnier 6 years ago
commit 1f689dc7d9
  1. 25
      main/admin/statistics/index.php
  2. 18
      main/inc/lib/api.lib.php
  3. 2
      main/survey/reporting.php
  4. 16
      main/survey/surveyUtil.class.php

@ -15,6 +15,7 @@ $interbreadcrumb[] = ['url' => '../index.php', 'name' => get_lang('PlatformAdmin
$report = isset($_REQUEST['report']) ? $_REQUEST['report'] : '';
$sessionDuration = isset($_GET['session_duration']) ? (int) $_GET['session_duration'] : '';
$validated = false;
$sessionStatusAllowed = api_get_configuration_value('allow_session_status');
if (
in_array(
@ -199,8 +200,12 @@ in_array(
true,
['format' => 'YYYY-MM-DD', 'timePicker' => 'false', 'validate_format' => 'Y-m-d']
);
$options = SessionManager::getStatusList();
$form->addSelect('status_id', get_lang('SessionStatus'), $options, ['placeholder' => get_lang('All')]);
if ($sessionStatusAllowed) {
$options = SessionManager::getStatusList();
$form->addSelect('status_id', get_lang('SessionStatus'), $options, ['placeholder' => get_lang('All')]);
}
$form->addHidden('report', 'session_by_date');
$form->addButtonSearch(get_lang('Search'));
@ -267,12 +272,15 @@ in_array(
$reportOptions2,
'canvas2'
);
$htmlHeadXtra[] = Statistics::getJSChartTemplate(
$url3,
$reportType,
$reportOptions3,
'canvas3'
);
if ($sessionStatusAllowed) {
$htmlHeadXtra[] = Statistics::getJSChartTemplate(
$url3,
$reportType,
$reportOptions3,
'canvas3'
);
}
$reportOptions = '
legend: {
@ -361,7 +369,6 @@ $tools = [
$course_categories = Statistics::getCourseCategories();
$content = '';
$sessionStatusAllowed = api_get_configuration_value('allow_session_status');
switch ($report) {
case 'session_by_date':

@ -9686,7 +9686,8 @@ function api_find_template($template)
/**
* Returns an array of languages (English names like "english", "french", etc)
* to ISO 639-1 codes (fr, es, etc) for use (for example) to show flags
* Note: 'english' is returned as 'gb'
* Note: 'english' is returned as 'gb'.
*
* @return array
*/
function api_get_language_list_for_flag()
@ -9708,9 +9709,11 @@ function api_get_language_list_for_flag()
/**
* Generate the Javascript required for the on-page translation of
* multi-language strings
* @return string
* multi-language strings.
*
* @throws Exception
*
* @return string
*/
function api_get_language_translate_html()
{
@ -9792,11 +9795,14 @@ function api_get_language_translate_html()
/**
* Filter a multi-language HTML string (for the multi-language HTML
* feature) into the given language (strip the rest)
* feature) into the given language (strip the rest).
*
* @param string $htmlString The HTML string to "translate". Usually <p><span lang="en">Some string</span></p><p><span lang="fr">Une chaîne</span></p>
* @param string $language The language in which we want to get the
* @return string The filtered string in the given language, or the full string if no translated string was identified
* @param string $language The language in which we want to get the
*
* @throws Exception
*
* @return string The filtered string in the given language, or the full string if no translated string was identified
*/
function api_get_filtered_multilingual_HTML_string($htmlString, $language = null)
{

@ -72,7 +72,7 @@ if (!empty($exportReport) && !empty($format)) {
case 'csv':
default:
$data = SurveyUtil::export_complete_report($survey_data, $userId, $compact);
$filename = 'survey_results_'.$survey_id.($compact?'_compact':'').'.csv';
$filename = 'survey_results_'.$survey_id.($compact ? '_compact' : '').'.csv';
header('Content-type: application/octet-stream');
header('Content-Type: application/force-download');

@ -1312,18 +1312,20 @@ class SurveyUtil
/**
* Quite similar to display_complete_report(), returns an HTML string
* that can be used in a csv file.
*
* @param array $survey_data The basic survey data as initially obtained by SurveyManager::get_survey()
* @param int $user_id The ID of the user asking for the report
* @param bool $compact Whether to present the long (v marks with multiple columns per question) or compact (one column per question) answers format
*
* @todo consider merging this function with display_complete_report
*
* @throws Exception
*
* @return string The contents of a csv file
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
*
* @version February 2007
* @throws Exception
*/
public static function export_complete_report($survey_data, $user_id = 0, $compact = false)
{
@ -1541,12 +1543,12 @@ class SurveyUtil
/**
* Add a line to the csv file.
*
* @param array $survey_data Basic survey data (we're mostly interested in the 'anonymous' index)
* @param array $possible_options Possible answers
* @param array $answers_of_user User's answers
* @param mixed $user User ID or user details as string - Used as a string in the result string
* @param bool $display_extra_user_fields Whether to display user fields or not
* @param bool $compact Whether to show answers as different column values (true) or one column per option (false, default)
* @param array $survey_data Basic survey data (we're mostly interested in the 'anonymous' index)
* @param array $possible_options Possible answers
* @param array $answers_of_user User's answers
* @param mixed $user User ID or user details as string - Used as a string in the result string
* @param bool $display_extra_user_fields Whether to display user fields or not
* @param bool $compact Whether to show answers as different column values (true) or one column per option (false, default)
*
* @return string One line of the csv file
*

Loading…
Cancel
Save