diff --git a/assets/css/app.scss b/assets/css/app.scss index f3e5dde6b8..9139441c3d 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -742,6 +742,54 @@ form .field { } } +.files-info-page { + .form-control { + @apply w-48 p-1 border border-gray-300 rounded; + } + + .btn-primary { + @apply bg-primary text-primary-button-text p-1 rounded; + } + + .btn-primary:hover { + @apply bg-secondary-hover; + } + + .modal { + @apply hidden fixed z-10 left-0 top-0 w-full h-full overflow-auto bg-black bg-opacity-50 pt-16; + } + + .modal-content { + @apply bg-white m-auto p-5 border border-gray-300 w-1/3; + } + + .close-button { + @apply text-fontdisabled float-right text-2xl font-bold; + } + + .close-button:hover, + .close-button:focus { + @apply text-black no-underline cursor-pointer; + } + + .pagination { + @apply flex justify-center my-5; + } + + .pagination a, + .pagination span { + @apply mx-1 px-4 py-2 text-primary border border-gray-25; + } + + .pagination a:hover { + @apply bg-gray-15; + } + + .pagination span { + @apply bg-primary text-white border-primary; + } +} + //@import 'primevue-md-light-indigo/theme.css'; //@import '~primevue/resources/primevue.min.css'; //@import '~primeflex/primeflex.css'; diff --git a/public/documentation/changelog.html b/public/documentation/changelog.html index 29c4618bfd..10ffe53185 100644 --- a/public/documentation/changelog.html +++ b/public/documentation/changelog.html @@ -19,18 +19,33 @@
-

Chamilo 2.0 alpha 1 - [release name not defined], 2024-07-05

+

Chamilo 2.0 alpha 1 - Babaorum, 2024-07-18

Release notes - summary

-

Chamilo 2.0 is a major release that starts a new branch for the Chamilo software. +

+ Chamilo 2.0 will be a major release, a new branch for the Chamilo software. It is based on Chamilo 1.11.10 and includes tons of backend changes that will make - developing Chamilo more "mainstream" in the future, by adopting more widely-known libraries, - with the notable inclusions of Symfony as a main controller and framework (except for - some legacy tools not yet converted) and VueJS as our main frontend framework.
- For the first time in more than 14 years (since its launch in 2010), - Chamilo changes appearance, with a new and streamlined (open source) set of - icons, and a design that will allow more flexibility and speed across devices.

+ developing Chamilo more "mainstream" and (hopefully) faster in the future, + by adopting more widely-known libraries, with the notable inclusions of Symfony + as a main controller and framework (except for some legacy tools not yet converted), + VueJS as our main frontend framework and TailwindCSS as our CSS framework. +

+

+ For the first time in almost 15 years (since its launch in 2010), + Chamilo considerably changes appearance, with a new, foldable, left menu (meant + to improve space usage on mobile devices) and a streamlined (and open source) set of + icons, and a design that will allow more flexibility and speed across devices. +

+

+ This is an ALPHA release, meaning it is not finished and is meant for testing and development + only. It should *NOT* be used in production unless you have a full-time dedicated IT team behind it. +

+

+ An alpha version, to us, means that (except for unforeseen issues) the database structure is fixed + and the files structure is fixed (although some files could still be added/removed before the beta + release). +

Release name

-

Not assigned yet

+

Babaorum (ficticious village name, see French art)

Security fixes

diff --git a/public/documentation/installation_guide.html b/public/documentation/installation_guide.html index 1d6e6ba3b1..024c15f4cd 100644 --- a/public/documentation/installation_guide.html +++ b/public/documentation/installation_guide.html @@ -19,26 +19,39 @@ This version of Chamilo requires the following software stack. Within PHP, Chamilo requires or benefits from the following extensions: -

Database

+

Web-panel installation

+

Database

+ Make sure you have a database available with full permissions. + Do not share that database with another application as Chamilo might need to create + a table that has the same name as a table in the other application. +

Virtual host

+ Define a new virtual host/subdomain name you will use for Chamilo (Chamilo 2 does *not* work as a sub-folder of an existing website, you need a subdomain like "elearning.yourdomain.com").
+ Upload and/or unzip your Chamilo files inside your web folder (usually inside a folder called "public_html/").
+ Configure a virtual host pointing at the "public" directory inside your Chamilo directory. For example, this could be "/home/elearning.yourdomain.com/public_html/chamilo2/public/".
+

Installation wizard

