Internal - Format code, fix breadcrumb, fix variables.

pull/3543/head
Julio Montoya 5 years ago
parent bfc3eeee11
commit 619d0b8b52
  1. 8
      public/main/admin/index.php
  2. 10
      public/main/forum/forumfunction.inc.php
  3. 1
      public/main/forum/forumqualify.php
  4. 2
      public/main/inc/lib/agenda.lib.php
  5. 8
      public/main/inc/lib/display.lib.php
  6. 14
      public/main/inc/lib/template.lib.php
  7. 5
      src/CoreBundle/Controller/CourseHomeController.php
  8. 15
      src/CoreBundle/Entity/Session.php

@ -70,9 +70,9 @@ if (api_is_platform_admin()) {
$items = [ $items = [
['url' => 'user_list.php', 'label' => get_lang('User list')], ['url' => 'user_list.php', 'label' => get_lang('User list')],
['url' => 'user_add.php', 'label' => get_lang('Add a user')], ['url' => 'user_add.php', 'label' => get_lang('Add a user')],
['url' => 'user_export.php', 'label' => get_lang('ExportUser listXMLCSV')], ['url' => 'user_export.php', 'label' => get_lang('Export users list')],
['url' => 'user_import.php', 'label' => get_lang('ImportUser listXMLCSV')], ['url' => 'user_import.php', 'label' => get_lang('Import users list')],
['url' => 'user_update_import.php', 'label' => get_lang('EditUser listCSV')], ['url' => 'user_update_import.php', 'label' => get_lang('Edit users list')],
]; ];
if (isset($extAuthSource) && isset($extAuthSource['extldap']) && count($extAuthSource['extldap']) > 0) { if (isset($extAuthSource) && isset($extAuthSource['extldap']) && count($extAuthSource['extldap']) > 0) {
@ -90,7 +90,7 @@ if (api_is_platform_admin()) {
$items = [ $items = [
['url' => 'user_list.php', 'label' => get_lang('User list')], ['url' => 'user_list.php', 'label' => get_lang('User list')],
['url' => 'user_add.php', 'label' => get_lang('Add a user')], ['url' => 'user_add.php', 'label' => get_lang('Add a user')],
['url' => 'user_import.php', 'label' => get_lang('ImportUser listXMLCSV')], ['url' => 'user_import.php', 'label' => get_lang('Import users list')],
['url' => 'usergroups.php', 'label' => get_lang('Classes')], ['url' => 'usergroups.php', 'label' => get_lang('Classes')],
]; ];

@ -3230,6 +3230,7 @@ function saveThreadScore(
$sql = "INSERT INTO $table_threads_qualify (c_id, user_id, thread_id,qualify,qualify_user_id,qualify_time,session_id) $sql = "INSERT INTO $table_threads_qualify (c_id, user_id, thread_id,qualify,qualify_user_id,qualify_time,session_id)
VALUES (".$course_id.", '".$user_id."','".$thread_id."',".(float) $thread_qualify.", '".$currentUserId."','".$qualify_time."','".$session_id."')"; VALUES (".$course_id.", '".$user_id."','".$thread_id."',".(float) $thread_qualify.", '".$currentUserId."','".$qualify_time."','".$session_id."')";
Database::query($sql); Database::query($sql);
return 'insert'; return 'insert';
} else { } else {
saveThreadScoreHistory( saveThreadScoreHistory(
@ -6388,8 +6389,6 @@ function postIsEditableByStudent($forum, $post)
} }
/** /**
* @param CForumPost $post
*
* @return bool * @return bool
*/ */
function savePostRevision(CForumPost $post) function savePostRevision(CForumPost $post)
@ -6454,7 +6453,6 @@ function postNeedsRevision(CForumPost $post): bool
} }
/** /**
* @param CForumPost $post
* @param array $threadInfo * @param array $threadInfo
* *
* @return string * @return string
@ -6590,9 +6588,8 @@ function getReportRecipients()
} }
/** /**
* @param CForumPost $post * @param array $forumInfo
* @param array $forumInfo * @param array $threadInfo
* @param array $threadInfo
* *
* @return bool * @return bool
*/ */
@ -6628,5 +6625,4 @@ function reportPost(CForumPost $post, $forumInfo, $threadInfo)
MessageManager::send_message_simple($userId, $subject, $content); MessageManager::send_message_simple($userId, $subject, $content);
} }
} }
} }

@ -9,7 +9,6 @@ use Chamilo\CourseBundle\Entity\CForumThread;
/** /**
* @todo fix all this qualify files avoid including files, use classes POO jmontoya * @todo fix all this qualify files avoid including files, use classes POO jmontoya
*/ */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
require_once 'forumfunction.inc.php'; require_once 'forumfunction.inc.php';

