Fix php warnings

pull/3432/head
Julio Montoya 5 years ago
parent 6cb4af9195
commit 77afb22240
  1. 22
      public/main/gradebook/gradebook_add_link.php
  2. 35
      public/main/gradebook/lib/be/forumthreadlink.class.php
  3. 29
      public/main/template/default/forum/list.html.twig

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php';
@ -99,16 +100,16 @@ if (isset($typeSelected) && '0' != $typeSelected) {
(isset($addvalues['select_link']) && "" != $addvalues['select_link'])
) {
$sql1 = 'SELECT thread_title from '.$tbl_forum_thread.'
WHERE
c_id = '.$course_info['real_id'].' AND
WHERE
c_id = '.$course_info['real_id'].' AND
thread_id = '.$addvalues['select_link'];
$res1 = Database::query($sql1);
$rowtit = Database::fetch_row($res1);
$course_id = api_get_course_id();
$sql_l = 'SELECT count(*) FROM '.$tbl_link.'
WHERE
ref_id='.$addvalues['select_link'].' AND
course_code="'.$course_id.'" AND
WHERE
ref_id='.$addvalues['select_link'].' AND
course_code="'.$course_id.'" AND
type = 5;';
$res_l = Database::query($sql_l);
$row = Database::fetch_row($res_l);
@ -118,8 +119,8 @@ if (isset($typeSelected) && '0' != $typeSelected) {
thread_qualify_max= "'.api_float_val($addvalues['weight']).'",
thread_weight= "'.api_float_val($addvalues['weight']).'",
thread_title_qualify = "'.$rowtit[0].'"
WHERE
thread_id='.$addvalues['select_link'].' AND
WHERE
thread_id='.$addvalues['select_link'].' AND
c_id = '.$course_info['real_id'].' ';
Database::query($sql);
}
@ -190,7 +191,12 @@ $(function() {
Display::display_header(get_lang('Add online activity'));
if (isset($typeform)) {
echo Display::return_message(get_lang('LearningPathAssessmentsWarning'), 'warning');
echo Display::return_message(
get_lang(
'Warning: It is possible to use, in the gradebook, tests that are part of learning paths. If the learning path itself is already included, this test might be part of the gradebook already. The learning paths evaluation is made on the basis of a progress percentage, while the evaluation on tests is made on the basis of a score. Survey evaluation is based on whether the user has answered (1) or not (0). Make sure you test your combinations of gradebook evaluations to avoid mind-boggling situations.'
),
'warning'
);
$typeform->display();
}
if (isset($addform)) {

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**
@ -58,13 +59,9 @@ class ForumThreadLink extends AbstractLink
}
$sql = 'SELECT tl.thread_id, tl.thread_title, tl.thread_title_qualify
FROM '.$tbl_grade_links.' tl INNER JOIN '.$tbl_item_property.' ip
ON (tl.thread_id = ip.ref AND tl.c_id = ip.c_id)
FROM '.$tbl_grade_links.' tl
WHERE
tl.c_id = '.$this->course_id.' AND
ip.c_id = '.$this->course_id.' AND
ip.tool = "forum_thread" AND
ip.visibility <> 2 AND
'.$session_condition.'
';
@ -93,7 +90,7 @@ class ForumThreadLink extends AbstractLink
$sql = "SELECT count(*) AS number FROM $table
WHERE
c_id = ".$this->course_id." AND
thread_id = '".$this->get_ref_id()."'
thread_id = '".$this->get_ref_id()."'
";
$result = Database::query($sql);
$number = Database::fetch_row($result);
@ -122,8 +119,8 @@ class ForumThreadLink extends AbstractLink
$sql = 'SELECT thread_qualify_max
FROM '.Database::get_course_table(TABLE_FORUM_THREAD)."
WHERE
c_id = ".$this->course_id." AND
WHERE
c_id = ".$this->course_id." AND
thread_id = '".$this->get_ref_id()."'
$sessionCondition
";
@ -131,8 +128,8 @@ class ForumThreadLink extends AbstractLink
$assignment = Database::fetch_array($query);
$sql = "SELECT * FROM $thread_qualify
WHERE
c_id = ".$this->course_id." AND
WHERE
c_id = ".$this->course_id." AND
thread_id = ".$this->get_ref_id()."
$sessionCondition
";
@ -265,9 +262,9 @@ class ForumThreadLink extends AbstractLink
{
$sessionId = $this->get_session_id();
$sql = 'SELECT count(id) from '.$this->get_forum_thread_table().'
WHERE
c_id = '.$this->course_id.' AND
thread_id = '.$this->get_ref_id().' AND
WHERE
c_id = '.$this->course_id.' AND
thread_id = '.$this->get_ref_id().' AND
session_id='.$sessionId;
$result = Database::query($sql);
$number = Database::fetch_row($result);
@ -281,8 +278,8 @@ class ForumThreadLink extends AbstractLink
//it was extracts the forum id
$sql = 'SELECT * FROM '.$this->get_forum_thread_table()."
WHERE
c_id = '.$this->course_id.' AND
thread_id = '".$this->get_ref_id()."' AND
c_id = '.$this->course_id.' AND
thread_id = '".$this->get_ref_id()."' AND
session_id = $sessionId ";
$result = Database::query($sql);
$row = Database::fetch_array($result, 'ASSOC');
@ -304,7 +301,7 @@ class ForumThreadLink extends AbstractLink
$ref_id = $this->get_ref_id();
if (!empty($ref_id)) {
$sql = 'UPDATE '.$this->get_forum_thread_table().' SET
$sql = 'UPDATE '.$this->get_forum_thread_table().' SET
thread_weight='.api_float_val($weight).'
WHERE c_id = '.$this->course_id.' AND thread_id= '.$ref_id;
Database::query($sql);
@ -344,9 +341,9 @@ class ForumThreadLink extends AbstractLink
if (!isset($this->exercise_data)) {
$sql = 'SELECT * FROM '.$this->get_forum_thread_table().'
WHERE
c_id = '.$this->course_id.' AND
thread_id = '.$this->get_ref_id().' AND
WHERE
c_id = '.$this->course_id.' AND
thread_id = '.$this->get_ref_id().' AND
'.$session_condition;
$query = Database::query($sql);
$this->exercise_data = Database::fetch_array($query);

@ -71,9 +71,9 @@
{% for category_language_item in category_language_array %}
<span class="flag-icon flag-icon-{{ languages[category_language_item | lower] }}"></span>
{% endfor %}
<div class="pull-right">
{{ item.tools }}
</div>
{# <div class="pull-right">#}
{# {{ item.tools }}#}
{# </div>#}
{% endset %}
{% endif %}
@ -88,7 +88,7 @@
<div class="row">
<div class="col-xs-4 col-md-3">
<div class="number-post">
<a href="{{ forum.url }}" title="{{forum.title}}">
<a href="{{ subitem.url }}" title="{{subitem.title}}">
{% if subitem.forum_image is not empty %}
<img src="{{ subitem.forum_image }}" width="48px">
{% else %}
@ -99,15 +99,15 @@
{% endif %}
{% endif %}
</a>
<p>{{ 'Forum threads'| trans }}: {{ subitem.number_threads }} </p>
{# <p>{{ 'Forum threads'| trans }}: {{ subitem.number_threads }} </p>#}
</div>
</div>
<div class="col-xs-8 col-md-9">
<div class="pull-right">
<div class="toolbar">
{{ subitem.tools }}
</div>
</div>
{# <div class="pull-right">#}
{# <div class="toolbar">#}
{# {{ subitem.tools }}#}
{# </div>#}
{# </div>#}
<h3 class="title">
{{ 'forum_yellow.png'|img(32) }}
<a href="{{ subitem.url }}" title="{{ subitem.title }}" class="{{ subitem.visibility != '1' ? 'text-muted': '' }}">{{ subitem.title }}</a>
@ -131,13 +131,14 @@
{{ subitem.description }}
</div>
{{ subitem.last_post_text }}
{# {{ subitem.last_post_text }}#}
{{ subitem.alert }}
{% if subitem.moderation is not empty %}
{% if subitem.moderation is defined and subitem.moderation is not empty %}
<span class="label label-warning">
{{ "Posts pending moderation"|trans }}: {{ subitem.moderation }}
</span>
{{ "Posts pending moderation"|trans }}: {{ subitem.moderation }}
</span>
{% endif %}
</div>
</div>

Loading…
Cancel
Save