From a75e82ac08a430a843da8b8536bdba3b819f7135 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 20 May 2020 08:15:49 +0200 Subject: [PATCH] Refactor code, remove ticket bundle move into core bundle --- config/bundles.php | 1 - public/main/document/downloadfolder.inc.php | 12 +- public/main/document/edit_document.php | 8 +- public/main/exercise/TestCategory.php | 2 +- public/main/exercise/exercise.class.php | 2 +- public/main/exercise/question.class.php | 2 +- public/main/forum/forumfunction.inc.php | 2 +- public/main/inc/lib/AnnouncementManager.php | 2 +- public/main/inc/lib/CourseChatUtils.php | 4 +- .../main/inc/lib/ExerciseCategoryManager.php | 2 +- public/main/inc/lib/TicketManager.php | 122 +++++++++--------- public/main/inc/lib/UnserializeApi.php | 4 +- public/main/inc/lib/agenda.lib.php | 2 +- public/main/inc/lib/attendance.lib.php | 2 +- public/main/inc/lib/database.lib.php | 1 - public/main/inc/lib/document.lib.php | 6 +- public/main/inc/lib/fileUpload.lib.php | 2 +- public/main/inc/lib/groupmanager.lib.php | 2 +- public/main/inc/lib/link.lib.php | 2 +- public/main/inc/lib/thematic.lib.php | 2 +- public/main/install/install.lib.php | 6 +- public/main/lp/learnpath.class.php | 2 +- public/main/lp/scorm.class.php | 2 +- public/main/work/work.lib.php | 2 +- src/CoreBundle/Admin/ResourceFileAdmin.php | 2 +- src/CoreBundle/Admin/ResourceLinkAdmin.php | 2 +- .../Controller/EditorController.php | 2 +- .../Controller/ResourceApiController.php | 4 +- .../Controller/ResourceController.php | 14 +- .../Controller/ResourceUploadController.php | 4 +- .../{Resource => }/AbstractResource.php | 6 +- src/CoreBundle/Entity/AccessUrl.php | 4 +- src/CoreBundle/Entity/Course.php | 19 ++- src/CoreBundle/Entity/CourseRelUser.php | 2 +- src/CoreBundle/Entity/Illustration.php | 4 +- .../Entity/Listener/ResourceListener.php | 6 +- src/CoreBundle/Entity/PersonalFile.php | 4 +- .../Entity/{Resource => }/ResourceComment.php | 4 +- .../Entity/{Resource => }/ResourceFile.php | 37 +++++- .../{Resource => }/ResourceInterface.php | 2 +- .../Entity/{Resource => }/ResourceLink.php | 22 ++-- .../Entity/{Resource => }/ResourceNode.php | 5 +- .../Entity/{Resource => }/ResourceRight.php | 4 +- .../Entity/{Resource => }/ResourceType.php | 4 +- src/CoreBundle/Entity/Session.php | 4 +- .../Entity/Ticket.php | 18 +-- .../Entity/TicketAssignedLog.php} | 6 +- .../Entity/TicketCategory.php} | 32 ++--- .../Entity/TicketCategoryRelUser.php} | 10 +- .../Entity/TicketMessage.php} | 26 ++-- .../Entity/TicketMessageAttachment.php} | 24 ++-- .../Entity/TicketPriority.php} | 24 ++-- .../Entity/TicketProject.php} | 22 ++-- .../Entity/TicketStatus.php} | 12 +- src/CoreBundle/Entity/Tool.php | 4 +- src/CoreBundle/Entity/User.php | 35 ++++- .../EventListener/ResourceUploadListener.php | 2 +- .../Form/Type/ResourceCommentType.php | 2 +- src/CoreBundle/Form/Type/ResourceLinkType.php | 2 +- src/CoreBundle/Form/Type/ResourceNodeType.php | 2 +- .../Form/Type/ResourceRightType.php | 2 +- .../Repository/CourseRepository.php | 2 +- src/CoreBundle/Repository/GridInterface.php | 2 +- .../Repository/IllustrationRepository.php | 6 +- .../Repository/PersonalFileRepository.php | 2 +- .../Repository/ResourceNodeRepository.php | 8 +- .../Repository/ResourceRepository.php | 16 +-- .../Repository/ResourceWithLinkInterface.php | 2 +- src/CoreBundle/Repository/UserRepository.php | 38 +++++- src/CoreBundle/Resources/config/admin.yml | 10 +- .../Authorization/Voter/ResourceNodeVoter.php | 6 +- src/CoreBundle/ToolChain.php | 4 +- .../Traits/ResourceControllerTrait.php | 8 +- src/CourseBundle/Entity/CAnnouncement.php | 4 +- .../Entity/CAnnouncementAttachment.php | 4 +- src/CourseBundle/Entity/CAttendance.php | 4 +- src/CourseBundle/Entity/CCalendarEvent.php | 4 +- .../Entity/CCalendarEventAttachment.php | 4 +- src/CourseBundle/Entity/CChatConversation.php | 4 +- .../Entity/CCourseDescription.php | 4 +- src/CourseBundle/Entity/CDocument.php | 20 ++- src/CourseBundle/Entity/CExerciseCategory.php | 4 +- src/CourseBundle/Entity/CForumAttachment.php | 4 +- src/CourseBundle/Entity/CForumCategory.php | 4 +- src/CourseBundle/Entity/CForumForum.php | 4 +- src/CourseBundle/Entity/CForumPost.php | 4 +- src/CourseBundle/Entity/CForumThread.php | 4 +- src/CourseBundle/Entity/CGlossary.php | 4 +- src/CourseBundle/Entity/CGroupInfo.php | 4 +- src/CourseBundle/Entity/CLink.php | 4 +- src/CourseBundle/Entity/CLinkCategory.php | 4 +- src/CourseBundle/Entity/CLp.php | 4 +- src/CourseBundle/Entity/CLpCategory.php | 4 +- src/CourseBundle/Entity/CQuiz.php | 4 +- src/CourseBundle/Entity/CQuizQuestion.php | 4 +- .../Entity/CQuizQuestionCategory.php | 4 +- src/CourseBundle/Entity/CShortcut.php | 6 +- .../Entity/CStudentPublication.php | 4 +- .../Entity/CStudentPublicationAssignment.php | 4 +- .../Entity/CStudentPublicationComment.php | 4 +- src/CourseBundle/Entity/CThematic.php | 4 +- src/CourseBundle/Entity/CThematicAdvance.php | 4 +- src/CourseBundle/Entity/CThematicPlan.php | 4 +- src/CourseBundle/Entity/CTool.php | 4 +- .../CChatConversationRepository.php | 2 +- .../CCourseDescriptionRepository.php | 2 +- .../Repository/CDocumentRepository.php | 4 +- .../Repository/CForumAttachmentRepository.php | 2 +- .../Repository/CForumCategoryRepository.php | 2 +- .../Repository/CForumForumRepository.php | 2 +- .../Repository/CForumPostRepository.php | 2 +- .../Repository/CForumThreadRepository.php | 2 +- .../Repository/CGlossaryRepository.php | 2 +- .../Repository/CLinkCategoryRepository.php | 2 +- .../Repository/CLinkRepository.php | 2 +- .../Repository/CLpCategoryRepository.php | 2 +- src/CourseBundle/Repository/CLpRepository.php | 2 +- .../Repository/CQuizRepository.php | 2 +- .../Repository/CShortcutRepository.php | 4 +- .../Repository/CThematicAdvanceRepository.php | 2 +- .../Repository/CThematicPlanRepository.php | 2 +- .../Repository/CThematicRepository.php | 2 +- .../Repository/CToolRepository.php | 4 +- src/TicketBundle/ChamiloTicketBundle.php | 14 -- 124 files changed, 475 insertions(+), 401 deletions(-) rename src/CoreBundle/Entity/{Resource => }/AbstractResource.php (93%) rename src/CoreBundle/Entity/{Resource => }/ResourceComment.php (97%) rename src/CoreBundle/Entity/{Resource => }/ResourceFile.php (89%) rename src/CoreBundle/Entity/{Resource => }/ResourceInterface.php (92%) rename src/CoreBundle/Entity/{Resource => }/ResourceLink.php (92%) rename src/CoreBundle/Entity/{Resource => }/ResourceNode.php (98%) rename src/CoreBundle/Entity/{Resource => }/ResourceRight.php (95%) rename src/CoreBundle/Entity/{Resource => }/ResourceType.php (94%) rename src/{TicketBundle => CoreBundle}/Entity/Ticket.php (91%) rename src/{TicketBundle/Entity/AssignedLog.php => CoreBundle/Entity/TicketAssignedLog.php} (88%) rename src/{TicketBundle/Entity/Category.php => CoreBundle/Entity/TicketCategory.php} (90%) rename src/{TicketBundle/Entity/CategoryRelUser.php => CoreBundle/Entity/TicketCategoryRelUser.php} (77%) rename src/{TicketBundle/Entity/Message.php => CoreBundle/Entity/TicketMessage.php} (91%) rename src/{TicketBundle/Entity/MessageAttachment.php => CoreBundle/Entity/TicketMessageAttachment.php} (86%) rename src/{TicketBundle/Entity/Priority.php => CoreBundle/Entity/TicketPriority.php} (93%) rename src/{TicketBundle/Entity/Project.php => CoreBundle/Entity/TicketProject.php} (93%) rename src/{TicketBundle/Entity/Status.php => CoreBundle/Entity/TicketStatus.php} (91%) delete mode 100644 src/TicketBundle/ChamiloTicketBundle.php diff --git a/config/bundles.php b/config/bundles.php index 6d63a582cd..42ea28b6fb 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -15,7 +15,6 @@ return [ FOS\JsRoutingBundle\FOSJsRoutingBundle::class => ['all' => true], Chamilo\CoreBundle\ChamiloCoreBundle::class => ['all' => true], Chamilo\CourseBundle\ChamiloCourseBundle::class => ['all' => true], - Chamilo\TicketBundle\ChamiloTicketBundle::class => ['all' => true], Chamilo\GraphQlBundle\ChamiloGraphQlBundle::class => ['all' => true], Chamilo\LtiBundle\ChamiloLtiBundle::class => ['all' => true], Sylius\Bundle\SettingsBundle\SyliusSettingsBundle::class => ['all' => true], diff --git a/public/main/document/downloadfolder.inc.php b/public/main/document/downloadfolder.inc.php index f243a7c41d..c5d90068e0 100644 --- a/public/main/document/downloadfolder.inc.php +++ b/public/main/document/downloadfolder.inc.php @@ -1,7 +1,7 @@ $(function() { $(".scrollbar-light").scrollbar(); - + expandColumnToogle("#hide_bar_template", { selector: "#template_col", width: 3 @@ -295,8 +295,8 @@ $filename = $path_info['filename']; $extension = $path_info['extension'] ?? ''; $em = Database::getManager(); -/** @var \Chamilo\CoreBundle\Entity\Resource\ResourceNode $node */ -//$node = $em->getRepository('ChamiloCoreBundle:Resource\ResourceNode')->find($document_data['resource_node_id']); +/** @var \Chamilo\CoreBundle\Entity\ResourceNode $node */ +//$node = $em->getRepository('ChamiloCoreBundle:ResourceNode')->find($document_data['resource_node_id']); $node = $document->getResourceNode(); if (in_array($extension, ['html', 'htm'])) { @@ -494,7 +494,7 @@ if ($owner_id == api_get_user_id() || $(function() { $("[data-toggle=\'tooltip\']").tooltip( { - content: + content: function() { return $(this).attr("title"); } diff --git a/public/main/exercise/TestCategory.php b/public/main/exercise/TestCategory.php index 5bc77c7d62..0ec47319d4 100644 --- a/public/main/exercise/TestCategory.php +++ b/public/main/exercise/TestCategory.php @@ -6,7 +6,7 @@ use APY\DataGridBundle\Grid\Action\MassAction; use APY\DataGridBundle\Grid\Action\RowAction; use APY\DataGridBundle\Grid\Row; use APY\DataGridBundle\Grid\Source\Entity; -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceLink; use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter; use Chamilo\CourseBundle\Entity\CQuizQuestionCategory; diff --git a/public/main/exercise/exercise.class.php b/public/main/exercise/exercise.class.php index fd75887895..f84c165c18 100644 --- a/public/main/exercise/exercise.class.php +++ b/public/main/exercise/exercise.class.php @@ -7,7 +7,7 @@ use APY\DataGridBundle\Grid\Action\RowAction; use APY\DataGridBundle\Grid\Row; use APY\DataGridBundle\Grid\Source\Entity; use Chamilo\CoreBundle\Entity\GradebookLink; -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; +use Chamilo\CoreBundle\EntityLink; use Chamilo\CoreBundle\Entity\TrackEHotspot; use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter; diff --git a/public/main/exercise/question.class.php b/public/main/exercise/question.class.php index 4d953187f4..b69fe49511 100644 --- a/public/main/exercise/question.class.php +++ b/public/main/exercise/question.class.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceLink; use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CQuizAnswer; use Chamilo\CourseBundle\Entity\CQuizQuestion; diff --git a/public/main/forum/forumfunction.inc.php b/public/main/forum/forumfunction.inc.php index 199ca47875..0f56ee490f 100644 --- a/public/main/forum/forumfunction.inc.php +++ b/public/main/forum/forumfunction.inc.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceLink; use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CForumAttachment; use Chamilo\CourseBundle\Entity\CForumCategory; diff --git a/public/main/inc/lib/AnnouncementManager.php b/public/main/inc/lib/AnnouncementManager.php index 667b24439f..679a3959a4 100644 --- a/public/main/inc/lib/AnnouncementManager.php +++ b/public/main/inc/lib/AnnouncementManager.php @@ -4,7 +4,7 @@ use Chamilo\CoreBundle\Entity\ExtraField as ExtraFieldEntity; use Chamilo\CoreBundle\Entity\ExtraFieldValues; -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceLink; use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CAnnouncement; use Chamilo\CourseBundle\Entity\CAnnouncementAttachment; diff --git a/public/main/inc/lib/CourseChatUtils.php b/public/main/inc/lib/CourseChatUtils.php index ad17eced2f..695ab949a4 100644 --- a/public/main/inc/lib/CourseChatUtils.php +++ b/public/main/inc/lib/CourseChatUtils.php @@ -4,8 +4,8 @@ use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\CourseRelUser; -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser; use Chamilo\CoreBundle\Repository\ResourceRepository; diff --git a/public/main/inc/lib/ExerciseCategoryManager.php b/public/main/inc/lib/ExerciseCategoryManager.php index 7a41716e97..58ccfb92c4 100644 --- a/public/main/inc/lib/ExerciseCategoryManager.php +++ b/public/main/inc/lib/ExerciseCategoryManager.php @@ -5,7 +5,7 @@ use APY\DataGridBundle\Grid\Action\MassAction; use APY\DataGridBundle\Grid\Action\RowAction; use APY\DataGridBundle\Grid\Row; use APY\DataGridBundle\Grid\Source\Entity; -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceLink; use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter; use Chamilo\CourseBundle\Entity\CExerciseCategory; diff --git a/public/main/inc/lib/TicketManager.php b/public/main/inc/lib/TicketManager.php index 6154c5de2b..aca6e8f4e1 100644 --- a/public/main/inc/lib/TicketManager.php +++ b/public/main/inc/lib/TicketManager.php @@ -1,11 +1,11 @@ getRepository('ChamiloTicketBundle:MessageAttachment')->find($id); + $item = $em->getRepository('TicketMessageAttachment')->find($id); if ($item) { return $item; } @@ -1134,7 +1134,7 @@ class TicketManager { $id = (int) $id; $em = Database::getManager(); - $items = $em->getRepository('ChamiloTicketBundle:MessageAttachment')->findBy(['ticket' => $id]); + $items = $em->getRepository('TicketMessageAttachment')->findBy(['ticket' => $id]); if ($items) { return $items; } @@ -1159,9 +1159,9 @@ class TicketManager $table_main_user = Database::get_main_table(TABLE_MAIN_USER); $sql = "SELECT - ticket.*, + ticket.*, cat.name, - status.name as status, + status.name as status, priority.name priority FROM $table_support_tickets ticket INNER JOIN $table_support_category cat @@ -1214,8 +1214,8 @@ class TicketManager $ticket['ticket'] = $row; } - $sql = "SELECT *, message.id as message_id - FROM $table_support_messages message + $sql = "SELECT *, message.id as message_id + FROM $table_support_messages message INNER JOIN $table_main_user user ON (message.sys_insert_user_id = user.user_id) WHERE @@ -1326,7 +1326,7 @@ class TicketManager $attachmentList = []; $attachments = self::getTicketMessageAttachmentsByTicketId($ticketId); if (!empty($attachments)) { - /** @var MessageAttachment $attachment */ + /** @var TicketMessageAttachment $attachment */ foreach ($attachments as $attachment) { $file = api_get_uploaded_file( 'ticket_attachment', @@ -1828,10 +1828,10 @@ class TicketManager */ public static function getStatusList() { - $items = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->findAll(); + $items = Database::getManager()->getRepository('TicketStatus')->findAll(); $list = []; - /** @var Status $row */ + /** @var TicketStatus $row */ foreach ($items as $row) { $list[$row->getId()] = $row->getName(); } @@ -1846,7 +1846,7 @@ class TicketManager */ public static function getTicketsFromCriteria($criteria) { - $items = Database::getManager()->getRepository('ChamiloTicketBundle:Ticket')->findBy($criteria); + $items = Database::getManager()->getRepository('ChamiloCoreBundle:Ticket')->findBy($criteria); $list = []; /** @var Ticket $row */ @@ -1865,7 +1865,7 @@ class TicketManager public static function getStatusIdFromCode($code) { $item = Database::getManager() - ->getRepository('ChamiloTicketBundle:Status') + ->getRepository('TicketStatus') ->findOneBy(['code' => $code]) ; @@ -1881,10 +1881,10 @@ class TicketManager */ public static function getPriorityList() { - $projects = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->findAll(); + $projects = Database::getManager()->getRepository('TicketPriority')->findAll(); $list = []; - /** @var Priority $row */ + /** @var TicketPriority $row */ foreach ($projects as $row) { $list[$row->getId()] = $row->getName(); } @@ -1897,10 +1897,10 @@ class TicketManager */ public static function getProjects() { - $projects = Database::getManager()->getRepository('ChamiloTicketBundle:Project')->findAll(); + $projects = Database::getManager()->getRepository('TicketProject')->findAll(); $list = []; - /** @var Project $row */ + /** @var TicketProject $row */ foreach ($projects as $row) { $list[] = [ 'id' => $row->getId(), @@ -1919,10 +1919,10 @@ class TicketManager */ public static function getProjectsSimple() { - $projects = Database::getManager()->getRepository('ChamiloTicketBundle:Project')->findAll(); + $projects = Database::getManager()->getRepository('TicketProject')->findAll(); $list = []; - /** @var Project $row */ + /** @var TicketProject $row */ foreach ($projects as $row) { $list[] = [ 'id' => $row->getId(), @@ -1943,7 +1943,7 @@ class TicketManager */ public static function getProjectsCount() { - $count = Database::getManager()->getRepository('ChamiloTicketBundle:Project')->createQueryBuilder('p') + $count = Database::getManager()->getRepository('TicketProject')->createQueryBuilder('p') ->select('COUNT(p.id)') ->getQuery() ->getSingleScalarResult(); @@ -1956,7 +1956,7 @@ class TicketManager */ public static function addProject($params) { - $project = new Project(); + $project = new TicketProject(); $project->setName($params['name']); $project->setDescription($params['description']); $project->setInsertUserId(api_get_user_id()); @@ -1968,11 +1968,11 @@ class TicketManager /** * @param int $id * - * @return Project + * @return TicketProject */ public static function getProject($id) { - return Database::getManager()->getRepository('ChamiloTicketBundle:Project')->find($id); + return Database::getManager()->getRepository('TicketProject')->find($id); } /** @@ -2023,10 +2023,10 @@ class TicketManager */ public static function getStatusAdminList() { - $items = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->findAll(); + $items = Database::getManager()->getRepository('TicketStatus')->findAll(); $list = []; - /** @var Status $row */ + /** @var TicketStatus $row */ foreach ($items as $row) { $list[] = [ 'id' => $row->getId(), @@ -2046,10 +2046,10 @@ class TicketManager */ public static function getStatusSimple() { - $projects = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->findAll(); + $projects = Database::getManager()->getRepository('TicketStatus')->findAll(); $list = []; - /** @var Project $row */ + /** @var TicketProject $row */ foreach ($projects as $row) { $list[] = [ 'id' => $row->getId(), @@ -2067,7 +2067,7 @@ class TicketManager */ public static function getStatusCount() { - $count = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->createQueryBuilder('p') + $count = Database::getManager()->getRepository('TicketStatus')->createQueryBuilder('p') ->select('COUNT(p.id)') ->getQuery() ->getSingleScalarResult(); @@ -2080,7 +2080,7 @@ class TicketManager */ public static function addStatus($params) { - $item = new Status(); + $item = new TicketStatus(); $item->setCode(URLify::filter($params['name'])); $item->setName($params['name']); $item->setDescription($params['description']); @@ -2092,11 +2092,11 @@ class TicketManager /** * @param $id * - * @return Project + * @return TicketProject */ public static function getStatus($id) { - return Database::getManager()->getRepository('ChamiloTicketBundle:Status')->find($id); + return Database::getManager()->getRepository('TicketStatus')->find($id); } /** @@ -2145,10 +2145,10 @@ class TicketManager */ public static function getPriorityAdminList() { - $items = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->findAll(); + $items = Database::getManager()->getRepository('TicketPriority')->findAll(); $list = []; - /** @var Status $row */ + /** @var TicketStatus $row */ foreach ($items as $row) { $list[] = [ 'id' => $row->getId(), @@ -2168,10 +2168,10 @@ class TicketManager */ public static function getPrioritySimple() { - $projects = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->findAll(); + $projects = Database::getManager()->getRepository('TicketPriority')->findAll(); $list = []; - /** @var Priority $row */ + /** @var TicketPriority $row */ foreach ($projects as $row) { $list[] = [ 'id' => $row->getId(), @@ -2189,7 +2189,7 @@ class TicketManager */ public static function getPriorityCount() { - $count = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->createQueryBuilder('p') + $count = Database::getManager()->getRepository('TicketPriority')->createQueryBuilder('p') ->select('COUNT(p.id)') ->getQuery() ->getSingleScalarResult(); @@ -2202,7 +2202,7 @@ class TicketManager */ public static function addPriority($params) { - $item = new Priority(); + $item = new TicketPriority(); $item ->setCode(URLify::filter($params['name'])) ->setName($params['name']) @@ -2219,11 +2219,11 @@ class TicketManager /** * @param $id * - * @return Priority + * @return TicketPriority */ public static function getPriority($id) { - return Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->find($id); + return Database::getManager()->getRepository('TicketPriority')->find($id); } /** diff --git a/public/main/inc/lib/UnserializeApi.php b/public/main/inc/lib/UnserializeApi.php index 24c5c48503..c6ad68690b 100644 --- a/public/main/inc/lib/UnserializeApi.php +++ b/public/main/inc/lib/UnserializeApi.php @@ -102,8 +102,8 @@ class UnserializeApi LpItem::class, \Chamilo\CourseBundle\Entity\CLp::class, \Chamilo\CoreBundle\Entity\Course::class, - \Chamilo\CoreBundle\Entity\Resource\ResourceNode::class, - \Chamilo\CoreBundle\Entity\Resource\ResourceType::class, + \Chamilo\CoreBundle\Entity\ResourceNode::class, + \Chamilo\CoreBundle\Entity\ResourceType::class, ] ); diff --git a/public/main/inc/lib/agenda.lib.php b/public/main/inc/lib/agenda.lib.php index 4b07cf3dff..60d9f23b0a 100644 --- a/public/main/inc/lib/agenda.lib.php +++ b/public/main/inc/lib/agenda.lib.php @@ -3,7 +3,7 @@ /* For licensing terms, see /license.txt */ use Chamilo\CoreBundle\Entity\PersonalAgenda; -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceLink; use Chamilo\CoreBundle\Entity\SysCalendar; use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CCalendarEvent; diff --git a/public/main/inc/lib/attendance.lib.php b/public/main/inc/lib/attendance.lib.php index 9886b4369d..5e76cd1b96 100644 --- a/public/main/inc/lib/attendance.lib.php +++ b/public/main/inc/lib/attendance.lib.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceLink; use Chamilo\CoreBundle\Framework\Container; use Chamilo\CourseBundle\Entity\CAttendance; diff --git a/public/main/inc/lib/database.lib.php b/public/main/inc/lib/database.lib.php index d09632ca23..f1d2b4c852 100644 --- a/public/main/inc/lib/database.lib.php +++ b/public/main/inc/lib/database.lib.php @@ -36,7 +36,6 @@ class Database [ 'ChamiloCoreBundle' => 'Chamilo\CoreBundle\Entity', 'ChamiloCourseBundle' => 'Chamilo\CourseBundle\Entity', - 'ChamiloTicketBundle' => 'Chamilo\TicketBundle\Entity', 'ChamiloPluginBundle' => 'Chamilo\PluginBundle\Entity', ] ); diff --git a/public/main/inc/lib/document.lib.php b/public/main/inc/lib/document.lib.php index f793e4b299..08c84a1ce7 100644 --- a/public/main/inc/lib/document.lib.php +++ b/public/main/inc/lib/document.lib.php @@ -1,8 +1,8 @@ createQueryBuilder() ->select('node') - ->from('ChamiloCoreBundle:Resource\ResourceNode', 'node') + ->from('ChamiloCoreBundle:ResourceNode', 'node') ->innerJoin('node.resourceType', 'type') ->innerJoin('node.resourceLinks', 'links') //->innerJoin('node.resourceFile', 'file') diff --git a/public/main/inc/lib/fileUpload.lib.php b/public/main/inc/lib/fileUpload.lib.php index 34a45d7128..52a0b6ac77 100644 --- a/public/main/inc/lib/fileUpload.lib.php +++ b/public/main/inc/lib/fileUpload.lib.php @@ -1,7 +1,7 @@ getDoctrine()->getManager(); $id = $request->get('id'); - $resourceNode = $this->getDoctrine()->getRepository('ChamiloCoreBundle:Resource\ResourceNode')->find($id); + $resourceNode = $this->getDoctrine()->getRepository('ChamiloCoreBundle:ResourceNode')->find($id); $parentId = $resourceNode->getParent()->getId(); $this->denyAccessUnlessGranted( @@ -824,7 +824,7 @@ class ResourceController extends AbstractResourceController implements CourseCon $mode = $request->get('mode'); $em = $this->getDoctrine(); /** @var ResourceNode $resourceNode */ - $resourceNode = $em->getRepository('ChamiloCoreBundle:Resource\ResourceNode')->find($id); + $resourceNode = $em->getRepository('ChamiloCoreBundle:ResourceNode')->find($id); if (null === $resourceNode) { throw new FileNotFoundException('Resource not found'); @@ -853,7 +853,7 @@ class ResourceController extends AbstractResourceController implements CourseCon $em = $this->getDoctrine(); /** @var ResourceNode $resourceNode */ - $resourceNode = $em->getRepository('ChamiloCoreBundle:Resource\ResourceNode')->find($id); + $resourceNode = $em->getRepository('ChamiloCoreBundle:ResourceNode')->find($id); $this->denyAccessUnlessGranted( ResourceNodeVoter::VIEW, diff --git a/src/CoreBundle/Controller/ResourceUploadController.php b/src/CoreBundle/Controller/ResourceUploadController.php index 1a518f7184..f3b90a816d 100644 --- a/src/CoreBundle/Controller/ResourceUploadController.php +++ b/src/CoreBundle/Controller/ResourceUploadController.php @@ -4,8 +4,8 @@ namespace Chamilo\CoreBundle\Controller; -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Repository\ResourceRepository; use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter; use Chamilo\CourseBundle\Entity\CDocument; diff --git a/src/CoreBundle/Entity/Resource/AbstractResource.php b/src/CoreBundle/Entity/AbstractResource.php similarity index 93% rename from src/CoreBundle/Entity/Resource/AbstractResource.php rename to src/CoreBundle/Entity/AbstractResource.php index 9e731d925c..115edf3364 100644 --- a/src/CoreBundle/Entity/Resource/AbstractResource.php +++ b/src/CoreBundle/Entity/AbstractResource.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\CoreBundle\Entity\Resource; +namespace Chamilo\CoreBundle\Entity; use ApiPlatform\Core\Annotation\ApiSubresource; use APY\DataGridBundle\Grid\Mapping as GRID; @@ -25,10 +25,10 @@ abstract class AbstractResource * * @Assert\Valid() * @ApiSubresource() - * @Groups({"resource_node:read", "document:read"}) + * @Groups({"resource_node:read", "resource_node:write", "document:read","document:write"}) * @GRID\Column(field="resourceNode.createdAt", title="Date added", type="datetime") * @ORM\OneToOne( - * targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", cascade={"remove"}, orphanRemoval=true + * targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", cascade={"remove"}, orphanRemoval=true * ) * @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="CASCADE") */ diff --git a/src/CoreBundle/Entity/AccessUrl.php b/src/CoreBundle/Entity/AccessUrl.php index 6f8e641863..3c60a9d38c 100644 --- a/src/CoreBundle/Entity/AccessUrl.php +++ b/src/CoreBundle/Entity/AccessUrl.php @@ -4,8 +4,8 @@ namespace Chamilo\CoreBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Traits\CourseTrait; use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; diff --git a/src/CoreBundle/Entity/Course.php b/src/CoreBundle/Entity/Course.php index 21c222c142..02886ea117 100644 --- a/src/CoreBundle/Entity/Course.php +++ b/src/CoreBundle/Entity/Course.php @@ -11,8 +11,9 @@ use ApiPlatform\Core\Annotation\ApiSubresource; use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter; use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter; use ApiPlatform\Core\Serializer\Filter\PropertyFilter; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; +use Chamilo\CoreBundle\Entity\ResourceLink; use Chamilo\CourseBundle\Entity\CGroupInfo; use Chamilo\CourseBundle\Entity\CTool; use Doctrine\Common\Collections\ArrayCollection; @@ -106,6 +107,15 @@ class Course extends AbstractResource implements ResourceInterface */ protected $users; + /** + * @var ArrayCollection|ResourceLink[] + * + * @ApiSubresource() + * @Groups({"course:read"}) + * @ORM\OneToMany(targetEntity="ResourceLink", mappedBy="course", cascade={"persist"}, orphanRemoval=true) + */ + protected $resourceLinks; + /** * @ORM\OneToMany(targetEntity="AccessUrlRelCourse", mappedBy="course", cascade={"persist", "remove"}, orphanRemoval=true) */ @@ -190,11 +200,6 @@ class Course extends AbstractResource implements ResourceInterface */ protected $templates; - /** - * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceLink", mappedBy="course", cascade={"remove"}, orphanRemoval=true) - */ - protected $resourceLinks; - /** * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SpecificFieldValues", mappedBy="course") */ diff --git a/src/CoreBundle/Entity/CourseRelUser.php b/src/CoreBundle/Entity/CourseRelUser.php index d15061ca64..8534a0a772 100644 --- a/src/CoreBundle/Entity/CourseRelUser.php +++ b/src/CoreBundle/Entity/CourseRelUser.php @@ -14,7 +14,7 @@ use Symfony\Component\Serializer\Annotation\Groups; * @ApiResource( * shortName="CourseSubscription", * attributes={"security"="is_granted('ROLE_ADMIN')"}, - * normalizationContext={"groups"={"skill:read"}} + * normalizationContext={"groups"={"course_rel_user:read"}} * ) * * @ORM\Table( diff --git a/src/CoreBundle/Entity/Illustration.php b/src/CoreBundle/Entity/Illustration.php index b293f5d5d8..96bb0afb03 100644 --- a/src/CoreBundle/Entity/Illustration.php +++ b/src/CoreBundle/Entity/Illustration.php @@ -6,8 +6,8 @@ namespace Chamilo\CoreBundle\Entity; use ApiPlatform\Core\Annotation\ApiResource; use APY\DataGridBundle\Grid\Mapping as GRID; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CourseBundle\Traits\PersonalResourceTrait; use Doctrine\ORM\Mapping as ORM; use Gedmo\Timestampable\Traits\TimestampableEntity; diff --git a/src/CoreBundle/Entity/Listener/ResourceListener.php b/src/CoreBundle/Entity/Listener/ResourceListener.php index f0e10e470e..775794acb1 100644 --- a/src/CoreBundle/Entity/Listener/ResourceListener.php +++ b/src/CoreBundle/Entity/Listener/ResourceListener.php @@ -4,8 +4,8 @@ namespace Chamilo\CoreBundle\Entity\Listener; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\ToolChain; use Cocur\Slugify\SlugifyInterface; use Doctrine\ORM\Event\LifecycleEventArgs; @@ -52,7 +52,7 @@ class ResourceListener $slug = sprintf('%s.%s', $this->slugify->slugify($originalBasename), $originalExtension); } - $repo = $em->getRepository('ChamiloCoreBundle:Resource\ResourceType'); + $repo = $em->getRepository('ChamiloCoreBundle:ResourceType'); $class = str_replace('Entity', 'Repository', get_class($args->getEntity())); $class .= 'Repository'; $name = $this->toolChain->getResourceTypeNameFromRepository($class); diff --git a/src/CoreBundle/Entity/PersonalFile.php b/src/CoreBundle/Entity/PersonalFile.php index 6808b79dae..29164b7570 100644 --- a/src/CoreBundle/Entity/PersonalFile.php +++ b/src/CoreBundle/Entity/PersonalFile.php @@ -5,8 +5,8 @@ namespace Chamilo\CoreBundle\Entity; use APY\DataGridBundle\Grid\Mapping as GRID; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; use Gedmo\Timestampable\Traits\TimestampableEntity; diff --git a/src/CoreBundle/Entity/Resource/ResourceComment.php b/src/CoreBundle/Entity/ResourceComment.php similarity index 97% rename from src/CoreBundle/Entity/Resource/ResourceComment.php rename to src/CoreBundle/Entity/ResourceComment.php index dfcc4c38d7..15360350e5 100644 --- a/src/CoreBundle/Entity/Resource/ResourceComment.php +++ b/src/CoreBundle/Entity/ResourceComment.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\CoreBundle\Entity\Resource; +namespace Chamilo\CoreBundle\Entity; use ApiPlatform\Core\Annotation\ApiResource; use Chamilo\CoreBundle\Entity\User; @@ -40,7 +40,7 @@ class ResourceComment protected $id; /** - * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", inversedBy="comments") + * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", inversedBy="comments") * @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="SET NULL") */ protected $resourceNode; diff --git a/src/CoreBundle/Entity/Resource/ResourceFile.php b/src/CoreBundle/Entity/ResourceFile.php similarity index 89% rename from src/CoreBundle/Entity/Resource/ResourceFile.php rename to src/CoreBundle/Entity/ResourceFile.php index 2f550cd5ed..215f5fe213 100644 --- a/src/CoreBundle/Entity/Resource/ResourceFile.php +++ b/src/CoreBundle/Entity/ResourceFile.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\CoreBundle\Entity\Resource; +namespace Chamilo\CoreBundle\Entity; use ApiPlatform\Core\Annotation\ApiFilter; use ApiPlatform\Core\Annotation\ApiProperty; @@ -17,17 +17,19 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Validator\Constraints as Assert; use Vich\UploaderBundle\Mapping\Annotation as Vich; -use Chamilo\CoreBundle\Controller\CreateMediaObjectAction; +use Chamilo\CoreBundle\Controller\CreateResourceFileAction; // //* attributes={"security"="is_granted('ROLE_ADMIN')"}, /** * @ApiResource( * iri="http://schema.org/MediaObject", - * normalizationContext={"groups"={"resource_file:read", "media_object_read"}}, + * normalizationContext={ + * "groups"={"resource_file:read", "resource_node:read", "document:read", "media_object_read"} + * }, * collectionOperations={ * "post"={ - * "controller"=CreateMediaObjectAction::class, + * "controller"=CreateResourceFileAction::class, * "deserialize"=false, * "security"="is_granted('ROLE_USER')", * "validation_groups"={"Default", "media_object_create"}, @@ -57,6 +59,7 @@ use Chamilo\CoreBundle\Controller\CreateMediaObjectAction; * ) * @ApiFilter(SearchFilter::class, properties={"name": "partial"}) * @ApiFilter(PropertyFilter::class) + * @ApiFilter(OrderFilter::class, properties={"id", "name", "size", "updatedAt"}) * @ORM\Entity * @Vich\Uploadable * @@ -101,7 +104,7 @@ class ResourceFile /** * @var string * - * @Groups({"resource_file:read", "document:read"}) + * @Groups({"resource_file:read", "resource_node:read", "document:read"}) * @ORM\Column(type="simple_array", nullable=true) */ protected $dimensions; @@ -140,14 +143,14 @@ class ResourceFile * @var string|null * * @ApiProperty(iri="http://schema.org/contentUrl") - * @Groups({"media_object_read"}) + * @Groups({"resource_file:read", "resource_node:read", "document:read", "media_object_read"}) */ public $contentUrl; /** * @var ResourceNode * - * @ORM\OneToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", mappedBy="resourceFile") + * @ORM\OneToOne(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", mappedBy="resourceFile") */ protected $resourceNode; @@ -410,4 +413,24 @@ class ResourceFile $this->updatedAt = new \DateTimeImmutable(); } } + + /** + * @return string|null + */ + public function getContentUrl(): ?string + { + return $this->contentUrl; + } + + /** + * @param string|null $contentUrl + * + * @return ResourceFile + */ + public function setContentUrl(?string $contentUrl): ResourceFile + { + $this->contentUrl = $contentUrl; + + return $this; + } } diff --git a/src/CoreBundle/Entity/Resource/ResourceInterface.php b/src/CoreBundle/Entity/ResourceInterface.php similarity index 92% rename from src/CoreBundle/Entity/Resource/ResourceInterface.php rename to src/CoreBundle/Entity/ResourceInterface.php index 5f0803636b..a871944082 100644 --- a/src/CoreBundle/Entity/Resource/ResourceInterface.php +++ b/src/CoreBundle/Entity/ResourceInterface.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\CoreBundle\Entity\Resource; +namespace Chamilo\CoreBundle\Entity; /** * Interface ResourceInterface. diff --git a/src/CoreBundle/Entity/Resource/ResourceLink.php b/src/CoreBundle/Entity/ResourceLink.php similarity index 92% rename from src/CoreBundle/Entity/Resource/ResourceLink.php rename to src/CoreBundle/Entity/ResourceLink.php index eed9459920..f532124b2c 100644 --- a/src/CoreBundle/Entity/Resource/ResourceLink.php +++ b/src/CoreBundle/Entity/ResourceLink.php @@ -2,19 +2,19 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\CoreBundle\Entity\Resource; +namespace Chamilo\CoreBundle\Entity; use ApiPlatform\Core\Annotation\ApiResource; -use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Session; -use Chamilo\CoreBundle\Entity\User; -use Chamilo\CoreBundle\Entity\Usergroup; use Chamilo\CourseBundle\Entity\CGroupInfo; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Serializer\Annotation\Groups; /** - * @ApiResource() + * @ApiResource( + * normalizationContext={"groups"={"resource_link:read", "course:read"}}, + * + * ) * @ORM\Entity * @ORM\Table(name="resource_link") */ @@ -33,12 +33,16 @@ class ResourceLink protected $id; /** - * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", inversedBy="resourceLinks") + * @Groups({"resource_link:read", "resource_node:read", "course:read"}) + * + * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", inversedBy="resourceLinks") * @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="SET NULL") */ protected $resourceNode; /** + * @Groups({"resource_link:read", "resource_node:read", "course:read"}) + * * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="resourceLinks") * @ORM\JoinColumn(name="c_id", referencedColumnName="id", nullable=true) */ @@ -70,7 +74,7 @@ class ResourceLink /** * @ORM\OneToMany( - * targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceRight", + * targetEntity="Chamilo\CoreBundle\Entity\ResourceRight", * mappedBy="resourceLink", cascade={"persist", "remove"}, orphanRemoval=true * ) */ @@ -79,6 +83,8 @@ class ResourceLink /** * @var int * + * @Groups({"resource_link:read", "resource_node:read", "course:read"}) + * * @ORM\Column(name="visibility", type="integer", nullable=false) */ protected $visibility; diff --git a/src/CoreBundle/Entity/Resource/ResourceNode.php b/src/CoreBundle/Entity/ResourceNode.php similarity index 98% rename from src/CoreBundle/Entity/Resource/ResourceNode.php rename to src/CoreBundle/Entity/ResourceNode.php index 3c48214115..b4952c947e 100644 --- a/src/CoreBundle/Entity/Resource/ResourceNode.php +++ b/src/CoreBundle/Entity/ResourceNode.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\CoreBundle\Entity\Resource; +namespace Chamilo\CoreBundle\Entity; use ApiPlatform\Core\Annotation\ApiFilter; use ApiPlatform\Core\Annotation\ApiProperty; @@ -23,7 +23,6 @@ use Symfony\Component\Routing\RouterInterface; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Validator\Constraints as Assert; - //* attributes={"security"="is_granted('ROLE_ADMIN')"}, /** * Base entity for all resources. @@ -35,7 +34,7 @@ use Symfony\Component\Validator\Constraints as Assert; * ) * @ApiFilter(SearchFilter::class, properties={"title": "partial"}) * @ApiFilter(PropertyFilter::class) - * @ApiFilter(OrderFilter::class, properties={"id", "title", "createdAt", "updatedAt"}) + * @ApiFilter(OrderFilter::class, properties={"id", "title", "resourceFile", "createdAt", "updatedAt"}) * @ORM\Entity(repositoryClass="Chamilo\CoreBundle\Repository\ResourceNodeRepository") * * @ORM\Table(name="resource_node") diff --git a/src/CoreBundle/Entity/Resource/ResourceRight.php b/src/CoreBundle/Entity/ResourceRight.php similarity index 95% rename from src/CoreBundle/Entity/Resource/ResourceRight.php rename to src/CoreBundle/Entity/ResourceRight.php index 8b5b84da6d..1aeb0f5a7e 100644 --- a/src/CoreBundle/Entity/Resource/ResourceRight.php +++ b/src/CoreBundle/Entity/ResourceRight.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\CoreBundle\Entity\Resource; +namespace Chamilo\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; @@ -20,7 +20,7 @@ class ResourceRight protected $id; /** - * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceLink", inversedBy="resourceRight") + * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\ResourceLink", inversedBy="resourceRight") * @ORM\JoinColumn(name="resource_link_id", referencedColumnName="id", onDelete="CASCADE") */ protected $resourceLink; diff --git a/src/CoreBundle/Entity/Resource/ResourceType.php b/src/CoreBundle/Entity/ResourceType.php similarity index 94% rename from src/CoreBundle/Entity/Resource/ResourceType.php rename to src/CoreBundle/Entity/ResourceType.php index 43a287ebce..6aee051411 100644 --- a/src/CoreBundle/Entity/Resource/ResourceType.php +++ b/src/CoreBundle/Entity/ResourceType.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\CoreBundle\Entity\Resource; +namespace Chamilo\CoreBundle\Entity; use Chamilo\CoreBundle\Entity\Tool; use Doctrine\ORM\Mapping as ORM; @@ -38,7 +38,7 @@ class ResourceType protected $tool; /** - * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", mappedBy="resourceType", cascade={"persist", "remove"}) + * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", mappedBy="resourceType", cascade={"persist", "remove"}) */ protected $resourceNodes; diff --git a/src/CoreBundle/Entity/Session.php b/src/CoreBundle/Entity/Session.php index d92f5f310c..34262d8a68 100644 --- a/src/CoreBundle/Entity/Session.php +++ b/src/CoreBundle/Entity/Session.php @@ -112,7 +112,7 @@ class Session protected $urls; /** - * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceLink", mappedBy="session", cascade={"remove"}, orphanRemoval=true) + * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\ResourceLink", mappedBy="session", cascade={"remove"}, orphanRemoval=true) */ protected $resourceLinks; @@ -176,7 +176,7 @@ class Session /** * @var User * - * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="receivedMessages") + * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User") * @ORM\JoinColumn(name="session_admin_id", referencedColumnName="id", nullable=true) */ protected $sessionAdmin; diff --git a/src/TicketBundle/Entity/Ticket.php b/src/CoreBundle/Entity/Ticket.php similarity index 91% rename from src/TicketBundle/Entity/Ticket.php rename to src/CoreBundle/Entity/Ticket.php index 50cd3f2a79..df63eb7ecd 100644 --- a/src/TicketBundle/Entity/Ticket.php +++ b/src/CoreBundle/Entity/Ticket.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\TicketBundle\Entity; +namespace Chamilo\CoreBundle\Entity; use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Session; @@ -47,25 +47,25 @@ class Ticket protected $message; /** - * @var Project + * @var TicketProject * - * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Project") + * @ORM\ManyToOne(targetEntity="TicketProject") * @ORM\JoinColumn(name="project_id", referencedColumnName="id") */ protected $project; /** - * @var Project + * @var TicketProject * - * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Category") + * @ORM\ManyToOne(targetEntity="TicketCategory") * @ORM\JoinColumn(name="category_id", referencedColumnName="id") */ protected $category; /** - * @var Priority + * @var TicketPriority * - * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Priority") + * @ORM\ManyToOne(targetEntity="TicketPriority") * @ORM\JoinColumn(name="priority_id", referencedColumnName="id") */ protected $priority; @@ -101,9 +101,9 @@ class Ticket protected $assignedLastUser; /** - * @var Status + * @var TicketStatus * - * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Status") + * @ORM\ManyToOne(targetEntity="TicketStatus") * @ORM\JoinColumn(name="status_id", referencedColumnName="id") */ protected $status; diff --git a/src/TicketBundle/Entity/AssignedLog.php b/src/CoreBundle/Entity/TicketAssignedLog.php similarity index 88% rename from src/TicketBundle/Entity/AssignedLog.php rename to src/CoreBundle/Entity/TicketAssignedLog.php index a84be65ab6..dbd429fc12 100644 --- a/src/TicketBundle/Entity/AssignedLog.php +++ b/src/CoreBundle/Entity/TicketAssignedLog.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\TicketBundle\Entity; +namespace Chamilo\CoreBundle\Entity; use Chamilo\CoreBundle\Entity\User; use Doctrine\ORM\Mapping as ORM; @@ -15,7 +15,7 @@ use Doctrine\ORM\Mapping as ORM; * ) * @ORM\Entity */ -class AssignedLog +class TicketAssignedLog { /** * @var int @@ -29,7 +29,7 @@ class AssignedLog /** * @var Ticket * - * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Ticket") + * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Ticket") * @ORM\JoinColumn(name="ticket_id", referencedColumnName="id") */ protected $ticket; diff --git a/src/TicketBundle/Entity/Category.php b/src/CoreBundle/Entity/TicketCategory.php similarity index 90% rename from src/TicketBundle/Entity/Category.php rename to src/CoreBundle/Entity/TicketCategory.php index a398f585b3..8959f37799 100644 --- a/src/TicketBundle/Entity/Category.php +++ b/src/CoreBundle/Entity/TicketCategory.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\TicketBundle\Entity; +namespace Chamilo\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; @@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM; * @ORM\Table(name="ticket_category") * @ORM\Entity */ -class Category +class TicketCategory { /** * @var int @@ -52,9 +52,9 @@ class Category protected $courseRequired; /** - * @var Project + * @var TicketProject * - * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Project") + * @ORM\ManyToOne(targetEntity="TicketProject") * @ORM\JoinColumn(name="project_id", referencedColumnName="id") */ protected $project; @@ -107,7 +107,7 @@ class Category /** * @param int $id * - * @return Category + * @return TicketCategory */ public function setId($id) { @@ -127,7 +127,7 @@ class Category /** * @param string $name * - * @return Category + * @return TicketCategory */ public function setName($name) { @@ -147,7 +147,7 @@ class Category /** * @param string $description * - * @return Category + * @return TicketCategory */ public function setDescription($description) { @@ -167,7 +167,7 @@ class Category /** * @param int $totalTickets * - * @return Category + * @return TicketCategory */ public function setTotalTickets($totalTickets) { @@ -187,7 +187,7 @@ class Category /** * @param bool $courseRequired * - * @return Category + * @return TicketCategory */ public function setCourseRequired($courseRequired) { @@ -197,7 +197,7 @@ class Category } /** - * @return Project + * @return TicketProject */ public function getProject() { @@ -205,9 +205,9 @@ class Category } /** - * @param Project $project + * @param TicketProject $project * - * @return Category + * @return TicketCategory */ public function setProject($project) { @@ -227,7 +227,7 @@ class Category /** * @param int $insertUserId * - * @return Category + * @return TicketCategory */ public function setInsertUserId($insertUserId) { @@ -247,7 +247,7 @@ class Category /** * @param \DateTime $insertDateTime * - * @return Category + * @return TicketCategory */ public function setInsertDateTime($insertDateTime) { @@ -267,7 +267,7 @@ class Category /** * @param int $lastEditUserId * - * @return Category + * @return TicketCategory */ public function setLastEditUserId($lastEditUserId) { @@ -287,7 +287,7 @@ class Category /** * @param \DateTime $lastEditDateTime * - * @return Category + * @return TicketCategory */ public function setLastEditDateTime($lastEditDateTime) { diff --git a/src/TicketBundle/Entity/CategoryRelUser.php b/src/CoreBundle/Entity/TicketCategoryRelUser.php similarity index 77% rename from src/TicketBundle/Entity/CategoryRelUser.php rename to src/CoreBundle/Entity/TicketCategoryRelUser.php index 96f6548f99..cb5f35a371 100644 --- a/src/TicketBundle/Entity/CategoryRelUser.php +++ b/src/CoreBundle/Entity/TicketCategoryRelUser.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\TicketBundle\Entity; +namespace Chamilo\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; @@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM; * @ORM\Table(name="ticket_category_rel_user") * @ORM\Entity */ -class CategoryRelUser +class TicketCategoryRelUser { /** * @var int @@ -24,15 +24,15 @@ class CategoryRelUser protected $id; /** - * @var Category + * @var TicketCategory * - * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Category") + * @ORM\ManyToOne(targetEntity="TicketCategory") * @ORM\JoinColumn(name="category_id", referencedColumnName="id") */ protected $category; /** - * @var Category + * @var TicketCategory * * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User") * @ORM\JoinColumn(name="user_id", referencedColumnName="id") diff --git a/src/TicketBundle/Entity/Message.php b/src/CoreBundle/Entity/TicketMessage.php similarity index 91% rename from src/TicketBundle/Entity/Message.php rename to src/CoreBundle/Entity/TicketMessage.php index ff59952bb3..88656e6074 100644 --- a/src/TicketBundle/Entity/Message.php +++ b/src/CoreBundle/Entity/TicketMessage.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\TicketBundle\Entity; +namespace Chamilo\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; @@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM; * @ORM\Table(name="ticket_message") * @ORM\Entity */ -class Message +class TicketMessage { /** * @var int @@ -54,7 +54,7 @@ class Message /** * @var Ticket * - * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Ticket") + * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Ticket") * @ORM\JoinColumn(name="ticket_id", referencedColumnName="id") */ protected $ticket; @@ -98,7 +98,7 @@ class Message /** * @param int $id * - * @return Message + * @return TicketMessage */ public function setId($id) { @@ -118,7 +118,7 @@ class Message /** * @param string $subject * - * @return Message + * @return TicketMessage */ public function setSubject($subject) { @@ -138,7 +138,7 @@ class Message /** * @param string $message * - * @return Message + * @return TicketMessage */ public function setMessage($message) { @@ -158,7 +158,7 @@ class Message /** * @param string $status * - * @return Message + * @return TicketMessage */ public function setStatus($status) { @@ -178,7 +178,7 @@ class Message /** * @param string $ipAddress * - * @return Message + * @return TicketMessage */ public function setIpAddress($ipAddress) { @@ -198,7 +198,7 @@ class Message /** * @param Ticket $ticket * - * @return Message + * @return TicketMessage */ public function setTicket($ticket) { @@ -218,7 +218,7 @@ class Message /** * @param int $insertUserId * - * @return Message + * @return TicketMessage */ public function setInsertUserId($insertUserId) { @@ -238,7 +238,7 @@ class Message /** * @param \DateTime $insertDateTime * - * @return Message + * @return TicketMessage */ public function setInsertDateTime($insertDateTime) { @@ -258,7 +258,7 @@ class Message /** * @param int $lastEditUserId * - * @return Message + * @return TicketMessage */ public function setLastEditUserId($lastEditUserId) { @@ -278,7 +278,7 @@ class Message /** * @param \DateTime $lastEditDateTime * - * @return Message + * @return TicketMessage */ public function setLastEditDateTime($lastEditDateTime) { diff --git a/src/TicketBundle/Entity/MessageAttachment.php b/src/CoreBundle/Entity/TicketMessageAttachment.php similarity index 86% rename from src/TicketBundle/Entity/MessageAttachment.php rename to src/CoreBundle/Entity/TicketMessageAttachment.php index 05a64f4671..f6f740b468 100644 --- a/src/TicketBundle/Entity/MessageAttachment.php +++ b/src/CoreBundle/Entity/TicketMessageAttachment.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\TicketBundle\Entity; +namespace Chamilo\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; @@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM; * @ORM\Table(name="ticket_message_attachments") * @ORM\Entity */ -class MessageAttachment +class TicketMessageAttachment { /** * @var int @@ -26,15 +26,15 @@ class MessageAttachment /** * @var Ticket * - * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Ticket") + * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Ticket") * @ORM\JoinColumn(name="ticket_id", referencedColumnName="id") */ protected $ticket; /** - * @var Message + * @var TicketMessage * - * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Message") + * @ORM\ManyToOne(targetEntity="TicketMessage") * @ORM\JoinColumn(name="message_id", referencedColumnName="id") */ protected $message; @@ -99,7 +99,7 @@ class MessageAttachment /** * @param int $id * - * @return MessageAttachment + * @return TicketMessageAttachment */ public function setId($id) { @@ -109,7 +109,7 @@ class MessageAttachment } /** - * @return Message + * @return TicketMessage */ public function getMessage() { @@ -117,9 +117,9 @@ class MessageAttachment } /** - * @param Message $message + * @param TicketMessage $message * - * @return MessageAttachment + * @return TicketMessageAttachment */ public function setMessage($message) { @@ -139,7 +139,7 @@ class MessageAttachment /** * @param string $path * - * @return MessageAttachment + * @return TicketMessageAttachment */ public function setPath($path) { @@ -159,7 +159,7 @@ class MessageAttachment /** * @param string $filename * - * @return MessageAttachment + * @return TicketMessageAttachment */ public function setFilename($filename) { @@ -179,7 +179,7 @@ class MessageAttachment /** * @param int $size * - * @return MessageAttachment + * @return TicketMessageAttachment */ public function setSize($size) { diff --git a/src/TicketBundle/Entity/Priority.php b/src/CoreBundle/Entity/TicketPriority.php similarity index 93% rename from src/TicketBundle/Entity/Priority.php rename to src/CoreBundle/Entity/TicketPriority.php index d248539b09..584c177cdd 100644 --- a/src/TicketBundle/Entity/Priority.php +++ b/src/CoreBundle/Entity/TicketPriority.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\TicketBundle\Entity; +namespace Chamilo\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; @@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM; * @ORM\Table(name="ticket_priority") * @ORM\Entity */ -class Priority +class TicketPriority { /** * @var int @@ -107,7 +107,7 @@ class Priority /** * @param int $id * - * @return Priority + * @return TicketPriority */ public function setId($id) { @@ -127,7 +127,7 @@ class Priority /** * @param string $name * - * @return Priority + * @return TicketPriority */ public function setName($name) { @@ -147,7 +147,7 @@ class Priority /** * @param string $code * - * @return Priority + * @return TicketPriority */ public function setCode($code) { @@ -167,7 +167,7 @@ class Priority /** * @param string $description * - * @return Priority + * @return TicketPriority */ public function setDescription($description) { @@ -187,7 +187,7 @@ class Priority /** * @param string $color * - * @return Priority + * @return TicketPriority */ public function setColor($color) { @@ -207,7 +207,7 @@ class Priority /** * @param string $urgency * - * @return Priority + * @return TicketPriority */ public function setUrgency($urgency) { @@ -227,7 +227,7 @@ class Priority /** * @param int $insertUserId * - * @return Priority + * @return TicketPriority */ public function setInsertUserId($insertUserId) { @@ -247,7 +247,7 @@ class Priority /** * @param \DateTime $insertDateTime * - * @return Priority + * @return TicketPriority */ public function setInsertDateTime($insertDateTime) { @@ -267,7 +267,7 @@ class Priority /** * @param int $lastEditUserId * - * @return Priority + * @return TicketPriority */ public function setLastEditUserId($lastEditUserId) { @@ -287,7 +287,7 @@ class Priority /** * @param \DateTime $lastEditDateTime * - * @return Priority + * @return TicketPriority */ public function setLastEditDateTime($lastEditDateTime) { diff --git a/src/TicketBundle/Entity/Project.php b/src/CoreBundle/Entity/TicketProject.php similarity index 93% rename from src/TicketBundle/Entity/Project.php rename to src/CoreBundle/Entity/TicketProject.php index 63d27123f2..d53e52a62c 100644 --- a/src/TicketBundle/Entity/Project.php +++ b/src/CoreBundle/Entity/TicketProject.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\TicketBundle\Entity; +namespace Chamilo\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; @@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM; * @ORM\Table(name="ticket_project") * @ORM\Entity */ -class Project +class TicketProject { /** * @var int @@ -98,7 +98,7 @@ class Project /** * @param int $id * - * @return Project + * @return TicketProject */ public function setId($id) { @@ -118,7 +118,7 @@ class Project /** * @param string $name * - * @return Project + * @return TicketProject */ public function setName($name) { @@ -138,7 +138,7 @@ class Project /** * @param string $description * - * @return Project + * @return TicketProject */ public function setDescription($description) { @@ -158,7 +158,7 @@ class Project /** * @param string $email * - * @return Project + * @return TicketProject */ public function setEmail($email) { @@ -178,7 +178,7 @@ class Project /** * @param string $otherArea * - * @return Project + * @return TicketProject */ public function setOtherArea($otherArea) { @@ -198,7 +198,7 @@ class Project /** * @param int $insertUserId * - * @return Project + * @return TicketProject */ public function setInsertUserId($insertUserId) { @@ -218,7 +218,7 @@ class Project /** * @param \DateTime $insertDateTime * - * @return Project + * @return TicketProject */ public function setInsertDateTime($insertDateTime) { @@ -238,7 +238,7 @@ class Project /** * @param int $lastEditUserId * - * @return Project + * @return TicketProject */ public function setLastEditUserId($lastEditUserId) { @@ -258,7 +258,7 @@ class Project /** * @param \DateTime $lastEditDateTime * - * @return Project + * @return TicketProject */ public function setLastEditDateTime($lastEditDateTime) { diff --git a/src/TicketBundle/Entity/Status.php b/src/CoreBundle/Entity/TicketStatus.php similarity index 91% rename from src/TicketBundle/Entity/Status.php rename to src/CoreBundle/Entity/TicketStatus.php index 01fb439386..125a1f40d4 100644 --- a/src/TicketBundle/Entity/Status.php +++ b/src/CoreBundle/Entity/TicketStatus.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ -namespace Chamilo\TicketBundle\Entity; +namespace Chamilo\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; @@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM; * @ORM\Table(name="ticket_status") * @ORM\Entity */ -class Status +class TicketStatus { /** * @var int @@ -55,7 +55,7 @@ class Status /** * @param int $id * - * @return Status + * @return TicketStatus */ public function setId($id) { @@ -75,7 +75,7 @@ class Status /** * @param string $code * - * @return Status + * @return TicketStatus */ public function setCode($code) { @@ -95,7 +95,7 @@ class Status /** * @param string $name * - * @return Status + * @return TicketStatus */ public function setName($name) { @@ -115,7 +115,7 @@ class Status /** * @param string $description * - * @return Status + * @return TicketStatus */ public function setDescription($description) { diff --git a/src/CoreBundle/Entity/Tool.php b/src/CoreBundle/Entity/Tool.php index fecbf42d28..0115e1e102 100644 --- a/src/CoreBundle/Entity/Tool.php +++ b/src/CoreBundle/Entity/Tool.php @@ -4,7 +4,7 @@ namespace Chamilo\CoreBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\ResourceType; +use Chamilo\CoreBundle\Entity\ResourceType; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\Mapping as ORM; @@ -34,7 +34,7 @@ class Tool protected $name; /** - * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceType", mappedBy="tool", cascade={"persist", "remove"}) + * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\ResourceType", mappedBy="tool", cascade={"persist", "remove"}) */ protected $resourceTypes; diff --git a/src/CoreBundle/Entity/User.php b/src/CoreBundle/Entity/User.php index 681afb1033..27db649f79 100644 --- a/src/CoreBundle/Entity/User.php +++ b/src/CoreBundle/Entity/User.php @@ -10,7 +10,7 @@ use ApiPlatform\Core\Annotation\ApiResource; use ApiPlatform\Core\Annotation\ApiSubresource; use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter; use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Criteria; @@ -332,14 +332,14 @@ class User implements UserInterface, EquatableInterface /** * @ORM\OneToOne( - * targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", cascade={"remove"}, orphanRemoval=true + * targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", cascade={"remove"}, orphanRemoval=true * ) * @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="CASCADE") */ protected $resourceNode; /** - * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", mappedBy="creator") + * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", mappedBy="creator") */ protected $resourceNodes; @@ -1464,6 +1464,29 @@ class User implements UserInterface, EquatableInterface return $this->setUsername($slug); } + public function setUsername($username) + { + $this->username = $username; + + return $this; + } + + public function setUsernameCanonical($usernameCanonical) + { + $this->usernameCanonical = $usernameCanonical; + + return $this; + } + + public function setEmailCanonical($emailCanonical) + { + $this->emailCanonical = $emailCanonical; + + return $this; + } + + + /** * Set lastLogin. * @@ -1558,13 +1581,15 @@ class User implements UserInterface, EquatableInterface return $this->plainPassword; } - public function setPlainPassword(string $password): void + public function setPlainPassword(string $password) { $this->plainPassword = $password; // forces the object to look "dirty" to Doctrine. Avoids // Doctrine *not* saving this entity, if only plainPassword changes $this->password = null; + + return $this; } /** @@ -2149,4 +2174,6 @@ class User implements UserInterface, EquatableInterface return $this->courseGroupsAsTutor->matching($criteria); } + + } diff --git a/src/CoreBundle/EventListener/ResourceUploadListener.php b/src/CoreBundle/EventListener/ResourceUploadListener.php index 3d93254a34..d7154bab75 100644 --- a/src/CoreBundle/EventListener/ResourceUploadListener.php +++ b/src/CoreBundle/EventListener/ResourceUploadListener.php @@ -4,7 +4,7 @@ namespace Chamilo\CoreBundle\EventListener; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Oneup\UploaderBundle\Event\PostPersistEvent; use Oneup\UploaderBundle\Uploader\Response\ResponseInterface; use Symfony\Component\Routing\RouterInterface; diff --git a/src/CoreBundle/Form/Type/ResourceCommentType.php b/src/CoreBundle/Form/Type/ResourceCommentType.php index 0a98eab3b6..35741b5225 100644 --- a/src/CoreBundle/Form/Type/ResourceCommentType.php +++ b/src/CoreBundle/Form/Type/ResourceCommentType.php @@ -4,7 +4,7 @@ namespace Chamilo\CoreBundle\Form\Type; -use Chamilo\CoreBundle\Entity\Resource\ResourceComment; +use Chamilo\CoreBundle\Entity\ResourceComment; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\TextareaType; diff --git a/src/CoreBundle/Form/Type/ResourceLinkType.php b/src/CoreBundle/Form/Type/ResourceLinkType.php index cbbffd552e..c5df07f8bf 100644 --- a/src/CoreBundle/Form/Type/ResourceLinkType.php +++ b/src/CoreBundle/Form/Type/ResourceLinkType.php @@ -70,7 +70,7 @@ class ResourceLinkType extends AbstractType { $resolver->setDefaults( [ - 'data_class' => 'Chamilo\CoreBundle\Entity\Resource\ResourceLink', + 'data_class' => 'Chamilo\CoreBundle\Entity\ResourceLink', ] ); } diff --git a/src/CoreBundle/Form/Type/ResourceNodeType.php b/src/CoreBundle/Form/Type/ResourceNodeType.php index 5f671d9a4d..5f071a3b52 100644 --- a/src/CoreBundle/Form/Type/ResourceNodeType.php +++ b/src/CoreBundle/Form/Type/ResourceNodeType.php @@ -30,7 +30,7 @@ class ResourceNodeType extends AbstractType { $resolver->setDefaults( [ - 'data_class' => 'Chamilo\CoreBundle\Entity\Resource\ResourceNode', + 'data_class' => 'Chamilo\CoreBundle\Entity\ResourceNode', ] ); } diff --git a/src/CoreBundle/Form/Type/ResourceRightType.php b/src/CoreBundle/Form/Type/ResourceRightType.php index 8c47cacbec..1ed72c3d00 100644 --- a/src/CoreBundle/Form/Type/ResourceRightType.php +++ b/src/CoreBundle/Form/Type/ResourceRightType.php @@ -33,7 +33,7 @@ class ResourceRightType extends AbstractType { $resolver->setDefaults( [ - 'data_class' => 'Chamilo\CoreBundle\Entity\Resource\ResourceRight', + 'data_class' => 'Chamilo\CoreBundle\Entity\ResourceRight', ] ); } diff --git a/src/CoreBundle/Repository/CourseRepository.php b/src/CoreBundle/Repository/CourseRepository.php index 87b0ebc3ed..2e9255d006 100644 --- a/src/CoreBundle/Repository/CourseRepository.php +++ b/src/CoreBundle/Repository/CourseRepository.php @@ -5,7 +5,7 @@ namespace Chamilo\CoreBundle\Repository; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Criteria; diff --git a/src/CoreBundle/Repository/GridInterface.php b/src/CoreBundle/Repository/GridInterface.php index d6477d074b..f833b668a6 100644 --- a/src/CoreBundle/Repository/GridInterface.php +++ b/src/CoreBundle/Repository/GridInterface.php @@ -8,7 +8,7 @@ use APY\DataGridBundle\Grid\Column\Column; use APY\DataGridBundle\Grid\Grid; use Chamilo\CoreBundle\Component\Resource\Settings; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CourseBundle\Entity\CGroupInfo; diff --git a/src/CoreBundle/Repository/IllustrationRepository.php b/src/CoreBundle/Repository/IllustrationRepository.php index 817afbadfd..4ce44d42d7 100644 --- a/src/CoreBundle/Repository/IllustrationRepository.php +++ b/src/CoreBundle/Repository/IllustrationRepository.php @@ -8,9 +8,9 @@ use APY\DataGridBundle\Grid\Column\Column; use APY\DataGridBundle\Grid\Grid; use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Illustration; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceFile; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceFile; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Form\Resource\IllustrationType; diff --git a/src/CoreBundle/Repository/PersonalFileRepository.php b/src/CoreBundle/Repository/PersonalFileRepository.php index 185c7297d6..647281afb4 100644 --- a/src/CoreBundle/Repository/PersonalFileRepository.php +++ b/src/CoreBundle/Repository/PersonalFileRepository.php @@ -8,7 +8,7 @@ use APY\DataGridBundle\Grid\Column\Column; use APY\DataGridBundle\Grid\Grid; use Chamilo\CoreBundle\Component\Resource\Settings; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Form\Resource\PersonalFileType; diff --git a/src/CoreBundle/Repository/ResourceNodeRepository.php b/src/CoreBundle/Repository/ResourceNodeRepository.php index 5a12aa532e..cffda1ab7f 100644 --- a/src/CoreBundle/Repository/ResourceNodeRepository.php +++ b/src/CoreBundle/Repository/ResourceNodeRepository.php @@ -5,10 +5,10 @@ namespace Chamilo\CoreBundle\Repository; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceFile; -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; -use Chamilo\CoreBundle\Entity\Resource\ResourceType; +use Chamilo\CoreBundle\Entity\ResourceFile; +use Chamilo\CoreBundle\Entity\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceType; use Chamilo\CoreBundle\Entity\Session; use Doctrine\ORM\EntityManagerInterface; use Gedmo\Tree\Entity\Repository\MaterializedPathRepository; diff --git a/src/CoreBundle/Repository/ResourceRepository.php b/src/CoreBundle/Repository/ResourceRepository.php index 8798bf40e7..39c5503fc6 100644 --- a/src/CoreBundle/Repository/ResourceRepository.php +++ b/src/CoreBundle/Repository/ResourceRepository.php @@ -9,13 +9,13 @@ use APY\DataGridBundle\Grid\Row; use Chamilo\CoreBundle\Component\Resource\Settings; use Chamilo\CoreBundle\Component\Resource\Template; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceFile; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; -use Chamilo\CoreBundle\Entity\Resource\ResourceRight; -use Chamilo\CoreBundle\Entity\Resource\ResourceType; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceFile; +use Chamilo\CoreBundle\Entity\ResourceInterface; +use Chamilo\CoreBundle\Entity\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceRight; +use Chamilo\CoreBundle\Entity\ResourceType; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\Usergroup; @@ -433,7 +433,7 @@ class ResourceRepository extends BaseEntityRepository public function getResourceType() { $name = $this->getResourceTypeName(); - $repo = $this->getEntityManager()->getRepository('ChamiloCoreBundle:Resource\ResourceType'); + $repo = $this->getEntityManager()->getRepository('ChamiloCoreBundle:ResourceType'); $this->resourceType = $repo->findOneBy(['name' => $name]); return $this->resourceType; diff --git a/src/CoreBundle/Repository/ResourceWithLinkInterface.php b/src/CoreBundle/Repository/ResourceWithLinkInterface.php index 43fef7d6ab..b53652caaa 100644 --- a/src/CoreBundle/Repository/ResourceWithLinkInterface.php +++ b/src/CoreBundle/Repository/ResourceWithLinkInterface.php @@ -4,7 +4,7 @@ namespace Chamilo\CoreBundle\Repository; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Symfony\Component\Routing\RouterInterface; /** diff --git a/src/CoreBundle/Repository/UserRepository.php b/src/CoreBundle/Repository/UserRepository.php index d30df03316..bf0e732e1d 100644 --- a/src/CoreBundle/Repository/UserRepository.php +++ b/src/CoreBundle/Repository/UserRepository.php @@ -11,7 +11,7 @@ use Chamilo\CoreBundle\Entity\CourseRelUser; use Chamilo\CoreBundle\Entity\GradebookCertificate; use Chamilo\CoreBundle\Entity\GradebookResult; use Chamilo\CoreBundle\Entity\Message; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser; use Chamilo\CoreBundle\Entity\SkillRelUser; @@ -45,7 +45,7 @@ use Chamilo\CourseBundle\Entity\CStudentPublication; use Chamilo\CourseBundle\Entity\CStudentPublicationComment; use Chamilo\CourseBundle\Entity\CSurveyAnswer; use Chamilo\CourseBundle\Entity\CWiki; -use Chamilo\TicketBundle\Entity\Ticket; +use Chamilo\CoreBundle\Entity\Ticket; use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\Query\Expr\Join; use Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface; @@ -70,12 +70,36 @@ class UserRepository extends ResourceRepository implements UserLoaderInterface, return $this->findBy(['username' => $username]); } - public function updateUser($user) + public function updateUser($user, $andFlush = true) { + $this->updateCanonicalFields($user); + $this->updatePassword($user); $this->getEntityManager()->persist($user); - $this->getEntityManager()->flush(); + if ($andFlush) { + $this->getEntityManager()->flush(); + } + } + + public function updateCanonicalFields(UserInterface $user) + { + //$user->setUsernameCanonical($this->canonicalizeUsername($user->getUsername())); + //$user->setEmailCanonical($this->canonicalizeEmail($user->getEmail())); + } + + + /** + * {@inheritDoc} + */ + public function updatePassword(UserInterface $user) + { + if (0 !== strlen($password = $user->getPlainPassword())) { + // $encoder = $this->getEncoder($user); + //$user->setPassword($encoder->encodePassword($password, $user->getSalt())); + //$user->eraseCredentials(); + } } + public function upgradePassword(UserInterface $user, string $newEncodedPassword): void { // this code is only an example; the exact code will depend on @@ -1205,7 +1229,7 @@ class UserRepository extends ResourceRepository implements UserLoaderInterface, $criteria = [ 'insertUserId' => $userId, ]; - $result = $em->getRepository('ChamiloTicketBundle:Ticket')->findBy($criteria); + $result = $em->getRepository('ChamiloCoreBundle:Ticket')->findBy($criteria); $ticket = []; /** @var Ticket $item */ foreach ($result as $item) { @@ -1220,9 +1244,9 @@ class UserRepository extends ResourceRepository implements UserLoaderInterface, $criteria = [ 'insertUserId' => $userId, ]; - $result = $em->getRepository('ChamiloTicketBundle:Message')->findBy($criteria); + $result = $em->getRepository('TicketMessage')->findBy($criteria); $ticketMessage = []; - /** @var \Chamilo\TicketBundle\Entity\Message $item */ + /** @var \Chamilo\CoreBundle\Entity\TicketMessage $item */ foreach ($result as $item) { $date = $item->getInsertDateTime() ? $item->getInsertDateTime()->format($dateFormat) : ''; $list = [ diff --git a/src/CoreBundle/Resources/config/admin.yml b/src/CoreBundle/Resources/config/admin.yml index 164ac69c8f..0a5ef26118 100644 --- a/src/CoreBundle/Resources/config/admin.yml +++ b/src/CoreBundle/Resources/config/admin.yml @@ -155,7 +155,7 @@ services: - {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "Resource node"} arguments: - ~ - - Chamilo\CoreBundle\Entity\Resource\ResourceNode + - Chamilo\CoreBundle\Entity\ResourceNode - ~ calls: - [setTranslationDomain, [ChamiloCoreBundle]] @@ -166,7 +166,7 @@ services: - {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "Resource file"} arguments: - ~ - - Chamilo\CoreBundle\Entity\Resource\ResourceFile + - Chamilo\CoreBundle\Entity\ResourceFile - ~ calls: - [setTranslationDomain, [ChamiloCoreBundle]] @@ -177,7 +177,7 @@ services: - {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "Resource link"} arguments: - ~ - - Chamilo\CoreBundle\Entity\Resource\ResourceLink + - Chamilo\CoreBundle\Entity\ResourceLink - ~ calls: - [setTranslationDomain, [ChamiloCoreBundle]] @@ -188,7 +188,7 @@ services: - {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "Resource right"} arguments: - ~ - - Chamilo\CoreBundle\Entity\Resource\ResourceRight + - Chamilo\CoreBundle\Entity\ResourceRight - ~ calls: - [setTranslationDomain, [ChamiloCoreBundle]] @@ -199,7 +199,7 @@ services: - {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "Resource type"} arguments: - ~ - - Chamilo\CoreBundle\Entity\Resource\ResourceType + - Chamilo\CoreBundle\Entity\ResourceType - ~ calls: - [setTranslationDomain, [ChamiloCoreBundle]] diff --git a/src/CoreBundle/Security/Authorization/Voter/ResourceNodeVoter.php b/src/CoreBundle/Security/Authorization/Voter/ResourceNodeVoter.php index f848e66ee5..62c2f470fd 100644 --- a/src/CoreBundle/Security/Authorization/Voter/ResourceNodeVoter.php +++ b/src/CoreBundle/Security/Authorization/Voter/ResourceNodeVoter.php @@ -5,9 +5,9 @@ namespace Chamilo\CoreBundle\Security\Authorization\Voter; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; -use Chamilo\CoreBundle\Entity\Resource\ResourceRight; +use Chamilo\CoreBundle\Entity\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceRight; use Chamilo\CoreBundle\Entity\Session; use Laminas\Permissions\Acl\Acl; use Laminas\Permissions\Acl\Resource\GenericResource as SecurityResource; diff --git a/src/CoreBundle/ToolChain.php b/src/CoreBundle/ToolChain.php index fe37f51784..b26222f304 100644 --- a/src/CoreBundle/ToolChain.php +++ b/src/CoreBundle/ToolChain.php @@ -5,8 +5,8 @@ namespace Chamilo\CoreBundle; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; -use Chamilo\CoreBundle\Entity\Resource\ResourceType; +use Chamilo\CoreBundle\Entity\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceType; use Chamilo\CoreBundle\Entity\Tool; use Chamilo\CoreBundle\Entity\ToolResourceRight; use Chamilo\CoreBundle\Manager\SettingsManager; diff --git a/src/CoreBundle/Traits/ResourceControllerTrait.php b/src/CoreBundle/Traits/ResourceControllerTrait.php index 4ae69427d6..7c848976c4 100644 --- a/src/CoreBundle/Traits/ResourceControllerTrait.php +++ b/src/CoreBundle/Traits/ResourceControllerTrait.php @@ -5,9 +5,9 @@ namespace Chamilo\CoreBundle\Traits; use Chamilo\CoreBundle\Component\Utils\Glide; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Repository\ResourceFactory; use Chamilo\CoreBundle\Repository\ResourceRepository; @@ -95,7 +95,7 @@ trait ResourceControllerTrait } } } else { - $repo = $this->getDoctrine()->getRepository('ChamiloCoreBundle:Resource\ResourceNode'); + $repo = $this->getDoctrine()->getRepository('ChamiloCoreBundle:ResourceNode'); $parentResourceNode = $repo->find($parentNodeId); } diff --git a/src/CourseBundle/Entity/CAnnouncement.php b/src/CourseBundle/Entity/CAnnouncement.php index 4561a81ff0..681be22ef2 100644 --- a/src/CourseBundle/Entity/CAnnouncement.php +++ b/src/CourseBundle/Entity/CAnnouncement.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CAnnouncementAttachment.php b/src/CourseBundle/Entity/CAnnouncementAttachment.php index 831677c37e..cb526537ca 100644 --- a/src/CourseBundle/Entity/CAnnouncementAttachment.php +++ b/src/CourseBundle/Entity/CAnnouncementAttachment.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CAttendance.php b/src/CourseBundle/Entity/CAttendance.php index b433b8ef10..1bb6e659f2 100644 --- a/src/CourseBundle/Entity/CAttendance.php +++ b/src/CourseBundle/Entity/CAttendance.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CCalendarEvent.php b/src/CourseBundle/Entity/CCalendarEvent.php index ecebdf8a38..3b36584438 100644 --- a/src/CourseBundle/Entity/CCalendarEvent.php +++ b/src/CourseBundle/Entity/CCalendarEvent.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Entity\Room; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; diff --git a/src/CourseBundle/Entity/CCalendarEventAttachment.php b/src/CourseBundle/Entity/CCalendarEventAttachment.php index a2e822770f..0c29fe015b 100644 --- a/src/CourseBundle/Entity/CCalendarEventAttachment.php +++ b/src/CourseBundle/Entity/CCalendarEventAttachment.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CChatConversation.php b/src/CourseBundle/Entity/CChatConversation.php index 9ba14b078b..cd535dc0f6 100644 --- a/src/CourseBundle/Entity/CChatConversation.php +++ b/src/CourseBundle/Entity/CChatConversation.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CCourseDescription.php b/src/CourseBundle/Entity/CCourseDescription.php index 8477f0afe6..a4c807a6be 100644 --- a/src/CourseBundle/Entity/CCourseDescription.php +++ b/src/CourseBundle/Entity/CCourseDescription.php @@ -5,8 +5,8 @@ namespace Chamilo\CourseBundle\Entity; use APY\DataGridBundle\Grid\Mapping as GRID; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CDocument.php b/src/CourseBundle/Entity/CDocument.php index 1cd9380d17..dd31e58c67 100644 --- a/src/CourseBundle/Entity/CDocument.php +++ b/src/CourseBundle/Entity/CDocument.php @@ -13,8 +13,8 @@ use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter; use ApiPlatform\Core\Serializer\Filter\PropertyFilter; use APY\DataGridBundle\Grid\Mapping as GRID; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CourseBundle\Traits\ShowCourseResourcesInSessionTrait; use Doctrine\ORM\Event\LifecycleEventArgs; @@ -24,13 +24,19 @@ use Symfony\Component\Serializer\Annotation\Groups; /** * @ApiResource( * shortName="Documents", - * normalizationContext={"groups"={"document:read", "resource_node:node"}}, + * normalizationContext={"groups"={"document:read", "resource_node:read"}}, * denormalizationContext={"groups"={"document:write"}} * ) - * @ApiFilter(SearchFilter::class, properties={"title": "partial"}) + * @ApiFilter(SearchFilter::class, properties={"title": "partial", "resourceNode": "exact"}) * @ApiFilter( * OrderFilter::class, - * properties={"id", "resourceNode.title", "resourceNode.createdAt", "resourceNode.updatedAt"} + * properties={ + * "id", + * "resourceNode.title", + * "resourceNode.createdAt", + * "resourceNode.resourceFile.size", + * "resourceNode.updatedAt" + * } * ) * * @ORM\Table( @@ -138,11 +144,11 @@ class CDocument extends AbstractResource implements ResourceInterface */ public function __construct() { + $this->id = 0; + $this->size = 0; $this->filetype = 'folder'; $this->readonly = false; $this->template = false; - $this->size = 0; - $this->id = 0; } public function __toString(): string diff --git a/src/CourseBundle/Entity/CExerciseCategory.php b/src/CourseBundle/Entity/CExerciseCategory.php index 86f19cf2b7..8d0ccecf42 100644 --- a/src/CourseBundle/Entity/CExerciseCategory.php +++ b/src/CourseBundle/Entity/CExerciseCategory.php @@ -6,8 +6,8 @@ namespace Chamilo\CourseBundle\Entity; use APY\DataGridBundle\Grid\Mapping as GRID; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Timestampable\Traits\TimestampableEntity; diff --git a/src/CourseBundle/Entity/CForumAttachment.php b/src/CourseBundle/Entity/CForumAttachment.php index cf4ac5a374..260561b383 100644 --- a/src/CourseBundle/Entity/CForumAttachment.php +++ b/src/CourseBundle/Entity/CForumAttachment.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CForumCategory.php b/src/CourseBundle/Entity/CForumCategory.php index 15631eff0e..dee4867394 100644 --- a/src/CourseBundle/Entity/CForumCategory.php +++ b/src/CourseBundle/Entity/CForumCategory.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; diff --git a/src/CourseBundle/Entity/CForumForum.php b/src/CourseBundle/Entity/CForumForum.php index ae0929493b..1821f031dd 100644 --- a/src/CourseBundle/Entity/CForumForum.php +++ b/src/CourseBundle/Entity/CForumForum.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; diff --git a/src/CourseBundle/Entity/CForumPost.php b/src/CourseBundle/Entity/CForumPost.php index d90eab4a13..f1eff552ed 100644 --- a/src/CourseBundle/Entity/CForumPost.php +++ b/src/CourseBundle/Entity/CForumPost.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; diff --git a/src/CourseBundle/Entity/CForumThread.php b/src/CourseBundle/Entity/CForumThread.php index 3720b9fcb7..21942d90c8 100644 --- a/src/CourseBundle/Entity/CForumThread.php +++ b/src/CourseBundle/Entity/CForumThread.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; diff --git a/src/CourseBundle/Entity/CGlossary.php b/src/CourseBundle/Entity/CGlossary.php index 50cf806aad..19f4b6adf3 100644 --- a/src/CourseBundle/Entity/CGlossary.php +++ b/src/CourseBundle/Entity/CGlossary.php @@ -5,8 +5,8 @@ namespace Chamilo\CourseBundle\Entity; use APY\DataGridBundle\Grid\Mapping as GRID; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CGroupInfo.php b/src/CourseBundle/Entity/CGroupInfo.php index f608334ab2..9d6ec7adfb 100644 --- a/src/CourseBundle/Entity/CGroupInfo.php +++ b/src/CourseBundle/Entity/CGroupInfo.php @@ -5,8 +5,8 @@ namespace Chamilo\CourseBundle\Entity; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Traits\CourseTrait; use Doctrine\Common\Collections\Collection; diff --git a/src/CourseBundle/Entity/CLink.php b/src/CourseBundle/Entity/CLink.php index 330d040572..9efb13231c 100644 --- a/src/CourseBundle/Entity/CLink.php +++ b/src/CourseBundle/Entity/CLink.php @@ -5,8 +5,8 @@ namespace Chamilo\CourseBundle\Entity; use APY\DataGridBundle\Grid\Mapping as GRID; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CLinkCategory.php b/src/CourseBundle/Entity/CLinkCategory.php index 5cebd658cb..4b36f9a347 100644 --- a/src/CourseBundle/Entity/CLinkCategory.php +++ b/src/CourseBundle/Entity/CLinkCategory.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; diff --git a/src/CourseBundle/Entity/CLp.php b/src/CourseBundle/Entity/CLp.php index 09b0db5eb0..8f3898f3bb 100644 --- a/src/CourseBundle/Entity/CLp.php +++ b/src/CourseBundle/Entity/CLp.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CLpCategory.php b/src/CourseBundle/Entity/CLpCategory.php index 32ad372c7f..14ff11a771 100644 --- a/src/CourseBundle/Entity/CLpCategory.php +++ b/src/CourseBundle/Entity/CLpCategory.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Entity\User; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Criteria; diff --git a/src/CourseBundle/Entity/CQuiz.php b/src/CourseBundle/Entity/CQuiz.php index 73123a042c..7b46e320ce 100644 --- a/src/CourseBundle/Entity/CQuiz.php +++ b/src/CourseBundle/Entity/CQuiz.php @@ -5,8 +5,8 @@ namespace Chamilo\CourseBundle\Entity; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CourseBundle\Traits\ShowCourseResourcesInSessionTrait; use Doctrine\ORM\Event\LifecycleEventArgs; use Doctrine\ORM\Mapping as ORM; diff --git a/src/CourseBundle/Entity/CQuizQuestion.php b/src/CourseBundle/Entity/CQuizQuestion.php index 41145b952a..fb2b7cb933 100644 --- a/src/CourseBundle/Entity/CQuizQuestion.php +++ b/src/CourseBundle/Entity/CQuizQuestion.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CQuizQuestionCategory.php b/src/CourseBundle/Entity/CQuizQuestionCategory.php index 24099c857a..da1803d3af 100644 --- a/src/CourseBundle/Entity/CQuizQuestionCategory.php +++ b/src/CourseBundle/Entity/CQuizQuestionCategory.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CourseBundle\Traits\ShowCourseResourcesInSessionTrait; use Doctrine\ORM\Event\LifecycleEventArgs; diff --git a/src/CourseBundle/Entity/CShortcut.php b/src/CourseBundle/Entity/CShortcut.php index 91858b3edb..8f53ba226e 100644 --- a/src/CourseBundle/Entity/CShortcut.php +++ b/src/CourseBundle/Entity/CShortcut.php @@ -5,8 +5,8 @@ namespace Chamilo\CourseBundle\Entity; use APY\DataGridBundle\Grid\Mapping as GRID; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; @@ -35,7 +35,7 @@ class CShortcut extends AbstractResource implements ResourceInterface /** * @ORM\OneToOne( - * targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode" + * targetEntity="Chamilo\CoreBundle\Entity\ResourceNode" * ) * @ORM\JoinColumn(name="shortcut_node_id", referencedColumnName="id") */ diff --git a/src/CourseBundle/Entity/CStudentPublication.php b/src/CourseBundle/Entity/CStudentPublication.php index 8abbb7573d..fee090fa05 100644 --- a/src/CourseBundle/Entity/CStudentPublication.php +++ b/src/CourseBundle/Entity/CStudentPublication.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Entity\Session; use Doctrine\ORM\Mapping as ORM; diff --git a/src/CourseBundle/Entity/CStudentPublicationAssignment.php b/src/CourseBundle/Entity/CStudentPublicationAssignment.php index 275d0a8e13..3411acd92b 100644 --- a/src/CourseBundle/Entity/CStudentPublicationAssignment.php +++ b/src/CourseBundle/Entity/CStudentPublicationAssignment.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CStudentPublicationComment.php b/src/CourseBundle/Entity/CStudentPublicationComment.php index 8e10aef0a4..8dd14e4cf8 100644 --- a/src/CourseBundle/Entity/CStudentPublicationComment.php +++ b/src/CourseBundle/Entity/CStudentPublicationComment.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CThematic.php b/src/CourseBundle/Entity/CThematic.php index 44b846f853..29ecf3ccc6 100644 --- a/src/CourseBundle/Entity/CThematic.php +++ b/src/CourseBundle/Entity/CThematic.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; diff --git a/src/CourseBundle/Entity/CThematicAdvance.php b/src/CourseBundle/Entity/CThematicAdvance.php index 51ab6e6ef6..b7129714c4 100644 --- a/src/CourseBundle/Entity/CThematicAdvance.php +++ b/src/CourseBundle/Entity/CThematicAdvance.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Entity\Room; use Doctrine\ORM\Mapping as ORM; diff --git a/src/CourseBundle/Entity/CThematicPlan.php b/src/CourseBundle/Entity/CThematicPlan.php index 0fdc9d3b2f..16780e8b30 100644 --- a/src/CourseBundle/Entity/CThematicPlan.php +++ b/src/CourseBundle/Entity/CThematicPlan.php @@ -4,8 +4,8 @@ namespace Chamilo\CourseBundle\Entity; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; /** diff --git a/src/CourseBundle/Entity/CTool.php b/src/CourseBundle/Entity/CTool.php index 48733b7749..3a73ff7f98 100644 --- a/src/CourseBundle/Entity/CTool.php +++ b/src/CourseBundle/Entity/CTool.php @@ -6,8 +6,8 @@ namespace Chamilo\CourseBundle\Entity; use APY\DataGridBundle\Grid\Mapping as GRID; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\Tool; use Doctrine\ORM\Event\LifecycleEventArgs; diff --git a/src/CourseBundle/Repository/CChatConversationRepository.php b/src/CourseBundle/Repository/CChatConversationRepository.php index c8020d96c0..11d7619a0e 100644 --- a/src/CourseBundle/Repository/CChatConversationRepository.php +++ b/src/CourseBundle/Repository/CChatConversationRepository.php @@ -5,7 +5,7 @@ namespace Chamilo\CourseBundle\Repository; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Repository\ResourceRepository; diff --git a/src/CourseBundle/Repository/CCourseDescriptionRepository.php b/src/CourseBundle/Repository/CCourseDescriptionRepository.php index 1d532a8fe0..9c7fa36227 100644 --- a/src/CourseBundle/Repository/CCourseDescriptionRepository.php +++ b/src/CourseBundle/Repository/CCourseDescriptionRepository.php @@ -9,7 +9,7 @@ use APY\DataGridBundle\Grid\Grid; use Chamilo\CoreBundle\Component\Resource\Settings; use Chamilo\CoreBundle\Component\Resource\Template; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Form\Resource\CCourseDescriptionType; diff --git a/src/CourseBundle/Repository/CDocumentRepository.php b/src/CourseBundle/Repository/CDocumentRepository.php index 531337a874..f08ab1c005 100644 --- a/src/CourseBundle/Repository/CDocumentRepository.php +++ b/src/CourseBundle/Repository/CDocumentRepository.php @@ -8,8 +8,8 @@ use APY\DataGridBundle\Grid\Column\Column; use APY\DataGridBundle\Grid\Grid; use Chamilo\CoreBundle\Component\Resource\Settings; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Form\Resource\CDocumentType; diff --git a/src/CourseBundle/Repository/CForumAttachmentRepository.php b/src/CourseBundle/Repository/CForumAttachmentRepository.php index 9668d40416..6602d2c8a3 100644 --- a/src/CourseBundle/Repository/CForumAttachmentRepository.php +++ b/src/CourseBundle/Repository/CForumAttachmentRepository.php @@ -5,7 +5,7 @@ namespace Chamilo\CourseBundle\Repository; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Repository\ResourceRepository; diff --git a/src/CourseBundle/Repository/CForumCategoryRepository.php b/src/CourseBundle/Repository/CForumCategoryRepository.php index 7e11044186..64bf484f23 100644 --- a/src/CourseBundle/Repository/CForumCategoryRepository.php +++ b/src/CourseBundle/Repository/CForumCategoryRepository.php @@ -5,7 +5,7 @@ namespace Chamilo\CourseBundle\Repository; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Repository\ResourceRepository; diff --git a/src/CourseBundle/Repository/CForumForumRepository.php b/src/CourseBundle/Repository/CForumForumRepository.php index 7b2d83193f..dbcedbe72b 100644 --- a/src/CourseBundle/Repository/CForumForumRepository.php +++ b/src/CourseBundle/Repository/CForumForumRepository.php @@ -4,7 +4,7 @@ namespace Chamilo\CourseBundle\Repository; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; +use Chamilo\CoreBundle\Entity\AbstractResource; use Chamilo\CoreBundle\Repository\ResourceRepository; use Chamilo\CourseBundle\Entity\CForumForum; diff --git a/src/CourseBundle/Repository/CForumPostRepository.php b/src/CourseBundle/Repository/CForumPostRepository.php index f8dc75b65f..c5f351a3ce 100644 --- a/src/CourseBundle/Repository/CForumPostRepository.php +++ b/src/CourseBundle/Repository/CForumPostRepository.php @@ -5,7 +5,7 @@ namespace Chamilo\CourseBundle\Repository; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; +use Chamilo\CoreBundle\Entity\AbstractResource; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Repository\ResourceRepository; use Chamilo\CourseBundle\Entity\CForumPost; diff --git a/src/CourseBundle/Repository/CForumThreadRepository.php b/src/CourseBundle/Repository/CForumThreadRepository.php index c098ab9b46..21991625be 100644 --- a/src/CourseBundle/Repository/CForumThreadRepository.php +++ b/src/CourseBundle/Repository/CForumThreadRepository.php @@ -4,7 +4,7 @@ namespace Chamilo\CourseBundle\Repository; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; +use Chamilo\CoreBundle\Entity\AbstractResource; use Chamilo\CoreBundle\Repository\ResourceRepository; use Chamilo\CourseBundle\Entity\CForumThread; diff --git a/src/CourseBundle/Repository/CGlossaryRepository.php b/src/CourseBundle/Repository/CGlossaryRepository.php index cbd4213932..3ccbab2f79 100644 --- a/src/CourseBundle/Repository/CGlossaryRepository.php +++ b/src/CourseBundle/Repository/CGlossaryRepository.php @@ -9,7 +9,7 @@ use APY\DataGridBundle\Grid\Grid; use Chamilo\CoreBundle\Component\Resource\Settings; use Chamilo\CoreBundle\Component\Resource\Template; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Form\Resource\CGlossaryType; diff --git a/src/CourseBundle/Repository/CLinkCategoryRepository.php b/src/CourseBundle/Repository/CLinkCategoryRepository.php index 575d80152f..990e0b9a5a 100644 --- a/src/CourseBundle/Repository/CLinkCategoryRepository.php +++ b/src/CourseBundle/Repository/CLinkCategoryRepository.php @@ -8,7 +8,7 @@ use APY\DataGridBundle\Grid\Column\Column; use APY\DataGridBundle\Grid\Grid; use Chamilo\CoreBundle\Component\Resource\Settings; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Form\Resource\CLinkType; diff --git a/src/CourseBundle/Repository/CLinkRepository.php b/src/CourseBundle/Repository/CLinkRepository.php index 540a07d1a5..e86190a1ca 100644 --- a/src/CourseBundle/Repository/CLinkRepository.php +++ b/src/CourseBundle/Repository/CLinkRepository.php @@ -7,7 +7,7 @@ namespace Chamilo\CourseBundle\Repository; use APY\DataGridBundle\Grid\Column\Column; use APY\DataGridBundle\Grid\Grid; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Form\Resource\CLinkType; diff --git a/src/CourseBundle/Repository/CLpCategoryRepository.php b/src/CourseBundle/Repository/CLpCategoryRepository.php index e4c432822d..625e5fad01 100644 --- a/src/CourseBundle/Repository/CLpCategoryRepository.php +++ b/src/CourseBundle/Repository/CLpCategoryRepository.php @@ -4,7 +4,7 @@ namespace Chamilo\CourseBundle\Repository; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Repository\ResourceRepository; use Chamilo\CoreBundle\Repository\ResourceWithLinkInterface; use Symfony\Component\Routing\RouterInterface; diff --git a/src/CourseBundle/Repository/CLpRepository.php b/src/CourseBundle/Repository/CLpRepository.php index 51425ddbbc..495a50e022 100644 --- a/src/CourseBundle/Repository/CLpRepository.php +++ b/src/CourseBundle/Repository/CLpRepository.php @@ -4,7 +4,7 @@ namespace Chamilo\CourseBundle\Repository; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Repository\ResourceRepository; use Chamilo\CoreBundle\Repository\ResourceWithLinkInterface; use Symfony\Component\Routing\RouterInterface; diff --git a/src/CourseBundle/Repository/CQuizRepository.php b/src/CourseBundle/Repository/CQuizRepository.php index 3ff7d3ec3e..8368f7b7da 100644 --- a/src/CourseBundle/Repository/CQuizRepository.php +++ b/src/CourseBundle/Repository/CQuizRepository.php @@ -4,7 +4,7 @@ namespace Chamilo\CourseBundle\Repository; -use Chamilo\CoreBundle\Entity\Resource\ResourceInterface; +use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Repository\ResourceRepository; use Chamilo\CoreBundle\Repository\ResourceWithLinkInterface; use Symfony\Component\Routing\RouterInterface; diff --git a/src/CourseBundle/Repository/CShortcutRepository.php b/src/CourseBundle/Repository/CShortcutRepository.php index 4a7a120941..38550eb98f 100644 --- a/src/CourseBundle/Repository/CShortcutRepository.php +++ b/src/CourseBundle/Repository/CShortcutRepository.php @@ -5,8 +5,8 @@ namespace Chamilo\CourseBundle\Repository; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\AbstractResource; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\AbstractResource; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Repository\ResourceRepository; diff --git a/src/CourseBundle/Repository/CThematicAdvanceRepository.php b/src/CourseBundle/Repository/CThematicAdvanceRepository.php index 12d4844273..b120c673ef 100644 --- a/src/CourseBundle/Repository/CThematicAdvanceRepository.php +++ b/src/CourseBundle/Repository/CThematicAdvanceRepository.php @@ -5,7 +5,7 @@ namespace Chamilo\CourseBundle\Repository; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Repository\ResourceRepository; diff --git a/src/CourseBundle/Repository/CThematicPlanRepository.php b/src/CourseBundle/Repository/CThematicPlanRepository.php index 261cac6c19..02a22854b6 100644 --- a/src/CourseBundle/Repository/CThematicPlanRepository.php +++ b/src/CourseBundle/Repository/CThematicPlanRepository.php @@ -5,7 +5,7 @@ namespace Chamilo\CourseBundle\Repository; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Repository\ResourceRepository; diff --git a/src/CourseBundle/Repository/CThematicRepository.php b/src/CourseBundle/Repository/CThematicRepository.php index c67bf6ea16..6371ff8acc 100644 --- a/src/CourseBundle/Repository/CThematicRepository.php +++ b/src/CourseBundle/Repository/CThematicRepository.php @@ -5,7 +5,7 @@ namespace Chamilo\CourseBundle\Repository; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Repository\ResourceRepository; diff --git a/src/CourseBundle/Repository/CToolRepository.php b/src/CourseBundle/Repository/CToolRepository.php index b1bc81b2b3..d429fe818b 100644 --- a/src/CourseBundle/Repository/CToolRepository.php +++ b/src/CourseBundle/Repository/CToolRepository.php @@ -5,8 +5,8 @@ namespace Chamilo\CourseBundle\Repository; use Chamilo\CoreBundle\Entity\Course; -use Chamilo\CoreBundle\Entity\Resource\ResourceLink; -use Chamilo\CoreBundle\Entity\Resource\ResourceNode; +use Chamilo\CoreBundle\Entity\ResourceLink; +use Chamilo\CoreBundle\Entity\ResourceNode; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Repository\ResourceRepository; diff --git a/src/TicketBundle/ChamiloTicketBundle.php b/src/TicketBundle/ChamiloTicketBundle.php deleted file mode 100644 index 9a3de1e546..0000000000 --- a/src/TicketBundle/ChamiloTicketBundle.php +++ /dev/null @@ -1,14 +0,0 @@ -