@ -2940,7 +2940,7 @@ class Agenda
/** /**
* This function delete a attachment file by id. * This function delete a attachment file by id.
* *
* @param int $attachmentId * @param int $attachmentId
* *
* @return string * @return string
*/ */

@ -125,9 +125,15 @@ class Display
$courseInfo = api_get_course_info(); $courseInfo = api_get_course_info();
if (!empty($courseInfo)) { if (!empty($courseInfo)) {
$url = $courseInfo['course_public_url'];
$sessionId = api_get_session_id();
if (!empty($sessionId)) {
$url.= '&sid='.$sessionId;
}
array_unshift( array_unshift(
$interbreadcrumb, $interbreadcrumb,
['name' => $courseInfo['title'], 'url' => $courseInfo['course_public_url']] ['name' => $courseInfo['title'], 'url' => $url]
); );
} }

@ -1104,6 +1104,20 @@ class Template
{ {
// Set legacy breadcrumb // Set legacy breadcrumb
global $interbreadcrumb; global $interbreadcrumb;
$courseInfo = api_get_course_info();
if (!empty($courseInfo)) {
$url = $courseInfo['course_public_url'];
$sessionId = api_get_session_id();
if (!empty($sessionId)) {
$url.= '&sid='.$sessionId;
}
array_unshift(
$interbreadcrumb,
['name' => $courseInfo['title'], 'url' => $url]
);
}
$this->params['legacy_breadcrumb'] = $interbreadcrumb; $this->params['legacy_breadcrumb'] = $interbreadcrumb;
global $htmlHeadXtra; global $htmlHeadXtra;

@ -114,10 +114,7 @@ class CourseHomeController extends ToolBaseController
$qb = $toolRepository->getResourcesByCourse($course, $this->getSession()); $qb = $toolRepository->getResourcesByCourse($course, $this->getSession());
$qb->addSelect('tool'); $qb->addSelect('tool');
$qb->innerJoin( $qb->innerJoin('resource.tool', 'tool');
'resource.tool',
'tool'
);
$result = $qb->getQuery()->getResult(); $result = $qb->getQuery()->getResult();
$tools = []; $tools = [];
/** @var CTool $item */ /** @var CTool $item */

@ -60,14 +60,13 @@ class Session
protected $id; protected $id;
/** /**
* @ORM\OneToMany( * @var ArrayCollection|SkillRelCourse[]
* targetEntity="SkillRelCourse", mappedBy="session", cascade={"persist", "remove"} * @ORM\OneToMany(targetEntity="SkillRelCourse", mappedBy="session", cascade={"persist", "remove"})
* )
*/ */
protected $skills; protected $skills;
/** /**
* @var ArrayCollection * @var ArrayCollection|SessionRelCourse[]
* *
* @ORM\OrderBy({"position" = "ASC"}) * @ORM\OrderBy({"position" = "ASC"})
* @ORM\OneToMany(targetEntity="SessionRelCourse", mappedBy="session", cascade={"persist"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="SessionRelCourse", mappedBy="session", cascade={"persist"}, orphanRemoval=true)
@ -75,7 +74,7 @@ class Session
protected $courses; protected $courses;
/** /**
* @var ArrayCollection * @var ArrayCollection|SessionRelUser[]
* *
* @ORM\OneToMany(targetEntity="SessionRelUser", mappedBy="session", cascade={"persist"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="SessionRelUser", mappedBy="session", cascade={"persist"}, orphanRemoval=true)
*/ */
@ -99,11 +98,15 @@ class Session
protected $currentCourse; protected $currentCourse;
/** /**
* @var ArrayCollection|SkillRelUser[]
*
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SkillRelUser", mappedBy="session", cascade={"persist"}) * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SkillRelUser", mappedBy="session", cascade={"persist"})
*/ */
protected $issuedSkills; protected $issuedSkills;
/** /**
* @var ArrayCollection|AccessUrlRelSession[]
*
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity="Chamilo\CoreBundle\Entity\AccessUrlRelSession", * targetEntity="Chamilo\CoreBundle\Entity\AccessUrlRelSession",
* mappedBy="session", * mappedBy="session",
@ -113,6 +116,8 @@ class Session
protected $urls; protected $urls;
/** /**
* @var ArrayCollection|ResourceLink[]
*
* @ORM\OneToMany(targetEntity="ResourceLink", mappedBy="session", cascade={"remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="ResourceLink", mappedBy="session", cascade={"remove"}, orphanRemoval=true)
*/ */
protected $resourceLinks; protected $resourceLinks;

Loading…
Cancel
Save