Minor - format code, flint fixes

pull/3213/head
Julio Montoya 6 years ago
parent be9d888e94
commit 75a65bcc6a
  1. 8
      main/admin/statistics/index.php
  2. 4
      main/admin/user_add.php
  3. 9
      main/inc/ajax/statistics.ajax.php
  4. 25
      main/inc/lib/api.lib.php
  5. 5
      main/inc/lib/formvalidator/FormValidator.class.php
  6. 1
      main/inc/lib/tracking.lib.php
  7. 2
      main/lp/learnpathItem.class.php
  8. 6
      main/permissions/permissions_functions.inc.php
  9. 2
      main/survey/ch_multiplechoiceother.php
  10. 2
      main/survey/ch_selectivedisplay.php
  11. 3
      main/survey/survey.lib.php

@ -1141,7 +1141,7 @@ switch ($report) {
];
while ($row = Database::fetch_array($query)) {
++$usersFound;
$usersFound++;
if (!empty($row['value'])) {
$validDate = DateTime::createFromFormat('Y-m-d', $row['value']);
$validDate = $validDate && $validDate->format('Y-m-d') === $row['value'];
@ -1151,13 +1151,13 @@ switch ($report) {
$years = (int) $interval->y;
if ($years >= 16 && $years <= 17) {
++$all['16-17'];
$all['16-17']++;
}
if ($years >= 18 && $years <= 25) {
++$all['18-25'];
$all['18-25']++;
}
if ($years >= 26 && $years <= 30) {
++$all['26-30'];
$all['26-30']++;
}
}
}

@ -1,9 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.admin
*/
$cidReset = true;
// Including necessary libraries.
require_once __DIR__.'/../inc/global.inc.php';

@ -434,13 +434,13 @@ switch ($action) {
$years = (int) $interval->y;
if ($years >= 16 && $years <= 17) {
$all['16-17'] += 1;
$all['16-17']++;
}
if ($years >= 18 && $years <= 25) {
$all['18-25'] += 1;
$all['18-25']++;
}
if ($years >= 26 && $years <= 30) {
$all['26-30'] += 1;
$all['26-30']++;
}
}
}
@ -659,7 +659,7 @@ switch ($action) {
if (!isset($all[$language])) {
$all[$language] = 0;
}
$all[$language] += 1;
$all[$language]++;
}
$table = Statistics::buildJsChartData($all, '');
$table = $table['table'];
@ -718,7 +718,6 @@ switch ($action) {
$list['table'] = $table;
header('Content-type: application/json');
echo json_encode($list);
break;

@ -1380,6 +1380,7 @@ function api_get_navigator()
if (strpos($version, '.') === false) {
$version = number_format(doubleval($version), 1);
}
return ['name' => $navigator, 'version' => $version];
}
@ -2534,6 +2535,7 @@ function get_status_from_code($status_code)
case INVITEE:
return get_lang('Invitee', '');
}
return '';
}
@ -2905,6 +2907,7 @@ function api_get_settings_params($params)
function api_get_settings_params_simple($params)
{
$table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
return Database::select('*', $table, ['where' => $params], 'one');
}
@ -3612,6 +3615,7 @@ function api_is_allowed_to_session_edit($tutor = false, $coach = false)
}
}
}
return false;
}
@ -3694,6 +3698,7 @@ function api_is_allowed($tool, $action, $task_id = 0)
return false;
}
}
return false;
}
@ -5081,8 +5086,6 @@ function api_get_visual_theme()
}
}
// Get style directly from DB
$styleFromDatabase = api_get_settings_params_simple(
[
@ -5149,7 +5152,6 @@ function api_get_visual_theme()
if ($useCache) {
apcu_store($apcVar, $visual_theme, 120);
}
}
return $visual_theme;
@ -5429,10 +5431,10 @@ function rmdirr($dirname, $delete_only_content_in_folder = false, $strict = fals
* function adapted from a php.net comment
* copy recursively a folder.
*
* @param string $source the source folder
* @param string $dest the dest folder
* @param array $exclude an array of excluded file_name (without extension)
* @param array $copied_files the returned array of copied files
* @param string $source the source folder
* @param string $dest the dest folder
* @param array $exclude an array of excluded file_name (without extension)
* @param array $copied_files the returned array of copied files
*/
function copyr($source, $dest, $exclude = [], $copied_files = [])
{
@ -9175,7 +9177,8 @@ function api_mail_html(
}
/**
* Checks access to a course group
* Checks access to a course group.
*
* @param string $tool Possible values: GroupManager::GROUP_TOOL_*
* @param bool $showHeader
*/
@ -9223,6 +9226,7 @@ function api_protect_course_group($tool, $showHeader = true)
api_not_allowed($showHeader);
}
}
return false;
}
@ -9346,6 +9350,7 @@ function api_upload_file($type, $file, $itemId, $cropParameters = '')
return ['path_to_save' => $pathId.$name];
}
}
return false;
}
@ -9632,9 +9637,7 @@ function api_unserialize_content($type, $serialized, $ignoreErrors = false)
/**
* Set the From and ReplyTo properties to PHPMailer instance.
* @param PHPMailer $mailer
* @param array $sender
* @param array $replyToAddress
*
* @throws \PHPMailer\PHPMailer\Exception
*/
function api_set_noreply_and_from_address_to_mailer(PHPMailer $mailer, array $sender, array $replyToAddress = [])

