Minor - format code

pull/3741/head
Julio Montoya 4 years ago
parent 95aea43f7c
commit 1ee0e226af
  1. 1
      src/CoreBundle/Controller/ResourceApiController.php
  2. 4
      src/CoreBundle/Repository/AssetRepository.php
  3. 2
      src/CoreBundle/Traits/ControllerTrait.php
  4. 30
      src/CourseBundle/Component/CourseCopy/CourseBuilder.php
  5. 2
      src/CourseBundle/Component/CourseCopy/CourseRestorer.php
  6. 9
      src/CourseBundle/Component/CourseCopy/Resources/CourseCopyLearnpath.php
  7. 1
      src/CourseBundle/Resources/config/services.yml

@ -16,7 +16,6 @@ use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Class ResourceApiController.

@ -5,7 +5,6 @@
namespace Chamilo\CoreBundle\Repository;
use Chamilo\CoreBundle\Entity\Asset;
use Chamilo\CoreBundle\Entity\ResourceFile;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use League\Flysystem\FilesystemInterface;
@ -58,10 +57,11 @@ class AssetRepository extends ServiceEntityRepository
}
}
public function getFolder(Asset $asset):? string
public function getFolder(Asset $asset): ? string
{
if ($asset->hasFile()) {
$file = $asset->getTitle();
return '/'.$asset->getCategory().'/'.$file.'/';
}

@ -32,7 +32,7 @@ trait ControllerTrait
{
$services = parent::getSubscribedServices();
$services['translator'] = TranslatorInterface::class;
$services['resource_factory'] = ResourceFactory::class;
//$services['resource_factory'] = ResourceFactory::class;
$services['glide'] = Glide::class;
$services['chamilo.settings.manager'] = SettingsManager::class;
$services['chamilo_settings.form_factory.settings'] = SettingsFormFactory::class;

@ -367,7 +367,7 @@ class CourseBuilder
if (!empty($this->course->type) && 'partial' == $this->course->type) {
$sql = "SELECT d.iid, d.path, d.comment, d.title, d.filetype, d.size
FROM $table_doc d
FROM $table_doc d
INNER JOIN $table_prop p
ON (p.ref = d.id AND d.c_id = p.c_id)
WHERE
@ -382,7 +382,7 @@ class CourseBuilder
ORDER BY path";
} else {
$sql = "SELECT d.iid, d.path, d.comment, d.title, d.filetype, d.size
FROM $table_doc d
FROM $table_doc d
INNER JOIN $table_prop p
ON (p.ref = d.id AND d.c_id = p.c_id)
WHERE
@ -410,7 +410,7 @@ class CourseBuilder
} else {
if (!empty($this->course->type) && 'partial' == $this->course->type) {
$sql = "SELECT d.iid, d.path, d.comment, d.title, d.filetype, d.size
FROM $table_doc d
FROM $table_doc d
INNER JOIN $table_prop p
ON (p.ref = d.id AND d.c_id = p.c_id)
WHERE
@ -425,7 +425,7 @@ class CourseBuilder
ORDER BY path";
} else {
$sql = "SELECT d.iid, d.path, d.comment, d.title, d.filetype, d.size
FROM $table_doc d
FROM $table_doc d
INNER JOIN $table_prop p
ON (p.ref = d.id AND d.c_id = p.c_id)
WHERE
@ -769,18 +769,18 @@ class CourseBuilder
// Select only quizzes with active = 0 or 1 (not -1 which is for deleted quizzes)
$sql = "SELECT * FROM $table_qui
WHERE
c_id = $courseId AND
WHERE
c_id = $courseId AND
$idCondition
active >=0
active >=0
$sessionCondition ";
} else {
// Select only quizzes with active = 0 or 1 (not -1 which is for deleted quizzes)
$sql = "SELECT * FROM $table_qui
WHERE
c_id = $courseId AND
WHERE
c_id = $courseId AND
$idCondition
active >=0 AND
active >=0 AND
(session_id = 0 OR session_id IS NULL)";
}
@ -1513,7 +1513,7 @@ class CourseBuilder
$obj->debug,
$visibility,
$obj->author,
$obj->preview_image,
//$obj->preview_image,
$obj->use_max_score,
$obj->autolaunch,
$obj->created_on,
@ -1527,7 +1527,7 @@ class CourseBuilder
$this->course->add_resource($lp);
if (!empty($obj->preview_image)) {
/*if (!empty($obj->preview_image)) {
// Add LP teacher image
$asset = new Asset(
$obj->preview_image,
@ -1535,7 +1535,7 @@ class CourseBuilder
'/upload/learning_path/images/'.$obj->preview_image
);
$this->course->add_resource($asset);
}
}*/
}
}
@ -1850,8 +1850,8 @@ class CourseBuilder
$sql = "SELECT * FROM $table_work
WHERE
c_id = $courseId
$sessionCondition AND
c_id = $courseId
$sessionCondition AND
filetype = 'folder' AND
parent_id = 0 AND
active = 1

@ -2805,7 +2805,7 @@ class CourseRestorer
'js_lib' => self::DBUTF8($lp->js_lib),
'content_license' => self::DBUTF8($lp->content_license),
'author' => self::DBUTF8($lp->author),
'preview_image' => self::DBUTF8($lp->preview_image),
//'preview_image' => self::DBUTF8($lp->preview_image),
'use_max_score' => self::DBUTF8($lp->use_max_score),
'autolaunch' => self::DBUTF8(isset($lp->autolaunch) ? $lp->autolaunch : ''),
'created_on' => empty($lp->created_on) ? api_get_utc_datetime() : self::DBUTF8($lp->created_on),

@ -85,11 +85,6 @@ class CourseCopyLearnpath extends Resource
*/
public $author;
/**
* Author's image.
*/
public $preview_image;
/**
* Create a new learnpath.
*
@ -132,7 +127,7 @@ class CourseCopyLearnpath extends Resource
$debug,
$visibility,
$author,
$preview_image,
//$preview_image,
$use_max_score,
$autolaunch,
$created_on,
@ -168,7 +163,7 @@ class CourseCopyLearnpath extends Resource
$this->expired_on = $expired_on;
$this->session_id = $session_id;
$this->author = $author;
$this->preview_image = $preview_image;
//$this->preview_image = $preview_image;
$this->categoryId = $categoryId;
$this->items = $items;
}

@ -36,4 +36,3 @@ services:
- setToolChain: ['@Chamilo\CoreBundle\ToolChain']
- setResourceNodeRepository: ['@Chamilo\CoreBundle\Repository\ResourceNodeRepository']
exclude: '../../Repository/CCourseSettingRepository.php'

Loading…
Cancel
Save