Refactor code, remove ticket bundle move into core bundle

pull/3262/head
Julio Montoya 5 years ago
parent e0f24d5723
commit a75e82ac08
  1. 1
      config/bundles.php
  2. 12
      public/main/document/downloadfolder.inc.php
  3. 8
      public/main/document/edit_document.php
  4. 2
      public/main/exercise/TestCategory.php
  5. 2
      public/main/exercise/exercise.class.php
  6. 2
      public/main/exercise/question.class.php
  7. 2
      public/main/forum/forumfunction.inc.php
  8. 2
      public/main/inc/lib/AnnouncementManager.php
  9. 4
      public/main/inc/lib/CourseChatUtils.php
  10. 2
      public/main/inc/lib/ExerciseCategoryManager.php
  11. 122
      public/main/inc/lib/TicketManager.php
  12. 4
      public/main/inc/lib/UnserializeApi.php
  13. 2
      public/main/inc/lib/agenda.lib.php
  14. 2
      public/main/inc/lib/attendance.lib.php
  15. 1
      public/main/inc/lib/database.lib.php
  16. 6
      public/main/inc/lib/document.lib.php
  17. 2
      public/main/inc/lib/fileUpload.lib.php
  18. 2
      public/main/inc/lib/groupmanager.lib.php
  19. 2
      public/main/inc/lib/link.lib.php
  20. 2
      public/main/inc/lib/thematic.lib.php
  21. 6
      public/main/install/install.lib.php
  22. 2
      public/main/lp/learnpath.class.php
  23. 2
      public/main/lp/scorm.class.php
  24. 2
      public/main/work/work.lib.php
  25. 2
      src/CoreBundle/Admin/ResourceFileAdmin.php
  26. 2
      src/CoreBundle/Admin/ResourceLinkAdmin.php
  27. 2
      src/CoreBundle/Controller/EditorController.php
  28. 4
      src/CoreBundle/Controller/ResourceApiController.php
  29. 14
      src/CoreBundle/Controller/ResourceController.php
  30. 4
      src/CoreBundle/Controller/ResourceUploadController.php
  31. 6
      src/CoreBundle/Entity/AbstractResource.php
  32. 4
      src/CoreBundle/Entity/AccessUrl.php
  33. 19
      src/CoreBundle/Entity/Course.php
  34. 2
      src/CoreBundle/Entity/CourseRelUser.php
  35. 4
      src/CoreBundle/Entity/Illustration.php
  36. 6
      src/CoreBundle/Entity/Listener/ResourceListener.php
  37. 4
      src/CoreBundle/Entity/PersonalFile.php
  38. 4
      src/CoreBundle/Entity/ResourceComment.php
  39. 37
      src/CoreBundle/Entity/ResourceFile.php
  40. 2
      src/CoreBundle/Entity/ResourceInterface.php
  41. 22
      src/CoreBundle/Entity/ResourceLink.php
  42. 5
      src/CoreBundle/Entity/ResourceNode.php
  43. 4
      src/CoreBundle/Entity/ResourceRight.php
  44. 4
      src/CoreBundle/Entity/ResourceType.php
  45. 4
      src/CoreBundle/Entity/Session.php
  46. 18
      src/CoreBundle/Entity/Ticket.php
  47. 6
      src/CoreBundle/Entity/TicketAssignedLog.php
  48. 32
      src/CoreBundle/Entity/TicketCategory.php
  49. 10
      src/CoreBundle/Entity/TicketCategoryRelUser.php
  50. 26
      src/CoreBundle/Entity/TicketMessage.php
  51. 24
      src/CoreBundle/Entity/TicketMessageAttachment.php
  52. 24
      src/CoreBundle/Entity/TicketPriority.php
  53. 22
      src/CoreBundle/Entity/TicketProject.php
  54. 12
      src/CoreBundle/Entity/TicketStatus.php
  55. 4
      src/CoreBundle/Entity/Tool.php
  56. 35
      src/CoreBundle/Entity/User.php
  57. 2
      src/CoreBundle/EventListener/ResourceUploadListener.php
  58. 2
      src/CoreBundle/Form/Type/ResourceCommentType.php
  59. 2
      src/CoreBundle/Form/Type/ResourceLinkType.php
  60. 2
      src/CoreBundle/Form/Type/ResourceNodeType.php
  61. 2
      src/CoreBundle/Form/Type/ResourceRightType.php
  62. 2
      src/CoreBundle/Repository/CourseRepository.php
  63. 2
      src/CoreBundle/Repository/GridInterface.php
  64. 6
      src/CoreBundle/Repository/IllustrationRepository.php
  65. 2
      src/CoreBundle/Repository/PersonalFileRepository.php
  66. 8
      src/CoreBundle/Repository/ResourceNodeRepository.php
  67. 16
      src/CoreBundle/Repository/ResourceRepository.php
  68. 2
      src/CoreBundle/Repository/ResourceWithLinkInterface.php
  69. 38
      src/CoreBundle/Repository/UserRepository.php
  70. 10
      src/CoreBundle/Resources/config/admin.yml
  71. 6
      src/CoreBundle/Security/Authorization/Voter/ResourceNodeVoter.php
  72. 4
      src/CoreBundle/ToolChain.php
  73. 8
      src/CoreBundle/Traits/ResourceControllerTrait.php
  74. 4
      src/CourseBundle/Entity/CAnnouncement.php
  75. 4
      src/CourseBundle/Entity/CAnnouncementAttachment.php
  76. 4
      src/CourseBundle/Entity/CAttendance.php
  77. 4
      src/CourseBundle/Entity/CCalendarEvent.php
  78. 4
      src/CourseBundle/Entity/CCalendarEventAttachment.php
  79. 4
      src/CourseBundle/Entity/CChatConversation.php
  80. 4
      src/CourseBundle/Entity/CCourseDescription.php
  81. 20
      src/CourseBundle/Entity/CDocument.php
  82. 4
      src/CourseBundle/Entity/CExerciseCategory.php
  83. 4
      src/CourseBundle/Entity/CForumAttachment.php
  84. 4
      src/CourseBundle/Entity/CForumCategory.php
  85. 4
      src/CourseBundle/Entity/CForumForum.php
  86. 4
      src/CourseBundle/Entity/CForumPost.php
  87. 4
      src/CourseBundle/Entity/CForumThread.php
  88. 4
      src/CourseBundle/Entity/CGlossary.php
  89. 4
      src/CourseBundle/Entity/CGroupInfo.php
  90. 4
      src/CourseBundle/Entity/CLink.php
  91. 4
      src/CourseBundle/Entity/CLinkCategory.php
  92. 4
      src/CourseBundle/Entity/CLp.php
  93. 4
      src/CourseBundle/Entity/CLpCategory.php
  94. 4
      src/CourseBundle/Entity/CQuiz.php
  95. 4
      src/CourseBundle/Entity/CQuizQuestion.php
  96. 4
      src/CourseBundle/Entity/CQuizQuestionCategory.php
  97. 6
      src/CourseBundle/Entity/CShortcut.php
  98. 4
      src/CourseBundle/Entity/CStudentPublication.php
  99. 4
      src/CourseBundle/Entity/CStudentPublicationAssignment.php
  100. 4
      src/CourseBundle/Entity/CStudentPublicationComment.php
  101. Some files were not shown because too many files have changed in this diff Show More

