Merge branch 'master' into ui

pull/2715/head
Alex Aragón 6 years ago
commit 8dda058509
  1. 5
      .gitignore
  2. 1
      main/inc/lib/template.lib.php
  3. 33
      main/install/install.lib.php
  4. 14
      main/install/install_files.inc.php
  5. 5
      plugin/show_user_info/README.md
  6. 20
      plugin/show_user_info/index.php
  7. 3
      plugin/show_user_info/lang/english.php
  8. 3
      plugin/show_user_info/lang/spanish.php
  9. 23
      plugin/show_user_info/plugin.php
  10. 30
      plugin/show_user_info/template.html.twig
  11. 2
      src/ApiBundle/GraphQL/Resolver/CourseAnnouncementResolver.php
  12. 3
      src/ApiBundle/GraphQL/Resolver/ToolAnnouncementsResolver.php
  13. 4
      src/CoreBundle/Admin/ToolAdmin.php
  14. 10
      src/CoreBundle/Admin/ToolResourceRightAdmin.php
  15. 4
      src/CoreBundle/Controller/ResourceController.php
  16. 127
      src/CoreBundle/Entity/Resource/ResourceFile.php
  17. 8
      src/CoreBundle/Entity/Resource/ResourceLink.php
  18. 20
      src/CoreBundle/Entity/Resource/ResourceNode.php
  19. 4
      src/CoreBundle/Entity/Resource/ResourceRight.php
  20. 59
      src/CoreBundle/Entity/Resource/ResourceType.php
  21. 29
      src/CoreBundle/Entity/Tool.php
  22. 8
      src/CoreBundle/Entity/ToolResourceRight.php
  23. 2
      src/CoreBundle/Form/Type/DocumentType.php
  24. 8
      src/CoreBundle/Form/Type/ResourceLinkType.php
  25. 12
      src/CoreBundle/Form/Type/ResourceRightType.php
  26. 2
      src/CoreBundle/Menu/NavBuilder.php
  27. 36
      src/CoreBundle/Migrations/Schema/V200/Version20.php
  28. 44
      src/CoreBundle/Repository/ResourceRepository.php
  29. 8
      src/CoreBundle/Resources/config/admin.yml
  30. 6
      src/CoreBundle/Resources/config/services.yml
  31. 3
      src/CoreBundle/Security/Authorization/Voter/ResourceNodeVoter.php
  32. 2
      src/CoreBundle/Settings/AnnouncementSettingsSchema.php
  33. 2
      src/CoreBundle/Settings/CertificateSettingsSchema.php
  34. 2
      src/CoreBundle/Settings/DisplaySettingsSchema.php
  35. 2
      src/CoreBundle/Settings/LearningPathSettingsSchema.php
  36. 2
      src/CoreBundle/Settings/SessionSettingsSchema.php
  37. 4
      src/CourseBundle/Entity/Manager/AnnouncementManager.php
  38. 10
      src/CourseBundle/ToolChain.php
  39. 2
      src/Kernel.php

5
.gitignore vendored

