Minor - flint fixes

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

@ -15,4 +15,4 @@ framework:
# annotations: # annotations:
# cache: file # cache: file
# file_cache_dir: "%kernel.cache_dir%/annotations" # file_cache_dir: "%kernel.cache_dir%/annotations"
serializer: { enable_annotations: true } serializer: {enable_annotations: true}

@ -78,4 +78,4 @@ security:
json_login: json_login:
check_path: /login_json check_path: /login_json
# username_path: security.credentials.login # username_path: security.credentials.login
# password_path: security.credentials.password # password_path: security.credentials.password

@ -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 {
@ -424,7 +424,7 @@ function prepare_user_sql_query($getCount)
// If simple search then use "OR" // If simple search then use "OR"
if (isset($_GET['keyword']) && !empty($_GET['keyword'])) { if (isset($_GET['keyword']) && !empty($_GET['keyword'])) {
$condition = ' OR '; $condition = ' OR ';
} }
if (!empty($extraFieldHasData) && !empty($extraFieldResult)) { if (!empty($extraFieldHasData) && !empty($extraFieldResult)) {
$sql .= " $condition (u.id IN ('".implode("','", $extraFieldResult)."') $extraConditions ) "; $sql .= " $condition (u.id IN ('".implode("','", $extraFieldResult)."') $extraConditions ) ";

@ -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,13 +89,13 @@ $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);
} else { } else {
$courseCondition = '&'.api_get_cidreq(); $courseCondition = '&'.api_get_cidreq();

@ -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,10 +272,10 @@ 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 */
$contents .= $objAnswerTmp->selectComment($answerId); $contents .= $objAnswerTmp->selectComment($answerId);
} }
} }
@ -289,16 +289,16 @@ if ($objExercise->getFeedbackType() === EXERCISE_FEEDBACK_TYPE_DIRECT) {
} else { } else {
if ($partialCorrect) { if ($partialCorrect) {
$message = get_lang('PartialCorrect'); $message = get_lang('PartialCorrect');
}
} }
}
$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;

@ -4255,8 +4255,8 @@ EOT;
!empty($exercise_stat_info['exe_user_id']) && !empty($exercise_stat_info['exe_user_id']) &&
!empty($studentInfo) !empty($studentInfo)
) { ) {
// Shows exercise header // Shows exercise header
echo $objExercise->showExerciseResultHeader( echo $objExercise->showExerciseResultHeader(
$studentInfo, $studentInfo,
$exercise_stat_info $exercise_stat_info
); );
@ -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;
} }

