diff --git a/main/inc/ajax/lang.ajax.php b/main/inc/ajax/lang.ajax.php index 093cfbafc4..327b4edd07 100644 --- a/main/inc/ajax/lang.ajax.php +++ b/main/inc/ajax/lang.ajax.php @@ -17,9 +17,7 @@ switch ($action) { echo api_get_language_translate_html(); break; case 'translate_portfolio_category': - if (isset($_REQUEST['new_language']) && isset($_REQUEST['variable_language']) && isset($_REQUEST['category_id'])) { - $newLanguage = Security::remove_XSS($_REQUEST['new_language']); $langVariable = Security::remove_XSS($_REQUEST['variable_language']); $categoryId = (int) $_REQUEST['category_id']; diff --git a/main/inc/lib/PortfolioController.php b/main/inc/lib/PortfolioController.php index 9c2a7abf25..669ad08f85 100644 --- a/main/inc/lib/PortfolioController.php +++ b/main/inc/lib/PortfolioController.php @@ -57,7 +57,6 @@ class PortfolioController } /** - * * @throws \Doctrine\ORM\ORMException * @throws \Doctrine\ORM\OptimisticLockException */ @@ -484,7 +483,7 @@ class PortfolioController $parentCategories = $this->getCategoriesForIndex(null, 0); foreach ($parentCategories as $parentCategory) { $categoriesSelect->addOption($parentCategory->getTitle(), $parentCategory->getId()); - $subCategories = $this->getCategoriesForIndex(null, $parentCategory->getId()); + $subCategories = $this->getCategoriesForIndex(null, $parentCategory->getId()); if (count($subCategories) > 0) { foreach ($subCategories as $subCategory) { $categoriesSelect->addOption(' — '.$subCategory->getTitle(), $subCategory->getId()); @@ -2919,7 +2918,7 @@ class PortfolioController } /** - * It parsers a title for a variable in lang + * It parsers a title for a variable in lang. * * @param $defaultDisplayText * @return string @@ -2934,7 +2933,7 @@ class PortfolioController } /** - * It translates the text as parameter + * It translates the text as parameter. * * @param $defaultDisplayText * @return mixed diff --git a/main/portfolio/index.php b/main/portfolio/index.php index e8be2ca8c1..f85d9e6d41 100755 --- a/main/portfolio/index.php +++ b/main/portfolio/index.php @@ -23,7 +23,7 @@ $httpRequest = HttpRequest::createFromGlobals(); $action = $httpRequest->query->get('action', 'list'); // It validates the management of categories will be only for admins -if (in_array($action , ['list_categories', 'add_category', 'edit_category']) && !api_is_platform_admin()) { +if (in_array($action, ['list_categories', 'add_category', 'edit_category']) && !api_is_platform_admin()) { api_not_allowed(true); } diff --git a/src/Chamilo/CoreBundle/Entity/PortfolioCategory.php b/src/Chamilo/CoreBundle/Entity/PortfolioCategory.php index cb35e272c1..100b0f32f6 100644 --- a/src/Chamilo/CoreBundle/Entity/PortfolioCategory.php +++ b/src/Chamilo/CoreBundle/Entity/PortfolioCategory.php @@ -217,7 +217,11 @@ class PortfolioCategory } /** + * Set parent id + * * @param int $parentId + * + * @return PortfolioCategory */ public function setParentId(int $parentId) {