Skip to content

Commit

Permalink
Internal: Fix forum visibility and notification issues - refs BT#21692
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbeeznest committed Jun 13, 2024
1 parent d79566b commit 7932938
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions public/main/forum/forumfunction.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1844,14 +1844,14 @@ function saveThread(
) {
$message .= get_lang('Your message has to be approved before people can view it.').'<br />';
$message .= get_lang('You can now return to the').
' <a href="viewforum.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'">'.
' <a href="viewforum.php?'.api_get_cidreq(true, true, false).'&forum='.$values['forum_id'].'">'.
get_lang('Forum').'</a><br />';
} else {
$message .= get_lang('You can now return to the').
' <a href="viewforum.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'">'.
' <a href="viewforum.php?'.api_get_cidreq(true, true, false).'&forum='.$values['forum_id'].'">'.
get_lang('Forum').'</a><br />';
$message .= get_lang('You can now return to the').
' <a href="viewthread.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'&thread='.$thread->getIid().'">'.
' <a href="viewthread.php?'.api_get_cidreq(true, true, false).'&forum='.$values['forum_id'].'&thread='.$thread->getIid().'">'.
get_lang('Message').'</a>';
}
$reply_info['new_post_id'] = $postId;
Expand Down
4 changes: 3 additions & 1 deletion public/main/inc/lib/api.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2075,7 +2075,9 @@ function api_get_cidreq($addSessionId = true, $addGroupId = true, $origin = '')

if (!empty($url)) {
$url .= '&gradebook='.(int) api_is_in_gradebook();
$url .= '&origin='.$origin;
if (false !== $origin) {
$url .= '&origin=' . $origin;
}
}

return $url;
Expand Down
3 changes: 2 additions & 1 deletion src/CourseBundle/Entity/CForum.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\ResourceShowCourseResourcesInSessionInterface;
use Chamilo\CourseBundle\Repository\CForumRepository;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
Expand All @@ -21,7 +22,7 @@
*/
#[ORM\Table(name: 'c_forum_forum')]
#[ORM\Entity(repositoryClass: CForumRepository::class)]
class CForum extends AbstractResource implements ResourceInterface, Stringable
class CForum extends AbstractResource implements ResourceInterface, ResourceShowCourseResourcesInSessionInterface, Stringable
{
#[ORM\Column(name: 'iid', type: 'integer')]
#[ORM\Id]
Expand Down
3 changes: 2 additions & 1 deletion src/CourseBundle/Entity/CForumCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\ResourceShowCourseResourcesInSessionInterface;
use Chamilo\CourseBundle\Repository\CForumCategoryRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
Expand All @@ -18,7 +19,7 @@

#[ORM\Table(name: 'c_forum_category')]
#[ORM\Entity(repositoryClass: CForumCategoryRepository::class)]
class CForumCategory extends AbstractResource implements ResourceInterface, Stringable
class CForumCategory extends AbstractResource implements ResourceInterface, ResourceShowCourseResourcesInSessionInterface, Stringable
{
#[ORM\Column(name: 'iid', type: 'integer')]
#[ORM\Id]
Expand Down
3 changes: 2 additions & 1 deletion src/CourseBundle/Entity/CForumThread.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\ResourceShowCourseResourcesInSessionInterface;
use Chamilo\CoreBundle\Entity\User;
use Chamilo\CourseBundle\Repository\CForumThreadRepository;
use DateTime;
Expand All @@ -23,7 +24,7 @@
*/
#[ORM\Table(name: 'c_forum_thread')]
#[ORM\Entity(repositoryClass: CForumThreadRepository::class)]
class CForumThread extends AbstractResource implements ResourceInterface, Stringable
class CForumThread extends AbstractResource implements ResourceInterface, ResourceShowCourseResourcesInSessionInterface, Stringable
{
#[ORM\Column(name: 'iid', type: 'integer')]
#[ORM\Id]
Expand Down

0 comments on commit 7932938

Please sign in to comment.