@ -16,7 +16,9 @@ var/log/*
/app/config/events.conf.php
/app/config/mail.conf.php
/app/config/profile.conf.php
/config/configuration.php
/app/config/configuration.php
/main/inc/conf/configuration.php
# Courses
var/courses/*
@ -53,12 +55,11 @@ plugin/vchamilo/templates/*
vendor
web/assets/*
###> symfony/framework-bundle ###
.env
/public/bundles/
/var/
/vendor/
/vendor
###< symfony/framework-bundle ###
###> friendsofphp/php-cs-fixer ###

@ -1293,6 +1293,7 @@ class Template
/**
* Set header parameters.
*
* @deprecated
*
* @param bool $sendHeaders send headers

@ -429,8 +429,6 @@ function write_system_config_file($path)
Your problems can be related on two possible causes:<br />
<ul>
<li>Permission problems.<br />Try initially with <em>chmod -R 777</em> and increase restrictions gradually.</li>
<li>PHP is running in <a href="http://www.php.net/manual/en/features.safe-mode.php" target="_blank">Safe-Mode</a>.
If possible, try to switch it off.</li>
</ul>
<a href="http://forum.chamilo.org/" target="_blank">Read about this problem in Support Forum</a><br /><br />
Please go back to step 5.
@ -545,6 +543,8 @@ function get_config_param($param, $updatePath = '')
$updateFromConfigFile = 'main/inc/conf/configuration.php';
} elseif (file_exists($updatePath.'app/config/configuration.php')) {
$updateFromConfigFile = 'app/config/configuration.php';
} elseif (file_exists($updatePath.'config/configuration.php')) {
$updateFromConfigFile = 'config/configuration.php';
} else {
// Give up recovering.
//error_log('Chamilo Notice: Could not find previous config file at '.$updatePath.'main/inc/conf/configuration.php nor at '.$updatePath.'claroline/inc/conf/claro_main.conf.php in get_config_param(). Will start new config (in '.__FILE__.', line '.__LINE__.')', 0);
@ -868,11 +868,7 @@ function display_requirements(
<th>'.get_lang('Recommended').'</th>
<th>'.get_lang('Actual').'</th>
</tr>
<tr>
<td class="requirements-item"><a href="http://php.net/manual/features.safe-mode.php">Safe Mode</a></td>
<td class="requirements-recommended">'.Display::label('OFF', 'success').'</td>
<td class="requirements-value">'.checkPhpSetting('safe_mode', 'OFF').'</td>
</tr>
<tr>
<td class="requirements-item"><a href="http://php.net/manual/ref.errorfunc.php#ini.display-errors">Display Errors</a></td>
<td class="requirements-recommended">'.Display::label('OFF', 'success').'</td>
@ -883,21 +879,6 @@ function display_requirements(
<td class="requirements-recommended">'.Display::label('ON', 'success').'</td>
<td class="requirements-value">'.checkPhpSetting('file_uploads', 'ON').'</td>
</tr>
<tr>
<td class="requirements-item"><a href="http://php.net/manual/ref.info.php#ini.magic-quotes-gpc">Magic Quotes GPC</a></td>
<td class="requirements-recommended">'.Display::label('OFF', 'success').'</td>
<td class="requirements-value">'.checkPhpSetting('magic_quotes_gpc', 'OFF').'</td>
</tr>
<tr>
<td class="requirements-item"><a href="http://php.net/manual/ref.info.php#ini.magic-quotes-runtime">Magic Quotes Runtime</a></td>
<td class="requirements-recommended">'.Display::label('OFF', 'success').'</td>
<td class="requirements-value">'.checkPhpSetting('magic_quotes_runtime', 'OFF').'</td>
</tr>
<tr>
<td class="requirements-item"><a href="http://php.net/manual/security.globals.php">Register Globals</a></td>
<td class="requirements-recommended">'.Display::label('OFF', 'success').'</td>
<td class="requirements-value">'.checkPhpSetting('register_globals', 'OFF').'</td>
</tr>
<tr>
<td class="requirements-item"><a href="http://php.net/manual/ref.session.php#ini.session.auto-start">Session auto start</a></td>
<td class="requirements-recommended">'.Display::label('OFF', 'success').'</td>
@ -1015,12 +996,8 @@ function display_requirements(
<td class="requirements-value">'.check_writable(api_get_path(SYS_APP_PATH)).'</td>
</tr>
<tr>
<td class="requirements-item">'.api_get_path(SYS_CODE_PATH).'default_course_document/images/</td>
<td class="requirements-value">'.check_writable(api_get_path(SYS_CODE_PATH).'default_course_document/images/').'</td>
</tr>
<tr>
<td class="requirements-item">'.api_get_path(SYS_CODE_PATH).'lang/</td>
<td class="requirements-value">'.check_writable(api_get_path(SYS_CODE_PATH).'lang/', true).' <br />('.get_lang('SuggestionOnlyToEnableSubLanguageFeatureOrUpgradeProcess').')</td>
<td class="requirements-item">'.api_get_path(SYS_PATH).'config</td>
<td class="requirements-value">'.check_writable(api_get_path(SYS_PATH).'config').'</td>
</tr>
<tr>
<td class="requirements-item">'.api_get_path(SYS_PATH).'vendor/</td>

@ -15,19 +15,7 @@
*/
if (defined('SYSTEM_INSTALLATION')) {
// Write the system config file
write_system_config_file(api_get_path(CONFIGURATION_PATH).'configuration.php');
// Write a distribution file with the config as a backup for the admin
//write_system_config_file(api_get_path(CONFIGURATION_PATH) . 'configuration.dist.php');
// Write a .htaccess file in the course repository
//write_courses_htaccess_file($urlAppendPath);
// Copy distribution files with renaming for being the actual system configuration files.
copy(
api_get_path(CONFIGURATION_PATH).'profile.conf.dist.php',
api_get_path(CONFIGURATION_PATH).'profile.conf.php'
);
write_system_config_file(api_get_path(SYS_PATH).'config/configuration.php');
} else {
echo 'You are not allowed here !'.__FILE__;
}

@ -1,5 +0,0 @@
Show User Info plugin
===
This plugin shows the current user information in a selected region.
Make sure you select a region in which you want to show this information.

@ -1,20 +0,0 @@
<?php
// A user must be logged in.
$_template['show_message'] = false;
if (!api_is_anonymous()) {
$_template['show_message'] = true;
// Getting the current user id.
$user_id = api_get_user_id();
//Getting the current user info.
$user_info = api_get_user_info($user_id);
$_template['user_info'] = [];
$_template['username'] = '';
if ($user_info) {
// You can also use template setting variables in the special variable called template.
$_template['user_info'] = $user_info;
$_template['username'] = $user_info['username'];
}
}

@ -1,3 +0,0 @@
<?php
$strings['WelcomeToChamiloUserX'] = "Welcome to Chamilo %s!";

@ -1,3 +0,0 @@
<?php
$strings['WelcomeToChamiloUserX'] = "Bienvenido a Chamilo %s!";

@ -1,23 +0,0 @@
<?php
/**
* This script is a configuration file for the date plugin. You can use it as a master for other platform plugins (course plugins are slightly different).
* These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins).
*
* @package chamilo.plugin
*
* @author Julio Montoya <gugli100@gmail.com>
*/
/**
* Plugin details (must be present).
*/
// The plugin title
$plugin_info['title'] = 'Show user information';
// The comments that go with the plugin
$plugin_info['comment'] = "Shows a welcome message, (this is an example to uses the template system: Twig)";
// The plugin version
$plugin_info['version'] = '1.0';
// The plugin author
$plugin_info['author'] = 'Julio Montoya';
// Set the templates that are going to be used
$plugin_info['templates'] = ['template.html.twig'];

@ -1,30 +0,0 @@
{#
This is a Chamilo plugin using Twig you can use these handy shorcuts like:
1. Shortcuts
_p = url chamilo paths
_u = user information of the current user
2. i18n
You can use i18n variables just use this syntax:
{{ "HelloWorld"|get_lang }}
Now you can add your variables in the main/lang/english/ or main/lang/spanish/ for example in spanish:
$HelloWorld = "Hola Mundo";
3. Portal settings
You can access the portal settings using:
{{ "siteName"|api_get_setting }}
For more settings check the settings_current database table
4. Read more
You can also see more examples in main/template/default/layout
#}
{% if show_user_info.show_message is not null and _u.logged == 1 %}
<div class="well">
{{ "WelcomeToChamiloUserX" | get_lang | format(show_user_info.user_info.complete_name) }}
</div>
{% endif %}

@ -85,4 +85,4 @@ class CourseAnnouncementResolver implements ResolverInterface, ContainerAwareInt
{
return $itemProperty->getLasteditDate();
}
}
}

