diff --git a/public/main/admin/course_add.php b/public/main/admin/course_add.php index 96537efaad..81510004c6 100644 --- a/public/main/admin/course_add.php +++ b/public/main/admin/course_add.php @@ -112,14 +112,13 @@ if (1 === count($languages)) { } if ('true' === api_get_setting('teacher_can_select_course_template')) { - $form->addElement( - 'select_ajax', + $form->addSelectAjax( 'course_template', [ get_lang('Course template'), get_lang('Pick a course as template for this new course'), ], - null, + [], ['url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course'] ); } diff --git a/public/main/inc/lib/TicketManager.php b/public/main/inc/lib/TicketManager.php index 247977d578..4ab804b6bc 100644 --- a/public/main/inc/lib/TicketManager.php +++ b/public/main/inc/lib/TicketManager.php @@ -1,4 +1,5 @@ '.get_lang('Ticket info').'
'.$helpDeskMessage; if ('true' === api_get_setting('ticket_warn_admin_no_user_in_category')) { @@ -522,7 +522,9 @@ class TicketManager if ('true' === api_get_setting('ticket_send_warning_to_all_admins')) { Display::addFlash(Display::return_message( sprintf( - get_lang('A notification was sent to the administrators to report this category has no user assigned'), + get_lang( + 'A notification was sent to the administrators to report this category has no user assigned' + ), $categoryInfo['name'] ), null, @@ -784,12 +786,8 @@ class TicketManager * * @return array */ - public static function getTicketsByCurrentUser( - $from, - $number_of_items, - $column, - $direction - ) { + public static function getTicketsByCurrentUser($from, $number_of_items, $column, $direction) + { $table_support_category = Database::get_main_table(TABLE_TICKET_CATEGORY); $table_support_tickets = Database::get_main_table(TABLE_TICKET_TICKET); $table_support_priority = Database::get_main_table(TABLE_TICKET_PRIORITY); @@ -1002,8 +1000,18 @@ class TicketManager ]; } if ($isAdmin) { - $ticket['0'] .= '   - '.get_lang('History').' + $ticket['0'] .= '   + + '.Display::returnFontAwesomeIcon('history').' + +
  
  '; } @@ -1374,23 +1382,7 @@ class TicketManager if (!empty($attachments)) { /** @var TicketMessageAttachment $attachment */ foreach ($attachments as $attachment) { - $file = api_get_uploaded_file( - 'ticket_attachment', - $ticketId, - $attachment->getPath() - ); - if (!empty($file)) { - $attachmentList[] = [ - 'tmp_name' => api_get_uploaded_file( - 'ticket_attachment', - $ticketId, - $attachment->getPath() - ), - 'size' => $attachment->getSize(), - 'name' => $attachment->getFilename(), - 'error' => 0, - ]; - } + //$attachment->get } } diff --git a/src/CoreBundle/Controller/AssetController.php b/src/CoreBundle/Controller/AssetController.php index 7f54b43493..ccc1dbc342 100644 --- a/src/CoreBundle/Controller/AssetController.php +++ b/src/CoreBundle/Controller/AssetController.php @@ -9,8 +9,6 @@ namespace Chamilo\CoreBundle\Controller; use Chamilo\CoreBundle\Component\Utils\GlideAsset; use Chamilo\CoreBundle\Repository\AssetRepository; use Chamilo\CoreBundle\Traits\ControllerTrait; -use Chamilo\CoreBundle\Traits\CourseControllerTrait; -use Chamilo\CoreBundle\Traits\ResourceControllerTrait; use League\MimeTypeDetection\ExtensionMimeTypeDetector; use Symfony\Component\Filesystem\Exception\FileNotFoundException; use Symfony\Component\HttpFoundation\RequestStack; @@ -18,22 +16,24 @@ use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\Routing\Annotation\Route; -/** - * @Route("/assets") - */ +#[Route('/assets')] class AssetController { - use CourseControllerTrait; - use ResourceControllerTrait; use ControllerTrait; /** * @Route("/{category}/{path}", methods={"GET"}, requirements={"path"=".+"}, name="chamilo_core_asset_showfile") */ - public function showFile($category, $path, AssetRepository $assetRepository, GlideAsset $glide, RequestStack $requestStack) - { + public function showFile( + $category, + $path, + AssetRepository $assetRepository, + GlideAsset $glide, + RequestStack $requestStack + ) { $filePath = $category.'/'.$path; $exists = $assetRepository->getFileSystem()->fileExists($filePath); + if ($exists) { $fileName = basename($filePath); $detector = new ExtensionMimeTypeDetector(); @@ -71,6 +71,7 @@ class AssetController $fileName ); $response->headers->set('Content-Disposition', $disposition); + //$response->headers->set('Content-Type', $mimeType ?: 'application/octet-stream'); return $response; diff --git a/src/CoreBundle/Entity/AbstractResource.php b/src/CoreBundle/Entity/AbstractResource.php index 4bdc4901a4..a2e23b684c 100644 --- a/src/CoreBundle/Entity/AbstractResource.php +++ b/src/CoreBundle/Entity/AbstractResource.php @@ -53,7 +53,15 @@ abstract class AbstractResource * Resource illustration URL - Property set by ResourceNormalizer.php. * * @ApiProperty(iri="http://schema.org/contentUrl") - * @Groups({"resource_node:read", "document:read", "media_object_read", "course:read", "session:read", "course_rel_user:read", "session_rel_course_rel_user:read"}) + * @Groups({ + * "resource_node:read", + * "document:read", + * "media_object_read", + * "course:read", + * "session:read", + * "course_rel_user:read", + * "session_rel_course_rel_user:read" + * }) */ public ?string $illustrationUrl = null; diff --git a/src/CoreBundle/Entity/CourseCategory.php b/src/CoreBundle/Entity/CourseCategory.php index f3598b821d..51eca3cb88 100644 --- a/src/CoreBundle/Entity/CourseCategory.php +++ b/src/CoreBundle/Entity/CourseCategory.php @@ -248,12 +248,7 @@ class CourseCategory return $this; } - /** - * Get authCourseChild. - * - * @return string - */ - public function getAuthCourseChild() + public function getAuthCourseChild(): ?string { return $this->authCourseChild; } @@ -265,17 +260,12 @@ class CourseCategory return $this; } - /** - * Get authCatChild. - * - * @return string - */ - public function getAuthCatChild() + public function getAuthCatChild(): ?string { return $this->authCatChild; } - public function getImage(): string + public function getImage(): ?string { return $this->image; } diff --git a/src/CoreBundle/Entity/UserRelUser.php b/src/CoreBundle/Entity/UserRelUser.php index 2221f5d5fc..ba6ac7e2e9 100644 --- a/src/CoreBundle/Entity/UserRelUser.php +++ b/src/CoreBundle/Entity/UserRelUser.php @@ -84,12 +84,7 @@ class UserRelUser return $this; } - /** - * Get relationType. - * - * @return int - */ - public function getRelationType() + public function getRelationType(): ?int { return $this->relationType; }