Fix format code + remove unused code

pull/3924/head
Julio Montoya 4 years ago
parent e3abaa08e5
commit 7abcd40d39
  1. 5
      public/main/admin/course_add.php
  2. 46
      public/main/inc/lib/TicketManager.php
  3. 19
      src/CoreBundle/Controller/AssetController.php
  4. 10
      src/CoreBundle/Entity/AbstractResource.php
  5. 16
      src/CoreBundle/Entity/CourseCategory.php
  6. 7
      src/CoreBundle/Entity/UserRelUser.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']
);
}

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Ticket;
@ -508,7 +509,6 @@ class TicketManager
} else {
$categoryInfo = self::getCategory($category_id);
$usersInCategory = self::getUsersInCategory($category_id);
$message = '<h2>'.get_lang('Ticket info').'</h2><br />'.$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'] .= '&nbsp;&nbsp;<a href="javascript:void(0)" onclick="load_history_ticket(\'div_'.$row['ticket_id'].'\','.$row['ticket_id'].')">
<img onclick="load_course_list(\'div_'.$row['ticket_id'].'\','.$row['ticket_id'].')" onmouseover="clear_course_list (\'div_'.$row['ticket_id'].'\')" src="'.Display::returnIconPath('history.gif').'" title="'.get_lang('History').'" alt="'.get_lang('History').'"/>
$ticket['0'] .= '&nbsp;&nbsp;<a
href="javascript:void(0)"
onclick="load_history_ticket(\'div_'.$row['ticket_id'].'\','.$row['ticket_id'].')">
<a
onclick="load_course_list(\'div_'.$row['ticket_id'].'\','.$row['ticket_id'].')"
onmouseover="clear_course_list (\'div_'.$row['ticket_id'].'\')"
title="'.get_lang('History').'"
alt="'.get_lang('History').'"
>
'.Display::returnFontAwesomeIcon('history').'
</a>
<div class="blackboard_hide" id="div_'.$row['ticket_id'].'">&nbsp;&nbsp;</div>
</a>&nbsp;&nbsp;';
}
@ -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
}
}

@ -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;

@ -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;

@ -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;
}

@ -84,12 +84,7 @@ class UserRelUser
return $this;
}
/**
* Get relationType.
*
* @return int
*/
public function getRelationType()
public function getRelationType(): ?int
{
return $this->relationType;
}

Loading…
Cancel
Save