@ -6,7 +6,6 @@ namespace Chamilo\ApiBundle\GraphQL\Resolver;
use Chamilo\ApiBundle\GraphQL\ApiGraphQLTrait;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CourseBundle\Entity\CAnnouncement;
use Chamilo\CourseBundle\Entity\CTool;
use GraphQL\Error\UserError;
use Overblog\GraphQLBundle\Definition\Argument;
@ -71,4 +70,4 @@ class ToolAnnouncementsResolver implements ResolverInterface, ContainerAwareInte
return $announcements;
}
}
}

@ -24,7 +24,7 @@ class ToolAdmin extends AbstractAdmin
->add('name')
->add('description', 'ckeditor')
->add(
'toolResourceRights',
'toolResourceRight',
'sonata_type_collection',
[
'cascade_validation' => true,
@ -38,7 +38,7 @@ class ToolAdmin extends AbstractAdmin
//'multiple' => true
//'sortable' => 'position',
//'link_parameters' => array('content' => $users),
'admin_code' => 'sonata.admin.tool_resource_rights',
'admin_code' => 'sonata.admin.tool_resource_right',
]
)
/*->add('image', 'sonata_media_type', array(

@ -3,18 +3,18 @@
namespace Chamilo\CoreBundle\Admin;
use Chamilo\CoreBundle\Entity\ToolResourceRights;
use Chamilo\CoreBundle\Entity\ToolResourceRight;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
/**
* Class ToolResourceRightsAdmin.
* Class ToolResourceRightAdmin.
*
* @package Chamilo\CoreBundle\Admin
*/
class ToolResourceRightsAdmin extends AbstractAdmin
class ToolResourceRightAdmin extends AbstractAdmin
{
/**
* {@inheritdoc}
@ -26,12 +26,12 @@ class ToolResourceRightsAdmin extends AbstractAdmin
->add(
'role',
'choice',
['choices' => ToolResourceRights::getDefaultRoles()]
['choices' => ToolResourceRight::getDefaultRoles()]
)
->add(
'mask',
'choice',
['choices' => ToolResourceRights::getMaskList()]
['choices' => ToolResourceRight::getMaskList()]
)
;
}

@ -9,7 +9,7 @@ use APY\DataGridBundle\Grid\Export\CSVExport;
use APY\DataGridBundle\Grid\Export\ExcelExport;
use APY\DataGridBundle\Grid\Grid;
use APY\DataGridBundle\Grid\Source\Entity;
use Chamilo\CoreBundle\Entity\Resource\ResourceRights;
use Chamilo\CoreBundle\Entity\Resource\ResourceRight;
use Chamilo\CoreBundle\Repository\ResourceRepository;
use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter;
use Chamilo\CourseBundle\Controller\CourseControllerInterface;
@ -247,7 +247,7 @@ class ResourceController extends BaseResourceController implements CourseControl
$resourceRight = null;
if (isset($share['mask'])) {
$resourceRight = new ResourceRights();
$resourceRight = new ResourceRight();
$resourceRight
->setMask($share['mask'])
->setRole($share['role'])

@ -0,0 +1,127 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="resource_file")
*/
class ResourceFile
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/**
* @ORM\Column()
* @Assert\NotBlank()
*/
protected $name;
/**
* @var string
*
* @Assert\NotBlank()
*
* @ORM\Column(name="hash", type="string", nullable=false)
*/
protected $hash;
/**
* @Assert\NotBlank()
*
* @var string
*
* @ORM\Column(name="original_filename", type="string", nullable=false)
*/
protected $originalFilename;
/**
* @Assert\NotBlank()
*
* @var string
*
* @ORM\Column(name="size", type="string", nullable=false)
*/
protected $size;
/**
* @Assert\NotBlank()
*
* @var string
*
* @ORM\Column(name="width", type="string", nullable=true)
*/
protected $width;
/**
* @Assert\NotBlank()
*
* @var string
*
* @ORM\Column(name="height", type="string", nullable=true)
*/
protected $height;
/**
* @var string
*
* @ORM\Column(name="copyright", type="string", nullable=true)
*/
protected $copyright;
/**
* @var string
*
* @ORM\Column(name="contentType", type="string", nullable=true)
*/
protected $contentType;
/**
* @var string
*
* @ORM\Column(name="extension", type="string", nullable=false)
*/
protected $extension;
/**
* @var ResourceNode
*
* @ORM\OneToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", mappedBy="resourceFile")
*/
protected $resourceNode;
/**
* @var string
*
* @ORM\Column(name="enabled", type="boolean")
*/
protected $enabled;
/**
* @ORM\Column(name="created_at", type="datetime")
* @Gedmo\Timestampable(on="create")
*/
protected $createdAt;
/**
* @ORM\Column(name="updated_at", type="datetime")
* @Gedmo\Timestampable(on="update")
*/
protected $updatedAt;
/**
* Constructor.
*/
public function __construct()
{
}
}

