Minor - flint fixes

pull/3272/head
Julio Montoya 5 years ago
parent a0a31da801
commit c87e63449f
  1. 1
      config/routes.yaml
  2. 1
      config/services.yaml
  3. 2
      public/main/admin/add_drh_to_user.php
  4. 2
      public/main/admin/course_edit.php
  5. 1
      public/main/admin/index.php
  6. 2
      public/main/admin/user_information.php
  7. 2
      public/main/admin/user_linking_requests.php
  8. 8
      public/main/admin/user_list.php
  9. 2
      public/main/auth/profile.php
  10. 2
      public/main/badge/issued.php
  11. 2
      public/main/badge/issued_all.php
  12. 4
      public/main/calendar/agenda_list.php
  13. 3
      public/main/dropbox/dropbox_download.php
  14. 3
      public/main/exercise/exercise.class.php
  15. 10
      public/main/exercise/exercise_submit_modal.php
  16. 12
      public/main/exercise/question_pool.php
  17. 2
      public/main/inc/global.inc.php
  18. 2
      public/main/inc/lib/CourseChatUtils.php
  19. 2
      public/main/inc/lib/TicketManager.php
  20. 4
      public/main/inc/lib/api.lib.php
  21. 2
      public/main/inc/lib/document.lib.php
  22. 2
      public/main/inc/lib/exercise.lib.php
  23. 6
      public/main/inc/lib/extra_field.lib.php
  24. 5
      public/main/inc/lib/extra_field_value.lib.php
  25. 2
      public/main/inc/lib/image.lib.php
  26. 165
      public/main/inc/lib/internationalization.lib.php
  27. 8
      public/main/inc/lib/message.lib.php
  28. 2
      public/main/inc/lib/myspace.lib.php
  29. 4
      public/main/inc/lib/sessionmanager.lib.php
  30. 4
      public/main/inc/lib/skill.lib.php
  31. 2
      public/main/inc/lib/template.lib.php
  32. 8
      public/main/inc/lib/tracking.lib.php
  33. 6
      public/main/inc/lib/usergroup.lib.php
  34. 5
      public/main/inc/lib/usermanager.lib.php
  35. 41
      public/main/inc/lib/webservices/Rest.php
  36. 6
      public/main/install/install.lib.php
  37. 3
      public/main/lp/learnpath.class.php
  38. 2
      public/main/lp/lp_subscribe_users.php
  39. 2
      public/main/lp/lp_subscribe_users_to_category.php
  40. 4
      public/main/session/session_list_simple.php
  41. 2
      public/main/webservices/registration.soap.php
  42. 2
      public/plugin/buycourses/src/buycourses.ajax.php
  43. 23
      public/plugin/grading_electronic/generate.php
  44. 10
      src/CoreBundle/Entity/Group.php
  45. 16
      src/CoreBundle/Entity/ResourceFile.php
  46. 2
      src/CoreBundle/Entity/ResourceNode.php
  47. 2
      src/CoreBundle/Entity/User.php

@ -68,4 +68,3 @@ chamilo_graphql:
chamilo_lti: chamilo_lti:
resource: "@ChamiloLtiBundle/Resources/config/routing.yml" resource: "@ChamiloLtiBundle/Resources/config/routing.yml"

@ -140,4 +140,3 @@ cocur_slugify:
imports: imports:
- {resource: ../src/CoreBundle/Resources/config/services.yml} - {resource: ../src/CoreBundle/Resources/config/services.yml}
# - {resource: ../src/PageBundle/Resources/config/services.yml}

@ -2,8 +2,8 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\UserRelUser;
use Chamilo\CoreBundle\Entity\User as UserEntity; use Chamilo\CoreBundle\Entity\User as UserEntity;
use Chamilo\CoreBundle\Entity\UserRelUser;
$cidReset = true; $cidReset = true;

@ -3,9 +3,9 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\CourseCategory; use Chamilo\CoreBundle\Entity\CourseCategory;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Repository\CourseCategoryRepository; use Chamilo\CoreBundle\Repository\CourseCategoryRepository;
use Chamilo\CoreBundle\Repository\CourseRepository; use Chamilo\CoreBundle\Repository\CourseRepository;
use Chamilo\CoreBundle\Entity\User;
$cidReset = true; $cidReset = true;

