diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index ddf90f9d43..b10854e860 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -4,11 +4,11 @@ use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\ExtraField as EntityExtraField; use Chamilo\CoreBundle\Framework\Container; +use Chamilo\CoreBundle\ToolChain; use Chamilo\CoreBundle\Hook\HookCreateCourse; use Chamilo\CourseBundle\Component\CourseCopy\CourseBuilder; use Chamilo\CourseBundle\Component\CourseCopy\CourseRestorer; use Chamilo\CourseBundle\Manager\SettingsManager; -use Chamilo\CoreBundle\ToolChain; use ChamiloSession as Session; /** diff --git a/main/inc/lib/usermanager.lib.php b/main/inc/lib/usermanager.lib.php index ccff856ae1..8db2b921e2 100755 --- a/main/inc/lib/usermanager.lib.php +++ b/main/inc/lib/usermanager.lib.php @@ -7,7 +7,6 @@ use Chamilo\CoreBundle\Entity\SkillRelUserComment; use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Hook\HookCreateUser; use Chamilo\CoreBundle\Hook\HookUpdateUser; -use Chamilo\CoreBundle\Repository\AccessUrlRepository; use Chamilo\UserBundle\Entity\User; use Chamilo\UserBundle\Repository\UserRepository; use ChamiloSession as Session; @@ -18,8 +17,6 @@ use ChamiloSession as Session; * This library provides functions for user management. * Include/require it in your code to use its functionality. * - * @package chamilo.library - * * @author Julio Montoya Social network groups added 2009/12 */ class UserManager diff --git a/main/webservices/access_url.php b/main/webservices/access_url.php index 0bbfc7ce48..a40b11ba4d 100644 --- a/main/webservices/access_url.php +++ b/main/webservices/access_url.php @@ -1,10 +1,6 @@ - * - * @package chamilo.plugin.advanced_subscription - */ - use Chamilo\CoreBundle\Hook\HookObserver; use Chamilo\CoreBundle\Hook\Interfaces\HookAdminBlockEventInterface; use Chamilo\CoreBundle\Hook\Interfaces\HookAdminBlockObserverInterface; @@ -18,6 +10,12 @@ use Chamilo\CoreBundle\Hook\Interfaces\HookNotificationTitleEventInterface; use Chamilo\CoreBundle\Hook\Interfaces\HookWSRegistrationEventInterface; use Chamilo\CoreBundle\Hook\Interfaces\HookWSRegistrationObserverInterface; +/** + * Hook Observer for Advanced subscription plugin. + * + * @author Daniel Alejandro Barreto Alva + */ + require_once __DIR__.'/../config.php'; /** diff --git a/plugin/advanced_subscription/test/ws_session_user.php b/plugin/advanced_subscription/test/ws_session_user.php index 222e5b19f5..4a66a41285 100644 --- a/plugin/advanced_subscription/test/ws_session_user.php +++ b/plugin/advanced_subscription/test/ws_session_user.php @@ -1,16 +1,13 @@ getUsers()->count()) { $criteria = Criteria::create()->where( @@ -1358,7 +1358,7 @@ class Course extends AbstractResource implements ResourceInterface * @param string $role * @param string $status */ - protected function addUser(User $user, $relationType, $role, $status) + public function addUser(User $user, $relationType, $role, $status) { $courseRelUser = new CourseRelUser(); $courseRelUser->setCourse($this); diff --git a/src/CoreBundle/Entity/Manager/SequenceResourceManager.php b/src/CoreBundle/Entity/Manager/SequenceResourceManager.php index 99ac9ac581..d22b85ade8 100644 --- a/src/CoreBundle/Entity/Manager/SequenceResourceManager.php +++ b/src/CoreBundle/Entity/Manager/SequenceResourceManager.php @@ -8,7 +8,6 @@ use Sonata\CoreBundle\Model\BaseEntityManager; /** * Class SequenceResourceManager * CRUD for the course. - * */ class SequenceResourceManager extends BaseEntityManager { diff --git a/src/CoreBundle/Entity/Resource/ResourceFile.php b/src/CoreBundle/Entity/Resource/ResourceFile.php index 08de5b7bee..3641b0c35f 100644 --- a/src/CoreBundle/Entity/Resource/ResourceFile.php +++ b/src/CoreBundle/Entity/Resource/ResourceFile.php @@ -88,7 +88,6 @@ class ResourceFile protected $dimensions; /** - * * @var int * * @Assert\NotBlank() diff --git a/src/CoreBundle/Framework/Container.php b/src/CoreBundle/Framework/Container.php index 4356ac8ee7..54e8ab5dd6 100644 --- a/src/CoreBundle/Framework/Container.php +++ b/src/CoreBundle/Framework/Container.php @@ -9,7 +9,6 @@ use Chamilo\CoreBundle\Repository\AccessUrlRepository; use Chamilo\CoreBundle\ToolChain; use Chamilo\CourseBundle\Repository\CDocumentRepository; use Chamilo\CourseBundle\Repository\CExerciseCategoryRepository; -use Chamilo\CourseBundle\Repository\CQuizCategoryRepository; use Chamilo\CourseBundle\Repository\CQuizQuestionCategoryRepository; use Chamilo\CourseBundle\Repository\CQuizRepository; use Chamilo\PageBundle\Entity\Page; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20.php b/src/CoreBundle/Migrations/Schema/V200/Version20.php index 5b77c8ac00..f95460955e 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20.php @@ -954,6 +954,14 @@ class Version20 extends AbstractMigrationChamilo $this->addSql("ALTER TABLE c_exercise_category ADD CONSTRAINT FK_B94C157E1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id);"); $this->addSql("CREATE UNIQUE INDEX UNIQ_B94C157E1BAD783F ON c_exercise_category (resource_node_id);"); + $this->addSql("ALTER TABLE course ADD resource_node_id INT DEFAULT NULL;"); + $this->addSql("ALTER TABLE course ADD CONSTRAINT FK_169E6FB91BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id)"); + $this->addSql("CREATE UNIQUE INDEX UNIQ_169E6FB91BAD783F ON course (resource_node_id)"); + + $this->addSql("ALTER TABLE access_url ADD resource_node_id INT DEFAULT NULL"); + $this->addSql("ALTER TABLE access_url ADD CONSTRAINT FK_9436187B1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id)"); + $this->addSql("CREATE UNIQUE INDEX UNIQ_9436187B1BAD783F ON access_url (resource_node_id)"); + //course_module drop ? } diff --git a/src/CoreBundle/Resources/config/services.yml b/src/CoreBundle/Resources/config/services.yml index d16f0f9e21..fbd002fd8d 100644 --- a/src/CoreBundle/Resources/config/services.yml +++ b/src/CoreBundle/Resources/config/services.yml @@ -293,4 +293,3 @@ services: Liip\ImagineBundle\Service\FilterService: alias: 'liip_imagine.service.filter' - diff --git a/src/CoreBundle/Resources/config/settings.yml b/src/CoreBundle/Resources/config/settings.yml index e714ae3db5..e52193d0be 100644 --- a/src/CoreBundle/Resources/config/settings.yml +++ b/src/CoreBundle/Resources/config/settings.yml @@ -180,4 +180,4 @@ services: chamilo_core.settings.webservice: class: Chamilo\CoreBundle\Settings\WebServiceSettingsSchema tags: - - {name: sylius.settings_schema, alias: chamilo_core.settings.webservice, namespace: webservice} \ No newline at end of file + - {name: sylius.settings_schema, alias: chamilo_core.settings.webservice, namespace: webservice} diff --git a/src/CoreBundle/Settings/AbstractSettingsSchema.php b/src/CoreBundle/Settings/AbstractSettingsSchema.php index 1c0eafb821..4c14ae7710 100644 --- a/src/CoreBundle/Settings/AbstractSettingsSchema.php +++ b/src/CoreBundle/Settings/AbstractSettingsSchema.php @@ -3,7 +3,6 @@ namespace Chamilo\CoreBundle\Settings; -use Chamilo\CoreBundle\Entity\Manager\CourseManager; use Sylius\Bundle\SettingsBundle\Schema\AbstractSettingsBuilder; use Sylius\Bundle\SettingsBundle\Schema\SchemaInterface; diff --git a/src/CoreBundle/ToolChain.php b/src/CoreBundle/ToolChain.php index ffea046232..b0fe6b01f5 100644 --- a/src/CoreBundle/ToolChain.php +++ b/src/CoreBundle/ToolChain.php @@ -41,8 +41,7 @@ use Doctrine\Common\Persistence\ObjectManager; * 1. Create a new tool class here: src/Chamilo/CoreBundle/Tool * 2. Add the class as a service here: src/Chamilo/CoreBundle/Resources/config/tools.yml (see examples there) - * 3. Create a new course. When you create a new course the new tool will be created - * + * 3. Create a new course. When you create a new course the new tool will be created. */ class ToolChain { diff --git a/src/CourseBundle/Resources/config/services.yml b/src/CourseBundle/Resources/config/services.yml index d756cc7917..34e4eb050b 100644 --- a/src/CourseBundle/Resources/config/services.yml +++ b/src/CourseBundle/Resources/config/services.yml @@ -126,5 +126,3 @@ services: - '@chamilo_course.repository.parameter' - '@sylius.factory.settings' - '@event_dispatcher' - - diff --git a/src/FaqBundle/Entity/Category.php b/src/FaqBundle/Entity/Category.php index 9b5b99cf07..9d4b4e601d 100644 --- a/src/FaqBundle/Entity/Category.php +++ b/src/FaqBundle/Entity/Category.php @@ -5,8 +5,8 @@ namespace Chamilo\FaqBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; -use Knp\DoctrineBehaviors\Model as ORMBehaviors; use Gedmo\Timestampable\Traits\TimestampableEntity; +use Knp\DoctrineBehaviors\Model as ORMBehaviors; /** * Class Category. diff --git a/src/FaqBundle/Entity/CategoryTranslation.php b/src/FaqBundle/Entity/CategoryTranslation.php index ab7bbfc02e..f98e3e384a 100644 --- a/src/FaqBundle/Entity/CategoryTranslation.php +++ b/src/FaqBundle/Entity/CategoryTranslation.php @@ -24,7 +24,6 @@ use Knp\DoctrineBehaviors\Model as ORMBehaviors; * ) * ) * }) - * */ class CategoryTranslation { diff --git a/src/SkillBundle/Entity/SkillRelCourse.php b/src/SkillBundle/Entity/SkillRelCourse.php index 1dbfae820d..4cb392bf2c 100644 --- a/src/SkillBundle/Entity/SkillRelCourse.php +++ b/src/SkillBundle/Entity/SkillRelCourse.php @@ -7,7 +7,6 @@ use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\Skill; use Doctrine\ORM\Mapping as ORM; -use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Timestampable\Traits\TimestampableEntity; /** diff --git a/src/TicketBundle/Entity/AssignedLog.php b/src/TicketBundle/Entity/AssignedLog.php index b452ce248c..e428d05009 100644 --- a/src/TicketBundle/Entity/AssignedLog.php +++ b/src/TicketBundle/Entity/AssignedLog.php @@ -13,7 +13,6 @@ use Doctrine\ORM\Mapping as ORM; * name="ticket_assigned_log", * ) * @ORM\Entity - * */ class AssignedLog {