Skip to content

Commit

Permalink
Disable status if config not set BT#17034
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Apr 20, 2020
1 parent d019feb commit 57fbd41
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions main/admin/statistics/index.php
Expand Up @@ -15,6 +15,7 @@
$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(
Expand Down Expand Up @@ -199,8 +200,12 @@
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'));

Expand Down Expand Up @@ -267,12 +272,15 @@
$reportOptions2,
'canvas2'
);
$htmlHeadXtra[] = Statistics::getJSChartTemplate(
$url3,
$reportType,
$reportOptions3,
'canvas3'
);

if ($sessionStatusAllowed) {
$htmlHeadXtra[] = Statistics::getJSChartTemplate(
$url3,
$reportType,
$reportOptions3,
'canvas3'
);
}

$reportOptions = '
legend: {
Expand Down Expand Up @@ -361,7 +369,6 @@

$course_categories = Statistics::getCourseCategories();
$content = '';
$sessionStatusAllowed = api_get_configuration_value('allow_session_status');

switch ($report) {
case 'session_by_date':
Expand Down

0 comments on commit 57fbd41

Please sign in to comment.