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. 2
      public/main/document/downloadfolder.inc.php
  3. 4
      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. 78
      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], FOS\JsRoutingBundle\FOSJsRoutingBundle::class => ['all' => true],
Chamilo\CoreBundle\ChamiloCoreBundle::class => ['all' => true], Chamilo\CoreBundle\ChamiloCoreBundle::class => ['all' => true],
Chamilo\CourseBundle\ChamiloCourseBundle::class => ['all' => true], Chamilo\CourseBundle\ChamiloCourseBundle::class => ['all' => true],
Chamilo\TicketBundle\ChamiloTicketBundle::class => ['all' => true],
Chamilo\GraphQlBundle\ChamiloGraphQlBundle::class => ['all' => true], Chamilo\GraphQlBundle\ChamiloGraphQlBundle::class => ['all' => true],
Chamilo\LtiBundle\ChamiloLtiBundle::class => ['all' => true], Chamilo\LtiBundle\ChamiloLtiBundle::class => ['all' => true],
Sylius\Bundle\SettingsBundle\SyliusSettingsBundle::class => ['all' => true], Sylius\Bundle\SettingsBundle\SyliusSettingsBundle::class => ['all' => true],

@ -1,7 +1,7 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* 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\Framework\Container;
use ChamiloSession as Session; use ChamiloSession as Session;

