From 72cd606acadef10437510afc8c72b0b511bb6f18 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos <1697880+AngelFQC@users.noreply.github.com> Date: Thu, 15 Jan 2026 17:02:53 -0500 Subject: [PATCH] Portfolio: Fixes related to resource structure #6836Portfolio: Simplify and fix resource visibility, comments filtering, and advanced sharing logic --- public/main/inc/lib/PortfolioController.php | 586 +++++++++--------- public/main/inc/lib/PortfolioNotifier.php | 12 +- src/CoreBundle/Entity/PortfolioComment.php | 11 +- src/CoreBundle/Framework/Container.php | 13 + .../Schema/V200/Version20250927180002.php | 2 +- .../Schema/V200/Version20260116085000.php | 44 ++ .../Schema/V200/Version20260116085001.php | 285 +++++++++ .../Node/PortfolioCommentRepository.php | 19 +- .../Repository/Node/PortfolioRepository.php | 6 +- .../Resources/views/Portfolio/items.html.twig | 2 +- .../Resources/views/Portfolio/view.html.twig | 28 +- 11 files changed, 684 insertions(+), 324 deletions(-) create mode 100644 src/CoreBundle/Migrations/Schema/V200/Version20260116085000.php create mode 100644 src/CoreBundle/Migrations/Schema/V200/Version20260116085001.php diff --git a/public/main/inc/lib/PortfolioController.php b/public/main/inc/lib/PortfolioController.php index 7d893904160..9a019e13af3 100644 --- a/public/main/inc/lib/PortfolioController.php +++ b/public/main/inc/lib/PortfolioController.php @@ -2,6 +2,8 @@ /* For licensing terms, see /license.txt */ +use Chamilo\CoreBundle\Entity\ResourceFile; +use Chamilo\CoreBundle\Entity\ResourceLink; use Chamilo\CoreBundle\Enums\ActionIcon; use Chamilo\CoreBundle\Enums\ObjectIcon; use Chamilo\CoreBundle\Enums\StateIcon; @@ -29,6 +31,8 @@ use Chamilo\CoreBundle\Event\PortfolioItemViewedEvent; use Chamilo\CoreBundle\Event\PortfolioItemVisibilityChangedEvent; use Chamilo\CoreBundle\Framework\Container; +use Chamilo\CoreBundle\Repository\Node\PortfolioCommentRepository; +use Chamilo\CoreBundle\Repository\ResourceLinkRepository; use Chamilo\CourseBundle\Entity\CItemProperty; use Doctrine\ORM\Query\Expr\Join; use Mpdf\MpdfException; @@ -1072,7 +1076,6 @@ public function index(HttpRequest $httpRequest): void 'found_comments' => $foundComments, '_p' => Template::getLegacyP(), '_c' => Template::getLegacyC(), - 'is_allowed_to_edit' => api_is_allowed_to_edit(false), ]; $js = ' +{% endautoescape %} \ No newline at end of file