@ -15,7 +15,6 @@ return [
FOS\JsRoutingBundle\FOSJsRoutingBundle::class => ['all' => true],
Chamilo\CoreBundle\ChamiloCoreBundle::class => ['all' => true],
Chamilo\CourseBundle\ChamiloCourseBundle::class => ['all' => true],
Chamilo\TicketBundle\ChamiloTicketBundle::class => ['all' => true],
Chamilo\GraphQlBundle\ChamiloGraphQlBundle::class => ['all' => true],
Chamilo\LtiBundle\ChamiloLtiBundle::class => ['all' => true],
Sylius\Bundle\SettingsBundle\SyliusSettingsBundle::class => ['all' => true],

@ -1,7 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use ChamiloSession as Session;
@ -146,8 +146,8 @@ if (api_is_allowed_to_edit()) {
INNER JOIN $tblDocument AS docs
ON (docs.resource_node_id = n.id)
INNER JOIN resource_link l
ON (l.resource_node_id = n.id)
WHERE
ON (l.resource_node_id = n.id)
WHERE
docs.c_id = $courseId AND
docs.path LIKE '".$querypath."/%' AND
docs.filetype = 'file' AND
@ -241,11 +241,11 @@ if (api_is_allowed_to_edit()) {
// 2nd: Get all folders that are invisible in the given path
$sql = "SELECT path, docs.session_id, docs.id, props.to_group_id, docs.c_id
FROM $doc_table AS docs
FROM $doc_table AS docs
INNER JOIN $prop_table AS props
ON
docs.id = props.ref AND
docs.c_id = props.c_id
docs.c_id = props.c_id
WHERE
docs.c_id = $courseId AND
props.tool = '".TOOL_DOCUMENT."' AND
@ -266,7 +266,7 @@ if (api_is_allowed_to_edit()) {
INNER JOIN $prop_table AS props
ON
docs.id = props.ref AND
docs.c_id = props.c_id
docs.c_id = props.c_id
WHERE
docs.c_id = $courseId AND
props.tool ='".TOOL_DOCUMENT."' AND

@ -36,7 +36,7 @@ $htmlHeadXtra[] = '
<script>
$(function() {
$(".scrollbar-light").scrollbar();
expandColumnToogle("#hide_bar_template", {
selector: "#template_col",
width: 3
@ -295,8 +295,8 @@ $filename = $path_info['filename'];
$extension = $path_info['extension'] ?? '';
$em = Database::getManager();
/** @var \Chamilo\CoreBundle\Entity\Resource\ResourceNode $node */
//$node = $em->getRepository('ChamiloCoreBundle:Resource\ResourceNode')->find($document_data['resource_node_id']);
/** @var \Chamilo\CoreBundle\Entity\ResourceNode $node */
//$node = $em->getRepository('ChamiloCoreBundle:ResourceNode')->find($document_data['resource_node_id']);
$node = $document->getResourceNode();
if (in_array($extension, ['html', 'htm'])) {
@ -494,7 +494,7 @@ if ($owner_id == api_get_user_id() ||
$(function() {
$("[data-toggle=\'tooltip\']").tooltip(
{
content:
content:
function() {
return $(this).attr("title");
}

@ -6,7 +6,7 @@ use APY\DataGridBundle\Grid\Action\MassAction;
use APY\DataGridBundle\Grid\Action\RowAction;
use APY\DataGridBundle\Grid\Row;
use APY\DataGridBundle\Grid\Source\Entity;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter;
use Chamilo\CourseBundle\Entity\CQuizQuestionCategory;

@ -7,7 +7,7 @@ use APY\DataGridBundle\Grid\Action\RowAction;
use APY\DataGridBundle\Grid\Row;
use APY\DataGridBundle\Grid\Source\Entity;
use Chamilo\CoreBundle\Entity\GradebookLink;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\EntityLink;
use Chamilo\CoreBundle\Entity\TrackEHotspot;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CQuizAnswer;
use Chamilo\CourseBundle\Entity\CQuizQuestion;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CForumAttachment;
use Chamilo\CourseBundle\Entity\CForumCategory;

@ -4,7 +4,7 @@
use Chamilo\CoreBundle\Entity\ExtraField as ExtraFieldEntity;
use Chamilo\CoreBundle\Entity\ExtraFieldValues;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CAnnouncement;
use Chamilo\CourseBundle\Entity\CAnnouncementAttachment;

@ -4,8 +4,8 @@
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\CourseRelUser;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser;
use Chamilo\CoreBundle\Repository\ResourceRepository;

@ -5,7 +5,7 @@ use APY\DataGridBundle\Grid\Action\MassAction;
use APY\DataGridBundle\Grid\Action\RowAction;
use APY\DataGridBundle\Grid\Row;
use APY\DataGridBundle\Grid\Source\Entity;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter;
use Chamilo\CourseBundle\Entity\CExerciseCategory;

@ -1,11 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\TicketBundle\Entity\MessageAttachment;
use Chamilo\TicketBundle\Entity\Priority;
use Chamilo\TicketBundle\Entity\Project;
use Chamilo\TicketBundle\Entity\Status;
use Chamilo\TicketBundle\Entity\Ticket;
use Chamilo\CoreBundle\Entity\TicketMessageAttachment;
use Chamilo\CoreBundle\Entity\TicketPriority;
use Chamilo\CoreBundle\Entity\TicketProject;
use Chamilo\CoreBundle\Entity\TicketStatus;
use Chamilo\CoreBundle\Entity\Ticket;
/**
* Class TicketManager.
@ -51,13 +51,13 @@ class TicketManager
$order = Database::escape_string($order);
$projectId = (int) $projectId;
$sql = "SELECT
category.*,
$sql = "SELECT
category.*,
category.id category_id,
project.other_area,
project.other_area,
project.email
FROM
$table_support_category category
FROM
$table_support_category category
INNER JOIN $table_support_project project
ON project.id = category.project_id
WHERE project.id = $projectId
@ -218,7 +218,7 @@ class TicketManager
$table = Database::get_main_table(TABLE_TICKET_CATEGORY_REL_USER);
$userId = (int) $userId;
$categoryId = (int) $categoryId;
$sql = "SELECT * FROM $table
$sql = "SELECT * FROM $table
WHERE category_id = $categoryId AND user_id = $userId";
$result = Database::query($sql);
@ -670,7 +670,7 @@ class TicketManager
if ($messageId) {
// update_total_message
$sql = "UPDATE $table_support_tickets
SET
SET
sys_lastedit_user_id = $userId,
sys_lastedit_datetime = '$now',
total_messages = (
@ -827,26 +827,26 @@ class TicketManager
$column = 'ticket_id';
}
$sql = "SELECT DISTINCT
$sql = "SELECT DISTINCT
ticket.*,
ticket.id ticket_id,
status.name AS status_name,
ticket.start_date,
ticket.sys_lastedit_datetime,
cat.name AS category_name,
priority.name AS priority_name,
priority.name AS priority_name,
ticket.total_messages AS total_messages,
ticket.message AS message,
ticket.subject AS subject,
ticket.assigned_last_user
FROM $table_support_tickets ticket
FROM $table_support_tickets ticket
INNER JOIN $table_support_category cat
ON (cat.id = ticket.category_id)
INNER JOIN $table_support_priority priority
ON (ticket.priority_id = priority.id)
INNER JOIN $table_support_status status
ON (ticket.status_id = status.id)
WHERE 1=1
WHERE 1=1
";
$projectId = (int) $_GET['project_id'];
@ -870,7 +870,7 @@ class TicketManager
cat.name LIKE '%$keyword%' OR
status.name LIKE '%$keyword%' OR
priority.name LIKE '%$keyword%' OR
ticket.personal_email LIKE '%$keyword%'
ticket.personal_email LIKE '%$keyword%'
)";
}
@ -908,11 +908,11 @@ class TicketManager
if ('' != $keyword_course) {
$course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql .= " AND ticket.course_id IN (
$sql .= " AND ticket.course_id IN (
SELECT id FROM $course_table
WHERE (
title LIKE '%$keyword_course%' OR
code LIKE '%$keyword_course%' OR
title LIKE '%$keyword_course%' OR
code LIKE '%$keyword_course%' OR
visual_code LIKE '%$keyword_course%'
)
)";
@ -1091,12 +1091,12 @@ class TicketManager
}
if ('' != $keyword_course) {
$course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql .= " AND ticket.course_id IN (
$sql .= " AND ticket.course_id IN (
SELECT id
FROM $course_table
WHERE (
title LIKE '%$keyword_course%' OR
code LIKE '%$keyword_course%' OR
title LIKE '%$keyword_course%' OR
code LIKE '%$keyword_course%' OR
visual_code LIKE '%$keyword_course%'
)
) ";
@ -1111,13 +1111,13 @@ class TicketManager
/**
* @param int $id
*
* @return false|MessageAttachment
* @return false|TicketMessageAttachment
*/
public static function getTicketMessageAttachment($id)
{
$id = (int) $id;
$em = Database::getManager();
$item = $em->getRepository('ChamiloTicketBundle:MessageAttachment')->find($id);
$item = $em->getRepository('TicketMessageAttachment')->find($id);
if ($item) {
return $item;
}
@ -1134,7 +1134,7 @@ class TicketManager
{
$id = (int) $id;
$em = Database::getManager();
$items = $em->getRepository('ChamiloTicketBundle:MessageAttachment')->findBy(['ticket' => $id]);
$items = $em->getRepository('TicketMessageAttachment')->findBy(['ticket' => $id]);
if ($items) {
return $items;
}
@ -1159,9 +1159,9 @@ class TicketManager
$table_main_user = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT
ticket.*,
ticket.*,
cat.name,
status.name as status,
status.name as status,
priority.name priority
FROM $table_support_tickets ticket
INNER JOIN $table_support_category cat
@ -1214,8 +1214,8 @@ class TicketManager
$ticket['ticket'] = $row;
}
$sql = "SELECT *, message.id as message_id
FROM $table_support_messages message
$sql = "SELECT *, message.id as message_id
FROM $table_support_messages message
INNER JOIN $table_main_user user
ON (message.sys_insert_user_id = user.user_id)
WHERE
@ -1326,7 +1326,7 @@ class TicketManager
$attachmentList = [];
$attachments = self::getTicketMessageAttachmentsByTicketId($ticketId);
if (!empty($attachments)) {
/** @var MessageAttachment $attachment */
/** @var TicketMessageAttachment $attachment */
foreach ($attachments as $attachment) {
$file = api_get_uploaded_file(
'ticket_attachment',
@ -1828,10 +1828,10 @@ class TicketManager
*/
public static function getStatusList()
{
$items = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->findAll();
$items = Database::getManager()->getRepository('TicketStatus')->findAll();
$list = [];
/** @var Status $row */
/** @var TicketStatus $row */
foreach ($items as $row) {
$list[$row->getId()] = $row->getName();
}
@ -1846,7 +1846,7 @@ class TicketManager
*/
public static function getTicketsFromCriteria($criteria)
{
$items = Database::getManager()->getRepository('ChamiloTicketBundle:Ticket')->findBy($criteria);
$items = Database::getManager()->getRepository('ChamiloCoreBundle:Ticket')->findBy($criteria);
$list = [];
/** @var Ticket $row */
@ -1865,7 +1865,7 @@ class TicketManager
public static function getStatusIdFromCode($code)
{
$item = Database::getManager()
->getRepository('ChamiloTicketBundle:Status')
->getRepository('TicketStatus')
->findOneBy(['code' => $code])
;
@ -1881,10 +1881,10 @@ class TicketManager
*/
public static function getPriorityList()
{
$projects = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->findAll();
$projects = Database::getManager()->getRepository('TicketPriority')->findAll();
$list = [];
/** @var Priority $row */
/** @var TicketPriority $row */
foreach ($projects as $row) {
$list[$row->getId()] = $row->getName();
}
@ -1897,10 +1897,10 @@ class TicketManager
*/
public static function getProjects()
{
$projects = Database::getManager()->getRepository('ChamiloTicketBundle:Project')->findAll();
$projects = Database::getManager()->getRepository('TicketProject')->findAll();
$list = [];
/** @var Project $row */
/** @var TicketProject $row */
foreach ($projects as $row) {
$list[] = [
'id' => $row->getId(),
@ -1919,10 +1919,10 @@ class TicketManager
*/
public static function getProjectsSimple()
{
$projects = Database::getManager()->getRepository('ChamiloTicketBundle:Project')->findAll();
$projects = Database::getManager()->getRepository('TicketProject')->findAll();
$list = [];
/** @var Project $row */
/** @var TicketProject $row */
foreach ($projects as $row) {
$list[] = [
'id' => $row->getId(),
@ -1943,7 +1943,7 @@ class TicketManager
*/
public static function getProjectsCount()
{
$count = Database::getManager()->getRepository('ChamiloTicketBundle:Project')->createQueryBuilder('p')
$count = Database::getManager()->getRepository('TicketProject')->createQueryBuilder('p')
->select('COUNT(p.id)')
->getQuery()
->getSingleScalarResult();
@ -1956,7 +1956,7 @@ class TicketManager
*/
public static function addProject($params)
{
$project = new Project();
$project = new TicketProject();
$project->setName($params['name']);
$project->setDescription($params['description']);
$project->setInsertUserId(api_get_user_id());
@ -1968,11 +1968,11 @@ class TicketManager
/**
* @param int $id
*
* @return Project
* @return TicketProject
*/
public static function getProject($id)
{
return Database::getManager()->getRepository('ChamiloTicketBundle:Project')->find($id);
return Database::getManager()->getRepository('TicketProject')->find($id);
}
/**
@ -2023,10 +2023,10 @@ class TicketManager
*/
public static function getStatusAdminList()
{
$items = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->findAll();
$items = Database::getManager()->getRepository('TicketStatus')->findAll();
$list = [];
/** @var Status $row */
/** @var TicketStatus $row */
foreach ($items as $row) {
$list[] = [
'id' => $row->getId(),
@ -2046,10 +2046,10 @@ class TicketManager
*/
public static function getStatusSimple()
{
$projects = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->findAll();
$projects = Database::getManager()->getRepository('TicketStatus')->findAll();
$list = [];
/** @var Project $row */
/** @var TicketProject $row */
foreach ($projects as $row) {
$list[] = [
'id' => $row->getId(),
@ -2067,7 +2067,7 @@ class TicketManager
*/
public static function getStatusCount()
{
$count = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->createQueryBuilder('p')
$count = Database::getManager()->getRepository('TicketStatus')->createQueryBuilder('p')
->select('COUNT(p.id)')
->getQuery()
->getSingleScalarResult();
@ -2080,7 +2080,7 @@ class TicketManager
*/
public static function addStatus($params)
{
$item = new Status();
$item = new TicketStatus();
$item->setCode(URLify::filter($params['name']));
$item->setName($params['name']);
$item->setDescription($params['description']);
@ -2092,11 +2092,11 @@ class TicketManager
/**
* @param $id
*
* @return Project
* @return TicketProject
*/
public static function getStatus($id)
{
return Database::getManager()->getRepository('ChamiloTicketBundle:Status')->find($id);
return Database::getManager()->getRepository('TicketStatus')->find($id);
}
/**
@ -2145,10 +2145,10 @@ class TicketManager
*/
public static function getPriorityAdminList()
{
$items = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->findAll();
$items = Database::getManager()->getRepository('TicketPriority')->findAll();
$list = [];
/** @var Status $row */
/** @var TicketStatus $row */
foreach ($items as $row) {
$list[] = [
'id' => $row->getId(),
@ -2168,10 +2168,10 @@ class TicketManager
*/
public static function getPrioritySimple()
{
$projects = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->findAll();
$projects = Database::getManager()->getRepository('TicketPriority')->findAll();
$list = [];
/** @var Priority $row */
/** @var TicketPriority $row */
foreach ($projects as $row) {
$list[] = [
'id' => $row->getId(),
@ -2189,7 +2189,7 @@ class TicketManager
*/
public static function getPriorityCount()
{
$count = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->createQueryBuilder('p')
$count = Database::getManager()->getRepository('TicketPriority')->createQueryBuilder('p')
->select('COUNT(p.id)')
->getQuery()
->getSingleScalarResult();
@ -2202,7 +2202,7 @@ class TicketManager
*/
public static function addPriority($params)
{
$item = new Priority();
$item = new TicketPriority();
$item
->setCode(URLify::filter($params['name']))
->setName($params['name'])
@ -2219,11 +2219,11 @@ class TicketManager
/**
* @param $id
*
* @return Priority
* @return TicketPriority
*/
public static function getPriority($id)
{
return Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->find($id);
return Database::getManager()->getRepository('TicketPriority')->find($id);
}
/**

@ -102,8 +102,8 @@ class UnserializeApi
LpItem::class,
\Chamilo\CourseBundle\Entity\CLp::class,
\Chamilo\CoreBundle\Entity\Course::class,
\Chamilo\CoreBundle\Entity\Resource\ResourceNode::class,
\Chamilo\CoreBundle\Entity\Resource\ResourceType::class,
\Chamilo\CoreBundle\Entity\ResourceNode::class,
\Chamilo\CoreBundle\Entity\ResourceType::class,
]
);

@ -3,7 +3,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\PersonalAgenda;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\SysCalendar;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CCalendarEvent;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CAttendance;

@ -36,7 +36,6 @@ class Database
[
'ChamiloCoreBundle' => 'Chamilo\CoreBundle\Entity',
'ChamiloCourseBundle' => 'Chamilo\CourseBundle\Entity',
'ChamiloTicketBundle' => 'Chamilo\TicketBundle\Entity',
'ChamiloPluginBundle' => 'Chamilo\PluginBundle\Entity',
]
);

@ -1,8 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Resource\ResourceFile;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceFile;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CDocument;
use Chamilo\CourseBundle\Entity\CGroupInfo;
@ -2904,7 +2904,7 @@ class DocumentManager
$query = $em
->createQueryBuilder()
->select('node')
->from('ChamiloCoreBundle:Resource\ResourceNode', 'node')
->from('ChamiloCoreBundle:ResourceNode', 'node')
->innerJoin('node.resourceType', 'type')
->innerJoin('node.resourceLinks', 'links')
//->innerJoin('node.resourceFile', 'file')

@ -1,7 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CDocument;
use Symfony\Component\HttpFoundation\File\UploadedFile;

@ -1,7 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CGroupInfo;
use Chamilo\CourseBundle\Entity\CGroupRelUser;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CLink;
use Chamilo\CourseBundle\Entity\CLinkCategory;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CThematic;
use Chamilo\CourseBundle\Entity\CThematicAdvance;

@ -6,9 +6,9 @@ use Chamilo\CoreBundle\Entity\BranchSync;
use Chamilo\CoreBundle\Entity\ExtraField;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\ToolChain;
use Chamilo\TicketBundle\Entity\Category as TicketCategory;
use Chamilo\TicketBundle\Entity\Priority as TicketPriority;
use Chamilo\TicketBundle\Entity\Project as TicketProject;
use Chamilo\CoreBundle\Entity\TicketCategory as TicketCategory;
use Chamilo\CoreBundle\Entity\TicketPriority as TicketPriority;
use Chamilo\CoreBundle\Entity\TicketProject as TicketProject;
use Chamilo\CoreBundle\Entity\Group;
use Doctrine\ORM\EntityManager;
use Symfony\Component\DependencyInjection\Container as SymfonyContainer;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Repository\CourseRepository;
use Chamilo\CourseBundle\Component\CourseCopy\CourseArchiver;

@ -1,7 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CLp;
use Symfony\Component\DomCrawler\Crawler;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CStudentPublication;
use Chamilo\CourseBundle\Entity\CStudentPublicationComment;

@ -4,7 +4,7 @@
namespace Chamilo\CoreBundle\Admin;
use Chamilo\CoreBundle\Entity\Resource\ResourceFile;
use Chamilo\CoreBundle\Entity\ResourceFile;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;

@ -4,7 +4,7 @@
namespace Chamilo\CoreBundle\Admin;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;

@ -11,7 +11,7 @@ use Chamilo\CoreBundle\Component\Editor\CkEditor\CkEditor;
use Chamilo\CoreBundle\Component\Editor\Connector;
use Chamilo\CoreBundle\Component\Editor\Finder;
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Manager\SettingsManager;
use Chamilo\CoreBundle\Repository\ResourceFactory;
use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter;

@ -4,8 +4,8 @@
namespace Chamilo\CoreBundle\Controller;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceComment;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceComment;
use Chamilo\CoreBundle\Form\Type\ResourceCommentType;
use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter;
use Chamilo\CoreBundle\Traits\ControllerTrait;

@ -12,10 +12,10 @@ use APY\DataGridBundle\Grid\Export\ExcelExport;
use APY\DataGridBundle\Grid\Grid;
use APY\DataGridBundle\Grid\Row;
use APY\DataGridBundle\Grid\Source\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Form\Type\ResourceCommentType;
use Chamilo\CoreBundle\Repository\IllustrationRepository;
use Chamilo\CoreBundle\Repository\ResourceRepository;
@ -748,7 +748,7 @@ class ResourceController extends AbstractResourceController implements CourseCon
$em = $this->getDoctrine()->getManager();
$id = $request->get('id');
$resourceNode = $this->getDoctrine()->getRepository('ChamiloCoreBundle:Resource\ResourceNode')->find($id);
$resourceNode = $this->getDoctrine()->getRepository('ChamiloCoreBundle:ResourceNode')->find($id);
$parentId = $resourceNode->getParent()->getId();
$this->denyAccessUnlessGranted(
@ -824,7 +824,7 @@ class ResourceController extends AbstractResourceController implements CourseCon
$mode = $request->get('mode');
$em = $this->getDoctrine();
/** @var ResourceNode $resourceNode */
$resourceNode = $em->getRepository('ChamiloCoreBundle:Resource\ResourceNode')->find($id);
$resourceNode = $em->getRepository('ChamiloCoreBundle:ResourceNode')->find($id);
if (null === $resourceNode) {
throw new FileNotFoundException('Resource not found');
@ -853,7 +853,7 @@ class ResourceController extends AbstractResourceController implements CourseCon
$em = $this->getDoctrine();
/** @var ResourceNode $resourceNode */
$resourceNode = $em->getRepository('ChamiloCoreBundle:Resource\ResourceNode')->find($id);
$resourceNode = $em->getRepository('ChamiloCoreBundle:ResourceNode')->find($id);
$this->denyAccessUnlessGranted(
ResourceNodeVoter::VIEW,

@ -4,8 +4,8 @@
namespace Chamilo\CoreBundle\Controller;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Repository\ResourceRepository;
use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter;
use Chamilo\CourseBundle\Entity\CDocument;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource;
namespace Chamilo\CoreBundle\Entity;
use ApiPlatform\Core\Annotation\ApiSubresource;
use APY\DataGridBundle\Grid\Mapping as GRID;
@ -25,10 +25,10 @@ abstract class AbstractResource
*
* @Assert\Valid()
* @ApiSubresource()
* @Groups({"resource_node:read", "document:read"})
* @Groups({"resource_node:read", "resource_node:write", "document:read","document:write"})
* @GRID\Column(field="resourceNode.createdAt", title="Date added", type="datetime")
* @ORM\OneToOne(
* targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", cascade={"remove"}, orphanRemoval=true
* targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", cascade={"remove"}, orphanRemoval=true
* )
* @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="CASCADE")
*/

@ -4,8 +4,8 @@
namespace Chamilo\CoreBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Traits\CourseTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

@ -11,8 +11,9 @@ use ApiPlatform\Core\Annotation\ApiSubresource;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Serializer\Filter\PropertyFilter;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CourseBundle\Entity\CGroupInfo;
use Chamilo\CourseBundle\Entity\CTool;
use Doctrine\Common\Collections\ArrayCollection;
@ -106,6 +107,15 @@ class Course extends AbstractResource implements ResourceInterface
*/
protected $users;
/**
* @var ArrayCollection|ResourceLink[]
*
* @ApiSubresource()
* @Groups({"course:read"})
* @ORM\OneToMany(targetEntity="ResourceLink", mappedBy="course", cascade={"persist"}, orphanRemoval=true)
*/
protected $resourceLinks;
/**
* @ORM\OneToMany(targetEntity="AccessUrlRelCourse", mappedBy="course", cascade={"persist", "remove"}, orphanRemoval=true)
*/
@ -190,11 +200,6 @@ class Course extends AbstractResource implements ResourceInterface
*/
protected $templates;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceLink", mappedBy="course", cascade={"remove"}, orphanRemoval=true)
*/
protected $resourceLinks;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SpecificFieldValues", mappedBy="course")
*/

@ -14,7 +14,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
* @ApiResource(
* shortName="CourseSubscription",
* attributes={"security"="is_granted('ROLE_ADMIN')"},
* normalizationContext={"groups"={"skill:read"}}
* normalizationContext={"groups"={"course_rel_user:read"}}
* )
*
* @ORM\Table(

@ -6,8 +6,8 @@ namespace Chamilo\CoreBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use APY\DataGridBundle\Grid\Mapping as GRID;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CourseBundle\Traits\PersonalResourceTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;

@ -4,8 +4,8 @@
namespace Chamilo\CoreBundle\Entity\Listener;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\ToolChain;
use Cocur\Slugify\SlugifyInterface;
use Doctrine\ORM\Event\LifecycleEventArgs;
@ -52,7 +52,7 @@ class ResourceListener
$slug = sprintf('%s.%s', $this->slugify->slugify($originalBasename), $originalExtension);
}
$repo = $em->getRepository('ChamiloCoreBundle:Resource\ResourceType');
$repo = $em->getRepository('ChamiloCoreBundle:ResourceType');
$class = str_replace('Entity', 'Repository', get_class($args->getEntity()));
$class .= 'Repository';
$name = $this->toolChain->getResourceTypeNameFromRepository($class);

@ -5,8 +5,8 @@
namespace Chamilo\CoreBundle\Entity;
use APY\DataGridBundle\Grid\Mapping as GRID;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource;
namespace Chamilo\CoreBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Chamilo\CoreBundle\Entity\User;
@ -40,7 +40,7 @@ class ResourceComment
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", inversedBy="comments")
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", inversedBy="comments")
* @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $resourceNode;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource;
namespace Chamilo\CoreBundle\Entity;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Annotation\ApiProperty;
@ -17,17 +17,19 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Chamilo\CoreBundle\Controller\CreateMediaObjectAction;
use Chamilo\CoreBundle\Controller\CreateResourceFileAction;
//
//* attributes={"security"="is_granted('ROLE_ADMIN')"},
/**
* @ApiResource(
* iri="http://schema.org/MediaObject",
* normalizationContext={"groups"={"resource_file:read", "media_object_read"}},
* normalizationContext={
* "groups"={"resource_file:read", "resource_node:read", "document:read", "media_object_read"}
* },
* collectionOperations={
* "post"={
* "controller"=CreateMediaObjectAction::class,
* "controller"=CreateResourceFileAction::class,
* "deserialize"=false,
* "security"="is_granted('ROLE_USER')",
* "validation_groups"={"Default", "media_object_create"},
@ -57,6 +59,7 @@ use Chamilo\CoreBundle\Controller\CreateMediaObjectAction;
* )
* @ApiFilter(SearchFilter::class, properties={"name": "partial"})
* @ApiFilter(PropertyFilter::class)
* @ApiFilter(OrderFilter::class, properties={"id", "name", "size", "updatedAt"})
* @ORM\Entity
* @Vich\Uploadable
*
@ -101,7 +104,7 @@ class ResourceFile
/**
* @var string
*
* @Groups({"resource_file:read", "document:read"})
* @Groups({"resource_file:read", "resource_node:read", "document:read"})
* @ORM\Column(type="simple_array", nullable=true)
*/
protected $dimensions;
@ -140,14 +143,14 @@ class ResourceFile
* @var string|null
*
* @ApiProperty(iri="http://schema.org/contentUrl")
* @Groups({"media_object_read"})
* @Groups({"resource_file:read", "resource_node:read", "document:read", "media_object_read"})
*/
public $contentUrl;
/**
* @var ResourceNode
*
* @ORM\OneToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", mappedBy="resourceFile")
* @ORM\OneToOne(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", mappedBy="resourceFile")
*/
protected $resourceNode;
@ -410,4 +413,24 @@ class ResourceFile
$this->updatedAt = new \DateTimeImmutable();
}
}
/**
* @return string|null
*/
public function getContentUrl(): ?string
{
return $this->contentUrl;
}
/**
* @param string|null $contentUrl
*
* @return ResourceFile
*/
public function setContentUrl(?string $contentUrl): ResourceFile
{
$this->contentUrl = $contentUrl;
return $this;
}
}

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource;
namespace Chamilo\CoreBundle\Entity;
/**
* Interface ResourceInterface.

@ -2,19 +2,19 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource;
namespace Chamilo\CoreBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Entity\Usergroup;
use Chamilo\CourseBundle\Entity\CGroupInfo;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ApiResource()
* @ApiResource(
* normalizationContext={"groups"={"resource_link:read", "course:read"}},
*
* )
* @ORM\Entity
* @ORM\Table(name="resource_link")
*/
@ -33,12 +33,16 @@ class ResourceLink
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", inversedBy="resourceLinks")
* @Groups({"resource_link:read", "resource_node:read", "course:read"})
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", inversedBy="resourceLinks")
* @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $resourceNode;
/**
* @Groups({"resource_link:read", "resource_node:read", "course:read"})
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="resourceLinks")
* @ORM\JoinColumn(name="c_id", referencedColumnName="id", nullable=true)
*/
@ -70,7 +74,7 @@ class ResourceLink
/**
* @ORM\OneToMany(
* targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceRight",
* targetEntity="Chamilo\CoreBundle\Entity\ResourceRight",
* mappedBy="resourceLink", cascade={"persist", "remove"}, orphanRemoval=true
* )
*/
@ -79,6 +83,8 @@ class ResourceLink
/**
* @var int
*
* @Groups({"resource_link:read", "resource_node:read", "course:read"})
*
* @ORM\Column(name="visibility", type="integer", nullable=false)
*/
protected $visibility;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource;
namespace Chamilo\CoreBundle\Entity;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Annotation\ApiProperty;
@ -23,7 +23,6 @@ use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
//* attributes={"security"="is_granted('ROLE_ADMIN')"},
/**
* Base entity for all resources.
@ -35,7 +34,7 @@ use Symfony\Component\Validator\Constraints as Assert;
* )
* @ApiFilter(SearchFilter::class, properties={"title": "partial"})
* @ApiFilter(PropertyFilter::class)
* @ApiFilter(OrderFilter::class, properties={"id", "title", "createdAt", "updatedAt"})
* @ApiFilter(OrderFilter::class, properties={"id", "title", "resourceFile", "createdAt", "updatedAt"})
* @ORM\Entity(repositoryClass="Chamilo\CoreBundle\Repository\ResourceNodeRepository")
*
* @ORM\Table(name="resource_node")

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource;
namespace Chamilo\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
@ -20,7 +20,7 @@ class ResourceRight
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceLink", inversedBy="resourceRight")
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\ResourceLink", inversedBy="resourceRight")
* @ORM\JoinColumn(name="resource_link_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected $resourceLink;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource;
namespace Chamilo\CoreBundle\Entity;
use Chamilo\CoreBundle\Entity\Tool;
use Doctrine\ORM\Mapping as ORM;
@ -38,7 +38,7 @@ class ResourceType
protected $tool;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", mappedBy="resourceType", cascade={"persist", "remove"})
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", mappedBy="resourceType", cascade={"persist", "remove"})
*/
protected $resourceNodes;

@ -112,7 +112,7 @@ class Session
protected $urls;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceLink", mappedBy="session", cascade={"remove"}, orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\ResourceLink", mappedBy="session", cascade={"remove"}, orphanRemoval=true)
*/
protected $resourceLinks;
@ -176,7 +176,7 @@ class Session
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="receivedMessages")
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User")
* @ORM\JoinColumn(name="session_admin_id", referencedColumnName="id", nullable=true)
*/
protected $sessionAdmin;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\TicketBundle\Entity;
namespace Chamilo\CoreBundle\Entity;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Session;
@ -47,25 +47,25 @@ class Ticket
protected $message;
/**
* @var Project
* @var TicketProject
*
* @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Project")
* @ORM\ManyToOne(targetEntity="TicketProject")
* @ORM\JoinColumn(name="project_id", referencedColumnName="id")
*/
protected $project;
/**
* @var Project
* @var TicketProject
*
* @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Category")
* @ORM\ManyToOne(targetEntity="TicketCategory")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id")
*/
protected $category;
/**
* @var Priority
* @var TicketPriority
*
* @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Priority")
* @ORM\ManyToOne(targetEntity="TicketPriority")
* @ORM\JoinColumn(name="priority_id", referencedColumnName="id")
*/
protected $priority;
@ -101,9 +101,9 @@ class Ticket
protected $assignedLastUser;
/**
* @var Status
* @var TicketStatus
*
* @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Status")
* @ORM\ManyToOne(targetEntity="TicketStatus")
* @ORM\JoinColumn(name="status_id", referencedColumnName="id")
*/
protected $status;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\TicketBundle\Entity;
namespace Chamilo\CoreBundle\Entity;
use Chamilo\CoreBundle\Entity\User;
use Doctrine\ORM\Mapping as ORM;
@ -15,7 +15,7 @@ use Doctrine\ORM\Mapping as ORM;
* )
* @ORM\Entity
*/
class AssignedLog
class TicketAssignedLog
{
/**
* @var int
@ -29,7 +29,7 @@ class AssignedLog
/**
* @var Ticket
*
* @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Ticket")
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Ticket")
* @ORM\JoinColumn(name="ticket_id", referencedColumnName="id")
*/
protected $ticket;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\TicketBundle\Entity;
namespace Chamilo\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Table(name="ticket_category")
* @ORM\Entity
*/
class Category
class TicketCategory
{
/**
* @var int
@ -52,9 +52,9 @@ class Category
protected $courseRequired;
/**
* @var Project
* @var TicketProject
*
* @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Project")
* @ORM\ManyToOne(targetEntity="TicketProject")
* @ORM\JoinColumn(name="project_id", referencedColumnName="id")
*/
protected $project;
@ -107,7 +107,7 @@ class Category
/**
* @param int $id
*
* @return Category
* @return TicketCategory
*/
public function setId($id)
{
@ -127,7 +127,7 @@ class Category
/**
* @param string $name
*
* @return Category
* @return TicketCategory
*/
public function setName($name)
{
@ -147,7 +147,7 @@ class Category
/**
* @param string $description
*
* @return Category
* @return TicketCategory
*/
public function setDescription($description)
{
@ -167,7 +167,7 @@ class Category
/**
* @param int $totalTickets
*
* @return Category
* @return TicketCategory
*/
public function setTotalTickets($totalTickets)
{
@ -187,7 +187,7 @@ class Category
/**
* @param bool $courseRequired
*
* @return Category
* @return TicketCategory
*/
public function setCourseRequired($courseRequired)
{
@ -197,7 +197,7 @@ class Category
}
/**
* @return Project
* @return TicketProject
*/
public function getProject()
{
@ -205,9 +205,9 @@ class Category
}
/**
* @param Project $project
* @param TicketProject $project
*
* @return Category
* @return TicketCategory
*/
public function setProject($project)
{
@ -227,7 +227,7 @@ class Category
/**
* @param int $insertUserId
*
* @return Category
* @return TicketCategory
*/
public function setInsertUserId($insertUserId)
{
@ -247,7 +247,7 @@ class Category
/**
* @param \DateTime $insertDateTime
*
* @return Category
* @return TicketCategory
*/
public function setInsertDateTime($insertDateTime)
{
@ -267,7 +267,7 @@ class Category
/**
* @param int $lastEditUserId
*
* @return Category
* @return TicketCategory
*/
public function setLastEditUserId($lastEditUserId)
{
@ -287,7 +287,7 @@ class Category
/**
* @param \DateTime $lastEditDateTime
*
* @return Category
* @return TicketCategory
*/
public function setLastEditDateTime($lastEditDateTime)
{

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\TicketBundle\Entity;
namespace Chamilo\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Table(name="ticket_category_rel_user")
* @ORM\Entity
*/
class CategoryRelUser
class TicketCategoryRelUser
{
/**
* @var int
@ -24,15 +24,15 @@ class CategoryRelUser
protected $id;
/**
* @var Category
* @var TicketCategory
*
* @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Category")
* @ORM\ManyToOne(targetEntity="TicketCategory")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id")
*/
protected $category;
/**
* @var Category
* @var TicketCategory
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\TicketBundle\Entity;
namespace Chamilo\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Table(name="ticket_message")
* @ORM\Entity
*/
class Message
class TicketMessage
{
/**
* @var int
@ -54,7 +54,7 @@ class Message
/**
* @var Ticket
*
* @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Ticket")
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Ticket")
* @ORM\JoinColumn(name="ticket_id", referencedColumnName="id")
*/
protected $ticket;
@ -98,7 +98,7 @@ class Message
/**
* @param int $id
*
* @return Message
* @return TicketMessage
*/
public function setId($id)
{
@ -118,7 +118,7 @@ class Message
/**
* @param string $subject
*
* @return Message
* @return TicketMessage
*/
public function setSubject($subject)
{
@ -138,7 +138,7 @@ class Message
/**
* @param string $message
*
* @return Message
* @return TicketMessage
*/
public function setMessage($message)
{
@ -158,7 +158,7 @@ class Message
/**
* @param string $status
*
* @return Message
* @return TicketMessage
*/
public function setStatus($status)
{
@ -178,7 +178,7 @@ class Message
/**
* @param string $ipAddress
*
* @return Message
* @return TicketMessage
*/
public function setIpAddress($ipAddress)
{
@ -198,7 +198,7 @@ class Message
/**
* @param Ticket $ticket
*
* @return Message
* @return TicketMessage
*/
public function setTicket($ticket)
{
@ -218,7 +218,7 @@ class Message
/**
* @param int $insertUserId
*
* @return Message
* @return TicketMessage
*/
public function setInsertUserId($insertUserId)
{
@ -238,7 +238,7 @@ class Message
/**
* @param \DateTime $insertDateTime
*
* @return Message
* @return TicketMessage
*/
public function setInsertDateTime($insertDateTime)
{
@ -258,7 +258,7 @@ class Message
/**
* @param int $lastEditUserId
*
* @return Message
* @return TicketMessage
*/
public function setLastEditUserId($lastEditUserId)
{
@ -278,7 +278,7 @@ class Message
/**
* @param \DateTime $lastEditDateTime
*
* @return Message
* @return TicketMessage
*/
public function setLastEditDateTime($lastEditDateTime)
{

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\TicketBundle\Entity;
namespace Chamilo\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Table(name="ticket_message_attachments")
* @ORM\Entity
*/
class MessageAttachment
class TicketMessageAttachment
{
/**
* @var int
@ -26,15 +26,15 @@ class MessageAttachment
/**
* @var Ticket
*
* @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Ticket")
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Ticket")
* @ORM\JoinColumn(name="ticket_id", referencedColumnName="id")
*/
protected $ticket;
/**
* @var Message
* @var TicketMessage
*
* @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Message")
* @ORM\ManyToOne(targetEntity="TicketMessage")
* @ORM\JoinColumn(name="message_id", referencedColumnName="id")
*/
protected $message;
@ -99,7 +99,7 @@ class MessageAttachment
/**
* @param int $id
*
* @return MessageAttachment
* @return TicketMessageAttachment
*/
public function setId($id)
{
@ -109,7 +109,7 @@ class MessageAttachment
}
/**
* @return Message
* @return TicketMessage
*/
public function getMessage()
{
@ -117,9 +117,9 @@ class MessageAttachment
}
/**
* @param Message $message
* @param TicketMessage $message
*
* @return MessageAttachment
* @return TicketMessageAttachment
*/
public function setMessage($message)
{
@ -139,7 +139,7 @@ class MessageAttachment
/**
* @param string $path
*
* @return MessageAttachment
* @return TicketMessageAttachment
*/
public function setPath($path)
{
@ -159,7 +159,7 @@ class MessageAttachment
/**
* @param string $filename
*
* @return MessageAttachment
* @return TicketMessageAttachment
*/
public function setFilename($filename)
{
@ -179,7 +179,7 @@ class MessageAttachment
/**
* @param int $size
*
* @return MessageAttachment
* @return TicketMessageAttachment
*/
public function setSize($size)
{

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\TicketBundle\Entity;
namespace Chamilo\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Table(name="ticket_priority")
* @ORM\Entity
*/
class Priority
class TicketPriority
{
/**
* @var int
@ -107,7 +107,7 @@ class Priority
/**
* @param int $id
*
* @return Priority
* @return TicketPriority
*/
public function setId($id)
{
@ -127,7 +127,7 @@ class Priority
/**
* @param string $name
*
* @return Priority
* @return TicketPriority
*/
public function setName($name)
{
@ -147,7 +147,7 @@ class Priority
/**
* @param string $code
*
* @return Priority
* @return TicketPriority
*/
public function setCode($code)
{
@ -167,7 +167,7 @@ class Priority
/**
* @param string $description
*
* @return Priority
* @return TicketPriority
*/
public function setDescription($description)
{
@ -187,7 +187,7 @@ class Priority
/**
* @param string $color
*
* @return Priority
* @return TicketPriority
*/
public function setColor($color)
{
@ -207,7 +207,7 @@ class Priority
/**
* @param string $urgency
*
* @return Priority
* @return TicketPriority
*/
public function setUrgency($urgency)
{
@ -227,7 +227,7 @@ class Priority
/**
* @param int $insertUserId
*
* @return Priority
* @return TicketPriority
*/
public function setInsertUserId($insertUserId)
{
@ -247,7 +247,7 @@ class Priority
/**
* @param \DateTime $insertDateTime
*
* @return Priority
* @return TicketPriority
*/
public function setInsertDateTime($insertDateTime)
{
@ -267,7 +267,7 @@ class Priority
/**
* @param int $lastEditUserId
*
* @return Priority
* @return TicketPriority
*/
public function setLastEditUserId($lastEditUserId)
{
@ -287,7 +287,7 @@ class Priority
/**
* @param \DateTime $lastEditDateTime
*
* @return Priority
* @return TicketPriority
*/
public function setLastEditDateTime($lastEditDateTime)
{

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\TicketBundle\Entity;
namespace Chamilo\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Table(name="ticket_project")
* @ORM\Entity
*/
class Project
class TicketProject
{
/**
* @var int
@ -98,7 +98,7 @@ class Project
/**
* @param int $id
*
* @return Project
* @return TicketProject
*/
public function setId($id)
{
@ -118,7 +118,7 @@ class Project
/**
* @param string $name
*
* @return Project
* @return TicketProject
*/
public function setName($name)
{
@ -138,7 +138,7 @@ class Project
/**
* @param string $description
*
* @return Project
* @return TicketProject
*/
public function setDescription($description)
{
@ -158,7 +158,7 @@ class Project
/**
* @param string $email
*
* @return Project
* @return TicketProject
*/
public function setEmail($email)
{
@ -178,7 +178,7 @@ class Project
/**
* @param string $otherArea
*
* @return Project
* @return TicketProject
*/
public function setOtherArea($otherArea)
{
@ -198,7 +198,7 @@ class Project
/**
* @param int $insertUserId
*
* @return Project
* @return TicketProject
*/
public function setInsertUserId($insertUserId)
{
@ -218,7 +218,7 @@ class Project
/**
* @param \DateTime $insertDateTime
*
* @return Project
* @return TicketProject
*/
public function setInsertDateTime($insertDateTime)
{
@ -238,7 +238,7 @@ class Project
/**
* @param int $lastEditUserId
*
* @return Project
* @return TicketProject
*/
public function setLastEditUserId($lastEditUserId)
{
@ -258,7 +258,7 @@ class Project
/**
* @param \DateTime $lastEditDateTime
*
* @return Project
* @return TicketProject
*/
public function setLastEditDateTime($lastEditDateTime)
{

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
namespace Chamilo\TicketBundle\Entity;
namespace Chamilo\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Table(name="ticket_status")
* @ORM\Entity
*/
class Status
class TicketStatus
{
/**
* @var int
@ -55,7 +55,7 @@ class Status
/**
* @param int $id
*
* @return Status
* @return TicketStatus
*/
public function setId($id)
{
@ -75,7 +75,7 @@ class Status
/**
* @param string $code
*
* @return Status
* @return TicketStatus
*/
public function setCode($code)
{
@ -95,7 +95,7 @@ class Status
/**
* @param string $name
*
* @return Status
* @return TicketStatus
*/
public function setName($name)
{
@ -115,7 +115,7 @@ class Status
/**
* @param string $description
*
* @return Status
* @return TicketStatus
*/
public function setDescription($description)
{

@ -4,7 +4,7 @@
namespace Chamilo\CoreBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\ResourceType;
use Chamilo\CoreBundle\Entity\ResourceType;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Mapping as ORM;
@ -34,7 +34,7 @@ class Tool
protected $name;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceType", mappedBy="tool", cascade={"persist", "remove"})
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\ResourceType", mappedBy="tool", cascade={"persist", "remove"})
*/
protected $resourceTypes;

@ -10,7 +10,7 @@ use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiSubresource;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
@ -332,14 +332,14 @@ class User implements UserInterface, EquatableInterface
/**
* @ORM\OneToOne(
* targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", cascade={"remove"}, orphanRemoval=true
* targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", cascade={"remove"}, orphanRemoval=true
* )
* @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected $resourceNode;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", mappedBy="creator")
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", mappedBy="creator")
*/
protected $resourceNodes;
@ -1464,6 +1464,29 @@ class User implements UserInterface, EquatableInterface
return $this->setUsername($slug);
}
public function setUsername($username)
{
$this->username = $username;
return $this;
}
public function setUsernameCanonical($usernameCanonical)
{
$this->usernameCanonical = $usernameCanonical;
return $this;
}
public function setEmailCanonical($emailCanonical)
{
$this->emailCanonical = $emailCanonical;
return $this;
}
/**
* Set lastLogin.
*
@ -1558,13 +1581,15 @@ class User implements UserInterface, EquatableInterface
return $this->plainPassword;
}
public function setPlainPassword(string $password): void
public function setPlainPassword(string $password)
{
$this->plainPassword = $password;
// forces the object to look "dirty" to Doctrine. Avoids
// Doctrine *not* saving this entity, if only plainPassword changes
$this->password = null;
return $this;
}
/**
@ -2149,4 +2174,6 @@ class User implements UserInterface, EquatableInterface
return $this->courseGroupsAsTutor->matching($criteria);
}
}

@ -4,7 +4,7 @@
namespace Chamilo\CoreBundle\EventListener;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Oneup\UploaderBundle\Event\PostPersistEvent;
use Oneup\UploaderBundle\Uploader\Response\ResponseInterface;
use Symfony\Component\Routing\RouterInterface;

@ -4,7 +4,7 @@
namespace Chamilo\CoreBundle\Form\Type;
use Chamilo\CoreBundle\Entity\Resource\ResourceComment;
use Chamilo\CoreBundle\Entity\ResourceComment;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;

@ -70,7 +70,7 @@ class ResourceLinkType extends AbstractType
{
$resolver->setDefaults(
[
'data_class' => 'Chamilo\CoreBundle\Entity\Resource\ResourceLink',
'data_class' => 'Chamilo\CoreBundle\Entity\ResourceLink',
]
);
}

@ -30,7 +30,7 @@ class ResourceNodeType extends AbstractType
{
$resolver->setDefaults(
[
'data_class' => 'Chamilo\CoreBundle\Entity\Resource\ResourceNode',
'data_class' => 'Chamilo\CoreBundle\Entity\ResourceNode',
]
);
}

@ -33,7 +33,7 @@ class ResourceRightType extends AbstractType
{
$resolver->setDefaults(
[
'data_class' => 'Chamilo\CoreBundle\Entity\Resource\ResourceRight',
'data_class' => 'Chamilo\CoreBundle\Entity\ResourceRight',
]
);
}

@ -5,7 +5,7 @@
namespace Chamilo\CoreBundle\Repository;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\Session;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Criteria;

@ -8,7 +8,7 @@ use APY\DataGridBundle\Grid\Column\Column;
use APY\DataGridBundle\Grid\Grid;
use Chamilo\CoreBundle\Component\Resource\Settings;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CourseBundle\Entity\CGroupInfo;

@ -8,9 +8,9 @@ use APY\DataGridBundle\Grid\Column\Column;
use APY\DataGridBundle\Grid\Grid;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Illustration;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceFile;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceFile;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Form\Resource\IllustrationType;

@ -8,7 +8,7 @@ use APY\DataGridBundle\Grid\Column\Column;
use APY\DataGridBundle\Grid\Grid;
use Chamilo\CoreBundle\Component\Resource\Settings;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Form\Resource\PersonalFileType;

@ -5,10 +5,10 @@
namespace Chamilo\CoreBundle\Repository;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\ResourceFile;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\Resource\ResourceType;
use Chamilo\CoreBundle\Entity\ResourceFile;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\ResourceType;
use Chamilo\CoreBundle\Entity\Session;
use Doctrine\ORM\EntityManagerInterface;
use Gedmo\Tree\Entity\Repository\MaterializedPathRepository;

@ -9,13 +9,13 @@ use APY\DataGridBundle\Grid\Row;
use Chamilo\CoreBundle\Component\Resource\Settings;
use Chamilo\CoreBundle\Component\Resource\Template;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceFile;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\Resource\ResourceRight;
use Chamilo\CoreBundle\Entity\Resource\ResourceType;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceFile;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\ResourceRight;
use Chamilo\CoreBundle\Entity\ResourceType;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Entity\Usergroup;
@ -433,7 +433,7 @@ class ResourceRepository extends BaseEntityRepository
public function getResourceType()
{
$name = $this->getResourceTypeName();
$repo = $this->getEntityManager()->getRepository('ChamiloCoreBundle:Resource\ResourceType');
$repo = $this->getEntityManager()->getRepository('ChamiloCoreBundle:ResourceType');
$this->resourceType = $repo->findOneBy(['name' => $name]);
return $this->resourceType;

@ -4,7 +4,7 @@
namespace Chamilo\CoreBundle\Repository;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Symfony\Component\Routing\RouterInterface;
/**

@ -11,7 +11,7 @@ use Chamilo\CoreBundle\Entity\CourseRelUser;
use Chamilo\CoreBundle\Entity\GradebookCertificate;
use Chamilo\CoreBundle\Entity\GradebookResult;
use Chamilo\CoreBundle\Entity\Message;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser;
use Chamilo\CoreBundle\Entity\SkillRelUser;
@ -45,7 +45,7 @@ use Chamilo\CourseBundle\Entity\CStudentPublication;
use Chamilo\CourseBundle\Entity\CStudentPublicationComment;
use Chamilo\CourseBundle\Entity\CSurveyAnswer;
use Chamilo\CourseBundle\Entity\CWiki;
use Chamilo\TicketBundle\Entity\Ticket;
use Chamilo\CoreBundle\Entity\Ticket;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Query\Expr\Join;
use Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface;
@ -70,12 +70,36 @@ class UserRepository extends ResourceRepository implements UserLoaderInterface,
return $this->findBy(['username' => $username]);
}
public function updateUser($user)
public function updateUser($user, $andFlush = true)
{
$this->updateCanonicalFields($user);
$this->updatePassword($user);
$this->getEntityManager()->persist($user);
$this->getEntityManager()->flush();
if ($andFlush) {
$this->getEntityManager()->flush();
}
}
public function updateCanonicalFields(UserInterface $user)
{
//$user->setUsernameCanonical($this->canonicalizeUsername($user->getUsername()));
//$user->setEmailCanonical($this->canonicalizeEmail($user->getEmail()));
}
/**
* {@inheritDoc}
*/
public function updatePassword(UserInterface $user)
{
if (0 !== strlen($password = $user->getPlainPassword())) {
// $encoder = $this->getEncoder($user);
//$user->setPassword($encoder->encodePassword($password, $user->getSalt()));
//$user->eraseCredentials();
}
}
public function upgradePassword(UserInterface $user, string $newEncodedPassword): void
{
// this code is only an example; the exact code will depend on
@ -1205,7 +1229,7 @@ class UserRepository extends ResourceRepository implements UserLoaderInterface,
$criteria = [
'insertUserId' => $userId,
];
$result = $em->getRepository('ChamiloTicketBundle:Ticket')->findBy($criteria);
$result = $em->getRepository('ChamiloCoreBundle:Ticket')->findBy($criteria);
$ticket = [];
/** @var Ticket $item */
foreach ($result as $item) {
@ -1220,9 +1244,9 @@ class UserRepository extends ResourceRepository implements UserLoaderInterface,
$criteria = [
'insertUserId' => $userId,
];
$result = $em->getRepository('ChamiloTicketBundle:Message')->findBy($criteria);
$result = $em->getRepository('TicketMessage')->findBy($criteria);
$ticketMessage = [];
/** @var \Chamilo\TicketBundle\Entity\Message $item */
/** @var \Chamilo\CoreBundle\Entity\TicketMessage $item */
foreach ($result as $item) {
$date = $item->getInsertDateTime() ? $item->getInsertDateTime()->format($dateFormat) : '';
$list = [

@ -155,7 +155,7 @@ services:
- {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "Resource node"}
arguments:
- ~
- Chamilo\CoreBundle\Entity\Resource\ResourceNode
- Chamilo\CoreBundle\Entity\ResourceNode
- ~
calls:
- [setTranslationDomain, [ChamiloCoreBundle]]
@ -166,7 +166,7 @@ services:
- {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "Resource file"}
arguments:
- ~
- Chamilo\CoreBundle\Entity\Resource\ResourceFile
- Chamilo\CoreBundle\Entity\ResourceFile
- ~
calls:
- [setTranslationDomain, [ChamiloCoreBundle]]
@ -177,7 +177,7 @@ services:
- {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "Resource link"}
arguments:
- ~
- Chamilo\CoreBundle\Entity\Resource\ResourceLink
- Chamilo\CoreBundle\Entity\ResourceLink
- ~
calls:
- [setTranslationDomain, [ChamiloCoreBundle]]
@ -188,7 +188,7 @@ services:
- {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "Resource right"}
arguments:
- ~
- Chamilo\CoreBundle\Entity\Resource\ResourceRight
- Chamilo\CoreBundle\Entity\ResourceRight
- ~
calls:
- [setTranslationDomain, [ChamiloCoreBundle]]
@ -199,7 +199,7 @@ services:
- {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "Resource type"}
arguments:
- ~
- Chamilo\CoreBundle\Entity\Resource\ResourceType
- Chamilo\CoreBundle\Entity\ResourceType
- ~
calls:
- [setTranslationDomain, [ChamiloCoreBundle]]

@ -5,9 +5,9 @@
namespace Chamilo\CoreBundle\Security\Authorization\Voter;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\Resource\ResourceRight;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\ResourceRight;
use Chamilo\CoreBundle\Entity\Session;
use Laminas\Permissions\Acl\Acl;
use Laminas\Permissions\Acl\Resource\GenericResource as SecurityResource;

@ -5,8 +5,8 @@
namespace Chamilo\CoreBundle;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\Resource\ResourceType;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\ResourceType;
use Chamilo\CoreBundle\Entity\Tool;
use Chamilo\CoreBundle\Entity\ToolResourceRight;
use Chamilo\CoreBundle\Manager\SettingsManager;

@ -5,9 +5,9 @@
namespace Chamilo\CoreBundle\Traits;
use Chamilo\CoreBundle\Component\Utils\Glide;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Repository\ResourceFactory;
use Chamilo\CoreBundle\Repository\ResourceRepository;
@ -95,7 +95,7 @@ trait ResourceControllerTrait
}
}
} else {
$repo = $this->getDoctrine()->getRepository('ChamiloCoreBundle:Resource\ResourceNode');
$repo = $this->getDoctrine()->getRepository('ChamiloCoreBundle:ResourceNode');
$parentResourceNode = $repo->find($parentNodeId);
}

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
/**

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
/**

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
/**

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\Room;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
/**

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
/**

@ -5,8 +5,8 @@
namespace Chamilo\CourseBundle\Entity;
use APY\DataGridBundle\Grid\Mapping as GRID;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
/**

@ -13,8 +13,8 @@ use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Serializer\Filter\PropertyFilter;
use APY\DataGridBundle\Grid\Mapping as GRID;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CourseBundle\Traits\ShowCourseResourcesInSessionTrait;
use Doctrine\ORM\Event\LifecycleEventArgs;
@ -24,13 +24,19 @@ use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ApiResource(
* shortName="Documents",
* normalizationContext={"groups"={"document:read", "resource_node:node"}},
* normalizationContext={"groups"={"document:read", "resource_node:read"}},
* denormalizationContext={"groups"={"document:write"}}
* )
* @ApiFilter(SearchFilter::class, properties={"title": "partial"})
* @ApiFilter(SearchFilter::class, properties={"title": "partial", "resourceNode": "exact"})
* @ApiFilter(
* OrderFilter::class,
* properties={"id", "resourceNode.title", "resourceNode.createdAt", "resourceNode.updatedAt"}
* properties={
* "id",
* "resourceNode.title",
* "resourceNode.createdAt",
* "resourceNode.resourceFile.size",
* "resourceNode.updatedAt"
* }
* )
*
* @ORM\Table(
@ -138,11 +144,11 @@ class CDocument extends AbstractResource implements ResourceInterface
*/
public function __construct()
{
$this->id = 0;
$this->size = 0;
$this->filetype = 'folder';
$this->readonly = false;
$this->template = false;
$this->size = 0;
$this->id = 0;
}
public function __toString(): string

@ -6,8 +6,8 @@ namespace Chamilo\CourseBundle\Entity;
use APY\DataGridBundle\Grid\Mapping as GRID;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Timestampable\Traits\TimestampableEntity;

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
/**

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

@ -5,8 +5,8 @@
namespace Chamilo\CourseBundle\Entity;
use APY\DataGridBundle\Grid\Mapping as GRID;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
/**

@ -5,8 +5,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Traits\CourseTrait;
use Doctrine\Common\Collections\Collection;

@ -5,8 +5,8 @@
namespace Chamilo\CourseBundle\Entity;
use APY\DataGridBundle\Grid\Mapping as GRID;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
/**

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
/**

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\User;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Criteria;

@ -5,8 +5,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CourseBundle\Traits\ShowCourseResourcesInSessionTrait;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Mapping as ORM;

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
/**

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CourseBundle\Traits\ShowCourseResourcesInSessionTrait;
use Doctrine\ORM\Event\LifecycleEventArgs;

@ -5,8 +5,8 @@
namespace Chamilo\CourseBundle\Entity;
use APY\DataGridBundle\Grid\Mapping as GRID;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
@ -35,7 +35,7 @@ class CShortcut extends AbstractResource implements ResourceInterface
/**
* @ORM\OneToOne(
* targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode"
* targetEntity="Chamilo\CoreBundle\Entity\ResourceNode"
* )
* @ORM\JoinColumn(name="shortcut_node_id", referencedColumnName="id")
*/

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\Session;
use Doctrine\ORM\Mapping as ORM;

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
/**

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM;
/**

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save