Minor - format code.

pull/2487/head
jmontoyaa 8 years ago
parent 33d0c2b884
commit fd62ba7211
  1. 10
      main/inc/lib/sessionmanager.lib.php
  2. 21
      main/session/resume_session.php

@ -8668,16 +8668,16 @@ class SessionManager
INNER JOIN ChamiloCoreBundle:SessionRelUser su INNER JOIN ChamiloCoreBundle:SessionRelUser su
WITH scu.user = su.user WITH scu.user = su.user
AND scu.session = su.session AND scu.session = su.session
WHERE scu.course = :course WHERE
AND su.relationType != :rrhh scu.course = :course AND
AND scu.session = :session su.relationType <> :relationType AND
scu.session = :session
") ")
->setParameters([ ->setParameters([
'course' => $course->getId(), 'course' => $course->getId(),
'rrhh' => SESSION_RELATION_TYPE_RRHH, 'relationType' => SESSION_RELATION_TYPE_RRHH,
'session' => $session->getId() 'session' => $session->getId()
]) ])
->getSingleScalarResult(); ->getSingleScalarResult();
} }
} }

@ -163,19 +163,21 @@ if ($sessionInfo['nbr_courses'] == 0) {
foreach ($courses as $course) { foreach ($courses as $course) {
// Select the number of users // Select the number of users
$numberOfUsers = SessionManager::getCountUsersInCourseSession($course, $session); $numberOfUsers = SessionManager::getCountUsersInCourseSession(
$course,
$session
);
// Get coachs of the courses in session // Get coachs of the courses in session
$namesOfCoaches = []; $namesOfCoaches = [];
$coachSubscriptions = $session $coachSubscriptions = $session
->getUserCourseSubscriptionsByStatus($course, Session::COACH) ->getUserCourseSubscriptionsByStatus($course, Session::COACH)
->forAll(function($index, SessionRelCourseRelUser $subscription) use (&$namesOfCoaches) { ->forAll(function ($index, SessionRelCourseRelUser $subscription) use (&$namesOfCoaches) {
$namesOfCoaches[] = $subscription->getUser()->getCompleteNameWithUserName(); $namesOfCoaches[] = $subscription->getUser()->getCompleteNameWithUserName();
return true; return true;
}); });
$orderButtons = ''; $orderButtons = '';
if (SessionManager::orderCourseIsEnabled()) { if (SessionManager::orderCourseIsEnabled()) {
$orderButtons = Display::url( $orderButtons = Display::url(
Display::return_icon( Display::return_icon(
@ -202,14 +204,15 @@ if ($sessionInfo['nbr_courses'] == 0) {
// hide_course_breadcrumb the parameter has been added to hide the name // hide_course_breadcrumb the parameter has been added to hide the name
// of the course, that appeared in the default $interbreadcrumb // of the course, that appeared in the default $interbreadcrumb
$courseItem .= ' $courseItem .= '<tr>
<tr> <td class="title">'.
<td class="title">'.Display::url( Display::url(
$course->getTitle().' ('.$course->getVisualCode().')', $course->getTitle().' ('.$course->getVisualCode().')',
$courseUrl $courseUrl
).'</td> ).'</td>';
<td>'.($namesOfCoaches ? implode('<br>', $namesOfCoaches) : get_lang('None')).'</td> $courseItem .= '<td>'.($namesOfCoaches ? implode('<br>', $namesOfCoaches) : get_lang('None')).'</td>';
<td>'.$numberOfUsers.'</td> $courseItem .= '<td>'.$numberOfUsers.'</td>';
$courseItem .= '
<td> <td>
<a href="'. $courseUrl.'">'. <a href="'. $courseUrl.'">'.
Display::return_icon('course_home.gif', get_lang('Course')).'</a> Display::return_icon('course_home.gif', get_lang('Course')).'</a>

Loading…
Cancel
Save