Internal: Flint fixes

pull/3513/head
Julio Montoya 5 years ago
parent 82c1a505ed
commit 6f3ca31e90
  1. 1
      public/main/admin/teachers_time_by_session_report.php
  2. 1
      public/main/course_home/redirect.php
  3. 2
      public/main/exercise/oral_expression.class.php
  4. 4
      public/main/forum/forumfunction.inc.php
  5. 46
      public/main/inc/lib/course.lib.php
  6. 2
      public/main/inc/lib/groupmanager.lib.php
  7. 1
      public/main/work/upload_corrections.php
  8. 10
      src/CoreBundle/Resources/views/Layout/base-layout.html.twig

@ -3,7 +3,6 @@
use Chamilo\CoreBundle\Entity\Session; use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Repository\CStudentPublicationRepository;
use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Criteria;
/** /**

@ -29,5 +29,4 @@ if (!empty($courseCode)) {
} }
} }
api_not_allowed(true); api_not_allowed(true);

@ -183,7 +183,9 @@ class OralExpression extends Question
/** /**
* Get the URL for the audio file. Return null if the file doesn't exists. * Get the URL for the audio file. Return null if the file doesn't exists.
*
* @todo fix path * @todo fix path
*
* @param bool $loadFromDatabase * @param bool $loadFromDatabase
* *
* @return string * @return string

@ -549,7 +549,6 @@ function forumForm(CForumForum $forum = null, $lp_id)
function delete_forum_image($forum_id) function delete_forum_image($forum_id)
{ {
throw new Exception('delete_forum_image'); throw new Exception('delete_forum_image');
/*$table_forums = Database::get_course_table(TABLE_FORUM); /*$table_forums = Database::get_course_table(TABLE_FORUM);
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
$forum_id = (int) $forum_id; $forum_id = (int) $forum_id;
@ -795,7 +794,6 @@ function store_forum($values, $courseInfo = [], $returnId = false)
if (isset($upload_ok)) { if (isset($upload_ok)) {
if ($has_attachment) { if ($has_attachment) {
throw new Exception('$has_attachment'); throw new Exception('$has_attachment');
/*$course_dir = $courseInfo['path'].'/upload/forum/images'; /*$course_dir = $courseInfo['path'].'/upload/forum/images';
$sys_course_path = api_get_path(SYS_COURSE_PATH); $sys_course_path = api_get_path(SYS_COURSE_PATH);
$updir = $sys_course_path.$course_dir; $updir = $sys_course_path.$course_dir;
@ -1109,7 +1107,7 @@ function delete_post($post_id)
* @param int $thread_id id of the thread we want to know the last post of * @param int $thread_id id of the thread we want to know the last post of
* *
* @return array an array or bool if there is a last post found, false if there is * @return array an array or bool if there is a last post found, false if there is
* no post entry linked to that thread => thread will be deleted * no post entry linked to that thread => thread will be deleted
* *
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* *

@ -2468,29 +2468,29 @@ class CourseManager
$groupList[$group['iid']] = $group; $groupList[$group['iid']] = $group;
} }
/* 0 != $session_id ? $session_condition = ' WHERE g.session_id IN(1,'.intval($session_id).')' : $session_condition = ' WHERE g.session_id = 0'; /* 0 != $session_id ? $session_condition = ' WHERE g.session_id IN(1,'.intval($session_id).')' : $session_condition = ' WHERE g.session_id = 0';
if (0 == $in_get_empty_group) { if (0 == $in_get_empty_group) {
// get only groups that are not empty // get only groups that are not empty
$sql = "SELECT DISTINCT g.iid, g.name $sql = "SELECT DISTINCT g.iid, g.name
FROM ".Database::get_course_table(TABLE_GROUP)." AS g FROM ".Database::get_course_table(TABLE_GROUP)." AS g
INNER JOIN ".Database::get_course_table(TABLE_GROUP_USER)." gu INNER JOIN ".Database::get_course_table(TABLE_GROUP_USER)." gu
ON (g.iid = gu.group_id) ON (g.iid = gu.group_id)
$session_condition $session_condition
ORDER BY g.name"; ORDER BY g.name";
} else { } else {
// get all groups even if they are empty // get all groups even if they are empty
$sql = "SELECT g.iid, g.name $sql = "SELECT g.iid, g.name
FROM ".Database::get_course_table(TABLE_GROUP)." AS g FROM ".Database::get_course_table(TABLE_GROUP)." AS g
$session_condition $session_condition
AND c_id = $course_id"; AND c_id = $course_id";
} }
$result = Database::query($sql); $result = Database::query($sql);
$groupList = []; $groupList = [];
while ($groupData = Database::fetch_array($result)) { while ($groupData = Database::fetch_array($result)) {
$groupData['userNb'] = GroupManager::number_of_students($groupData['iid'], $course_id); $groupData['userNb'] = GroupManager::number_of_students($groupData['iid'], $course_id);
$groupList[$groupData['iid']] = $groupData; $groupList[$groupData['iid']] = $groupData;
}*/ }*/
return $groupList; return $groupList;
} }

@ -68,7 +68,6 @@ class GroupManager
} }
/** /**
*
* @param int $courseId * @param int $courseId
* *
* @return array * @return array
@ -82,7 +81,6 @@ class GroupManager
return $qb->getQuery()->getArrayResult(); return $qb->getQuery()->getArrayResult();
$table_group = Database::get_course_table(TABLE_GROUP); $table_group = Database::get_course_table(TABLE_GROUP);
$courseId = !empty($courseId) ? (int) $courseId : api_get_course_int_id(); $courseId = !empty($courseId) ? (int) $courseId : api_get_course_int_id();

@ -103,7 +103,6 @@ if ($form->validate()) {
} }
throw new Exception('upload corrections'); throw new Exception('upload corrections');
/*$folder = api_get_unique_id(); /*$folder = api_get_unique_id();
$destinationDir = api_get_path(SYS_ARCHIVE_PATH).$folder; $destinationDir = api_get_path(SYS_ARCHIVE_PATH).$folder;
mkdir($destinationDir, api_get_permissions_for_new_directories(), true); mkdir($destinationDir, api_get_permissions_for_new_directories(), true);

@ -8,11 +8,11 @@
{% if not from_vue %} {% if not from_vue %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ app.request.locale }}" class="no-js h-100"> <html lang="{{ app.request.locale }}" class="no-js h-100">
{% block chamilo_head %} {% block chamilo_head %}
<head> <head>
{% include "@ChamiloCore/Layout/head.html.twig" %} {% include "@ChamiloCore/Layout/head.html.twig" %}
</head> </head>
{% endblock %} {% endblock %}
<body <body
class="{{ section_name }} h-100" class="{{ section_name }} h-100"
data-in-course="{{ course ? 'true' : 'false' }}" data-in-course="{{ course ? 'true' : 'false' }}"

Loading…
Cancel
Save