@ -3,7 +3,6 @@
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Hook\HookAdminBlock; use Chamilo\CoreBundle\Hook\HookAdminBlock;
use League\Flysystem\Filesystem;
/** /**
* Index page of the admin tools. * Index page of the admin tools.

@ -2,8 +2,8 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\UserRelUser;
use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Entity\UserRelUser;
/** /**
* Script showing information about a user (name, e-mail, courses and sessions). * Script showing information about a user (name, e-mail, courses and sessions).

@ -1,8 +1,8 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\UserRelUser;
use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Entity\UserRelUser;
$cidReset = true; $cidReset = true;

@ -298,14 +298,14 @@ function prepare_user_sql_query($getCount)
$keyword_admin = ''; $keyword_admin = '';
if (isset($keywordListValues['keyword_status']) && if (isset($keywordListValues['keyword_status']) &&
$keywordListValues['keyword_status'] == PLATFORM_ADMIN PLATFORM_ADMIN == $keywordListValues['keyword_status']
) { ) {
$query_admin_table = " , $admin_table a "; $query_admin_table = " , $admin_table a ";
$keyword_admin = ' AND a.user_id = u.id '; $keyword_admin = ' AND a.user_id = u.id ';
$keywordListValues['keyword_status'] = ''; $keywordListValues['keyword_status'] = '';
} }
if ($keywordListValues['keyword_status'] === '%') { if ('%' === $keywordListValues['keyword_status']) {
$keywordListValues['keyword_status'] = ''; $keywordListValues['keyword_status'] = '';
} }
@ -356,7 +356,7 @@ function prepare_user_sql_query($getCount)
$preventSessionAdminsToManageAllUsers = api_get_setting('prevent_session_admins_to_manage_all_users'); $preventSessionAdminsToManageAllUsers = api_get_setting('prevent_session_admins_to_manage_all_users');
$extraConditions = ''; $extraConditions = '';
if (api_is_session_admin() && $preventSessionAdminsToManageAllUsers === 'true') { if (api_is_session_admin() && 'true' === $preventSessionAdminsToManageAllUsers) {
$extraConditions .= ' AND u.creator_id = '.api_get_user_id(); $extraConditions .= ' AND u.creator_id = '.api_get_user_id();
} }
@ -405,7 +405,7 @@ function prepare_user_sql_query($getCount)
if (empty($value)) { if (empty($value)) {
continue; continue;
} }
if ($info['field_type'] == ExtraField::FIELD_TYPE_TAG) { if (ExtraField::FIELD_TYPE_TAG == $info['field_type']) {
$result = $extraField->getAllUserPerTag($info['id'], $value); $result = $extraField->getAllUserPerTag($info['id'], $value);
$result = empty($result) ? [] : array_column($result, 'user_id'); $result = empty($result) ? [] : array_column($result, 'user_id');
} else { } else {

@ -1,9 +1,9 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Hook\HookUpdateUser; use Chamilo\CoreBundle\Hook\HookUpdateUser;
use Chamilo\CoreBundle\Entity\User;
use ChamiloSession as Session; use ChamiloSession as Session;
/** /**

@ -233,7 +233,7 @@ if ($allowExport) {
if (0 !== strcmp($backpack, $configBackpack)) { if (0 !== strcmp($backpack, $configBackpack)) {
$backpack = $configBackpack; $backpack = $configBackpack;
if (substr($backpack, -1) !== '/') { if ('/' !== substr($backpack, -1)) {
$backpack .= '/'; $backpack .= '/';
} }
} }

@ -220,7 +220,7 @@ foreach ($userSkills as $index => $skillIssue) {
if (0 !== strcmp($backpack, $configBackpack)) { if (0 !== strcmp($backpack, $configBackpack)) {
$backpack = $configBackpack; $backpack = $configBackpack;
if (substr($backpack, -1) !== '/') { if ('/' !== substr($backpack, -1)) {
$backpack .= '/'; $backpack .= '/';
} }
} }

@ -89,11 +89,11 @@ $tpl->assign('agenda_actions', $actions);
$tpl->assign('is_allowed_to_edit', api_is_allowed_to_edit()); $tpl->assign('is_allowed_to_edit', api_is_allowed_to_edit());
if (api_is_allowed_to_edit()) { if (api_is_allowed_to_edit()) {
if ($action == 'change_visibility') { if ('change_visibility' == $action) {
$courseInfo = api_get_course_info(); $courseInfo = api_get_course_info();
$courseCondition = ''; $courseCondition = '';
// This happens when list agenda is not inside a course // This happens when list agenda is not inside a course
if (($type == 'course' || $type == 'session' && !empty($courseInfo))) { if (('course' == $type || 'session' == $type && !empty($courseInfo))) {
// For course and session event types // For course and session event types
// Just needs course ID // Just needs course ID
$agenda->changeVisibility($_GET['id'], $_GET['visibility'], $courseInfo); $agenda->changeVisibility($_GET['id'], $_GET['visibility'], $courseInfo);

@ -18,9 +18,6 @@ if (isset($_GET['cat_id']) &&
isset($_GET['sent_received']) isset($_GET['sent_received'])
) { ) {
/** step 1: constructing the sql statement. /** step 1: constructing the sql statement.
Due to the nature off the classes of the dropbox the categories for sent files are stored in the table
dropbox_file while the categories for the received files are stored in dropbox_post.
It would have been more elegant if these could be stored in dropbox_person (which stores the link file-person)
Therefore we have to create to separate sql statements to find which files are in the category Therefore we have to create to separate sql statements to find which files are in the category
(depending if we zip-download a sent category or a received category)*/ (depending if we zip-download a sent category or a received category)*/
if ('sent' == $_GET['sent_received']) { if ('sent' == $_GET['sent_received']) {

@ -7,7 +7,6 @@ use APY\DataGridBundle\Grid\Action\RowAction;
use APY\DataGridBundle\Grid\Row; use APY\DataGridBundle\Grid\Row;
use APY\DataGridBundle\Grid\Source\Entity; use APY\DataGridBundle\Grid\Source\Entity;
use Chamilo\CoreBundle\Entity\GradebookLink; use Chamilo\CoreBundle\Entity\GradebookLink;
use Chamilo\CoreBundle\EntityLink;
use Chamilo\CoreBundle\Entity\TrackEHotspot; use Chamilo\CoreBundle\Entity\TrackEHotspot;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter; use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter;
@ -4137,7 +4136,7 @@ class Exercise
} }
$type = FillBlanks::getFillTheBlankAnswerType($correctAnswer); $type = FillBlanks::getFillTheBlankAnswerType($correctAnswer);
if ($type == FillBlanks::FILL_THE_BLANK_MENU) { if (FillBlanks::FILL_THE_BLANK_MENU == $type) {
$listMenu = FillBlanks::getFillTheBlankMenuAnswers($correctAnswer, false); $listMenu = FillBlanks::getFillTheBlankMenuAnswers($correctAnswer, false);
if (!empty($studentAnswer)) { if (!empty($studentAnswer)) {
foreach ($listMenu as $key => $item) { foreach ($listMenu as $key => $item) {

@ -73,7 +73,7 @@ function SendEx(num) {
</script>'; </script>';
$header = ''; $header = '';
if ($objExercise->getFeedbackType() === EXERCISE_FEEDBACK_TYPE_POPUP) { if (EXERCISE_FEEDBACK_TYPE_POPUP === $objExercise->getFeedbackType()) {
$header = ' $header = '
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title" id="global-modal-title">'.get_lang('Incorrect').'</h4> <h4 class="modal-title" id="global-modal-title">'.get_lang('Incorrect').'</h4>
@ -272,7 +272,7 @@ if (!empty($result)) {
} }
$header = ''; $header = '';
if ($objExercise->getFeedbackType() === EXERCISE_FEEDBACK_TYPE_DIRECT) { if (EXERCISE_FEEDBACK_TYPE_DIRECT === $objExercise->getFeedbackType()) {
if (isset($result['correct_answer_id'])) { if (isset($result['correct_answer_id'])) {
foreach ($result['correct_answer_id'] as $answerId) { foreach ($result['correct_answer_id'] as $answerId) {
/** @var Answer $answer */ /** @var Answer $answer */
@ -293,12 +293,12 @@ if ($objExercise->getFeedbackType() === EXERCISE_FEEDBACK_TYPE_DIRECT) {
} }
$comments = ''; $comments = '';
if ($answerType != HOT_SPOT_DELINEATION) { if (HOT_SPOT_DELINEATION != $answerType) {
if (isset($result['correct_answer_id'])) { if (isset($result['correct_answer_id'])) {
$table = new HTML_Table(['class' => 'table data_table']); $table = new HTML_Table(['class' => 'table data_table']);
$row = 0; $row = 0;
$table->setCellContents($row, 0, get_lang('YourAnswer')); $table->setCellContents($row, 0, get_lang('YourAnswer'));
if ($answerType != DRAGGABLE) { if (DRAGGABLE != $answerType) {
$table->setCellContents($row, 1, get_lang('Comment')); $table->setCellContents($row, 1, get_lang('Comment'));
} }
@ -333,7 +333,7 @@ if ($objExercise->getFeedbackType() === EXERCISE_FEEDBACK_TYPE_DIRECT) {
</div>'; </div>';
} }
if ($answerType === HOT_SPOT_DELINEATION) { if (HOT_SPOT_DELINEATION === $answerType) {
$contents = $manageAnswerHtmlContent; $contents = $manageAnswerHtmlContent;
} }
$links = ''; $links = '';

@ -323,7 +323,7 @@ foreach ($sessionList as $item) {
$course_list = []; $course_list = [];
// Course list, get course list of session, or for course where user is admin // Course list, get course list of session, or for course where user is admin
if (!empty($session_id) && $session_id != '-1' && !empty($sessionList)) { if (!empty($session_id) && '-1' != $session_id && !empty($sessionList)) {
$sessionInfo = []; $sessionInfo = [];
foreach ($sessionList as $session) { foreach ($sessionList as $session) {
if ($session['session_id'] == $session_id) { if ($session['session_id'] == $session_id) {
@ -362,7 +362,7 @@ foreach ($course_list as $item) {
$course_select_list[$courseItemId] .= $courseInfo['title']; $course_select_list[$courseItemId] .= $courseInfo['title'];
} }
if (empty($selected_course) || $selected_course == '-1') { if (empty($selected_course) || '-1' == $selected_course) {
$course_info = api_get_course_info(); $course_info = api_get_course_info();
// no course selected, reset menu test / difficult<EFBFBD> / type de reponse // no course selected, reset menu test / difficult<EFBFBD> / type de reponse
reset_menu_exo_lvl_type(); reset_menu_exo_lvl_type();
@ -569,7 +569,7 @@ function getExtraFieldConditions(array $formValues, $queryType = 'from')
continue; continue;
} }
if ($queryType === 'from') { if ('from' === $queryType) {
$from .= ", extra_field_values efv_$variable, extra_field ef_$variable"; $from .= ", extra_field_values efv_$variable, extra_field ef_$variable";
$where .= "AND ( $where .= "AND (
qu.iid = efv_$variable.item_id qu.iid = efv_$variable.item_id
@ -578,7 +578,7 @@ function getExtraFieldConditions(array $formValues, $queryType = 'from')
AND ef_$variable.variable = '$variable' AND ef_$variable.variable = '$variable'
AND efv_$variable.value = '$value' AND efv_$variable.value = '$value'
)"; )";
} elseif ($queryType === 'join') { } elseif ('join' === $queryType) {
$from .= " INNER JOIN extra_field_values efv_$variable ON qu.iid = efv_$variable.item_id $from .= " INNER JOIN extra_field_values efv_$variable ON qu.iid = efv_$variable.item_id
INNER JOIN extra_field ef_$variable ON efv_$variable.field_id = ef_$variable.id"; INNER JOIN extra_field ef_$variable ON efv_$variable.field_id = ef_$variable.id";
$where .= "AND ( $where .= "AND (
@ -690,7 +690,7 @@ function getQuestions(
{$efConditions['where']} {$efConditions['where']}
ORDER BY BINARY qu.question ASC ORDER BY BINARY qu.question ASC
"; ";
} elseif ($exerciseId == -1) { } elseif (-1 == $exerciseId) {
$efConditions = getExtraFieldConditions($formValues, 'join'); $efConditions = getExtraFieldConditions($formValues, 'join');
// If we have selected the option 'Orphan questions' in the list-box 'Filter' // If we have selected the option 'Orphan questions' in the list-box 'Filter'
$level_where = ''; $level_where = '';
@ -850,7 +850,7 @@ function getQuestions(
$result = Database::query($sql); $result = Database::query($sql);
$mainQuestionList = []; $mainQuestionList = [];
while ($row = Database::fetch_array($result, 'ASSOC')) { while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($exerciseId == -1 && isQuestionInActiveQuiz($row['iid'])) { if (-1 == $exerciseId && isQuestionInActiveQuiz($row['iid'])) {
continue; continue;
} }

@ -1,10 +1,10 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Symfony\Component\ErrorHandler\Debug;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Patchwork\Utf8\Bootup; use Patchwork\Utf8\Bootup;
use Symfony\Component\Dotenv\Dotenv; use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\ErrorHandler\Debug;
/** /**
* All legacy Chamilo scripts should include this important file. * All legacy Chamilo scripts should include this important file.

@ -8,10 +8,10 @@ use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser; use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Repository\ResourceRepository; use Chamilo\CoreBundle\Repository\ResourceRepository;
use Chamilo\CourseBundle\Entity\CChatConnected; use Chamilo\CourseBundle\Entity\CChatConnected;
use Chamilo\CourseBundle\Entity\CChatConversation; use Chamilo\CourseBundle\Entity\CChatConversation;
use Chamilo\CoreBundle\Entity\User;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Criteria;
use Michelf\MarkdownExtra; use Michelf\MarkdownExtra;

@ -1,11 +1,11 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Ticket;
use Chamilo\CoreBundle\Entity\TicketMessageAttachment; use Chamilo\CoreBundle\Entity\TicketMessageAttachment;
use Chamilo\CoreBundle\Entity\TicketPriority; use Chamilo\CoreBundle\Entity\TicketPriority;
use Chamilo\CoreBundle\Entity\TicketProject; use Chamilo\CoreBundle\Entity\TicketProject;
use Chamilo\CoreBundle\Entity\TicketStatus; use Chamilo\CoreBundle\Entity\TicketStatus;
use Chamilo\CoreBundle\Entity\Ticket;
/** /**
* Class TicketManager. * Class TicketManager.

@ -5,9 +5,9 @@ use Chamilo\CoreBundle\Entity\AccessUrl;
use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Session as SessionEntity; use Chamilo\CoreBundle\Entity\Session as SessionEntity;
use Chamilo\CoreBundle\Entity\SettingsCurrent; use Chamilo\CoreBundle\Entity\SettingsCurrent;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CGroupInfo; use Chamilo\CourseBundle\Entity\CGroupInfo;
use Chamilo\CoreBundle\Entity\User;
use ChamiloSession as Session; use ChamiloSession as Session;
use Symfony\Bridge\Twig\Mime\TemplatedEmail; use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\Finder;
@ -6335,7 +6335,7 @@ function api_request_uri()
return $uri; return $uri;
} }
/** Gets the current access_url id of the Chamilo Platform /** Gets the current access_url id of the Chamilo Platform.
* @author Julio Montoya <gugli100@gmail.com> * @author Julio Montoya <gugli100@gmail.com>
* *
* @return int access_url_id of the current Chamilo Installation * @return int access_url_id of the current Chamilo Installation

@ -3,10 +3,10 @@
use Chamilo\CoreBundle\Entity\ResourceFile; use Chamilo\CoreBundle\Entity\ResourceFile;
use Chamilo\CoreBundle\Entity\ResourceLink; use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CDocument; use Chamilo\CourseBundle\Entity\CDocument;
use Chamilo\CourseBundle\Entity\CGroupInfo; use Chamilo\CourseBundle\Entity\CGroupInfo;
use Chamilo\CoreBundle\Entity\User;
use ChamiloSession as Session; use ChamiloSession as Session;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;

@ -5256,7 +5256,7 @@ EOT;
$exercise = new Exercise($courseId); $exercise = new Exercise($courseId);
$courseInfo = $courseId ? api_get_course_info_by_id($courseId) : []; $courseInfo = $courseId ? api_get_course_info_by_id($courseId) : [];
if ($exercise->read($exerciseId) === false) { if (false === $exercise->read($exerciseId)) {
return null; return null;
} }

@ -2480,7 +2480,7 @@ JAVASCRIPT;
// Parse params. // Parse params.
$fields = []; $fields = [];
foreach ($values as $key => $value) { foreach ($values as $key => $value) {
if (substr($key, 0, 6) !== 'extra_' && substr($key, 0, 7) !== '_extra_') { if ('extra_' !== substr($key, 0, 6) && '_extra_' !== substr($key, 0, 7)) {
continue; continue;
} }
if (!empty($value)) { if (!empty($value)) {
@ -2512,7 +2512,7 @@ JAVASCRIPT;
$filter->rules[] = $rule; $filter->rules[] = $rule;
$filter->groupOp = 'AND'; $filter->groupOp = 'AND';
if ($extraFieldsType[$variableNoExtra] == ExtraField::FIELD_TYPE_TAG) { if (ExtraField::FIELD_TYPE_TAG == $extraFieldsType[$variableNoExtra]) {
$tagElement = $form->getElement($variable); $tagElement = $form->getElement($variable);
$tags = []; $tags = [];
foreach ($values[$variable] as $tag) { foreach ($values[$variable] as $tag) {
@ -2895,7 +2895,7 @@ JAVASCRIPT;
continue; continue;
} }
if ($filter && $field['filter'] != 1) { if ($filter && 1 != $field['filter']) {
continue; continue;
} }

@ -119,8 +119,7 @@ class ExtraFieldValue extends Model
// Parse params. // Parse params.
foreach ($extraFields as $fieldDetails) { foreach ($extraFields as $fieldDetails) {
if ($forceSave === false) { if (false === $forceSave) {
// if the field is not visible to the user in the end, we need to apply special rules // if the field is not visible to the user in the end, we need to apply special rules
if (1 != $fieldDetails['visible_to_self']) { if (1 != $fieldDetails['visible_to_self']) {
//only admins should be able to add those values //only admins should be able to add those values
@ -798,7 +797,7 @@ class ExtraFieldValue extends Model
$sql .= ' DESC'; $sql .= ' DESC';
} }
$result = Database::query($sql); $result = Database::query($sql);
if ($result !== false && Database::num_rows($result)) { if (false !== $result && Database::num_rows($result)) {
if ($all) { if ($all) {
$result = Database::store_result($result, 'ASSOC'); $result = Database::store_result($result, 'ASSOC');
} else { } else {

@ -139,8 +139,6 @@ class Image
/** /**
* Image wrapper class. * Image wrapper class.
*
* @package chamilo.include.image
*/ */
abstract class ImageWrapper abstract class ImageWrapper
{ {

@ -1956,7 +1956,7 @@ function &_api_get_day_month_names($language = null)
/** /**
/** /**
* The following table contains two types of conventions concerning person names: * The following table contains two types of conventions concerning person names:.
* *
* "format" - determines how a full person name to be formatted, i.e. in what order the title, the first_name and the last_name to be placed. * "format" - determines how a full person name to be formatted, i.e. in what order the title, the first_name and the last_name to be placed.
* You might need to correct the value for your language. The possible values are: * You might need to correct the value for your language. The possible values are:
@ -1964,7 +1964,8 @@ function &_api_get_day_month_names($language = null)
* title last_name first_name - Eastern order; * title last_name first_name - Eastern order;
* title last_name, first_name - Western libraries order. * title last_name, first_name - Western libraries order.
* Placing the title (Dr, Mr, Miss, etc) depends on the tradition in you country. * Placing the title (Dr, Mr, Miss, etc) depends on the tradition in you country.
* @link http://en.wikipedia.org/wiki/Personal_name#Naming_convention *
* @see http://en.wikipedia.org/wiki/Personal_name#Naming_convention
* *
* "sort_by" - determines you preferable way of sorting person names. The possible values are: * "sort_by" - determines you preferable way of sorting person names. The possible values are:
* first_name - sorting names with priority for the first name; * first_name - sorting names with priority for the first name;
@ -1972,86 +1973,86 @@ function &_api_get_day_month_names($language = null)
*/ */
function getLegacyOrderConventions() function getLegacyOrderConventions()
{ {
return array( return [
'afrikaans' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'afrikaans' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'albanian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'albanian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'alemannic' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'alemannic' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'amharic' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'amharic' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'armenian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'armenian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'ar' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'ar' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'asturian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'asturian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'bosnian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'bosnian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'brazilian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'brazilian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'breton' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'breton' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'bulgarian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'bulgarian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'catalan' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'catalan' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'croatian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'croatian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'czech' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'czech' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'danish' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'danish' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'dari' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'dari' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'dutch' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'dutch' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'english' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'english' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'esperanto' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'esperanto' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'estonian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'estonian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'basque' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'basque' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'finnish' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'finnish' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'french' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'french' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'frisian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'frisian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'friulian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'friulian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'galician' => array('format' => 'title last_name first_name', 'sort_by' => 'last_name'), 'galician' => ['format' => 'title last_name first_name', 'sort_by' => 'last_name'],
'georgian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'georgian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'german' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'german' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'greek' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'greek' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'hawaiian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'hawaiian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'hebrew' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'hebrew' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'hindi' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'hindi' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'hungarian' => array('format' => 'title last_name first_name', 'sort_by' => 'last_name'), // Eastern order 'hungarian' => ['format' => 'title last_name first_name', 'sort_by' => 'last_name'], // Eastern order
'icelandic' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'icelandic' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'indonesian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'indonesian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'irish' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'irish' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'italian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'italian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'japanese' => array('format' => 'title last_name first_name', 'sort_by' => 'last_name'), // Eastern order 'japanese' => ['format' => 'title last_name first_name', 'sort_by' => 'last_name'], // Eastern order
'korean' => array('format' => 'title last_name first_name', 'sort_by' => 'last_name'), // Eastern order 'korean' => ['format' => 'title last_name first_name', 'sort_by' => 'last_name'], // Eastern order
'latin' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'latin' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'latvian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'latvian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'lithuanian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'lithuanian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'macedonian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'macedonian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'malay' => array('format' => 'title last_name first_name', 'sort_by' => 'last_name'), // Eastern order 'malay' => ['format' => 'title last_name first_name', 'sort_by' => 'last_name'], // Eastern order
'manx' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'manx' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'marathi' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'marathi' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'middle_frisian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'middle_frisian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'mingo' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'mingo' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'nepali' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'nepali' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'norwegian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'norwegian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'occitan' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'occitan' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'pashto' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'pashto' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'persian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'persian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'polish' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'polish' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'portuguese' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'portuguese' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'quechua_cusco' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'quechua_cusco' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'romanian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'romanian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'rumantsch' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'rumantsch' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'russian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'russian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'sanskrit' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'sanskrit' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'serbian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'serbian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'serbian_cyrillic' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'serbian_cyrillic' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'simpl_chinese' => array('format' => 'title last_name first_name', 'sort_by' => 'last_name'), // Eastern order 'simpl_chinese' => ['format' => 'title last_name first_name', 'sort_by' => 'last_name'], // Eastern order
'slovak' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'slovak' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'slovenian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'slovenian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'spanish' => array('format' => 'title last_name, first_name', 'sort_by' => 'last_name'), // Library order 'spanish' => ['format' => 'title last_name, first_name', 'sort_by' => 'last_name'], // Library order
'swahili' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'swahili' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'swedish' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'swedish' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'tagalog' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'tagalog' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'tamil' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'tamil' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'thai' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'thai' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'trad_chinese' => array('format' => 'title last_name first_name', 'sort_by' => 'last_name'), // Eastern order 'trad_chinese' => ['format' => 'title last_name first_name', 'sort_by' => 'last_name'], // Eastern order
'turkish' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'turkish' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'ukrainian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'ukrainian' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'vietnamese' => array('format' => 'title last_name first_name', 'sort_by' => 'last_name'), // Eastern order 'vietnamese' => ['format' => 'title last_name first_name', 'sort_by' => 'last_name'], // Eastern order
'welsh' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'welsh' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'yiddish' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'yiddish' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
'yoruba' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'), 'yoruba' => ['format' => 'title first_name last_name', 'sort_by' => 'first_name'],
); ];
} }
function getIsoToLegacy() function getIsoToLegacy()

@ -218,7 +218,7 @@ class MessageManager
} }
$userInfo = api_get_user_info($senderId); $userInfo = api_get_user_info($senderId);
if ($type == self::MESSAGE_TYPE_OUTBOX) { if (self::MESSAGE_TYPE_OUTBOX == $type) {
$userInfo = api_get_user_info($receiverId); $userInfo = api_get_user_info($receiverId);
} }
$message[3] = ''; $message[3] = '';
@ -2493,7 +2493,7 @@ class MessageManager
$result = Database::query($sql); $result = Database::query($sql);
$messages = []; $messages = [];
if ($result !== false) { if (false !== $result) {
while ($row = Database::fetch_assoc($result)) { while ($row = Database::fetch_assoc($result)) {
$pictureInfo = UserManager::get_user_picture_path_by_id($row['user_id'], 'web'); $pictureInfo = UserManager::get_user_picture_path_by_id($row['user_id'], 'web');
$row['pictureUri'] = $pictureInfo['dir'].$pictureInfo['file']; $row['pictureUri'] = $pictureInfo['dir'].$pictureInfo['file'];
@ -2537,7 +2537,7 @@ class MessageManager
$result = Database::query($sql); $result = Database::query($sql);
$messages = []; $messages = [];
if ($result !== false) { if (false !== $result) {
while ($row = Database::fetch_assoc($result)) { while ($row = Database::fetch_assoc($result)) {
$pictureInfo = UserManager::get_user_picture_path_by_id($row['user_id'], 'web'); $pictureInfo = UserManager::get_user_picture_path_by_id($row['user_id'], 'web');
$row['pictureUri'] = $pictureInfo['dir'].$pictureInfo['file']; $row['pictureUri'] = $pictureInfo['dir'].$pictureInfo['file'];
@ -2734,7 +2734,7 @@ class MessageManager
); );
$layoutContent = ''; $layoutContent = '';
$emailbody = ''; $emailbody = '';
if (api_get_configuration_value('mail_template_system') == true) { if (true == api_get_configuration_value('mail_template_system')) {
$mailTemplateManager = new MailTemplateManager(); $mailTemplateManager = new MailTemplateManager();
$templateText = $mailTemplateManager->getTemplateByType('new_user_mail_to_admin_approval.tpl'); $templateText = $mailTemplateManager->getTemplateByType('new_user_mail_to_admin_approval.tpl');
if (empty($templateText)) { if (empty($templateText)) {

@ -2827,7 +2827,7 @@ class MySpace
if (!empty($course_info)) { if (!empty($course_info)) {
$stringStartDate = ''; $stringStartDate = '';
$stringEndDate = ''; $stringEndDate = '';
if ($start_date != null && $end_date != null) { if (null != $start_date && null != $end_date) {
$end_date = self::add_day_to($end_date); $end_date = self::add_day_to($end_date);
$start_date = Database::escape_string($start_date); $start_date = Database::escape_string($start_date);

@ -9,8 +9,8 @@ use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\SessionRelCourse; use Chamilo\CoreBundle\Entity\SessionRelCourse;
use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser; use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser;
use Chamilo\CoreBundle\Entity\SessionRelUser; use Chamilo\CoreBundle\Entity\SessionRelUser;
use Chamilo\CoreBundle\Repository\SequenceRepository;
use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Repository\SequenceRepository;
use ExtraField as ExtraFieldModel; use ExtraField as ExtraFieldModel;
use Monolog\Logger; use Monolog\Logger;
@ -7642,7 +7642,7 @@ class SessionManager
$sessionFieldValueList = []; $sessionFieldValueList = [];
foreach (array_keys($fields) as $fieldId) { foreach (array_keys($fields) as $fieldId) {
$sessionFieldValue = $extra->get_values_by_handler_and_field_id($sessionId, $fieldId); $sessionFieldValue = $extra->get_values_by_handler_and_field_id($sessionId, $fieldId);
if ($sessionFieldValue != false) { if (false != $sessionFieldValue) {
$sessionFieldValueList[$fieldId] = $sessionFieldValue; $sessionFieldValueList[$fieldId] = $sessionFieldValue;
} }
} }

@ -3,10 +3,10 @@
use Chamilo\CoreBundle\Component\Utils\ChamiloApi; use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
use Chamilo\CoreBundle\Entity\Skill as SkillEntity; use Chamilo\CoreBundle\Entity\Skill as SkillEntity;
use Chamilo\CoreBundle\Entity\SkillRelItemRelUser;
use Chamilo\CoreBundle\Entity\SkillRelUser as SkillRelUserEntity;
use Chamilo\CoreBundle\Entity\SkillRelCourse; use Chamilo\CoreBundle\Entity\SkillRelCourse;
use Chamilo\CoreBundle\Entity\SkillRelItem; use Chamilo\CoreBundle\Entity\SkillRelItem;
use Chamilo\CoreBundle\Entity\SkillRelItemRelUser;
use Chamilo\CoreBundle\Entity\SkillRelUser as SkillRelUserEntity;
use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\User;
use Fhaculty\Graph\Graph; use Fhaculty\Graph\Graph;
use Fhaculty\Graph\Vertex; use Fhaculty\Graph\Vertex;

@ -3,8 +3,8 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser; use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Framework\Container;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
/** /**

@ -5,8 +5,8 @@
use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\ExtraField as EntityExtraField; use Chamilo\CoreBundle\Entity\ExtraField as EntityExtraField;
use Chamilo\CoreBundle\Entity\Session as SessionEntity; use Chamilo\CoreBundle\Entity\Session as SessionEntity;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Framework\Container;
use ChamiloSession as Session; use ChamiloSession as Session;
use CpChart\Cache as pCache; use CpChart\Cache as pCache;
use CpChart\Data as pData; use CpChart\Data as pData;
@ -1042,7 +1042,7 @@ class Tracking
$list1 = learnpath::get_iv_interactions_array($row['iv_id'], $course_id); $list1 = learnpath::get_iv_interactions_array($row['iv_id'], $course_id);
foreach ($list1 as $id => $interaction) { foreach ($list1 as $id => $interaction) {
$oddclass = 'row_even'; $oddclass = 'row_even';
if (($counter % 2) == 0) { if (0 == ($counter % 2)) {
$oddclass = 'row_odd'; $oddclass = 'row_odd';
} }
$timeRow = '<td class="lp_time">'.$interaction['time'].'</td>'; $timeRow = '<td class="lp_time">'.$interaction['time'].'</td>';
@ -1069,7 +1069,7 @@ class Tracking
$list2 = learnpath::get_iv_objectives_array($row['iv_id'], $course_id); $list2 = learnpath::get_iv_objectives_array($row['iv_id'], $course_id);
foreach ($list2 as $id => $interaction) { foreach ($list2 as $id => $interaction) {
$oddclass = 'row_even'; $oddclass = 'row_even';
if (($counter % 2) == 0) { if (0 == ($counter % 2)) {
$oddclass = 'row_odd'; $oddclass = 'row_odd';
} }
$output .= '<tr class="'.$oddclass.'"> $output .= '<tr class="'.$oddclass.'">
@ -6918,7 +6918,7 @@ class Tracking
} }
$lpProgress = self::get_avg_student_progress($userId, $courseCode, [$lp_id], $sessionId); $lpProgress = self::get_avg_student_progress($userId, $courseCode, [$lp_id], $sessionId);
$time = isset($lpTimeList[TOOL_LEARNPATH][$lp_id]) ? $lpTimeList[TOOL_LEARNPATH][$lp_id] : 0; $time = isset($lpTimeList[TOOL_LEARNPATH][$lp_id]) ? $lpTimeList[TOOL_LEARNPATH][$lp_id] : 0;
if ($lpProgress == 100) { if (100 == $lpProgress) {
if (!empty($time)) { if (!empty($time)) {
$timeInMinutes = $time / 60; $timeInMinutes = $time / 60;
$min = (int) learnpath::getAccumulateWorkTimePrerequisite($lp_id, $courseId); $min = (int) learnpath::getAccumulateWorkTimePrerequisite($lp_id, $courseId);

@ -269,7 +269,7 @@ class UserGroup extends Model
return 0; return 0;
} else { } else {
$typeCondition = ''; $typeCondition = '';
if ($type != -1) { if (-1 != $type) {
$type = (int) $type; $type = (int) $type;
$typeCondition = " AND group_type = $type "; $typeCondition = " AND group_type = $type ";
} }
@ -2198,7 +2198,7 @@ class UserGroup extends Model
return $array; return $array;
} }
/** Gets the inner join of users and group table /** Gets the inner join of users and group table.
* @param int quantity of records * @param int quantity of records
* @param bool show groups with image or not * @param bool show groups with image or not
* *
@ -2262,7 +2262,7 @@ class UserGroup extends Model
return $array; return $array;
} }
/** Gets the last groups created /** Gets the last groups created.
* @param int $num quantity of records * @param int $num quantity of records
* @param bool $withImage show groups with image or not * @param bool $withImage show groups with image or not
* *

@ -5,10 +5,10 @@ use Chamilo\CoreBundle\Entity\ExtraField as EntityExtraField;
use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\SkillRelUser; use Chamilo\CoreBundle\Entity\SkillRelUser;
use Chamilo\CoreBundle\Entity\SkillRelUserComment; use Chamilo\CoreBundle\Entity\SkillRelUserComment;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Hook\HookCreateUser; use Chamilo\CoreBundle\Hook\HookCreateUser;
use Chamilo\CoreBundle\Hook\HookUpdateUser; use Chamilo\CoreBundle\Hook\HookUpdateUser;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Repository\UserRepository; use Chamilo\CoreBundle\Repository\UserRepository;
use ChamiloSession as Session; use ChamiloSession as Session;
@ -62,7 +62,6 @@ class UserManager
/** /**
* Create/update/delete methods are available in the UserManager * Create/update/delete methods are available in the UserManager
* (based in the Sonata\UserBundle\Entity\UserManager). * (based in the Sonata\UserBundle\Entity\UserManager).
*
*/ */
public static function getManager() public static function getManager()
{ {
@ -2656,7 +2655,7 @@ class UserManager
return $extra_data; return $extra_data;
} }
/** Get extra user data by field /** Get extra user data by field.
* @param int user ID * @param int user ID
* @param string the internal variable name of the field * @param string the internal variable name of the field
* *

@ -1,14 +1,14 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\ExtraFieldValues; use Chamilo\CoreBundle\Entity\ExtraFieldValues;
use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CLpCategory; use Chamilo\CourseBundle\Entity\CLpCategory;
use Chamilo\CourseBundle\Entity\CNotebook; use Chamilo\CourseBundle\Entity\CNotebook;
use Chamilo\CourseBundle\Repository\CNotebookRepository; use Chamilo\CourseBundle\Repository\CNotebookRepository;
use Chamilo\CoreBundle\Entity\User;
/** /**
* Class RestApi. * Class RestApi.
@ -115,7 +115,7 @@ class Rest extends WebService
$this->course = $course; $this->course = $course;
} }
/** Set the current session /** Set the current session.
* @param int $id * @param int $id
* *
* @throws Exception * @throws Exception
@ -358,11 +358,11 @@ class Rest extends WebService
/** @var array $document */ /** @var array $document */
foreach ($documents as $document) { foreach ($documents as $document) {
if ($document['visibility'] != '1') { if ('1' != $document['visibility']) {
continue; continue;
} }
$icon = $document['filetype'] == 'file' $icon = 'file' == $document['filetype']
? choose_image($document['path']) ? choose_image($document['path'])
: chooseFolderIcon($document['path']); : chooseFolderIcon($document['path']);
@ -568,7 +568,7 @@ class Rest extends WebService
$categoriesFullData = get_forum_categories('', $this->course->getId(), $sessionId); $categoriesFullData = get_forum_categories('', $this->course->getId(), $sessionId);
$categories = []; $categories = [];
$includeGroupsForums = api_get_setting('display_groups_forum_in_general_tool') === 'true'; $includeGroupsForums = 'true' === api_get_setting('display_groups_forum_in_general_tool');
$forumsFullData = get_forums('', $this->course->getCode(), $includeGroupsForums, $sessionId); $forumsFullData = get_forums('', $this->course->getCode(), $includeGroupsForums, $sessionId);
$forums = []; $forums = [];
@ -776,7 +776,7 @@ class Rest extends WebService
$listData = []; $listData = [];
foreach ($flatLpList as $lpId => $lpDetails) { foreach ($flatLpList as $lpId => $lpDetails) {
if ($lpDetails['lp_visibility'] == 0) { if (0 == $lpDetails['lp_visibility']) {
continue; continue;
} }
@ -892,7 +892,6 @@ class Rest extends WebService
} }
/** /**
* @param array $postValues
* @param int $forumId * @param int $forumId
* *
* @return array * @return array
@ -967,7 +966,6 @@ class Rest extends WebService
/** /**
* @param string $subject * @param string $subject
* @param string $text * @param string $text
* @param array $receivers
* *
* @return array * @return array
*/ */
@ -992,7 +990,7 @@ class Rest extends WebService
$repo = UserManager::getRepository(); $repo = UserManager::getRepository();
$users = $repo->findUsersToSendMessage($this->user->getId(), $search); $users = $repo->findUsersToSendMessage($this->user->getId(), $search);
$showEmail = api_get_setting('show_email_addresses') === 'true'; $showEmail = 'true' === api_get_setting('show_email_addresses');
$data = []; $data = [];
/** @var User $user */ /** @var User $user */
@ -1036,7 +1034,6 @@ class Rest extends WebService
} }
/** /**
* @param array $values
* @param int $forumId * @param int $forumId
* *
* @return array * @return array
@ -1056,8 +1053,6 @@ class Rest extends WebService
} }
/** /**
* @param array $params
*
* @return array * @return array
*/ */
public function getUsersCampus(array $params) public function getUsersCampus(array $params)
@ -1082,8 +1077,6 @@ class Rest extends WebService
} }
/** /**
* @param array $params
*
* @return array * @return array
*/ */
public function getCoursesCampus(array $params) public function getCoursesCampus(array $params)
@ -1105,8 +1098,6 @@ class Rest extends WebService
} }
/** /**
* @param array $params
*
* @return array * @return array
*/ */
public function addSession(array $params) public function addSession(array $params)
@ -1158,8 +1149,6 @@ class Rest extends WebService
} }
/** /**
* @param array $courseParam
*
* @return array * @return array
*/ */
public function addCourse(array $courseParam) public function addCourse(array $courseParam)
@ -1269,7 +1258,7 @@ class Rest extends WebService
if ($userId) { if ($userId) {
if (api_is_multiple_url_enabled()) { if (api_is_multiple_url_enabled()) {
if (api_get_current_access_url_id() != -1) { if (-1 != api_get_current_access_url_id()) {
UrlManager::add_user_to_url( UrlManager::add_user_to_url(
$userId, $userId,
api_get_current_access_url_id() api_get_current_access_url_id()
@ -1364,9 +1353,9 @@ class Rest extends WebService
$active = isset($params['active']) ? intval($params['active']) : 0; $active = isset($params['active']) ? intval($params['active']) : 0;
$num = UrlManager::url_exist($urlCampus); $num = UrlManager::url_exist($urlCampus);
if ($num == 0) { if (0 == $num) {
// checking url // checking url
if (substr($urlCampus, strlen($urlCampus) - 1, strlen($urlCampus)) == '/') { if ('/' == substr($urlCampus, strlen($urlCampus) - 1, strlen($urlCampus))) {
$idCampus = UrlManager::add($urlCampus, $description, $active, true); $idCampus = UrlManager::add($urlCampus, $description, $active, true);
} else { } else {
//create //create
@ -1402,11 +1391,11 @@ class Rest extends WebService
if (!empty($url_id)) { if (!empty($url_id)) {
//we can't change the status of the url with id=1 //we can't change the status of the url with id=1
if ($url_id == 1) { if (1 == $url_id) {
$active = 1; $active = 1;
} }
//checking url //checking url
if (substr($urlCampus, strlen($urlCampus) - 1, strlen($urlCampus)) == '/') { if ('/' == substr($urlCampus, strlen($urlCampus) - 1, strlen($urlCampus))) {
UrlManager::update($url_id, $urlCampus, $description, $active); UrlManager::update($url_id, $urlCampus, $description, $active);
} else { } else {
UrlManager::update($url_id, $urlCampus.'/', $description, $active); UrlManager::update($url_id, $urlCampus.'/', $description, $active);
@ -1444,8 +1433,6 @@ class Rest extends WebService
} }
/** /**
* @param array $params
*
* @throws Exception * @throws Exception
* *
* @return array * @return array
@ -1476,8 +1463,6 @@ class Rest extends WebService
} }
/** /**
* @param array $params
*
* @return array * @return array
*/ */
public function addUsersSession(array $params) public function addUsersSession(array $params)

@ -4,12 +4,12 @@
use Chamilo\CoreBundle\Entity\AccessUrl; use Chamilo\CoreBundle\Entity\AccessUrl;
use Chamilo\CoreBundle\Entity\BranchSync; use Chamilo\CoreBundle\Entity\BranchSync;
use Chamilo\CoreBundle\Entity\ExtraField; use Chamilo\CoreBundle\Entity\ExtraField;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Entity\Group;
use Chamilo\CoreBundle\ToolChain;
use Chamilo\CoreBundle\Entity\TicketCategory as TicketCategory; use Chamilo\CoreBundle\Entity\TicketCategory as TicketCategory;
use Chamilo\CoreBundle\Entity\TicketPriority as TicketPriority; use Chamilo\CoreBundle\Entity\TicketPriority as TicketPriority;
use Chamilo\CoreBundle\Entity\TicketProject as TicketProject; use Chamilo\CoreBundle\Entity\TicketProject as TicketProject;
use Chamilo\CoreBundle\Entity\Group; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\ToolChain;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use Symfony\Component\DependencyInjection\Container as SymfonyContainer; use Symfony\Component\DependencyInjection\Container as SymfonyContainer;

@ -3,6 +3,7 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\ResourceLink; use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Repository\CourseRepository; use Chamilo\CoreBundle\Repository\CourseRepository;
use Chamilo\CourseBundle\Component\CourseCopy\CourseArchiver; use Chamilo\CourseBundle\Component\CourseCopy\CourseArchiver;
@ -18,7 +19,6 @@ use Chamilo\CourseBundle\Entity\CQuiz;
use Chamilo\CourseBundle\Entity\CShortcut; use Chamilo\CourseBundle\Entity\CShortcut;
use Chamilo\CourseBundle\Entity\CStudentPublication; use Chamilo\CourseBundle\Entity\CStudentPublication;
use Chamilo\CourseBundle\Entity\CTool; use Chamilo\CourseBundle\Entity\CTool;
use Chamilo\CoreBundle\Entity\User;
use ChamiloSession as Session; use ChamiloSession as Session;
use Gedmo\Sortable\Entity\Repository\SortableRepository; use Gedmo\Sortable\Entity\Repository\SortableRepository;
use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Filesystem;
@ -31,7 +31,6 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
* and SCORM learnpaths. It is used by the scorm class. * and SCORM learnpaths. It is used by the scorm class.
* *
* @todo decouple class * @todo decouple class
* *
* *
* @author Yannick Warnier <ywarnier@beeznest.org> * @author Yannick Warnier <ywarnier@beeznest.org>
* @author Julio Montoya <gugli100@gmail.com> Several improvements and fixes * @author Julio Montoya <gugli100@gmail.com> Several improvements and fixes

@ -4,8 +4,8 @@
use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser; use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser;
use Chamilo\CoreBundle\Repository\CourseRepository;
use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Repository\CourseRepository;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,10 +1,10 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CLpCategory; use Chamilo\CourseBundle\Entity\CLpCategory;
use Chamilo\CourseBundle\Entity\CLpCategoryUser; use Chamilo\CourseBundle\Entity\CLpCategoryUser;
use Chamilo\CoreBundle\Entity\User;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -283,7 +283,7 @@ $orderUrl = api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=order';
<?php <?php
// Create the searching dialog. // Create the searching dialog.
if ($hideSearch !== true) { if (true !== $hideSearch) {
echo 'grid.searchGrid(prmSearch);'; echo 'grid.searchGrid(prmSearch);';
} }
?> ?>
@ -373,7 +373,7 @@ $tabs = [
]; ];
$default = 2; $default = 2;
if ($list_type === 'complete') { if ('complete' === $list_type) {
$default = 3; $default = 3;
} }

@ -2,9 +2,9 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\ExtraField as EntityExtraField; use Chamilo\CoreBundle\Entity\ExtraField as EntityExtraField;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Hook\HookWSRegistration; use Chamilo\CoreBundle\Hook\HookWSRegistration;
use Chamilo\CoreBundle\Entity\User;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
$debug = true; $debug = true;

@ -4,8 +4,8 @@
use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CourseBundle\Entity\CLp;
use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\User;
use Chamilo\CourseBundle\Entity\CLp;
/** /**
* Responses to AJAX calls. * Responses to AJAX calls.

@ -99,9 +99,7 @@ try {
/** @var \Category $gradebook */ /** @var \Category $gradebook */
$gradebook = $cats[0]; $gradebook = $cats[0];
/** @var \ExerciseLink $exerciseLink */ /** @var \ExerciseLink $exerciseLink */
/** commented until we get clear understanding of how to use the dates refs BT#12404 /** commented until we get clear understanding of how to use the dates refs BT#12404.
$exerciseLink = $gradebook->get_links()[0];
$exerciseId = $exerciseLink->get_ref_id();
$exerciseInfo = ExerciseLib::get_exercise_by_id($exerciseId, $course->getId()); $exerciseInfo = ExerciseLib::get_exercise_by_id($exerciseId, $course->getId());
*/ */
$dateStart = new DateTime($values['range_start'].' 00:00:00', new DateTimeZone('UTC')); $dateStart = new DateTime($values['range_start'].' 00:00:00', new DateTimeZone('UTC'));
@ -125,24 +123,7 @@ try {
if (!$userFinishedCourse) { if (!$userFinishedCourse) {
continue; continue;
} }
/** commented until we get clear understanding of how to use the dates refs BT#12404 /** commented until we get clear understanding of how to use the dates refs BT#12404.
$exerciseResult = Event::get_best_exercise_results_by_user(
$exerciseId,
$course->getId(),
$session ? $session->getId() : 0,
$student->getId()
);
$exerciseResult = current($exerciseResult);
if (!$exerciseResult) {
continue;
}
$attemptDate = new DateTime($exerciseResult['exe_date'], new DateTimeZone('UTC'));
$dateIsRange = $attemptDate >= $dateStart && $attemptDate <= $dateEnd;
if (!$dateEnd) {
continue;
} }
*/ */
$fieldStudent = $uFieldValue->get_values_by_handler_and_field_variable( $fieldStudent = $uFieldValue->get_values_by_handler_and_field_variable(

@ -50,6 +50,11 @@ class Group
$this->roles = $roles; $this->roles = $roles;
} }
public function __toString()
{
return $this->getName() ?: '';
}
public function addRole($role) public function addRole($role)
{ {
if (!$this->hasRole($role)) { if (!$this->hasRole($role)) {
@ -135,9 +140,4 @@ class Group
return $this; return $this;
} }
public function __toString()
{
return $this->getName() ?: '';
}
} }

@ -69,6 +69,14 @@ class ResourceFile
{ {
use TimestampableEntity; use TimestampableEntity;
/**
* @var string|null
*
* @ApiProperty(iri="http://schema.org/contentUrl")
* @Groups({"resource_file:read", "resource_node:read", "document:read", "media_object_read"})
*/
public $contentUrl;
/** /**
* @ORM\Id * @ORM\Id
* @ORM\Column(type="integer") * @ORM\Column(type="integer")
@ -139,14 +147,6 @@ class ResourceFile
*/ */
protected $crop; protected $crop;
/**
* @var string|null
*
* @ApiProperty(iri="http://schema.org/contentUrl")
* @Groups({"resource_file:read", "resource_node:read", "document:read", "media_object_read"})
*/
public $contentUrl;
/** /**
* @var ResourceNode * @var ResourceNode
* *

@ -40,9 +40,9 @@ use Symfony\Component\Validator\Constraints as Assert;
*/ */
class ResourceNode class ResourceNode
{ {
public const PATH_SEPARATOR = '`';
use TimestampableEntity; use TimestampableEntity;
use TimestampableAgoTrait; use TimestampableAgoTrait;
public const PATH_SEPARATOR = '`';
/** /**
* @Groups({"resource_node:read", "document:read"}) * @Groups({"resource_node:read", "document:read"})

@ -931,7 +931,6 @@ class User implements UserInterface, EquatableInterface
/** /**
* Set lastname. * Set lastname.
* *
*
* @return User * @return User
*/ */
public function setLastname(string $lastname): self public function setLastname(string $lastname): self
@ -944,7 +943,6 @@ class User implements UserInterface, EquatableInterface
/** /**
* Set firstname. * Set firstname.
* *
*
* @return User * @return User
*/ */
public function setFirstname(string $firstname): self public function setFirstname(string $firstname): self

Loading…
Cancel
Save