+ You are ready to go. Open your browser on your subdomain (elearning.yourdomain.com in the example above), keep your database credentials at hand, and let the Chamilo installer guide you. +

Command line installation

+

Database

You will need a database user with privilege to fully use (and optionally create) a database.
-Although progress has been made to support multiple database management systems, Chamilo currently only supports MariaDB and MySQL.
+Although progress has been made to support multiple database management systems, Chamilo +currently only supports MariaDB and MySQL.
Setup a new user in your database system either through visual tools or directly in the terminal:
       mysql> GRANT ALL PRIVILEGES ON [db-name].* TO [db-user]@[db-host] IDENTIFIED BY '[db-password]';
@@ -53,14 +66,14 @@ where:
     
  • [db-host] is the name of the database server (use localhost when using the same machine for web server and database server - if you use a hosted service, your hosting provider will usually give you this name somewhere)
  • [db-password] is the password this user will use to connect to this database on this host. Use common sense to not make it too easy to guess (use special characters, lowercase and uppercase, numbers, and a length of *at least* 8 characters)
  • -

    Web server

    +

    Web server

    Chamilo 2+ only requires a working web server setup to work. You can run it on localhost with the default installation of any web server, provided you configure your DocumentRoot as the path pointing to Chamilo's public/ subfolder.
    Here is a minimal example Apache vhost configuration file for an installation on the http://my.chamilo.local/ URL (replace all values between brackets, including the brackets, to your custom values):
     <VirtualHost *:80>
         ServerAdmin [your-email]
         ServerName [my.chamilo.local]
    -    DocumentRoot [/var/www/chamilo/public/]
    +    DocumentRoot [/var/www/chamilo]/public/
         # The following might not even be required
         ErrorLog /var/log/apache2/[my.chamilo.local]-error.log
         CustomLog /var/log/apache2/[my.chamilo.local]-access.log combined
    @@ -73,13 +86,15 @@ After setting up this virtual host, don't forget to enable it (example here on D
           a2ensite [my.chamilo.local]
           systemctl reload apache2
       
    - Then you should be able to direct your browser to your URL (e.g. [http://my.chamilo.local]).
    +

    Installation wizard

    + You should now be able to direct your browser to your URL (e.g. [http://my.chamilo.local]).
    Chamilo will pick it up from there and offer the installation wizard to help guide you through the rest of the process. +

    Help available

    If you are struggling with this guide, don't hesitate to ask for help on our community forum.
    If you have reasons to seek professional assistance and warranties, please contact one of our official providers. They contribute heavily to the project and will be able to help you out quickly and efficiently, for configurations from 10 to 1M users.

    - Last updated: 2024-07-07 + Last updated: 2024-07-18 Valid XHTML 1.0 Transitional Valid CSS diff --git a/src/CoreBundle/Controller/Admin/AdminController.php b/src/CoreBundle/Controller/Admin/AdminController.php index af73560622..d5360063a7 100644 --- a/src/CoreBundle/Controller/Admin/AdminController.php +++ b/src/CoreBundle/Controller/Admin/AdminController.php @@ -7,18 +7,27 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Controller\Admin; use Chamilo\CoreBundle\Controller\BaseController; +use Chamilo\CoreBundle\Entity\ResourceFile; +use Chamilo\CoreBundle\Repository\ResourceNodeRepository; use Chamilo\CoreBundle\ServiceHelper\AccessUrlHelper; use Chamilo\CoreBundle\Settings\SettingsManager; +use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Attribute\Route; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; +use Vich\UploaderBundle\Storage\StorageInterface; #[Route('/admin')] class AdminController extends BaseController { + private const ITEMS_PER_PAGE = 50; + public function __construct( - private readonly AccessUrlHelper $accessUrlHelper, + private EntityManagerInterface $entityManager, + private ResourceNodeRepository $resourceNodeRepository, + private StorageInterface $storage, + private AccessUrlHelper $accessUrlHelper ) {} #[IsGranted('ROLE_ADMIN')] @@ -38,4 +47,78 @@ class AdminController extends BaseController return new Response('', Response::HTTP_NO_CONTENT); } + + #[IsGranted('ROLE_ADMIN')] + #[Route('/files_info', name: 'admin_files_info', methods: ['GET'])] + public function listFilesInfo(Request $request): Response + { + $page = $request->query->getInt('page', 1); + $search = $request->query->get('search', ''); + $offset = ($page - 1) * self::ITEMS_PER_PAGE; + + $queryBuilder = $this->entityManager->getRepository(ResourceFile::class)->createQueryBuilder('rf') + ->leftJoin('rf.resourceNode', 'rn') + ->leftJoin('rn.resourceLinks', 'rl') + ->leftJoin('rl.course', 'c') + ->leftJoin('rl.user', 'u') + ->addSelect('rn', 'rl', 'c', 'u'); + + if ($search) { + $queryBuilder->where('rf.title LIKE :search') + ->orWhere('rf.originalName LIKE :search') + ->orWhere('c.title LIKE :search') + ->orWhere('u.username LIKE :search') + ->orWhere('rn.uuid LIKE :search') + ->setParameter('search', '%' . $search . '%'); + } + + $queryBuilder->orderBy('rf.id', 'DESC') + ->setFirstResult($offset) + ->setMaxResults(self::ITEMS_PER_PAGE); + + $files = $queryBuilder->getQuery()->getResult(); + + $totalItemsQuery = $this->entityManager->getRepository(ResourceFile::class) + ->createQueryBuilder('rf') + ->leftJoin('rf.resourceNode', 'rn') + ->leftJoin('rn.resourceLinks', 'rl') + ->leftJoin('rl.course', 'c') + ->leftJoin('rl.user', 'u') + ->select('COUNT(rf.id)'); + + if ($search) { + $totalItemsQuery->where('rf.title LIKE :search') + ->orWhere('rf.originalName LIKE :search') + ->orWhere('c.title LIKE :search') + ->orWhere('u.username LIKE :search') + ->orWhere('rn.uuid LIKE :search') + ->setParameter('search', '%' . $search . '%'); + } + + $totalItems = $totalItemsQuery->getQuery()->getSingleScalarResult(); + $totalPages = ceil($totalItems / self::ITEMS_PER_PAGE); + + $fileUrls = []; + $filePaths = []; + foreach ($files as $file) { + $resourceNode = $file->getResourceNode(); + if ($resourceNode) { + $fileUrls[$file->getId()] = $this->resourceNodeRepository->getResourceFileUrl($resourceNode); + $creator = $resourceNode->getCreator(); + } else { + $fileUrls[$file->getId()] = null; + $creator = null; + } + $filePaths[$file->getId()] = $this->resourceNodeRepository->getFilename($file); + } + + return $this->render('@ChamiloCore/Admin/files_info.html.twig', [ + 'files' => $files, + 'fileUrls' => $fileUrls, + 'filePaths' => $filePaths, + 'totalPages' => $totalPages, + 'currentPage' => $page, + 'search' => $search, + ]); + } } diff --git a/src/CoreBundle/Controller/Admin/IndexBlocksController.php b/src/CoreBundle/Controller/Admin/IndexBlocksController.php index ddb85383d7..6b914f91da 100644 --- a/src/CoreBundle/Controller/Admin/IndexBlocksController.php +++ b/src/CoreBundle/Controller/Admin/IndexBlocksController.php @@ -566,6 +566,12 @@ class IndexBlocksController extends BaseController 'label' => $this->translator->trans('Colors'), ]; + $items[] = [ + 'class' => 'item-file-info', + 'url' => '/admin/files_info', + 'label' => $this->translator->trans('File info'), + ]; + return $items; } diff --git a/src/CoreBundle/Resources/views/Admin/files_info.html.twig b/src/CoreBundle/Resources/views/Admin/files_info.html.twig new file mode 100644 index 0000000000..0e6ba2de22 --- /dev/null +++ b/src/CoreBundle/Resources/views/Admin/files_info.html.twig @@ -0,0 +1,152 @@ +{% extends "@ChamiloCore/Layout/layout_one_col.html.twig" %} + +{% block content %} + + + +{% endblock %} diff --git a/tests/scripts/packaging/gitlog.php b/tests/scripts/packaging/gitlog.php index d9579cb7bb..490cf919fd 100644 --- a/tests/scripts/packaging/gitlog.php +++ b/tests/scripts/packaging/gitlog.php @@ -46,6 +46,19 @@ if (!empty($argv[1])) { echo "An initial commit has been defined as ".$endCommit.PHP_EOL; } } +// List if prefixes that can be skipped when creating a simplified, communication-focused changelog +$skipTechnicalPrefixes = [ + 'QA', + 'Internal', + 'Vendor', + 'Display', + 'Fix', + 'Minor', + 'Documentation', + 'Refactor', + 'Migration', + 'UI', +]; $git = new \YWarnier\PHPGit\Git($repository); echo "Log from branch: ".$git->getCurrentBranch().PHP_EOL;