@ -969,7 +969,12 @@ EOT;
*/
public function addHtml($snippet)
{
if (empty($snippet)) {
return false;
}
$this->addElement('html', $snippet);
return true;
}
/**

@ -159,7 +159,6 @@ class Tracking
$hideTime = api_get_configuration_value('hide_lp_time');
$allowNewTracking = api_get_configuration_value('use_new_tracking_in_lp_item');
$lp_id = (int) $lp_id;
if ($allowNewTracking) {

@ -75,11 +75,11 @@ class learnpathItem
public $type;
public $view_id;
public $oldTotalTime;
public $view_max_score;
//var used if absolute session time mode is used
private $last_scorm_session_time = 0;
private $prerequisiteMaxScore;
private $prerequisiteMinScore;
public $view_max_score;
/**
* Prepares the learning path item for later launch.

@ -123,7 +123,7 @@ function store_one_permission($content, $action, $id, $tool, $permission)
* This function retrieves the existing permissions of a user, group or role.
*
* @param string $content are we retrieving the rights of a user, a group or a role (the database depends on it)
* @param int $id the id of the user, group or role
* @param int $id the id of the user, group or role
*
* @author Patrick Cool <patrick.cool@ugent.be>, Ghent University
*
@ -487,8 +487,8 @@ function get_all_roles($content = 'course')
* This function gets all the roles that are defined.
*
* @param string $content are we finding the roles for a user or a group (the database depends on it)
* @param int $id the id of the user or group
* @param string $scope Deprecated parameter allowing use of 'platform' scope - the corresponding tables don't exist anymore so the scope is always set to 'course'
* @param int $id the id of the user or group
* @param string $scope Deprecated parameter allowing use of 'platform' scope - the corresponding tables don't exist anymore so the scope is always set to 'course'
*
* @return array that contains the name of the roles the user has
*

@ -103,7 +103,7 @@ class ch_multiplechoiceother extends survey_question
'other_question'.$questionId,
get_lang('SurveyOtherAnswer'),
false,
['id' =>'other_question'.$questionId]
['id' => 'other_question'.$questionId]
);
$form->addHtml('</div>');

@ -21,7 +21,7 @@ class ch_selectivedisplay extends ch_yesno
$radioAttributes = [
'radio-class' => $class,
'label-class' => $labelClass,
'class' => 'survey_selective_input'
'class' => 'survey_selective_input',
];
if (!empty($questionData['is_required'])) {

@ -1132,14 +1132,12 @@ class SurveyManager
$empty_answer = false;
if ($survey_data['survey_type'] == 1) {
if (empty($form_content['choose'])) {
return 'PleaseChooseACondition';
}
if (($form_content['choose'] == 2) &&
($form_content['assigned1'] == $form_content['assigned2'])
) {
return 'ChooseDifferentCategories';
}
}
@ -1661,7 +1659,6 @@ class SurveyManager
);
}
}
}
/**

Loading…
Cancel
Save