Fixing bug in gradebook when adding a forum thread and there was no title see #4550

skala
Julio Montoya 13 years ago
parent ab36f087a7
commit 72f6d7b6a4
  1. 2
      main/gradebook/gradebook_add_link.php
  2. 2
      main/gradebook/index.php
  3. 6
      main/gradebook/lib/be/forumthreadlink.class.php
  4. 20
      main/gradebook/lib/fe/gradebooktable.class.php
  5. 2
      main/gradebook/lib/gradebook_functions.inc.php

@ -77,7 +77,7 @@ if (isset($_GET['typeselected']) && $_GET['typeselected'] != '0') {
//update view_properties
if (isset($_GET['typeselected']) && 5 == $_GET['typeselected'] && (isset($addvalues['select_link']) && $addvalues['select_link']<>"")) {
echo $sql1 = 'SELECT thread_title from '.$tbl_forum_thread.'
$sql1 = 'SELECT thread_title from '.$tbl_forum_thread.'
WHERE c_id = '.$course_info['real_id'].' AND thread_id='.$addvalues['select_link'];
$res1 = Database::query($sql1);
$rowtit = Database::fetch_row($res1);

@ -873,5 +873,5 @@ if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) {
}
}
}
echo '<div id="chart3"></div>';
//echo '<div id="chart3"></div>';
Display :: display_footer();

@ -195,7 +195,7 @@ class ForumThreadLink extends AbstractLink
}
public function get_name() {
$this->get_exercise_data();
$this->get_exercise_data();
$thread_title=isset($this->exercise_data['thread_title']) ? $this->exercise_data['thread_title'] : '';
$thread_title_qualify=isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';
if ( isset($thread_title_qualify) && $thread_title_qualify!="") {
@ -237,8 +237,8 @@ class ForumThreadLink extends AbstractLink
}
private function get_exercise_data() {
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 session_id=".api_get_session_id()."";
$sql = 'SELECT * FROM '.$this->get_forum_thread_table().'
WHERE c_id = '.$this->course_id.' AND thread_id = '.$this->get_ref_id().' AND session_id = '.api_get_session_id();
$query = Database::query($sql);
$this->exercise_data = Database::fetch_array($query);
}

@ -429,12 +429,9 @@ class GradebookTable extends SortableTable {
. ($item->is_course() ? ' &nbsp;[' . $item->get_course_code() . ']'.$show_message : '');
// evaluation
case 'E' :
$cat=new Category();
//$dblib=new Database();
$category_id=Security::remove_XSS($_GET['selectcat']);
$course_id=Database::get_course_by_category($category_id);
$show_message=$cat->show_message_resource_delete($course_id);
$cat = new Category();
$course_id = Database::get_course_by_category($_GET['selectcat']);
$show_message = $cat->show_message_resource_delete($course_id);
// course/platform admin can go to the view_results page
@ -468,16 +465,13 @@ class GradebookTable extends SortableTable {
}
// link
case 'L' :
$cat = new Category();
$category_id = intval($_GET['selectcat']);
$course_id = Database::get_course_by_category($category_id);
$show_message = $cat->show_message_resource_delete($course_id);
$cat = new Category();
$course_id = Database::get_course_by_category($_GET['selectcat']);
$show_message = $cat->show_message_resource_delete($course_id);
$url = $item->get_link();
if (isset($url) && $show_message===false) {
if (isset($url) && $show_message===false) {
$text = '&nbsp;<a href="' . $item->get_link() . '">'
. $item->get_name()
. '</a>';

@ -268,7 +268,7 @@ function build_edit_icons_link($link, $selectcat) {
if ($message_link===false) {
$visibility_icon= ($link->is_visible() == 0) ? 'invisible' : 'visible';
$visibility_command= ($link->is_visible() == 0) ? 'set_visible' : 'set_invisible';
$modify_icons= '<a href="gradebook_edit_link.php?editlink=' . $link->get_id() . ' &amp;cidReq='.$link->get_course_code().'">'.Display::return_icon('edit.png', get_lang('Modify'),'',ICON_SIZE_SMALL).'</a>';
$modify_icons= '<a href="gradebook_edit_link.php?editlink='.$link->get_id().'&amp;cidReq='.$link->get_course_code().'">'.Display::return_icon('edit.png', get_lang('Modify'),'',ICON_SIZE_SMALL).'</a>';
//$modify_icons .= '&nbsp;<a href="' . api_get_self() . '?movelink=' . $link->get_id() . '&selectcat=' . $selectcat . '"><img src="../img/deplacer_fichier.gif" border="0" title="' . get_lang('Move') . '" alt="" /></a>';
$modify_icons .= '&nbsp;<a href="' . api_get_self() . '?visiblelink=' . $link->get_id() . '&amp;' . $visibility_command . '=&amp;selectcat=' . $selectcat . ' ">'.Display::return_icon($visibility_icon.'.png', get_lang('Visible'),'',ICON_SIZE_SMALL).'</a>';

Loading…
Cancel
Save