@ -62,9 +62,9 @@ class ResourceLink implements ResourceInterface
protected $userGroup;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceRights", mappedBy="resourceLink", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceRight", mappedBy="resourceLink", cascade={"persist", "remove"})
*/
protected $rights;
protected $resourceRight;
/**
* @var bool
@ -203,11 +203,11 @@ class ResourceLink implements ResourceInterface
}
/**
* @param ResourceRights $right
* @param ResourceRight $right
*
* @return $this
*/
public function addRight(ResourceRights $right)
public function addRight(ResourceRight $right)
{
$right->setResourceLink($this);
$this->rights[] = $right;

@ -36,22 +36,16 @@ class ResourceNode
protected $name;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Tool", inversedBy="resourceNodes")
* @ORM\JoinColumn(name="tool_id", referencedColumnName="id")
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceType", inversedBy="resourceNodes")
* @ORM\JoinColumn(name="resource_type_id", referencedColumnName="id")
*/
protected $tool;
protected $resourceType;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceLink", mappedBy="resourceNode", cascade={"remove"})
*/
protected $links;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\AbstractResource", inversedBy="resourceNodes", cascade={"persist", "remove"})
* @ORM\JoinColumn(name="resource_id", referencedColumnName="id")
*/
//protected $resource;
/**
* @ORM\ManyToOne(
* targetEntity="Chamilo\UserBundle\Entity\User",
@ -93,6 +87,14 @@ class ResourceNode
*/
protected $path;
/**
* @var ResourceFile
*
* @ORM\OneToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceFile", inversedBy="resourceNode")
* @ORM\JoinColumn(name="resource_file_id", referencedColumnName="id")
*/
protected $resourceFile;
/**
* @ORM\Column(name="created_at", type="datetime")
* @Gedmo\Timestampable(on="create")

@ -7,9 +7,9 @@ use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="resource_rights")
* @ORM\Table(name="resource_right")
*/
class ResourceRights
class ResourceRight
{
/**
* @ORM\Id

@ -0,0 +1,59 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource;
use Chamilo\CoreBundle\Entity\Tool;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="resource_type")
*/
class ResourceType
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/**
* @ORM\Column()
* @Assert\NotBlank()
*/
protected $name;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Tool", inversedBy="resourceTypes")
* @ORM\JoinColumn(name="tool_id", referencedColumnName="id")
*/
protected $tool;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", mappedBy="resourceType", cascade={"persist", "remove"})
*/
protected $resourceNodes;
/**
* @ORM\Column(name="created_at", type="datetime")
* @Gedmo\Timestampable(on="create")
*/
protected $createdAt;
/**
* @ORM\Column(name="updated_at", type="datetime")
* @Gedmo\Timestampable(on="update")
*/
protected $updatedAt;
/**
* Constructor.
*/
public function __construct()
{
}
}

@ -45,14 +45,9 @@ class Tool
protected $description;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", mappedBy="tool", cascade={"persist", "remove"})
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceType", mappedBy="tool", cascade={"persist", "remove"})
*/
protected $resourceNodes;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\ToolResourceRights", mappedBy="tool", cascade={"persist", "remove"})
*/
protected $toolResourceRights;
protected $resourceTypes;
/**
* @return string
@ -65,32 +60,32 @@ class Tool
/**
* @return ArrayCollection
*/
public function getToolResourceRights()
public function getToolResourceRight()
{
return $this->toolResourceRights;
return $this->toolResourceRight;
}
/**
* @param ArrayCollection $toolResourceRights
* @param ArrayCollection $toolResourceRight
*/
public function setToolResourceRights($toolResourceRights)
public function setToolResourceRight($toolResourceRight)
{
$this->toolResourceRights = new ArrayCollection();
$this->toolResourceRight = new ArrayCollection();
foreach ($toolResourceRights as $toolResourceRight) {
$this->addToolResourceRights($toolResourceRight);
foreach ($toolResourceRight as $toolResourceRight) {
$this->addToolResourceRight($toolResourceRight);
}
}
/**
* @param ToolResourceRights $toolResourceRight
* @param ToolResourceRight $toolResourceRight
*
* @return $this
*/
public function addToolResourceRights(ToolResourceRights $toolResourceRight)
public function addToolResourceRight(ToolResourceRight $toolResourceRight)
{
$toolResourceRight->setTool($this);
$this->toolResourceRights[] = $toolResourceRight;
$this->toolResourceRight[] = $toolResourceRight;
return $this;
}

@ -7,12 +7,12 @@ use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter;
use Doctrine\ORM\Mapping as ORM;
/**
* ToolResourceRights.
* ToolResourceRight.
*
* @ORM\Table(name="tool_resource_rights")
* @ORM\Table(name="tool_resource_right")
* @ORM\Entity
*/
class ToolResourceRights
class ToolResourceRight
{
/**
* @var int
@ -38,7 +38,7 @@ class ToolResourceRights
protected $mask;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Tool", inversedBy="toolResourceRights", cascade={"persist"})
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Tool", inversedBy="toolResourceRight", cascade={"persist"})
* @ORM\JoinColumn(name="tool_id", referencedColumnName="id")
*/
protected $tool;

@ -58,7 +58,7 @@ class DocumentType extends AbstractType
'rights',
'collection',
array(
'type' => new ResourceRightsType(),
'type' => new ResourceRightType(),
'mapped' => false,
'allow_add' => true,
)

@ -3,7 +3,7 @@
namespace Chamilo\CoreBundle\Form\Type;
use Chamilo\CoreBundle\Entity\ToolResourceRights;
use Chamilo\CoreBundle\Entity\ToolResourceRight;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
@ -48,7 +48,7 @@ class ResourceLinkType extends AbstractType
'role',
ChoiceType::class,
[
'choices' => ToolResourceRights::getDefaultRoles(),
'choices' => ToolResourceRight::getDefaultRoles(),
'mapped' => false,
]
)
@ -56,14 +56,14 @@ class ResourceLinkType extends AbstractType
'mask',
ChoiceType::class,
[
'choices' => ToolResourceRights::getMaskList(),
'choices' => ToolResourceRight::getMaskList(),
'mapped' => false,
]
)/*->add(
'rights',
'collection',
array(
'type' => new ResourceRightsType(),
'type' => new ResourceRightType(),
'allow_add' => true,
)
)*/

@ -3,17 +3,17 @@
namespace Chamilo\CoreBundle\Form\Type;
use Chamilo\CoreBundle\Entity\ToolResourceRights;
use Chamilo\CoreBundle\Entity\ToolResourceRight;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* Class ResourceRightsType.
* Class ResourceRightType.
*
* @package Chamilo\CoreBundle\Form\Type
*/
class ResourceRightsType extends AbstractType
class ResourceRightType extends AbstractType
{
/**
* {@inheritdoc}
@ -24,12 +24,12 @@ class ResourceRightsType extends AbstractType
->add(
'role',
'choice',
['choices' => ToolResourceRights::getDefaultRoles()]
['choices' => ToolResourceRight::getDefaultRoles()]
)
->add(
'mask',
'choice',
['choices' => ToolResourceRights::getMaskList()]
['choices' => ToolResourceRight::getMaskList()]
);
}
@ -40,7 +40,7 @@ class ResourceRightsType extends AbstractType
{
$resolver->setDefaults(
[
'data_class' => 'Chamilo\CoreBundle\Entity\Resource\ResourceRights',
'data_class' => 'Chamilo\CoreBundle\Entity\Resource\ResourceRight',
]
);
}

@ -239,7 +239,7 @@ class NavBuilder implements ContainerAwareInterface
// Set CSS classes for the items
foreach ($menu->getChildren() as $child) {
$child
$child
->setLinkAttribute('class', 'sidebar-link')
->setAttribute('class', 'nav-item');
}

@ -533,24 +533,30 @@ class Version20 extends AbstractMigrationChamilo
$this->addSql('CREATE TABLE IF NOT EXISTS ext_translations (id INT AUTO_INCREMENT NOT NULL, locale VARCHAR(8) NOT NULL, object_class VARCHAR(190) NOT NULL, field VARCHAR(32) NOT NULL, foreign_key VARCHAR(64) NOT NULL, content LONGTEXT DEFAULT NULL, INDEX translations_lookup_idx (locale, object_class, foreign_key), UNIQUE INDEX lookup_unique_idx (locale, object_class, field, foreign_key), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;');
$this->addSql('CREATE TABLE IF NOT EXISTS ext_log_entries (id INT AUTO_INCREMENT NOT NULL, action VARCHAR(8) NOT NULL, logged_at DATETIME NOT NULL, object_id VARCHAR(64) DEFAULT NULL, object_class VARCHAR(255) NOT NULL, version INT NOT NULL, data LONGTEXT DEFAULT NULL COMMENT "(DC2Type:array)", username VARCHAR(255) DEFAULT NULL, INDEX log_class_lookup_idx (object_class), INDEX log_date_lookup_idx (logged_at), INDEX log_user_lookup_idx (username), INDEX log_version_lookup_idx (object_id, object_class, version), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;');
$this->addSql('CREATE TABLE IF NOT EXISTS tool (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, description LONGTEXT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;');
$this->addSql('CREATE TABLE IF NOT EXISTS resource_node (id INT AUTO_INCREMENT NOT NULL, tool_id INT DEFAULT NULL, creator_id INT NOT NULL, parent_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, level INT DEFAULT NULL, path VARCHAR(3000) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_8A5F48FF8F7B22CC (tool_id), INDEX IDX_8A5F48FF61220EA6 (creator_id), INDEX IDX_8A5F48FF727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;');
$this->addSql('CREATE TABLE IF NOT EXISTS resource_rights (id INT AUTO_INCREMENT NOT NULL, resource_link_id INT DEFAULT NULL, role VARCHAR(255) NOT NULL, mask INT NOT NULL, UNIQUE INDEX UNIQ_C99C3BF9F004E599 (resource_link_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;');
$this->addSql('CREATE TABLE IF NOT EXISTS resource_link (id INT AUTO_INCREMENT NOT NULL, resource_node_id INT DEFAULT NULL, session_id INT DEFAULT NULL, user_id INT DEFAULT NULL, c_id INT DEFAULT NULL, group_id INT DEFAULT NULL, usergroup_id INT DEFAULT NULL, private TINYINT(1) DEFAULT NULL, public TINYINT(1) DEFAULT NULL, start_visibility_at DATETIME DEFAULT NULL, end_visibility_at DATETIME DEFAULT NULL, INDEX IDX_398C394B1BAD783F (resource_node_id), INDEX IDX_398C394B613FECDF (session_id), INDEX IDX_398C394BA76ED395 (user_id), INDEX IDX_398C394B91D79BD3 (c_id), INDEX IDX_398C394BFE54D947 (group_id), INDEX IDX_398C394BD2112630 (usergroup_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;');
$this->addSql('CREATE TABLE IF NOT EXISTS tool_resource_rights (id INT AUTO_INCREMENT NOT NULL, tool_id INT DEFAULT NULL, role VARCHAR(255) NOT NULL, mask INT NOT NULL, INDEX IDX_95CE3398F7B22CC (tool_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;');
$this->addSql('CREATE TABLE IF NOT EXISTS tool_resource_right (id INT AUTO_INCREMENT NOT NULL, tool_id INT DEFAULT NULL, role VARCHAR(255) NOT NULL, mask INT NOT NULL, INDEX IDX_95CE3398F7B22CC (tool_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;');
$this->addSql('ALTER TABLE tool_resource_right ADD CONSTRAINT FK_95CE3398F7B22CC FOREIGN KEY (tool_id) REFERENCES tool (id);');
$this->addSql('CREATE TABLE IF NOT EXISTS notification__message (id INT AUTO_INCREMENT NOT NULL, type VARCHAR(255) NOT NULL, body LONGTEXT NOT NULL COMMENT "(DC2Type:json)", state INT NOT NULL, restart_count INT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, started_at DATETIME DEFAULT NULL, completed_at DATETIME DEFAULT NULL, INDEX notification_message_state_idx (state), INDEX notification_message_created_at_idx (created_at), INDEX idx_state (state), INDEX idx_created_at (created_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;');
$this->addSql('CREATE TABLE sylius_settings (id INT AUTO_INCREMENT NOT NULL, schema_alias VARCHAR(190) NOT NULL, namespace VARCHAR(190) DEFAULT NULL, parameters LONGTEXT NOT NULL COMMENT "(DC2Type:json_array)", UNIQUE INDEX UNIQ_1AFEFB2A894A31AD33E16B56 (schema_alias, namespace), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;');
$this->addSql('ALTER TABLE resource_node ADD CONSTRAINT FK_8A5F48FF8F7B22CC FOREIGN KEY (tool_id) REFERENCES tool (id);');
$this->addSql('ALTER TABLE resource_node ADD CONSTRAINT FK_8A5F48FF61220EA6 FOREIGN KEY (creator_id) REFERENCES user (id) ON DELETE CASCADE;');
$this->addSql('ALTER TABLE resource_node ADD CONSTRAINT FK_8A5F48FF727ACA70 FOREIGN KEY (parent_id) REFERENCES resource_node (id) ON DELETE CASCADE;');
$this->addSql('ALTER TABLE resource_rights ADD CONSTRAINT FK_C99C3BF9F004E599 FOREIGN KEY (resource_link_id) REFERENCES resource_link (id);');
$this->addSql('ALTER TABLE resource_link ADD CONSTRAINT FK_398C394B1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id);');
$this->addSql('ALTER TABLE resource_link ADD CONSTRAINT FK_398C394B613FECDF FOREIGN KEY (session_id) REFERENCES session (id);');
$this->addSql('ALTER TABLE resource_link ADD CONSTRAINT FK_398C394BA76ED395 FOREIGN KEY (user_id) REFERENCES user (id);');
$this->addSql('ALTER TABLE resource_link ADD CONSTRAINT FK_398C394B91D79BD3 FOREIGN KEY (c_id) REFERENCES course (id);');
$this->addSql('ALTER TABLE resource_link ADD CONSTRAINT FK_398C394BFE54D947 FOREIGN KEY (group_id) REFERENCES c_group_info (iid);');
$this->addSql('ALTER TABLE resource_link ADD CONSTRAINT FK_398C394BD2112630 FOREIGN KEY (usergroup_id) REFERENCES usergroup (id);');
$this->addSql('ALTER TABLE tool_resource_rights ADD CONSTRAINT FK_95CE3398F7B22CC FOREIGN KEY (tool_id) REFERENCES tool (id);');
$this->addSql('CREATE TABLE resource_type (id INT AUTO_INCREMENT NOT NULL, tool_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_83FEF7938F7B22CC (tool_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC');
$this->addSql('CREATE TABLE resource_right (id INT AUTO_INCREMENT NOT NULL, resource_link_id INT DEFAULT NULL, role VARCHAR(255) NOT NULL, mask INT NOT NULL, UNIQUE INDEX UNIQ_C99C3BF9F004E599 (resource_link_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC');
$this->addSql('CREATE TABLE resource_link (id INT AUTO_INCREMENT NOT NULL, resource_node_id INT DEFAULT NULL, session_id INT DEFAULT NULL, user_id INT DEFAULT NULL, c_id INT DEFAULT NULL, group_id INT DEFAULT NULL, usergroup_id INT DEFAULT NULL, private TINYINT(1) DEFAULT NULL, public TINYINT(1) DEFAULT NULL, start_visibility_at DATETIME DEFAULT NULL, end_visibility_at DATETIME DEFAULT NULL, INDEX IDX_398C394B1BAD783F (resource_node_id), INDEX IDX_398C394B613FECDF (session_id), INDEX IDX_398C394BA76ED395 (user_id), INDEX IDX_398C394B91D79BD3 (c_id), INDEX IDX_398C394BFE54D947 (group_id), INDEX IDX_398C394BD2112630 (usergroup_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC');
$this->addSql('CREATE TABLE resource_node (id INT AUTO_INCREMENT NOT NULL, resource_type_id INT DEFAULT NULL, creator_id INT NOT NULL, parent_id INT DEFAULT NULL, resource_file_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, level INT DEFAULT NULL, path VARCHAR(3000) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_8A5F48FF98EC6B7B (resource_type_id), INDEX IDX_8A5F48FF61220EA6 (creator_id), INDEX IDX_8A5F48FF727ACA70 (parent_id), UNIQUE INDEX UNIQ_8A5F48FFCE6B9E84 (resource_file_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC');
$this->addSql('CREATE TABLE resource_file (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, hash VARCHAR(255) NOT NULL, original_filename VARCHAR(255) NOT NULL, size VARCHAR(255) NOT NULL, width VARCHAR(255) DEFAULT NULL, height VARCHAR(255) DEFAULT NULL, copyright VARCHAR(255) DEFAULT NULL, contentType VARCHAR(255) DEFAULT NULL, extension VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC');
$this->addSql('CREATE TABLE c_document (iid INT AUTO_INCREMENT NOT NULL, c_id INT DEFAULT NULL, session_id INT DEFAULT NULL, resource_node_id INT DEFAULT NULL, id INT DEFAULT NULL, path VARCHAR(255) NOT NULL, comment LONGTEXT DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, filetype VARCHAR(10) NOT NULL, size INT NOT NULL, readonly TINYINT(1) NOT NULL, INDEX IDX_C9FA0CBD613FECDF (session_id), UNIQUE INDEX UNIQ_C9FA0CBD1BAD783F (resource_node_id), INDEX course (c_id), PRIMARY KEY(iid)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC');
$this->addSql('ALTER TABLE resource_type ADD CONSTRAINT FK_83FEF7938F7B22CC FOREIGN KEY (tool_id) REFERENCES tool (id)');
$this->addSql('ALTER TABLE resource_right ADD CONSTRAINT FK_C99C3BF9F004E599 FOREIGN KEY (resource_link_id) REFERENCES resource_link (id)');
$this->addSql('ALTER TABLE resource_link ADD CONSTRAINT FK_398C394B1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id)');
$this->addSql('ALTER TABLE resource_link ADD CONSTRAINT FK_398C394B613FECDF FOREIGN KEY (session_id) REFERENCES session (id)');
$this->addSql('ALTER TABLE resource_link ADD CONSTRAINT FK_398C394BA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE resource_link ADD CONSTRAINT FK_398C394B91D79BD3 FOREIGN KEY (c_id) REFERENCES course (id)');
$this->addSql('ALTER TABLE resource_link ADD CONSTRAINT FK_398C394BFE54D947 FOREIGN KEY (group_id) REFERENCES c_group_info (iid)');
$this->addSql('ALTER TABLE resource_link ADD CONSTRAINT FK_398C394BD2112630 FOREIGN KEY (usergroup_id) REFERENCES usergroup (id)');
$this->addSql('ALTER TABLE resource_node ADD CONSTRAINT FK_8A5F48FF98EC6B7B FOREIGN KEY (resource_type_id) REFERENCES resource_type (id)');
$this->addSql('ALTER TABLE resource_node ADD CONSTRAINT FK_8A5F48FF61220EA6 FOREIGN KEY (creator_id) REFERENCES user (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE resource_node ADD CONSTRAINT FK_8A5F48FF727ACA70 FOREIGN KEY (parent_id) REFERENCES resource_node (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE resource_node ADD CONSTRAINT FK_8A5F48FFCE6B9E84 FOREIGN KEY (resource_file_id) REFERENCES resource_file (id)');
// From configuration.dist.php 1.11.x
$this->addSql('ALTER TABLE c_dropbox_file CHANGE filename filename VARCHAR(190) NOT NULL');

@ -7,7 +7,7 @@ use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
use Chamilo\CoreBundle\Entity\Resource\ResourceLink;
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
use Chamilo\CoreBundle\Entity\Resource\ResourceRights;
use Chamilo\CoreBundle\Entity\Resource\ResourceRight;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\Tool;
use Chamilo\CoreBundle\Entity\Usergroup;
@ -76,12 +76,12 @@ class ResourceRepository extends EntityRepository
}
/**
* @param ResourceNode $resourceNode
* @param ResourceRights $right
* @param ResourceNode $resourceNode
* @param ResourceRight $right
*
* @return ResourceLink
*/
public function addResourceToEveryone(ResourceNode $resourceNode, ResourceRights $right): ResourceLink
public function addResourceToEveryone(ResourceNode $resourceNode, ResourceRight $right): ResourceLink
{
$resourceLink = new ResourceLink();
$resourceLink
@ -96,13 +96,13 @@ class ResourceRepository extends EntityRepository
}
/**
* @param ResourceNode $resourceNode
* @param Course $course
* @param ResourceRights $right
* @param ResourceNode $resourceNode
* @param Course $course
* @param ResourceRight $right
*
* @return ResourceLink
*/
public function addResourceToCourse(ResourceNode $resourceNode, Course $course, ResourceRights $right): ResourceLink
public function addResourceToCourse(ResourceNode $resourceNode, Course $course, ResourceRight $right): ResourceLink
{
$resourceLink = new ResourceLink();
$resourceLink
@ -164,10 +164,10 @@ class ResourceRepository extends EntityRepository
}
/**
* @param ResourceNode $resourceNode
* @param Course $course
* @param Session $session
* @param ResourceRights $right
* @param ResourceNode $resourceNode
* @param Course $course
* @param Session $session
* @param ResourceRight $right
*
* @return ResourceLink
*/
@ -175,7 +175,7 @@ class ResourceRepository extends EntityRepository
ResourceNode $resourceNode,
Course $course,
Session $session,
ResourceRights $right
ResourceRight $right
) {
$resourceLink = $this->addResourceToCourse(
$resourceNode,
@ -189,10 +189,10 @@ class ResourceRepository extends EntityRepository
}
/**
* @param ResourceNode $resourceNode
* @param Course $course
* @param CGroupInfo $group
* @param ResourceRights $right
* @param ResourceNode $resourceNode
* @param Course $course
* @param CGroupInfo $group
* @param ResourceRight $right
*
* @return ResourceLink
*/
@ -200,7 +200,7 @@ class ResourceRepository extends EntityRepository
ResourceNode $resourceNode,
Course $course,
CGroupInfo $group,
ResourceRights $right
ResourceRight $right
) {
$resourceLink = $this->addResourceToCourse(
$resourceNode,
@ -214,16 +214,16 @@ class ResourceRepository extends EntityRepository
}
/**
* @param ResourceNode $resourceNode
* @param Usergroup $group
* @param ResourceRights $right
* @param ResourceNode $resourceNode
* @param Usergroup $group
* @param ResourceRight $right
*
* @return ResourceLink
*/
public function addResourceToGroup(
ResourceNode $resourceNode,
Usergroup $group,
ResourceRights $right
ResourceRight $right
) {
$resourceLink = new ResourceLink();
$resourceLink

@ -131,13 +131,13 @@ services:
calls:
- [setTranslationDomain, [ChamiloCoreBundle]]
sonata.admin.tool_resource_rights:
class: Chamilo\CoreBundle\Admin\ToolResourceRightsAdmin
sonata.admin.tool_resource_right:
class: Chamilo\CoreBundle\Admin\ToolResourceRightAdmin
tags:
- {name: sonata.admin, manager_type: orm, group: "LMS", label: "ToolResourceRights"}
- {name: sonata.admin, manager_type: orm, group: "LMS", label: "ToolResourceRight"}
arguments:
- ~
- Chamilo\CoreBundle\Entity\ToolResourceRights
- Chamilo\CoreBundle\Entity\ToolResourceRight
- ~
calls:
- [setTranslationDomain, [ChamiloCoreBundle]]

@ -269,7 +269,7 @@ services:
chamilo_core.settings.certificate:
class: Chamilo\CoreBundle\Settings\CertificateSettingsSchema
tags:
- {name: sylius.settings_schema, alias: chamilo_core.settings.certificate, namespace: certificate}
- {name: sylius.settings_schema, alias: chamilo_core.settings.certificate, namespace: certificate}
chamilo_core.settings.chat:
class: Chamilo\CoreBundle\Settings\ChatSettingsSchema
@ -339,10 +339,10 @@ services:
tags:
- {name: sylius.settings_schema, alias: chamilo_core.settings.language, namespace: language}
chamilo_core.settings.learning_path:
chamilo_core.settings.lp:
class: Chamilo\CoreBundle\Settings\LearningPathSettingsSchema
tags:
- {name: sylius.settings_schema, alias: chamilo_core.settings.language, namespace: lp}
- {name: sylius.settings_schema, alias: chamilo_core.settings.lp, namespace: lp}
chamilo_core.settings.mail:
class: Chamilo\CoreBundle\Settings\MailSettingsSchema

@ -66,6 +66,7 @@ class ResourceNodeVoter extends Voter
{
$builder = new MaskBuilder();
$builder
->add(self::VIEW)
->add(self::EDIT)
;
@ -193,7 +194,7 @@ class ResourceNodeVoter extends Voter
$rights = $rightFromResourceLink;
} else {
// Taken the rights from the default tool
$rights = $link->getResourceNode()->getTool()->getToolResourceRights();
$rights = $link->getResourceNode()->getTool()->getToolResourceRight();
}
// Asked mask

@ -23,7 +23,7 @@ class AnnouncementSettingsSchema extends AbstractSettingsSchema
->setDefaults(
[
'hide_global_announcements_when_not_connected' => 'false',
'hide_send_to_hrm_users' => 'true'
'hide_send_to_hrm_users' => 'true',
]
);

@ -23,7 +23,7 @@ class CertificateSettingsSchema extends AbstractSettingsSchema
->setDefaults(
[
'hide_my_certificate_link' => 'false',
'hide_header_footer' => 'false'
'hide_header_footer' => 'false',
]
);

@ -52,7 +52,7 @@ class DisplaySettingsSchema extends AbstractSettingsSchema
'hide_logout_button' => 'false',
'show_link_ticket_notification' => 'false',
'icons_mode_svg' => 'false',
'default_template' => 'default'
'default_template' => 'default',
]
);

@ -23,7 +23,7 @@ class LearningPathSettingsSchema extends AbstractSettingsSchema
->setDefaults(
[
'fixed_encoding' => 'false',
'show_invisible_exercise_in_lp_toc' => 'false'
'show_invisible_exercise_in_lp_toc' => 'false',
]
);

@ -46,7 +46,7 @@ class SessionSettingsSchema extends AbstractSettingsSchema
'session_days_before_coach_access' => '',
'show_session_description' => 'false',
'remove_session_url' => 'false',
'hide_tab_list' => ''
'hide_tab_list' => '',
]
)
;