@ -295,8 +295,8 @@ $filename = $path_info['filename'];
$extension = $path_info['extension'] ?? ''; $extension = $path_info['extension'] ?? '';
$em = Database::getManager(); $em = Database::getManager();
/** @var \Chamilo\CoreBundle\Entity\Resource\ResourceNode $node */ /** @var \Chamilo\CoreBundle\Entity\ResourceNode $node */
//$node = $em->getRepository('ChamiloCoreBundle:Resource\ResourceNode')->find($document_data['resource_node_id']); //$node = $em->getRepository('ChamiloCoreBundle:ResourceNode')->find($document_data['resource_node_id']);
$node = $document->getResourceNode(); $node = $document->getResourceNode();
if (in_array($extension, ['html', 'htm'])) { if (in_array($extension, ['html', 'htm'])) {

@ -6,7 +6,7 @@ use APY\DataGridBundle\Grid\Action\MassAction;
use APY\DataGridBundle\Grid\Action\RowAction; 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\Resource\ResourceLink; use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter; use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter;
use Chamilo\CourseBundle\Entity\CQuizQuestionCategory; use Chamilo\CourseBundle\Entity\CQuizQuestionCategory;

@ -7,7 +7,7 @@ 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\Entity\Resource\ResourceLink; 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;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */ /* 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\Framework\Container;
use Chamilo\CourseBundle\Entity\CQuizAnswer; use Chamilo\CourseBundle\Entity\CQuizAnswer;
use Chamilo\CourseBundle\Entity\CQuizQuestion; use Chamilo\CourseBundle\Entity\CQuizQuestion;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */ /* 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\Framework\Container;
use Chamilo\CourseBundle\Entity\CForumAttachment; use Chamilo\CourseBundle\Entity\CForumAttachment;
use Chamilo\CourseBundle\Entity\CForumCategory; use Chamilo\CourseBundle\Entity\CForumCategory;

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

@ -4,8 +4,8 @@
use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\CourseRelUser; use Chamilo\CoreBundle\Entity\CourseRelUser;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink; use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\Resource\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\Repository\ResourceRepository; 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\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\Resource\ResourceLink; use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter; use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter;
use Chamilo\CourseBundle\Entity\CExerciseCategory; use Chamilo\CourseBundle\Entity\CExerciseCategory;

@ -1,11 +1,11 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\TicketBundle\Entity\MessageAttachment; use Chamilo\CoreBundle\Entity\TicketMessageAttachment;
use Chamilo\TicketBundle\Entity\Priority; use Chamilo\CoreBundle\Entity\TicketPriority;
use Chamilo\TicketBundle\Entity\Project; use Chamilo\CoreBundle\Entity\TicketProject;
use Chamilo\TicketBundle\Entity\Status; use Chamilo\CoreBundle\Entity\TicketStatus;
use Chamilo\TicketBundle\Entity\Ticket; use Chamilo\CoreBundle\Entity\Ticket;
/** /**
* Class TicketManager. * Class TicketManager.
@ -1111,13 +1111,13 @@ class TicketManager
/** /**
* @param int $id * @param int $id
* *
* @return false|MessageAttachment * @return false|TicketMessageAttachment
*/ */
public static function getTicketMessageAttachment($id) public static function getTicketMessageAttachment($id)
{ {
$id = (int) $id; $id = (int) $id;
$em = Database::getManager(); $em = Database::getManager();
$item = $em->getRepository('ChamiloTicketBundle:MessageAttachment')->find($id); $item = $em->getRepository('TicketMessageAttachment')->find($id);
if ($item) { if ($item) {
return $item; return $item;
} }
@ -1134,7 +1134,7 @@ class TicketManager
{ {
$id = (int) $id; $id = (int) $id;
$em = Database::getManager(); $em = Database::getManager();
$items = $em->getRepository('ChamiloTicketBundle:MessageAttachment')->findBy(['ticket' => $id]); $items = $em->getRepository('TicketMessageAttachment')->findBy(['ticket' => $id]);
if ($items) { if ($items) {
return $items; return $items;
} }
@ -1326,7 +1326,7 @@ class TicketManager
$attachmentList = []; $attachmentList = [];
$attachments = self::getTicketMessageAttachmentsByTicketId($ticketId); $attachments = self::getTicketMessageAttachmentsByTicketId($ticketId);
if (!empty($attachments)) { if (!empty($attachments)) {
/** @var MessageAttachment $attachment */ /** @var TicketMessageAttachment $attachment */
foreach ($attachments as $attachment) { foreach ($attachments as $attachment) {
$file = api_get_uploaded_file( $file = api_get_uploaded_file(
'ticket_attachment', 'ticket_attachment',
@ -1828,10 +1828,10 @@ class TicketManager
*/ */
public static function getStatusList() public static function getStatusList()
{ {
$items = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->findAll(); $items = Database::getManager()->getRepository('TicketStatus')->findAll();
$list = []; $list = [];
/** @var Status $row */ /** @var TicketStatus $row */
foreach ($items as $row) { foreach ($items as $row) {
$list[$row->getId()] = $row->getName(); $list[$row->getId()] = $row->getName();
} }
@ -1846,7 +1846,7 @@ class TicketManager
*/ */
public static function getTicketsFromCriteria($criteria) public static function getTicketsFromCriteria($criteria)
{ {
$items = Database::getManager()->getRepository('ChamiloTicketBundle:Ticket')->findBy($criteria); $items = Database::getManager()->getRepository('ChamiloCoreBundle:Ticket')->findBy($criteria);
$list = []; $list = [];
/** @var Ticket $row */ /** @var Ticket $row */
@ -1865,7 +1865,7 @@ class TicketManager
public static function getStatusIdFromCode($code) public static function getStatusIdFromCode($code)
{ {
$item = Database::getManager() $item = Database::getManager()
->getRepository('ChamiloTicketBundle:Status') ->getRepository('TicketStatus')
->findOneBy(['code' => $code]) ->findOneBy(['code' => $code])
; ;
@ -1881,10 +1881,10 @@ class TicketManager
*/ */
public static function getPriorityList() public static function getPriorityList()
{ {
$projects = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->findAll(); $projects = Database::getManager()->getRepository('TicketPriority')->findAll();
$list = []; $list = [];
/** @var Priority $row */ /** @var TicketPriority $row */
foreach ($projects as $row) { foreach ($projects as $row) {
$list[$row->getId()] = $row->getName(); $list[$row->getId()] = $row->getName();
} }
@ -1897,10 +1897,10 @@ class TicketManager
*/ */
public static function getProjects() public static function getProjects()
{ {
$projects = Database::getManager()->getRepository('ChamiloTicketBundle:Project')->findAll(); $projects = Database::getManager()->getRepository('TicketProject')->findAll();
$list = []; $list = [];
/** @var Project $row */ /** @var TicketProject $row */
foreach ($projects as $row) { foreach ($projects as $row) {
$list[] = [ $list[] = [
'id' => $row->getId(), 'id' => $row->getId(),
@ -1919,10 +1919,10 @@ class TicketManager
*/ */
public static function getProjectsSimple() public static function getProjectsSimple()
{ {
$projects = Database::getManager()->getRepository('ChamiloTicketBundle:Project')->findAll(); $projects = Database::getManager()->getRepository('TicketProject')->findAll();
$list = []; $list = [];
/** @var Project $row */ /** @var TicketProject $row */
foreach ($projects as $row) { foreach ($projects as $row) {
$list[] = [ $list[] = [
'id' => $row->getId(), 'id' => $row->getId(),
@ -1943,7 +1943,7 @@ class TicketManager
*/ */
public static function getProjectsCount() public static function getProjectsCount()
{ {
$count = Database::getManager()->getRepository('ChamiloTicketBundle:Project')->createQueryBuilder('p') $count = Database::getManager()->getRepository('TicketProject')->createQueryBuilder('p')
->select('COUNT(p.id)') ->select('COUNT(p.id)')
->getQuery() ->getQuery()
->getSingleScalarResult(); ->getSingleScalarResult();
@ -1956,7 +1956,7 @@ class TicketManager
*/ */
public static function addProject($params) public static function addProject($params)
{ {
$project = new Project(); $project = new TicketProject();
$project->setName($params['name']); $project->setName($params['name']);
$project->setDescription($params['description']); $project->setDescription($params['description']);
$project->setInsertUserId(api_get_user_id()); $project->setInsertUserId(api_get_user_id());
@ -1968,11 +1968,11 @@ class TicketManager
/** /**
* @param int $id * @param int $id
* *
* @return Project * @return TicketProject
*/ */
public static function getProject($id) 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() public static function getStatusAdminList()
{ {
$items = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->findAll(); $items = Database::getManager()->getRepository('TicketStatus')->findAll();
$list = []; $list = [];
/** @var Status $row */ /** @var TicketStatus $row */
foreach ($items as $row) { foreach ($items as $row) {
$list[] = [ $list[] = [
'id' => $row->getId(), 'id' => $row->getId(),
@ -2046,10 +2046,10 @@ class TicketManager
*/ */
public static function getStatusSimple() public static function getStatusSimple()
{ {
$projects = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->findAll(); $projects = Database::getManager()->getRepository('TicketStatus')->findAll();
$list = []; $list = [];
/** @var Project $row */ /** @var TicketProject $row */
foreach ($projects as $row) { foreach ($projects as $row) {
$list[] = [ $list[] = [
'id' => $row->getId(), 'id' => $row->getId(),
@ -2067,7 +2067,7 @@ class TicketManager
*/ */
public static function getStatusCount() public static function getStatusCount()
{ {
$count = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->createQueryBuilder('p') $count = Database::getManager()->getRepository('TicketStatus')->createQueryBuilder('p')
->select('COUNT(p.id)') ->select('COUNT(p.id)')
->getQuery() ->getQuery()
->getSingleScalarResult(); ->getSingleScalarResult();
@ -2080,7 +2080,7 @@ class TicketManager
*/ */
public static function addStatus($params) public static function addStatus($params)
{ {
$item = new Status(); $item = new TicketStatus();
$item->setCode(URLify::filter($params['name'])); $item->setCode(URLify::filter($params['name']));
$item->setName($params['name']); $item->setName($params['name']);
$item->setDescription($params['description']); $item->setDescription($params['description']);
@ -2092,11 +2092,11 @@ class TicketManager
/** /**
* @param $id * @param $id
* *
* @return Project * @return TicketProject
*/ */
public static function getStatus($id) 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() public static function getPriorityAdminList()
{ {
$items = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->findAll(); $items = Database::getManager()->getRepository('TicketPriority')->findAll();
$list = []; $list = [];
/** @var Status $row */ /** @var TicketStatus $row */
foreach ($items as $row) { foreach ($items as $row) {
$list[] = [ $list[] = [
'id' => $row->getId(), 'id' => $row->getId(),
@ -2168,10 +2168,10 @@ class TicketManager
*/ */
public static function getPrioritySimple() public static function getPrioritySimple()
{ {
$projects = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->findAll(); $projects = Database::getManager()->getRepository('TicketPriority')->findAll();
$list = []; $list = [];
/** @var Priority $row */ /** @var TicketPriority $row */
foreach ($projects as $row) { foreach ($projects as $row) {
$list[] = [ $list[] = [
'id' => $row->getId(), 'id' => $row->getId(),
@ -2189,7 +2189,7 @@ class TicketManager
*/ */
public static function getPriorityCount() public static function getPriorityCount()
{ {
$count = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->createQueryBuilder('p') $count = Database::getManager()->getRepository('TicketPriority')->createQueryBuilder('p')
->select('COUNT(p.id)') ->select('COUNT(p.id)')
->getQuery() ->getQuery()
->getSingleScalarResult(); ->getSingleScalarResult();
@ -2202,7 +2202,7 @@ class TicketManager
*/ */
public static function addPriority($params) public static function addPriority($params)
{ {
$item = new Priority(); $item = new TicketPriority();
$item $item
->setCode(URLify::filter($params['name'])) ->setCode(URLify::filter($params['name']))
->setName($params['name']) ->setName($params['name'])
@ -2219,11 +2219,11 @@ class TicketManager
/** /**
* @param $id * @param $id
* *
* @return Priority * @return TicketPriority
*/ */
public static function getPriority($id) 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, LpItem::class,
\Chamilo\CourseBundle\Entity\CLp::class, \Chamilo\CourseBundle\Entity\CLp::class,
\Chamilo\CoreBundle\Entity\Course::class, \Chamilo\CoreBundle\Entity\Course::class,
\Chamilo\CoreBundle\Entity\Resource\ResourceNode::class, \Chamilo\CoreBundle\Entity\ResourceNode::class,
\Chamilo\CoreBundle\Entity\Resource\ResourceType::class, \Chamilo\CoreBundle\Entity\ResourceType::class,
] ]
); );

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

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */ /* 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\Framework\Container;
use Chamilo\CourseBundle\Entity\CAttendance; use Chamilo\CourseBundle\Entity\CAttendance;

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

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

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

@ -1,7 +1,7 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* 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\Framework\Container;
use Chamilo\CourseBundle\Entity\CGroupInfo; use Chamilo\CourseBundle\Entity\CGroupInfo;
use Chamilo\CourseBundle\Entity\CGroupRelUser; use Chamilo\CourseBundle\Entity\CGroupRelUser;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */ /* 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\Framework\Container;
use Chamilo\CourseBundle\Entity\CLink; use Chamilo\CourseBundle\Entity\CLink;
use Chamilo\CourseBundle\Entity\CLinkCategory; use Chamilo\CourseBundle\Entity\CLinkCategory;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */ /* 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\Framework\Container;
use Chamilo\CourseBundle\Entity\CThematic; use Chamilo\CourseBundle\Entity\CThematic;
use Chamilo\CourseBundle\Entity\CThematicAdvance; use Chamilo\CourseBundle\Entity\CThematicAdvance;

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

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */ /* 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\Framework\Container;
use Chamilo\CoreBundle\Repository\CourseRepository; use Chamilo\CoreBundle\Repository\CourseRepository;
use Chamilo\CourseBundle\Component\CourseCopy\CourseArchiver; use Chamilo\CourseBundle\Component\CourseCopy\CourseArchiver;

@ -1,7 +1,7 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* 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\Framework\Container;
use Chamilo\CourseBundle\Entity\CLp; use Chamilo\CourseBundle\Entity\CLp;
use Symfony\Component\DomCrawler\Crawler; use Symfony\Component\DomCrawler\Crawler;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */ /* 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\Framework\Container;
use Chamilo\CourseBundle\Entity\CStudentPublication; use Chamilo\CourseBundle\Entity\CStudentPublication;
use Chamilo\CourseBundle\Entity\CStudentPublicationComment; use Chamilo\CourseBundle\Entity\CStudentPublicationComment;

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

@ -4,7 +4,7 @@
namespace Chamilo\CoreBundle\Admin; namespace Chamilo\CoreBundle\Admin;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink; use Chamilo\CoreBundle\Entity\ResourceLink;
use Sonata\AdminBundle\Admin\AbstractAdmin; use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper; use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper; 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\Connector;
use Chamilo\CoreBundle\Component\Editor\Finder; use Chamilo\CoreBundle\Component\Editor\Finder;
use Chamilo\CoreBundle\Component\Utils\ChamiloApi; 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\Manager\SettingsManager;
use Chamilo\CoreBundle\Repository\ResourceFactory; use Chamilo\CoreBundle\Repository\ResourceFactory;
use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter; use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter;

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

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

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

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource; namespace Chamilo\CoreBundle\Entity;
use ApiPlatform\Core\Annotation\ApiSubresource; use ApiPlatform\Core\Annotation\ApiSubresource;
use APY\DataGridBundle\Grid\Mapping as GRID; use APY\DataGridBundle\Grid\Mapping as GRID;
@ -25,10 +25,10 @@ abstract class AbstractResource
* *
* @Assert\Valid() * @Assert\Valid()
* @ApiSubresource() * @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") * @GRID\Column(field="resourceNode.createdAt", title="Date added", type="datetime")
* @ORM\OneToOne( * @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") * @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="CASCADE")
*/ */

@ -4,8 +4,8 @@
namespace Chamilo\CoreBundle\Entity; namespace Chamilo\CoreBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource; use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Traits\CourseTrait; use Chamilo\CoreBundle\Traits\CourseTrait;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo; 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\OrderFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter; use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Serializer\Filter\PropertyFilter; use ApiPlatform\Core\Serializer\Filter\PropertyFilter;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource; use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CourseBundle\Entity\CGroupInfo; use Chamilo\CourseBundle\Entity\CGroupInfo;
use Chamilo\CourseBundle\Entity\CTool; use Chamilo\CourseBundle\Entity\CTool;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
@ -106,6 +107,15 @@ class Course extends AbstractResource implements ResourceInterface
*/ */
protected $users; 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) * @ORM\OneToMany(targetEntity="AccessUrlRelCourse", mappedBy="course", cascade={"persist", "remove"}, orphanRemoval=true)
*/ */
@ -190,11 +200,6 @@ class Course extends AbstractResource implements ResourceInterface
*/ */
protected $templates; 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") * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SpecificFieldValues", mappedBy="course")
*/ */

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

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

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

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

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

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

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

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

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

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource; namespace Chamilo\CoreBundle\Entity;
use Chamilo\CoreBundle\Entity\Tool; use Chamilo\CoreBundle\Entity\Tool;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
@ -38,7 +38,7 @@ class ResourceType
protected $tool; 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; protected $resourceNodes;

@ -112,7 +112,7 @@ class Session
protected $urls; 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; protected $resourceLinks;
@ -176,7 +176,7 @@ class Session
/** /**
* @var User * @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) * @ORM\JoinColumn(name="session_admin_id", referencedColumnName="id", nullable=true)
*/ */
protected $sessionAdmin; protected $sessionAdmin;

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

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

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

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

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

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

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

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

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

@ -4,7 +4,7 @@
namespace Chamilo\CoreBundle\Entity; namespace Chamilo\CoreBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\ResourceType; use Chamilo\CoreBundle\Entity\ResourceType;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
@ -34,7 +34,7 @@ class Tool
protected $name; 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; protected $resourceTypes;

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

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

@ -4,7 +4,7 @@
namespace Chamilo\CoreBundle\Form\Type; 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\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\TextareaType;

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

@ -5,7 +5,7 @@
namespace Chamilo\CoreBundle\Repository; namespace Chamilo\CoreBundle\Repository;
use Chamilo\CoreBundle\Entity\Course; 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\Session;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Criteria;

@ -8,7 +8,7 @@ use APY\DataGridBundle\Grid\Column\Column;
use APY\DataGridBundle\Grid\Grid; use APY\DataGridBundle\Grid\Grid;
use Chamilo\CoreBundle\Component\Resource\Settings; use Chamilo\CoreBundle\Component\Resource\Settings;
use Chamilo\CoreBundle\Entity\Course; 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\Session;
use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\User;
use Chamilo\CourseBundle\Entity\CGroupInfo; use Chamilo\CourseBundle\Entity\CGroupInfo;

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

@ -8,7 +8,7 @@ use APY\DataGridBundle\Grid\Column\Column;
use APY\DataGridBundle\Grid\Grid; use APY\DataGridBundle\Grid\Grid;
use Chamilo\CoreBundle\Component\Resource\Settings; use Chamilo\CoreBundle\Component\Resource\Settings;
use Chamilo\CoreBundle\Entity\Course; 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\Session;
use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Form\Resource\PersonalFileType; use Chamilo\CoreBundle\Form\Resource\PersonalFileType;

@ -5,10 +5,10 @@
namespace Chamilo\CoreBundle\Repository; namespace Chamilo\CoreBundle\Repository;
use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\ResourceFile; use Chamilo\CoreBundle\Entity\ResourceFile;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink; use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode; use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\Resource\ResourceType; use Chamilo\CoreBundle\Entity\ResourceType;
use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\Session;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Gedmo\Tree\Entity\Repository\MaterializedPathRepository; 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\Settings;
use Chamilo\CoreBundle\Component\Resource\Template; use Chamilo\CoreBundle\Component\Resource\Template;
use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource; use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceFile; use Chamilo\CoreBundle\Entity\ResourceFile;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink; use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode; use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\Resource\ResourceRight; use Chamilo\CoreBundle\Entity\ResourceRight;
use Chamilo\CoreBundle\Entity\Resource\ResourceType; use Chamilo\CoreBundle\Entity\ResourceType;
use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\User;
use Chamilo\CoreBundle\Entity\Usergroup; use Chamilo\CoreBundle\Entity\Usergroup;
@ -433,7 +433,7 @@ class ResourceRepository extends BaseEntityRepository
public function getResourceType() public function getResourceType()
{ {
$name = $this->getResourceTypeName(); $name = $this->getResourceTypeName();
$repo = $this->getEntityManager()->getRepository('ChamiloCoreBundle:Resource\ResourceType'); $repo = $this->getEntityManager()->getRepository('ChamiloCoreBundle:ResourceType');
$this->resourceType = $repo->findOneBy(['name' => $name]); $this->resourceType = $repo->findOneBy(['name' => $name]);
return $this->resourceType; return $this->resourceType;

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

@ -11,7 +11,7 @@ use Chamilo\CoreBundle\Entity\CourseRelUser;
use Chamilo\CoreBundle\Entity\GradebookCertificate; use Chamilo\CoreBundle\Entity\GradebookCertificate;
use Chamilo\CoreBundle\Entity\GradebookResult; use Chamilo\CoreBundle\Entity\GradebookResult;
use Chamilo\CoreBundle\Entity\Message; 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\Session;
use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser; use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser;
use Chamilo\CoreBundle\Entity\SkillRelUser; use Chamilo\CoreBundle\Entity\SkillRelUser;
@ -45,7 +45,7 @@ use Chamilo\CourseBundle\Entity\CStudentPublication;
use Chamilo\CourseBundle\Entity\CStudentPublicationComment; use Chamilo\CourseBundle\Entity\CStudentPublicationComment;
use Chamilo\CourseBundle\Entity\CSurveyAnswer; use Chamilo\CourseBundle\Entity\CSurveyAnswer;
use Chamilo\CourseBundle\Entity\CWiki; use Chamilo\CourseBundle\Entity\CWiki;
use Chamilo\TicketBundle\Entity\Ticket; use Chamilo\CoreBundle\Entity\Ticket;
use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\Query\Expr\Join;
use Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface; use Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface;
@ -70,12 +70,36 @@ class UserRepository extends ResourceRepository implements UserLoaderInterface,
return $this->findBy(['username' => $username]); 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()->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 public function upgradePassword(UserInterface $user, string $newEncodedPassword): void
{ {
// this code is only an example; the exact code will depend on // this code is only an example; the exact code will depend on
@ -1205,7 +1229,7 @@ class UserRepository extends ResourceRepository implements UserLoaderInterface,
$criteria = [ $criteria = [
'insertUserId' => $userId, 'insertUserId' => $userId,
]; ];
$result = $em->getRepository('ChamiloTicketBundle:Ticket')->findBy($criteria); $result = $em->getRepository('ChamiloCoreBundle:Ticket')->findBy($criteria);
$ticket = []; $ticket = [];
/** @var Ticket $item */ /** @var Ticket $item */
foreach ($result as $item) { foreach ($result as $item) {
@ -1220,9 +1244,9 @@ class UserRepository extends ResourceRepository implements UserLoaderInterface,
$criteria = [ $criteria = [
'insertUserId' => $userId, 'insertUserId' => $userId,
]; ];
$result = $em->getRepository('ChamiloTicketBundle:Message')->findBy($criteria); $result = $em->getRepository('TicketMessage')->findBy($criteria);
$ticketMessage = []; $ticketMessage = [];
/** @var \Chamilo\TicketBundle\Entity\Message $item */ /** @var \Chamilo\CoreBundle\Entity\TicketMessage $item */
foreach ($result as $item) { foreach ($result as $item) {
$date = $item->getInsertDateTime() ? $item->getInsertDateTime()->format($dateFormat) : ''; $date = $item->getInsertDateTime() ? $item->getInsertDateTime()->format($dateFormat) : '';
$list = [ $list = [

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity; namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource; use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\User; 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;

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

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

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

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

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

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

@ -4,8 +4,8 @@
namespace Chamilo\CourseBundle\Entity; namespace Chamilo\CourseBundle\Entity;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource; use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; use Chamilo\CoreBundle\Entity\ResourceInterface;
use Doctrine\ORM\Mapping as ORM; 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