diff --git a/app/Resources/public/assets/multiselect-two-sides/README.md b/app/Resources/public/assets/multiselect-two-sides/README.md deleted file mode 100644 index 2781f54063..0000000000 --- a/app/Resources/public/assets/multiselect-two-sides/README.md +++ /dev/null @@ -1,66 +0,0 @@ -multiselect -=========== - -jQuery multiselect plugin with two sides. The user can select one or more items and send them to the other side. - -# [Demo](http://crlcu.github.com/multiselect/) - -## Requirements - -- jQuery 1.7 or higher - -## Quick start - -Several quick start options are available: - -- Clone the repo: `git clone https://github.com/crlcu/multiselect.git` or -- Install with [Bower](http://bower.io): `bower install multiselect-two-sides`. - -### Usage example - -```html -
-
- -
- -
- - - - -
- -
- -
-
-``` - -```javascript - - - - -``` - -## Bugs and feature requests - -If your problem or idea is not [addressed](https://github.com/crlcu/multiselect/issues) yet, [please open a new issue](https://github.com/crlcu/multiselect/issues/new). - -## Versioning - -For transparency into release cycle and in striving to maintain backward compatibility, multiselect is maintained under [the Semantic Versioning guidelines](http://semver.org/). - - -## License - -The multiselect plugin is open-sourced software licensed under the [the MIT license](https://github.com/crlcu/multiselect/blob/master/LICENSE). diff --git a/main/inc/lib/PortfolioController.php b/main/inc/lib/PortfolioController.php index b82234c9e0..e848ea50bd 100644 --- a/main/inc/lib/PortfolioController.php +++ b/main/inc/lib/PortfolioController.php @@ -123,49 +123,6 @@ class PortfolioController $this->renderView($content, get_lang('AddCategory'), $actions); } - /** - * @param string $content - * @param string $toolName - * @param array $actions - * @param bool $showHeader - */ - private function renderView(string $content, string $toolName, array $actions = [], $showHeader = true) - { - global $this_section; - - $this_section = $this->course ? SECTION_COURSES : SECTION_SOCIAL; - - $view = new Template($toolName); - - if ($showHeader) { - $view->assign('header', $toolName); - } - - $actionsStr = ''; - - if ($this->course) { - $actionsStr .= Display::return_introduction_section(TOOL_PORTFOLIO); - } - - if ($actions) { - $actions = implode(PHP_EOL, $actions); - - $actionsStr .= Display::toolbarAction('portfolio-toolbar', [$actions]); - } - - $view->assign('baseurl', $this->baseUrl); - $view->assign('actions', $actionsStr); - - $view->assign('content', $content); - $view->display_one_col_template(); - } - - /** - * @param \Chamilo\CoreBundle\Entity\PortfolioCategory $category - * - * @throws \Doctrine\ORM\ORMException - * @throws \Doctrine\ORM\OptimisticLockException - */ public function editCategory(PortfolioCategory $category) { global $interbreadcrumb; @@ -234,26 +191,6 @@ class PortfolioController return $this->renderView($content, get_lang('EditCategory'), $actions); } - /** - * @param \Chamilo\CoreBundle\Entity\PortfolioCategory $category - * - * @return bool - */ - private function categoryBelongToOwner(PortfolioCategory $category): bool - { - if ($category->getUser()->getId() != $this->owner->getId()) { - return false; - } - - return true; - } - - /** - * @param \Chamilo\CoreBundle\Entity\PortfolioCategory $category - * - * @throws \Doctrine\ORM\ORMException - * @throws \Doctrine\ORM\OptimisticLockException - */ public function showHideCategory(PortfolioCategory $category) { if (!$this->categoryBelongToOwner($category)) { @@ -273,12 +210,6 @@ class PortfolioController exit; } - /** - * @param \Chamilo\CoreBundle\Entity\PortfolioCategory $category - * - * @throws \Doctrine\ORM\ORMException - * @throws \Doctrine\ORM\OptimisticLockException - */ public function deleteCategory(PortfolioCategory $category) { if (!$this->categoryBelongToOwner($category)) { @@ -376,8 +307,6 @@ class PortfolioController } /** - * @param \Chamilo\CoreBundle\Entity\Portfolio $item - * * @throws \Doctrine\ORM\ORMException * @throws \Doctrine\ORM\OptimisticLockException * @throws \Doctrine\ORM\TransactionRequiredException @@ -458,30 +387,6 @@ class PortfolioController } /** - * @param \Chamilo\CoreBundle\Entity\Portfolio $item - * - * @return bool - */ - private function itemBelongToOwner(Portfolio $item): bool - { - if ($this->session && $item->getSession()->getId() != $this->session->getId()) { - return false; - } - - if ($this->course && $item->getCourse()->getId() != $this->course->getId()) { - return false; - } - - if ($item->getUser()->getId() != $this->owner->getId()) { - return false; - } - - return true; - } - - /** - * @param \Chamilo\CoreBundle\Entity\Portfolio $item - * * @throws \Doctrine\ORM\ORMException * @throws \Doctrine\ORM\OptimisticLockException */ @@ -507,8 +412,6 @@ class PortfolioController } /** - * @param \Chamilo\CoreBundle\Entity\Portfolio $item - * * @throws \Doctrine\ORM\ORMException * @throws \Doctrine\ORM\OptimisticLockException */ @@ -620,8 +523,6 @@ class PortfolioController } /** - * @param \Chamilo\CoreBundle\Entity\Portfolio $item - * * @throws \Doctrine\ORM\ORMException * @throws \Doctrine\ORM\OptimisticLockException */ @@ -681,7 +582,7 @@ class PortfolioController json_encode(['id' => $comment->getId()]) ), 'role' => 'button', - 'class' => 'btn-reply-to' + 'class' => 'btn-reply-to', ] ); $commentActions .= PHP_EOL; @@ -735,54 +636,6 @@ class PortfolioController } /** - * @param \Chamilo\CoreBundle\Entity\Portfolio $item - * - * @throws \Doctrine\ORM\ORMException - * @throws \Doctrine\ORM\OptimisticLockException - * - * @return string - */ - private function createCommentForm(Portfolio $item): string - { - $formAction = $this->baseUrl.http_build_query(['action' => 'view', 'id' => $item->getId()]); - - $form = new FormValidator('frm_comment', 'post', $formAction); - $form->addHtmlEditor('content', get_lang('Comments'), true, false, ['ToolbarSet' => 'Minimal']); - $form->addHidden('item', $item->getId()); - $form->addHidden('parent', 0); - $form->applyFilter('content', 'trim'); - $form->addButtonSave(get_lang('Save')); - - if ($form->validate()) { - $values = $form->exportValues(); - - $parentComment = $this->em->find(PortfolioComment::class, $values['parent']); - - $comment = new PortfolioComment(); - $comment - ->setAuthor($this->owner) - ->setParent($parentComment) - ->setContent($values['content']) - ->setDate(api_get_utc_datetime(null, false, true)) - ->setItem($item); - - $this->em->persist($comment); - $this->em->flush(); - - Display::addFlash( - Display::return_message(get_lang('CommentAdded'), 'success') - ); - - header("Location: $formAction"); - exit; - } - - return $form->returnForm(); - } - - /** - * @param \Chamilo\CoreBundle\Entity\Portfolio $originItem - * * @throws \Doctrine\ORM\ORMException * @throws \Doctrine\ORM\OptimisticLockException */ @@ -816,8 +669,6 @@ class PortfolioController } /** - * @param \Chamilo\CoreBundle\Entity\PortfolioComment $originComment - * * @throws \Doctrine\ORM\ORMException * @throws \Doctrine\ORM\OptimisticLockException */ @@ -849,4 +700,106 @@ class PortfolioController header("Location: $this->baseUrl"); exit; } + + /** + * @param bool $showHeader + */ + private function renderView(string $content, string $toolName, array $actions = [], $showHeader = true) + { + global $this_section; + + $this_section = $this->course ? SECTION_COURSES : SECTION_SOCIAL; + + $view = new Template($toolName); + + if ($showHeader) { + $view->assign('header', $toolName); + } + + $actionsStr = ''; + + if ($this->course) { + $actionsStr .= Display::return_introduction_section(TOOL_PORTFOLIO); + } + + if ($actions) { + $actions = implode(PHP_EOL, $actions); + + $actionsStr .= Display::toolbarAction('portfolio-toolbar', [$actions]); + } + + $view->assign('baseurl', $this->baseUrl); + $view->assign('actions', $actionsStr); + + $view->assign('content', $content); + $view->display_one_col_template(); + } + + private function categoryBelongToOwner(PortfolioCategory $category): bool + { + if ($category->getUser()->getId() != $this->owner->getId()) { + return false; + } + + return true; + } + + private function itemBelongToOwner(Portfolio $item): bool + { + if ($this->session && $item->getSession()->getId() != $this->session->getId()) { + return false; + } + + if ($this->course && $item->getCourse()->getId() != $this->course->getId()) { + return false; + } + + if ($item->getUser()->getId() != $this->owner->getId()) { + return false; + } + + return true; + } + + /** + * @throws \Doctrine\ORM\ORMException + * @throws \Doctrine\ORM\OptimisticLockException + */ + private function createCommentForm(Portfolio $item): string + { + $formAction = $this->baseUrl.http_build_query(['action' => 'view', 'id' => $item->getId()]); + + $form = new FormValidator('frm_comment', 'post', $formAction); + $form->addHtmlEditor('content', get_lang('Comments'), true, false, ['ToolbarSet' => 'Minimal']); + $form->addHidden('item', $item->getId()); + $form->addHidden('parent', 0); + $form->applyFilter('content', 'trim'); + $form->addButtonSave(get_lang('Save')); + + if ($form->validate()) { + $values = $form->exportValues(); + + $parentComment = $this->em->find(PortfolioComment::class, $values['parent']); + + $comment = new PortfolioComment(); + $comment + ->setAuthor($this->owner) + ->setParent($parentComment) + ->setContent($values['content']) + ->setDate(api_get_utc_datetime(null, false, true)) + ->setItem($item); + + $this->em->persist($comment); + $this->em->flush(); + + Display::addFlash( + Display::return_message(get_lang('CommentAdded'), 'success') + ); + + header("Location: $formAction"); + exit; + } + + return $form->returnForm(); + } } diff --git a/main/inc/lib/agenda.lib.php b/main/inc/lib/agenda.lib.php index 9b9aad49f3..a109765f51 100644 --- a/main/inc/lib/agenda.lib.php +++ b/main/inc/lib/agenda.lib.php @@ -630,8 +630,8 @@ class Agenda foreach ($generatedDates as $dateInfo) { // $start = api_get_local_time($dateInfo['start']); // $end = api_get_local_time($dateInfo['end']); -// On line 529 in function generateDatesByType there is a @todo remove comment code -// just before the part updating the date in local time so keep both synchronised + // On line 529 in function generateDatesByType there is a @todo remove comment code + // just before the part updating the date in local time so keep both synchronised $start = $dateInfo['start']; $end = $dateInfo['end']; $this->addEvent( diff --git a/main/lp/learnpath.class.php b/main/lp/learnpath.class.php index 2dd9f75b84..c089bbb103 100755 --- a/main/lp/learnpath.class.php +++ b/main/lp/learnpath.class.php @@ -7336,23 +7336,23 @@ class learnpath case 'asset': case 'sco': if (isset($_GET['view']) && $_GET['view'] == 'build') { - $return .= $this->display_manipulate($item_id, $row['item_type']); - $return .= $this->display_item_form( + $return .= $this->display_manipulate($item_id, $row['item_type']); + $return .= $this->display_item_form( $row['item_type'], get_lang('EditCurrentChapter').' :', 'edit', $item_id, $row ); - } else { - $return .= $this->display_item_form( + } else { + $return .= $this->display_item_form( $row['item_type'], get_lang('EditCurrentChapter').' :', 'edit_item', $item_id, $row ); - } + } break; case TOOL_DOCUMENT: case TOOL_READOUT_TEXT: @@ -14178,9 +14178,11 @@ EOD; * editing an item of an LP. Returns the form with the authors' setting. It must be set before the setDefault. * * @param FormValidator $form + * * @return FormValidator */ - private function getAutorLpItem($form ){ + private function getAutorLpItem($form) + { /** @var FormValidator $form */ if ($form->hasElement('extra_authorlpitem')) { /** @var HTML_QuickForm_select $author */ @@ -14205,6 +14207,7 @@ EOD; } $author->setOptions($options); } + return $form; } } diff --git a/main/portfolio/index.php b/main/portfolio/index.php index 5c8e3a0095..3fa9582e86 100755 --- a/main/portfolio/index.php +++ b/main/portfolio/index.php @@ -42,6 +42,7 @@ switch ($action) { } $controller->editCategory($category); + return; case 'hide_category': case 'show_category': @@ -54,6 +55,7 @@ switch ($action) { } $controller->showHideCategory($category); + return; case 'delete_category': $id = $httpRequest->query->getInt('id'); @@ -66,9 +68,11 @@ switch ($action) { } $controller->deleteCategory($category); + return; case 'add_item': $controller->addItem(); + return; case 'edit_item': $id = $httpRequest->query->getInt('id'); @@ -81,6 +85,7 @@ switch ($action) { } $controller->editItem($item); + return; case 'hide_item': case 'show_item': @@ -94,6 +99,7 @@ switch ($action) { } $controller->showHideItem($item); + return; case 'delete_item': $id = $httpRequest->query->getInt('id'); @@ -106,6 +112,7 @@ switch ($action) { } $controller->deleteItem($item); + return; case 'view': $id = $httpRequest->query->getInt('id'); @@ -118,6 +125,7 @@ switch ($action) { } $controller->view($item); + return; case 'copy': $type = $httpRequest->query->getAlpha('copy'); @@ -145,5 +153,6 @@ switch ($action) { case 'list': default: $controller->index(); + return; } diff --git a/plugin/xapi/src/Entity/ActivityState.php b/plugin/xapi/src/Entity/ActivityState.php index 9da86ee960..f63d03b66d 100644 --- a/plugin/xapi/src/Entity/ActivityState.php +++ b/plugin/xapi/src/Entity/ActivityState.php @@ -49,19 +49,11 @@ class ActivityState */ private $documentData; - /** - * @return int - */ public function getId(): int { return $this->id; } - /** - * @param int $id - * - * @return ActivityState - */ public function setId(int $id): ActivityState { $this->id = $id; @@ -69,19 +61,11 @@ class ActivityState return $this; } - /** - * @return string - */ public function getStateId(): string { return $this->stateId; } - /** - * @param string $stateId - * - * @return ActivityState - */ public function setStateId(string $stateId): ActivityState { $this->stateId = $stateId; @@ -89,19 +73,11 @@ class ActivityState return $this; } - /** - * @return string - */ public function getActivityId(): string { return $this->activityId; } - /** - * @param string $activityId - * - * @return ActivityState - */ public function setActivityId(string $activityId): ActivityState { $this->activityId = $activityId; @@ -109,19 +85,11 @@ class ActivityState return $this; } - /** - * @return array - */ public function getAgent(): array { return $this->agent; } - /** - * @param array $agent - * - * @return ActivityState - */ public function setAgent(array $agent): ActivityState { $this->agent = $agent; @@ -129,19 +97,11 @@ class ActivityState return $this; } - /** - * @return array - */ public function getDocumentData(): array { return $this->documentData; } - /** - * @param array $documentData - * - * @return ActivityState - */ public function setDocumentData(array $documentData): ActivityState { $this->documentData = $documentData; diff --git a/plugin/xapi/src/Lrs/ActivitiesController.php b/plugin/xapi/src/Lrs/ActivitiesController.php index 3d63ca9763..6e9ea84906 100644 --- a/plugin/xapi/src/Lrs/ActivitiesController.php +++ b/plugin/xapi/src/Lrs/ActivitiesController.php @@ -37,7 +37,7 @@ class ActivitiesController extends BaseController 'state_id = ? AND activity_id = ? AND MD5(agent) = ?' => [ Database::escape_string($stateId), Database::escape_string($activityId), - md5($requestedAgent) + md5($requestedAgent), ], ], ], @@ -91,7 +91,7 @@ class ActivitiesController extends BaseController 'state_id = ? AND activity_id = ? AND MD5(agent) = ?' => [ Database::escape_string($stateId), Database::escape_string($activityId), - md5($agent) + md5($agent), ], ], ], @@ -117,6 +117,4 @@ class ActivitiesController extends BaseController return Response::create('', Response::HTTP_NO_CONTENT); } - - } diff --git a/src/Chamilo/CoreBundle/Entity/Portfolio.php b/src/Chamilo/CoreBundle/Entity/Portfolio.php index 734b0483a3..9e3b38cce2 100644 --- a/src/Chamilo/CoreBundle/Entity/Portfolio.php +++ b/src/Chamilo/CoreBundle/Entity/Portfolio.php @@ -348,25 +348,17 @@ class Portfolio return $this; } - /** - * @return \Doctrine\Common\Collections\Collection - */ public function getComments(): Collection { return $this->comments; } - /** - * @return int|null - */ public function getOrigin(): ?int { return $this->origin; } /** - * @param int|null $origin - * * @return \Chamilo\CoreBundle\Entity\Portfolio */ public function setOrigin(?int $origin): Portfolio @@ -376,17 +368,12 @@ class Portfolio return $this; } - /** - * @return int|null - */ public function getOriginType(): ?int { return $this->originType; } /** - * @param int|null $originType - * * @return \Chamilo\CoreBundle\Entity\Portfolio */ public function setOriginType(?int $originType): Portfolio diff --git a/src/Chamilo/CoreBundle/Entity/PortfolioComment.php b/src/Chamilo/CoreBundle/Entity/PortfolioComment.php index c98a60e586..1c453a6c6d 100644 --- a/src/Chamilo/CoreBundle/Entity/PortfolioComment.php +++ b/src/Chamilo/CoreBundle/Entity/PortfolioComment.php @@ -109,27 +109,16 @@ class PortfolioComment $this->children = new ArrayCollection(); } - /** - * @return int - */ public function getId(): int { return $this->id; } - /** - * @return \Chamilo\UserBundle\Entity\User - */ public function getAuthor(): User { return $this->author; } - /** - * @param \Chamilo\UserBundle\Entity\User $author - * - * @return PortfolioComment - */ public function setAuthor(User $author): PortfolioComment { $this->author = $author; @@ -147,8 +136,6 @@ class PortfolioComment /** * @param \Chamilo\CoreBundle\Entity\Portfolio $item - * - * @return PortfolioComment */ public function setItem(Portfolio $item): PortfolioComment { @@ -157,19 +144,11 @@ class PortfolioComment return $this; } - /** - * @return string - */ public function getContent(): string { return $this->content; } - /** - * @param string $content - * - * @return PortfolioComment - */ public function setContent(string $content): PortfolioComment { $this->content = $content; @@ -177,19 +156,11 @@ class PortfolioComment return $this; } - /** - * @return \DateTime - */ public function getDate(): DateTime { return $this->date; } - /** - * @param \DateTime $date - * - * @return PortfolioComment - */ public function setDate(DateTime $date): PortfolioComment { $this->date = $date; @@ -207,8 +178,6 @@ class PortfolioComment /** * @param \Chamilo\CoreBundle\Entity\PortfolioComment|null $parent - * - * @return PortfolioComment */ public function setParent(?PortfolioComment $parent): PortfolioComment { @@ -217,19 +186,11 @@ class PortfolioComment return $this; } - /** - * @return \Doctrine\Common\Collections\ArrayCollection - */ public function getChildren(): ArrayCollection { return $this->children; } - /** - * @param \Doctrine\Common\Collections\ArrayCollection $children - * - * @return PortfolioComment - */ public function setChildren(ArrayCollection $children): PortfolioComment { $this->children = $children; diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php index 0e3501085a..701e3d20ff 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php @@ -4,7 +4,6 @@ namespace Chamilo\CourseBundle\Component\CourseCopy; use Category; -use Chamilo\CoreBundle\Entity\ExtraField; use Chamilo\CourseBundle\Component\CourseCopy\Resources\Announcement; use Chamilo\CourseBundle\Component\CourseCopy\Resources\Asset; use Chamilo\CourseBundle\Component\CourseCopy\Resources\Attendance; diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php index a46cc97d67..f13e48d808 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php @@ -4,7 +4,6 @@ namespace Chamilo\CourseBundle\Component\CourseCopy; -use Chamilo\CourseBundle\Component\CourseCopy\Resources\CourseCopyLearnpath; use Chamilo\CourseBundle\Component\CourseCopy\Resources\GradeBookBackup; use Chamilo\CourseBundle\Component\CourseCopy\Resources\LearnPathCategory; use Chamilo\CourseBundle\Component\CourseCopy\Resources\QuizQuestion; @@ -2879,7 +2878,7 @@ class CourseRestorer $params = [ 'item_id' => $new_lp_id, 'value' => $extraField['value'], - 'variable' => $extraField['variable'] + 'variable' => $extraField['variable'], ]; $extraFieldValue->save($params); }