@ -11,7 +11,6 @@ use Sonata\CoreBundle\Model\BaseEntityManager;
class AnnouncementManager extends BaseEntityManager
{
/**
* @param User $user
* @param Course $course
@ -25,8 +24,9 @@ class AnnouncementManager extends BaseEntityManager
* @param string $titleToSearch
* @param User|null $userToSearch
*
* @return mixed
* @throws \Doctrine\ORM\NonUniqueResultException
*
* @return mixed
*/
public function getAnnouncements(
User $user,

@ -5,7 +5,7 @@ namespace Chamilo\CourseBundle;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Tool;
use Chamilo\CoreBundle\Entity\ToolResourceRights;
use Chamilo\CoreBundle\Entity\ToolResourceRight;
use Chamilo\CoreBundle\Security\Authorization\Voter\ResourceNodeVoter;
use Chamilo\CourseBundle\Entity\CTool;
use Chamilo\CourseBundle\Tool\BaseTool;
@ -98,20 +98,20 @@ class ToolChain
*/
public function setToolPermissions(Tool $tool)
{
$toolResourceRight = new ToolResourceRights();
$toolResourceRight = new ToolResourceRight();
$toolResourceRight
->setRole('ROLE_TEACHER')
->setMask(ResourceNodeVoter::getEditorMask())
;
$toolResourceRightReader = new ToolResourceRights();
$toolResourceRightReader = new ToolResourceRight();
$toolResourceRightReader
->setRole('ROLE_STUDENT')
->setMask(ResourceNodeVoter::getReaderMask())
;
$tool->addToolResourceRights($toolResourceRight);
$tool->addToolResourceRights($toolResourceRightReader);
$tool->addToolResourceRight($toolResourceRight);
$tool->addToolResourceRight($toolResourceRightReader);
}
/**

@ -104,7 +104,7 @@ class Kernel extends BaseKernel
*/
public function getConfigurationFile()
{
return $this->getRealRootDir().'app/config/configuration.php';
return $this->getRealRootDir().'config/configuration.php';
}
/**

Loading…
Cancel
Save