@ -630,25 +630,25 @@ class ExtraField extends Model
$result = Database::query($sql); $result = Database::query($sql);
if (Database::num_rows($result)) { if (Database::num_rows($result)) {
$row = Database::fetch_array($result, 'ASSOC'); $row = Database::fetch_array($result, 'ASSOC');
$row['display_text'] = $this->translateDisplayName( $row['display_text'] = $this->translateDisplayName(
$row['variable'], $row['variable'],
$row['display_text'] $row['display_text']
); );
// All the options of the field // All the options of the field
$sql = "SELECT * FROM $this->table_field_tag $sql = "SELECT * FROM $this->table_field_tag
WHERE field_id='".intval($row['id'])."' WHERE field_id='".intval($row['id'])."'
ORDER BY id ASC"; ORDER BY id ASC";
$result = Database::query($sql); $result = Database::query($sql);
while ($option = Database::fetch_array($result, 'ASSOC')) { while ($option = Database::fetch_array($result, 'ASSOC')) {
$row['options'][$option['id']] = $option; $row['options'][$option['id']] = $option;
} }
return $row; return $row;
} else { } else {
return false; return false;
}
} }
}
/** /**
* Translate the display text for a extra field. * Translate the display text for a extra field.
@ -750,17 +750,17 @@ class ExtraField extends Model
$extraData = false; $extraData = false;
if (!empty($itemId)) { if (!empty($itemId)) {
$extraData = $this->get_handler_extra_data($itemId); $extraData = $this->get_handler_extra_data($itemId);
if (!empty($showOnlyTheseFields)) { if (!empty($showOnlyTheseFields)) {
$setData = []; $setData = [];
foreach ($showOnlyTheseFields as $variable) { foreach ($showOnlyTheseFields as $variable) {
$extraName = 'extra_'.$variable; $extraName = 'extra_'.$variable;
if (in_array($extraName, array_keys($extraData))) { if (in_array($extraName, array_keys($extraData))) {
$setData[$extraName] = $extraData[$extraName]; $setData[$extraName] = $extraData[$extraName];
}
} }
$form->setDefaults($setData); }
} else { $form->setDefaults($setData);
$form->setDefaults($extraData); } else {
$form->setDefaults($extraData);
} }
} }
@ -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) {
@ -2575,82 +2575,82 @@ JAVASCRIPT;
is_array($filters->rules) && is_array($filters->rules) &&
!empty($filters->rules) !empty($filters->rules)
) { ) {
foreach ($filters->rules as $rule) { foreach ($filters->rules as $rule) {
if (empty($rule)) { if (empty($rule)) {
continue; continue;
} }
if (false === strpos($rule->field, '_second')) { if (false === strpos($rule->field, '_second')) {
} else { } else {
$my_field = str_replace('_second', '', $rule->field); $my_field = str_replace('_second', '', $rule->field);
$double_select[$my_field] = $rule->data; $double_select[$my_field] = $rule->data;
}
} }
}
foreach ($filters->rules as $rule) { foreach ($filters->rules as $rule) {
if (empty($rule)) { if (empty($rule)) {
continue; continue;
}
if (false === strpos($rule->field, $stringToSearch)) {
// normal fields
$field = $rule->field;
if (isset($rule->data) && is_string($rule->data) && -1 != $rule->data) {
$condition_array[] = $this->get_where_clause($field, $rule->op, $rule->data);
} }
} else { if (false === strpos($rule->field, $stringToSearch)) {
// Extra fields // normal fields
if (false === strpos($rule->field, '_second')) { $field = $rule->field;
//No _second if (isset($rule->data) && is_string($rule->data) && -1 != $rule->data) {
$original_field = str_replace($stringToSearch, '', $rule->field); $condition_array[] = $this->get_where_clause($field, $rule->op, $rule->data);
$field_option = $this->get_handler_field_info_by_field_variable($original_field); }
} else {
if (self::FIELD_TYPE_DOUBLE_SELECT == $field_option['field_type']) { // Extra fields
if (isset($double_select[$rule->field])) { if (false === strpos($rule->field, '_second')) {
$data = explode('#', $rule->data); //No _second
$rule->data = $data[1].'::'.$double_select[$rule->field]; $original_field = str_replace($stringToSearch, '', $rule->field);
} else { $field_option = $this->get_handler_field_info_by_field_variable($original_field);
// only was sent 1 select
if (is_string($rule->data)) { if (self::FIELD_TYPE_DOUBLE_SELECT == $field_option['field_type']) {
if (isset($double_select[$rule->field])) {
$data = explode('#', $rule->data); $data = explode('#', $rule->data);
$rule->data = $data[1]; $rule->data = $data[1].'::'.$double_select[$rule->field];
} else {
// only was sent 1 select
if (is_string($rule->data)) {
$data = explode('#', $rule->data);
$rule->data = $data[1];
}
} }
}
if (!isset($rule->data)) { if (!isset($rule->data)) {
$condition_array[] = ' (' $condition_array[] = ' ('
.$this->get_where_clause($rule->field, $rule->op, $rule->data) .$this->get_where_clause($rule->field, $rule->op, $rule->data)
.') '; .') ';
$extra_fields[] = ['field' => $rule->field, 'id' => $field_option['id']]; $extra_fields[] = ['field' => $rule->field, 'id' => $field_option['id']];
}
} else {
if (isset($rule->data)) {
if (isset($rule->data) && is_int($rule->data) && -1 == $rule->data) {
continue;
} }
/*var_dump($rule->data); } else {
foreach ($rule->data as $option) { if (isset($rule->data)) {
}*/ if (isset($rule->data) && is_int($rule->data) && -1 == $rule->data) {
$where = $this->get_where_clause($rule->field, $rule->op, $rule->data, 'OR'); continue;
$condition_array[] = " ( $where ) "; }
/*var_dump($rule->data);
foreach ($rule->data as $option) {
}*/
$where = $this->get_where_clause($rule->field, $rule->op, $rule->data, 'OR');
$condition_array[] = " ( $where ) ";
$extra_fields[] = [ $extra_fields[] = [
'field' => $rule->field, 'field' => $rule->field,
'id' => $field_option['id'], 'id' => $field_option['id'],
'data' => $rule->data, 'data' => $rule->data,
]; ];
}
} }
} } else {
} else { $my_field = str_replace('_second', '', $rule->field);
$my_field = str_replace('_second', '', $rule->field); $original_field = str_replace($stringToSearch, '', $my_field);
$original_field = str_replace($stringToSearch, '', $my_field); $field_option = $this->get_handler_field_info_by_field_variable($original_field);
$field_option = $this->get_handler_field_info_by_field_variable($original_field); $extra_fields[] = [
$extra_fields[] = [
'field' => $rule->field, 'field' => $rule->field,
'id' => $field_option['id'], 'id' => $field_option['id'],
]; ];
}
} }
} }
} }
}
/*var_dump( /*var_dump(
[ [
@ -2876,7 +2876,7 @@ JAVASCRIPT;
/** /**
* Get the extra fields and their formatted values. * Get the extra fields and their formatted values.
* *
* @param int|string $itemId The item ID (It could be a session_id, course_id or user_id) * @param int|string $itemId The item ID (It could be a session_id, course_id or user_id)
* @param bool $filter * @param bool $filter
* @param array $onlyShow (list of extra fields variables to show) * @param array $onlyShow (list of extra fields variables to show)
* *
@ -2895,7 +2895,7 @@ JAVASCRIPT;
continue; continue;
} }
if ($filter && $field['filter'] != 1) { if ($filter && 1 != $field['filter']) {
continue; continue;
} }

@ -119,10 +119,9 @@ 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
if (!api_is_platform_admin(true, true)) { if (!api_is_platform_admin(true, true)) {
// although if not admin but sent through a CLI script, we should accept it as well // although if not admin but sent through a CLI script, we should accept it as well
@ -757,8 +756,8 @@ class ExtraFieldValue extends Model
* *
* @param string $variable Field (type of data) we want to check * @param string $variable Field (type of data) we want to check
* @param string $value Data we are looking for in the given field * @param string $value Data we are looking for in the given field
* @param bool $transform Whether to transform the result to a human readable strings * @param bool $transform Whether to transform the result to a human readable strings
* @param bool $last Whether to return the last element or simply the first one we get * @param bool $last Whether to return the last element or simply the first one we get
* @param bool $useLike * @param bool $useLike
* *
* @return mixed Give the ID if found, or false on failure or not found * @return mixed Give the ID if found, or false on failure or not found
@ -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 {

@ -2242,8 +2242,8 @@ class GroupManager
/** /**
* Get all groups where a specific user is subscribed. * Get all groups where a specific user is subscribed.
* *
* @param int $user_id * @param int $user_id
* @param int $courseId * @param int $courseId
* @param int|null $sessionId * @param int|null $sessionId
* *
* @return array * @return array

@ -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()
@ -2140,7 +2141,7 @@ function _api_get_person_name_convention($iso, $type)
{ {
$conventions = getLegacyOrderConventions(); $conventions = getLegacyOrderConventions();
$languageName = null; $languageName = null;
if (isset(getIsoToLegacy()[$iso])){ if (isset(getIsoToLegacy()[$iso])) {
$languageName = getIsoToLegacy()[$iso]; $languageName = getIsoToLegacy()[$iso];
} }

@ -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)) {

@ -2811,35 +2811,35 @@ class MySpace
return $connections; return $connections;
} }
/** /**
* @param int $user_id * @param int $user_id
* @param array $course_info * @param array $course_info
* @param int $sessionId * @param int $sessionId
* @param null $start_date * @param null $start_date
* @param null $end_date * @param null $end_date
* *
* @return array * @return array
*/ */
public static function getStats($user_id, $course_info, $sessionId, $start_date = null, $end_date = null) public static function getStats($user_id, $course_info, $sessionId, $start_date = null, $end_date = null)
{ {
$table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS); $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
$result = []; $result = [];
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);
$end_date = Database::escape_string($end_date); $end_date = Database::escape_string($end_date);
$stringStartDate = "AND login_course_date BETWEEN '$start_date' AND '$end_date'"; $stringStartDate = "AND login_course_date BETWEEN '$start_date' AND '$end_date'";
$stringEndDate = "AND logout_course_date BETWEEN '$start_date' AND '$end_date'"; $stringEndDate = "AND logout_course_date BETWEEN '$start_date' AND '$end_date'";
} }
$user_id = (int) $user_id; $user_id = (int) $user_id;
$courseId = (int) $course_info['real_id']; $courseId = (int) $course_info['real_id'];
$sessionCondition = api_get_session_condition($sessionId); $sessionCondition = api_get_session_condition($sessionId);
$sql = "SELECT $sql = "SELECT
SEC_TO_TIME(AVG(time_to_sec(timediff(logout_course_date,login_course_date)))) as avrg, SEC_TO_TIME(AVG(time_to_sec(timediff(logout_course_date,login_course_date)))) as avrg,
SEC_TO_TIME(SUM(time_to_sec(timediff(logout_course_date,login_course_date)))) as total, SEC_TO_TIME(SUM(time_to_sec(timediff(logout_course_date,login_course_date)))) as total,
count(user_id) as times count(user_id) as times
@ -2850,96 +2850,96 @@ class MySpace
$sessionCondition $sessionCondition
ORDER BY login_course_date ASC"; ORDER BY login_course_date ASC";
$rs = Database::query($sql); $rs = Database::query($sql);
if ($row = Database::fetch_array($rs)) { if ($row = Database::fetch_array($rs)) {
$foo_avg = $row['avrg']; $foo_avg = $row['avrg'];
$foo_total = $row['total']; $foo_total = $row['total'];
$foo_times = $row['times']; $foo_times = $row['times'];
$result = [ $result = [
'avg' => $foo_avg, 'avg' => $foo_avg,
'total' => $foo_total, 'total' => $foo_total,
'times' => $foo_times, 'times' => $foo_times,
]; ];
}
} }
}
return $result; return $result;
} }
public static function add_day_to($end_date) public static function add_day_to($end_date)
{ {
$foo_date = strtotime($end_date); $foo_date = strtotime($end_date);
$foo_date = strtotime(' +1 day', $foo_date); $foo_date = strtotime(' +1 day', $foo_date);
$foo_date = date('Y-m-d', $foo_date); $foo_date = date('Y-m-d', $foo_date);
return $foo_date; return $foo_date;
} }
/** /**
* This function draw the graphic to be displayed on the user view as an image. * This function draw the graphic to be displayed on the user view as an image.
* *
* @param array $sql_result * @param array $sql_result
* @param string $start_date * @param string $start_date
* @param string $end_date * @param string $end_date
* @param string $type * @param string $type
* *
* @author Jorge Frisancho Jibaja * @author Jorge Frisancho Jibaja
* *
* @version OCT-22- 2010 * @version OCT-22- 2010
* *
* @return string * @return string
*/ */
public static function grapher($sql_result, $start_date, $end_date, $type = '') public static function grapher($sql_result, $start_date, $end_date, $type = '')
{ {
if (empty($start_date)) { if (empty($start_date)) {
$start_date = ''; $start_date = '';
} }
if (empty($end_date)) { if (empty($end_date)) {
$end_date = ''; $end_date = '';
} }
if ('' == $type) { if ('' == $type) {
$type = 'day'; $type = 'day';
} }
$main_year = $main_month_year = $main_day = []; $main_year = $main_month_year = $main_day = [];
$period = new DatePeriod( $period = new DatePeriod(
new DateTime($start_date), new DateTime($start_date),
new DateInterval('P1D'), new DateInterval('P1D'),
new DateTime($end_date) new DateTime($end_date)
); );
foreach ($period as $date) { foreach ($period as $date) {
$main_day[$date->format('d-m-Y')] = 0; $main_day[$date->format('d-m-Y')] = 0;
} }
$period = new DatePeriod( $period = new DatePeriod(
new DateTime($start_date), new DateTime($start_date),
new DateInterval('P1M'), new DateInterval('P1M'),
new DateTime($end_date) new DateTime($end_date)
); );
foreach ($period as $date) { foreach ($period as $date) {
$main_month_year[$date->format('m-Y')] = 0; $main_month_year[$date->format('m-Y')] = 0;
} }
$i = 0; $i = 0;
if (is_array($sql_result) && count($sql_result) > 0) { if (is_array($sql_result) && count($sql_result) > 0) {
foreach ($sql_result as $key => $data) { foreach ($sql_result as $key => $data) {
$login = api_strtotime($data['login']); $login = api_strtotime($data['login']);
$logout = api_strtotime($data['logout']); $logout = api_strtotime($data['logout']);
//creating the main array //creating the main array
if (isset($main_month_year[date('m-Y', $login)])) { if (isset($main_month_year[date('m-Y', $login)])) {
$main_month_year[date('m-Y', $login)] += (float) ($logout - $login) / 60; $main_month_year[date('m-Y', $login)] += (float) ($logout - $login) / 60;
} }
if (isset($main_day[date('d-m-Y', $login)])) { if (isset($main_day[date('d-m-Y', $login)])) {
$main_day[date('d-m-Y', $login)] += (float) ($logout - $login) / 60; $main_day[date('d-m-Y', $login)] += (float) ($logout - $login) / 60;
}
if ($i > 500) {
break;
}
$i++;
} }
if ($i > 500) { switch ($type) {
break;
}
$i++;
}
switch ($type) {
case 'day': case 'day':
$main_date = $main_day; $main_date = $main_day;
break; break;
@ -2951,52 +2951,52 @@ class MySpace
break; break;
} }
$labels = array_keys($main_date); $labels = array_keys($main_date);
if (1 == count($main_date)) { if (1 == count($main_date)) {
$labels = $labels[0]; $labels = $labels[0];
$main_date = $main_date[$labels]; $main_date = $main_date[$labels];
} }
/* Create and populate the pData object */
$myData = new pData();
$myData->addPoints($main_date, 'Serie1');
if (1 != count($main_date)) {
$myData->addPoints($labels, 'Labels');
$myData->setSerieDescription('Labels', 'Months');
$myData->setAbscissa('Labels');
}
$myData->setSerieWeight('Serie1', 1);
$myData->setSerieDescription('Serie1', get_lang('My results'));
$myData->setAxisName(0, get_lang('Minutes'));
$myData->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true);
// Cache definition
$cachePath = api_get_path(SYS_ARCHIVE_PATH);
$myCache = new pCache(['CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1)]);
$chartHash = $myCache->getHash($myData);
if ($myCache->isInCache($chartHash)) { /* Create and populate the pData object */
//if we already created the img $myData = new pData();
$imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; $myData->addPoints($main_date, 'Serie1');
$myCache->saveFromCache($chartHash, $imgPath); if (1 != count($main_date)) {
$imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; $myData->addPoints($labels, 'Labels');
} else { $myData->setSerieDescription('Labels', 'Months');
/* Define width, height and angle */ $myData->setAbscissa('Labels');
$mainWidth = 760; }
$mainHeight = 230; $myData->setSerieWeight('Serie1', 1);
$angle = 50; $myData->setSerieDescription('Serie1', get_lang('My results'));
$myData->setAxisName(0, get_lang('Minutes'));
/* Create the pChart object */ $myData->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true);
$myPicture = new pImage($mainWidth, $mainHeight, $myData);
// Cache definition
/* Turn of Antialiasing */ $cachePath = api_get_path(SYS_ARCHIVE_PATH);
$myPicture->Antialias = false; $myCache = new pCache(['CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1)]);
/* Draw the background */ $chartHash = $myCache->getHash($myData);
$settings = ["R" => 255, "G" => 255, "B" => 255];
$myPicture->drawFilledRectangle(0, 0, $mainWidth, $mainHeight, $settings); if ($myCache->isInCache($chartHash)) {
//if we already created the img
/* Add a border to the picture */ $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
$myPicture->drawRectangle( $myCache->saveFromCache($chartHash, $imgPath);
$imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
} else {
/* Define width, height and angle */
$mainWidth = 760;
$mainHeight = 230;
$angle = 50;
/* Create the pChart object */
$myPicture = new pImage($mainWidth, $mainHeight, $myData);
/* Turn of Antialiasing */
$myPicture->Antialias = false;
/* Draw the background */
$settings = ["R" => 255, "G" => 255, "B" => 255];
$myPicture->drawFilledRectangle(0, 0, $mainWidth, $mainHeight, $settings);
/* Add a border to the picture */
$myPicture->drawRectangle(
0, 0,
0, 0,
$mainWidth - 1, $mainWidth - 1,
@ -3004,14 +3004,14 @@ class MySpace
["R" => 0, "G" => 0, "B" => 0] ["R" => 0, "G" => 0, "B" => 0]
); );
/* Set the default font */ /* Set the default font */
$myPicture->setFontProperties( $myPicture->setFontProperties(
[ [
"FontName" => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', "FontName" => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
"FontSize" => 10, ] "FontSize" => 10, ]
); );
/* Write the chart title */ /* Write the chart title */
$myPicture->drawText( $myPicture->drawText(
$mainWidth / 2, $mainWidth / 2,
30, 30,
get_lang('Time spent in the course'), get_lang('Time spent in the course'),
@ -3021,19 +3021,19 @@ class MySpace
] ]
); );
/* Set the default font */ /* Set the default font */
$myPicture->setFontProperties( $myPicture->setFontProperties(
[ [
"FontName" => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', "FontName" => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
"FontSize" => 8, "FontSize" => 8,
] ]
); );
/* Define the chart area */ /* Define the chart area */
$myPicture->setGraphArea(50, 40, $mainWidth - 40, $mainHeight - 80); $myPicture->setGraphArea(50, 40, $mainWidth - 40, $mainHeight - 80);
/* Draw the scale */ /* Draw the scale */
$scaleSettings = [ $scaleSettings = [
'XMargin' => 10, 'XMargin' => 10,
'YMargin' => 10, 'YMargin' => 10,
'Floating' => true, 'Floating' => true,
@ -3045,13 +3045,13 @@ class MySpace
'LabelRotation' => $angle, 'LabelRotation' => $angle,
'Mode' => SCALE_MODE_ADDALL_START0, 'Mode' => SCALE_MODE_ADDALL_START0,
]; ];
$myPicture->drawScale($scaleSettings); $myPicture->drawScale($scaleSettings);
/* Turn on Antialiasing */ /* Turn on Antialiasing */
$myPicture->Antialias = true; $myPicture->Antialias = true;
/* Enable shadow computing */ /* Enable shadow computing */
$myPicture->setShadow( $myPicture->setShadow(
true, true,
[ [
"X" => 1, "X" => 1,
@ -3063,15 +3063,15 @@ class MySpace
] ]
); );
/* Draw the line chart */ /* Draw the line chart */
$myPicture->setFontProperties( $myPicture->setFontProperties(
[ [
"FontName" => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', "FontName" => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
"FontSize" => 10, "FontSize" => 10,
] ]
); );
$myPicture->drawSplineChart(); $myPicture->drawSplineChart();
$myPicture->drawPlotChart( $myPicture->drawPlotChart(
[ [
"DisplayValues" => true, "DisplayValues" => true,
"PlotBorder" => true, "PlotBorder" => true,
@ -3081,17 +3081,17 @@ class MySpace
] ]
); );
/* Do NOT Write the chart legend */ /* Do NOT Write the chart legend */
/* Write and save into cache */ /* Write and save into cache */
$myCache->writeToCache($chartHash, $myPicture); $myCache->writeToCache($chartHash, $myPicture);
$imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
$myCache->saveFromCache($chartHash, $imgPath); $myCache->saveFromCache($chartHash, $imgPath);
$imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
} }
return '<img src="'.$imgPath.'">'; return '<img src="'.$imgPath.'">';
} else { } else {
return api_convert_encoding( return api_convert_encoding(
'<div id="messages" class="warning-message">'.get_lang('GraphicNotAvailable').'</div>', '<div id="messages" class="warning-message">'.get_lang('GraphicNotAvailable').'</div>',
'UTF-8' 'UTF-8'

@ -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;
@ -490,7 +490,7 @@ class SessionManager
/** /**
* Get session list for a session admin or platform admin. * Get session list for a session admin or platform admin.
* *
* @param int $userId User Id for the session admin. * @param int $userId User Id for the session admin.
* @param array $options Order and limit keys. * @param array $options Order and limit keys.
* @param bool $getCount Whether to get all the results or only the count. * @param bool $getCount Whether to get all the results or only the count.
* @param array $columns Columns from jqGrid. * @param array $columns Columns from jqGrid.
@ -679,10 +679,10 @@ class SessionManager
/** /**
* Gets the admin session list callback of the session/session_list.php page. * Gets the admin session list callback of the session/session_list.php page.
* *
* @param array $options order and limit keys * @param array $options order and limit keys
* @param bool $getCount Whether to get all the results or only the count * @param bool $getCount Whether to get all the results or only the count
* @param array $columns * @param array $columns
* @param array $extraFieldsToLoad * @param array $extraFieldsToLoad
* @param string $listType * @param string $listType
* *
* @return mixed Integer for number of rows, or array of results * @return mixed Integer for number of rows, or array of results
@ -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.'">
@ -1645,9 +1645,9 @@ class Tracking
* Calculates the time spent on the platform by a user. * Calculates the time spent on the platform by a user.
* *
* @param int|array $userId * @param int|array $userId
* @param string $timeFilter type of time filter: 'last_week' or 'custom' * @param string $timeFilter type of time filter: 'last_week' or 'custom'
* @param string $start_date start date date('Y-m-d H:i:s') * @param string $start_date start date date('Y-m-d H:i:s')
* @param string $end_date end date date('Y-m-d H:i:s') * @param string $end_date end date date('Y-m-d H:i:s')
* @param bool $returnAllRecords * @param bool $returnAllRecords
* *
* @return int * @return int
@ -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);
@ -7682,14 +7682,14 @@ class TrackingCourseLog
if ($surveyList) { if ($surveyList) {
$total_surveys = count($surveyList); $total_surveys = count($surveyList);
foreach ($surveyList as $survey) { foreach ($surveyList as $survey) {
$user_list = SurveyManager::get_people_who_filled_survey( $user_list = SurveyManager::get_people_who_filled_survey(
$survey['survey_id'], $survey['survey_id'],
false, false,
$courseId $courseId
); );
foreach ($user_list as $user_id) { foreach ($user_list as $user_id) {
isset($survey_user_list[$user_id]) ? $survey_user_list[$user_id]++ : $survey_user_list[$user_id] = 1; isset($survey_user_list[$user_id]) ? $survey_user_list[$user_id]++ : $survey_user_list[$user_id] = 1;
} }
} }
} }

@ -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,8 +892,7 @@ 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,8 +1034,7 @@ 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';

@ -249,7 +249,7 @@ $orderUrl = api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=order';
original_cols = grid.jqGrid('getGridParam', 'colModel'); original_cols = grid.jqGrid('getGridParam', 'colModel');
<?php if ($allowOrder) { <?php if ($allowOrder) {
?> ?>
options = { options = {
update: function (e, ui) { update: function (e, ui) {
var rowNum = jQuery("#sessions").getGridParam('rowNum'); var rowNum = jQuery("#sessions").getGridParam('rowNum');
@ -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