[svn r10154] replace some remaining FORUM_TABLE by TOOL_FORUM_TABLE

skala
Eric Marguin 19 years ago
parent 1a1b3e816a
commit 82f0d9c144
  1. 4
      main/admin/course_edit.php
  2. 4
      main/admin/course_information.php
  3. 4
      main/course_info/infocours.php
  4. 12
      main/coursecopy/classes/CourseBuilder.class.php
  5. 10
      main/coursecopy/classes/CourseRecycler.class.php
  6. 16
      main/coursecopy/classes/CourseRestorer.class.php
  7. 12
      main/inc/lib/groupmanager.lib.php
  8. 4
      main/newscorm/learnpath_functions.inc.php
  9. 4
      main/newscorm/resourcelinker.inc.php
  10. 6
      main/resourcelinker/resourcelinker.inc.php
  11. 10
      main/resourcelinker/resourcelinker.php

@ -1,6 +1,6 @@
<?php <?php
// $Id: course_edit.php 9246 2006-09-25 13:24:53Z bmol $ // $Id: course_edit.php 10154 2006-11-23 08:48:12Z elixir_inter $
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
@ -141,7 +141,7 @@ if( $form->validate())
unsubscribe='".mysql_real_escape_string($unsubscribe)."' unsubscribe='".mysql_real_escape_string($unsubscribe)."'
WHERE code='".mysql_real_escape_string($course_code)."'"; WHERE code='".mysql_real_escape_string($course_code)."'";
api_sql_query($sql, __FILE__, __LINE__); api_sql_query($sql, __FILE__, __LINE__);
$forum_config_table = Database::get_course_table(FORUM_CONFIG_TABLE,$course_db_name); $forum_config_table = Database::get_course_table(TOOL_FORUM_CONFIG_TABLE,$course_db_name);
$sql = "UPDATE ".$forum_config_table." SET default_lang='".mysql_real_escape_string($course_language)."'"; $sql = "UPDATE ".$forum_config_table." SET default_lang='".mysql_real_escape_string($course_language)."'";
header('Location: course_list.php'); header('Location: course_list.php');
exit (); exit ();

@ -1,5 +1,5 @@
<?php <?php
// $Id: course_information.php 9246 2006-09-25 13:24:53Z bmol $ // $Id: course_information.php 10154 2006-11-23 08:48:12Z elixir_inter $
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
@ -53,7 +53,7 @@ function get_course_usage($course_code)
$table = Database :: get_course_table(LEARNPATH_MAIN_TABLE, $course->db_name); $table = Database :: get_course_table(LEARNPATH_MAIN_TABLE, $course->db_name);
$usage[] = array (get_lang(TOOL_LEARNPATH), Database::count_rows($table)); $usage[] = array (get_lang(TOOL_LEARNPATH), Database::count_rows($table));
// Forums // Forums
$table = Database :: get_course_table(FORUM_TABLE, $course->db_name); $table = Database :: get_course_table(TOOL_FORUM_TABLE, $course->db_name);
$usage[] = array (get_lang(TOOL_BB_FORUM), Database::count_rows($table)); $usage[] = array (get_lang(TOOL_BB_FORUM), Database::count_rows($table));
// Quizzes // Quizzes
$table = Database :: get_course_table(QUIZ_TEST_TABLE, $course->db_name); $table = Database :: get_course_table(QUIZ_TEST_TABLE, $course->db_name);

@ -1,5 +1,5 @@
<?php <?php
// $Id: infocours.php 9822 2006-10-26 09:55:27Z bmol $ // $Id: infocours.php 10154 2006-11-23 08:48:12Z elixir_inter $
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
@ -68,7 +68,7 @@ $TABLECOURSE = Database :: get_main_table(MAIN_COURSE_TABLE);
$TABLEFACULTY = Database :: get_main_table(MAIN_CATEGORY_TABLE); $TABLEFACULTY = Database :: get_main_table(MAIN_CATEGORY_TABLE);
$TABLECOURSEHOME = Database :: get_course_table(TOOL_LIST_TABLE); $TABLECOURSEHOME = Database :: get_course_table(TOOL_LIST_TABLE);
$TABLELANGUAGES = Database :: get_main_table(MAIN_LANGUAGE_TABLE); $TABLELANGUAGES = Database :: get_main_table(MAIN_LANGUAGE_TABLE);
$TABLEBBCONFIG = Database :: get_course_table(FORUM_CONFIG_TABLE); $TABLEBBCONFIG = Database :: get_course_table(TOOL_FORUM_CONFIG_TABLE);
$currentCourseID = $_course['sysCode']; $currentCourseID = $_course['sysCode'];
$currentCourseRepository = $_course["path"]; $currentCourseRepository = $_course["path"];
$is_allowedToEdit = $is_courseAdmin; $is_allowedToEdit = $is_courseAdmin;

@ -1,4 +1,4 @@
<?php // $Id: CourseBuilder.class.php 6747 2005-10-28 09:29:59Z bmol $ <?php // $Id: CourseBuilder.class.php 10154 2006-11-23 08:48:12Z elixir_inter $
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
@ -136,7 +136,7 @@ class CourseBuilder
*/ */
function build_forums() function build_forums()
{ {
$table = Database :: get_course_table(FORUM_TABLE); $table = Database :: get_course_table(TOOL_FORUM_TABLE);
$sql = 'SELECT * FROM '.$table; $sql = 'SELECT * FROM '.$table;
$db_result = api_sql_query($sql, __FILE__, __LINE__); $db_result = api_sql_query($sql, __FILE__, __LINE__);
while ($obj = mysql_fetch_object($db_result)) while ($obj = mysql_fetch_object($db_result))
@ -153,7 +153,7 @@ class CourseBuilder
*/ */
function build_forum_category($id) function build_forum_category($id)
{ {
$table = Database :: get_course_table(FORUM_CATEGORY_TABLE); $table = Database :: get_course_table(TOOL_FORUM_CATEGORY_TABLE);
$sql = 'SELECT * FROM '.$table.' WHERE cat_id = '.$id; $sql = 'SELECT * FROM '.$table.' WHERE cat_id = '.$id;
$db_result = api_sql_query($sql, __FILE__, __LINE__); $db_result = api_sql_query($sql, __FILE__, __LINE__);
while ($obj = mysql_fetch_object($db_result)) while ($obj = mysql_fetch_object($db_result))
@ -167,7 +167,7 @@ class CourseBuilder
*/ */
function build_forum_topics() function build_forum_topics()
{ {
$table = Database :: get_course_table(FORUM_TOPIC_TABLE); $table = Database :: get_course_table(TOOL_FORUM_TOPIC_TABLE);
$sql = 'SELECT * FROM '.$table; $sql = 'SELECT * FROM '.$table;
$db_result = api_sql_query($sql, __FILE__, __LINE__); $db_result = api_sql_query($sql, __FILE__, __LINE__);
while ($obj = mysql_fetch_object($db_result)) while ($obj = mysql_fetch_object($db_result))
@ -181,8 +181,8 @@ class CourseBuilder
*/ */
function build_forum_posts() function build_forum_posts()
{ {
$table_post = Database :: get_course_table(FORUM_POST_TABLE); $table_post = Database :: get_course_table(TOOL_FORUM_POST_TABLE);
$table_posttext = Database :: get_course_table(FORUM_POST_TEXT_TABLE); $table_posttext = Database :: get_course_table(TOOL_FORUM_POST_TEXT_TABLE);
$sql = 'SELECT * FROM '.$table_post.' p,'.$table_posttext.' pt WHERE p.post_id = pt.post_id'; $sql = 'SELECT * FROM '.$table_post.' p,'.$table_posttext.' pt WHERE p.post_id = pt.post_id';
$db_result = api_sql_query($sql, __FILE__, __LINE__); $db_result = api_sql_query($sql, __FILE__, __LINE__);
while ($obj = mysql_fetch_object($db_result)) while ($obj = mysql_fetch_object($db_result))

@ -1,5 +1,5 @@
<?php <?php
// $Id: CourseRecycler.class.php 5950 2005-08-11 10:52:34Z bmol $ // $Id: CourseRecycler.class.php 10154 2006-11-23 08:48:12Z elixir_inter $
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
@ -114,8 +114,8 @@ class CourseRecycler
{ {
$table_forum = Database :: get_course_table(FORUM_TABLE); $table_forum = Database :: get_course_table(FORUM_TABLE);
$table_topic = Database :: get_course_table(FORUM_TOPIC_TABLE); $table_topic = Database :: get_course_table(FORUM_TOPIC_TABLE);
$table_post = Database :: get_course_table(FORUM_POST_TABLE); $table_post = Database :: get_course_table(TOOL_FORUM_POST_TABLE);
$table_posttext = Database :: get_course_table(FORUM_POST_TEXT_TABLE); $table_posttext = Database :: get_course_table(TOOL_FORUM_POST_TEXT_TABLE);
$forum_ids = implode(',', (array_keys($this->course->resources[RESOURCE_FORUM]))); $forum_ids = implode(',', (array_keys($this->course->resources[RESOURCE_FORUM])));
$sql = "SELECT post_id FROM ".$table_post." WHERE forum_id IN (".$forum_ids.")"; $sql = "SELECT post_id FROM ".$table_post." WHERE forum_id IN (".$forum_ids.")";
$res = api_sql_query($sql,__FILE__,__LINE__); $res = api_sql_query($sql,__FILE__,__LINE__);
@ -141,8 +141,8 @@ class CourseRecycler
*/ */
function recycle_forum_categories() function recycle_forum_categories()
{ {
$table_forum = Database :: get_course_table(FORUM_TABLE); $table_forum = Database :: get_course_table(TOOL_FORUM_TABLE);
$table_forumcat = Database :: get_course_table(FORUM_CATEGORY_TABLE); $table_forumcat = Database :: get_course_table(TOOL_FORUM_CATEGORY_TABLE);
$sql = "SELECT fc.cat_id FROM ".$table_forumcat." fc LEFT JOIN ".$table_forum." f ON fc.cat_id=f.cat_id WHERE f.forum_id IS NULL"; $sql = "SELECT fc.cat_id FROM ".$table_forumcat." fc LEFT JOIN ".$table_forum." f ON fc.cat_id=f.cat_id WHERE f.forum_id IS NULL";
$res = api_sql_query($sql,__FILE__,__LINE__); $res = api_sql_query($sql,__FILE__,__LINE__);
while ($obj = mysql_fetch_object($res)) while ($obj = mysql_fetch_object($res))

@ -1,7 +1,7 @@
<?php <?php
// $Id: CourseRestorer.class.php 9246 2006-09-25 13:24:53Z bmol $ // $Id: CourseRestorer.class.php 10154 2006-11-23 08:48:12Z elixir_inter $
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
@ -323,9 +323,9 @@ class CourseRestorer
{ {
if ($this->course->has_resources(RESOURCE_FORUM)) if ($this->course->has_resources(RESOURCE_FORUM))
{ {
$table_forum = Database :: get_course_table(FORUM_TABLE, $this->course->destination_db); $table_forum = Database :: get_course_table(TOOL_FORUM_TABLE, $this->course->destination_db);
$table_topic = Database :: get_course_table(FORUM_TOPIC_TABLE, $this->course->destination_db); $table_topic = Database :: get_course_table(TOOL_FORUM_TOPIC_TABLE, $this->course->destination_db);
$table_post = Database :: get_course_table(FORUM_POST_TABLE, $this->course->destination_db); $table_post = Database :: get_course_table(TOOL_FORUM_POST_TABLE, $this->course->destination_db);
$resources = $this->course->resources; $resources = $this->course->resources;
foreach ($resources[RESOURCE_FORUM] as $id => $forum) foreach ($resources[RESOURCE_FORUM] as $id => $forum)
{ {
@ -360,7 +360,7 @@ class CourseRestorer
*/ */
function restore_forum_category($id) function restore_forum_category($id)
{ {
$forum_cat_table = Database :: get_course_table(FORUM_CATEGORY_TABLE, $this->course->destination_db); $forum_cat_table = Database :: get_course_table(TOOL_FORUM_CATEGORY_TABLE, $this->course->destination_db);
$resources = $this->course->resources; $resources = $this->course->resources;
$forum_cat = $resources[RESOURCE_FORUMCATEGORY][$id]; $forum_cat = $resources[RESOURCE_FORUMCATEGORY][$id];
if (!$forum_cat->is_restored()) if (!$forum_cat->is_restored())
@ -378,7 +378,7 @@ class CourseRestorer
*/ */
function restore_topic($id, $forum_id) function restore_topic($id, $forum_id)
{ {
$table = Database :: get_course_table(FORUM_TOPIC_TABLE, $this->course->destination_db); $table = Database :: get_course_table(TOOL_FORUM_TOPIC_TABLE, $this->course->destination_db);
$resources = $this->course->resources; $resources = $this->course->resources;
$topic = $resources[RESOURCE_FORUMTOPIC][$id]; $topic = $resources[RESOURCE_FORUMTOPIC][$id];
$sql = "INSERT INTO ".$table." SET topic_title = '".mysql_real_escape_string($topic->title)."', topic_time = '".$topic->time."', nom = '".mysql_real_escape_string($topic->lastname)."', prenom = '".mysql_real_escape_string($topic->firstname)."', topic_notify = '".$topic->topic_notify."', forum_id = '".$forum_id."'"; $sql = "INSERT INTO ".$table." SET topic_title = '".mysql_real_escape_string($topic->title)."', topic_time = '".$topic->time."', nom = '".mysql_real_escape_string($topic->lastname)."', prenom = '".mysql_real_escape_string($topic->firstname)."', topic_notify = '".$topic->topic_notify."', forum_id = '".$forum_id."'";
@ -408,8 +408,8 @@ class CourseRestorer
*/ */
function restore_post($id, $topic_id, $forum_id) function restore_post($id, $topic_id, $forum_id)
{ {
$table_post = Database :: get_course_table(FORUM_POST_TABLE, $this->course->destination_db); $table_post = Database :: get_course_table(TOOL_FORUM_POST_TABLE, $this->course->destination_db);
$table_posttext = Database :: get_course_table(FORUM_POST_TEXT_TABLE, $this->course->destination_db); $table_posttext = Database :: get_course_table(TOOL_FORUM_POST_TEXT_TABLE, $this->course->destination_db);
$resources = $this->course->resources; $resources = $this->course->resources;
$post = $resources[RESOURCE_FORUMPOST][$id]; $post = $resources[RESOURCE_FORUMPOST][$id];
$sql = "INSERT INTO ".$table_post." SET topic_id = '".$topic_id."', post_time = '".$post->post_time."', forum_id = '".$forum_id."', nom = '".mysql_real_escape_string($post->lastname)."', prenom = '".mysql_real_escape_string($post->firstname)."', topic_notify = '".$post->topic_notify."', poster_ip = '".$post->poster_ip."'"; $sql = "INSERT INTO ".$table_post." SET topic_id = '".$topic_id."', post_time = '".$post->post_time."', forum_id = '".$forum_id."', nom = '".mysql_real_escape_string($post->lastname)."', prenom = '".mysql_real_escape_string($post->firstname)."', topic_notify = '".$post->topic_notify."', poster_ip = '".$post->poster_ip."'";

@ -148,7 +148,7 @@ class GroupManager
$currentCourseRepository = $_course['path']; $currentCourseRepository = $_course['path'];
$table_group = Database :: get_course_table(GROUP_TABLE); $table_group = Database :: get_course_table(GROUP_TABLE);
$table_forum = Database :: get_course_table(FORUM_TABLE); $table_forum = Database :: get_course_table(TOOL_FORUM_TABLE);
$category = GroupManager :: get_category($category_id); $category = GroupManager :: get_category($category_id);
if( strlen($places) == 0) if( strlen($places) == 0)
{ {
@ -285,10 +285,10 @@ class GroupManager
} }
$group_table = Database :: get_course_table(GROUP_TABLE, $course_db); $group_table = Database :: get_course_table(GROUP_TABLE, $course_db);
$group_user_table = Database :: get_course_table(GROUP_USER_TABLE, $course_db); $group_user_table = Database :: get_course_table(GROUP_USER_TABLE, $course_db);
$forum_table = Database :: get_course_table(FORUM_TABLE, $course_db); $forum_table = Database :: get_course_table(TOOL_FORUM_TABLE, $course_db);
$forum_post_table = Database :: get_course_table(FORUM_POST_TABLE, $course_db); $forum_post_table = Database :: get_course_table(TOOL_FORUM_POST_TABLE, $course_db);
$forum_post_text_table = Database :: get_course_table(FORUM_POST_TEXT_TABLE, $course_db); $forum_post_text_table = Database :: get_course_table(TOOL_FORUM_POST_TEXT_TABLE, $course_db);
$forum_topic_table = Database :: get_course_table(FORUM_TOPIC_TABLE, $course_db); $forum_topic_table = Database :: get_course_table(TOOL_FORUM_TOPIC_TABLE, $course_db);
$group_ids = is_array($group_ids) ? $group_ids : array ($group_ids); $group_ids = is_array($group_ids) ? $group_ids : array ($group_ids);
// define repository for deleted element // define repository for deleted element
$group_garbage = api_get_path(GARBAGE_PATH).$course['path']."/group/"; $group_garbage = api_get_path(GARBAGE_PATH).$course['path']."/group/";
@ -359,7 +359,7 @@ class GroupManager
function set_group_properties($group_id, $name, $description, $maximum_number_of_students, $doc_state, $work_state, $calendar_state, $announcements_state, $self_registration_allowed, $self_unregistration_allowed) function set_group_properties($group_id, $name, $description, $maximum_number_of_students, $doc_state, $work_state, $calendar_state, $announcements_state, $self_registration_allowed, $self_unregistration_allowed)
{ {
$table_group = Database :: get_course_table(GROUP_TABLE); $table_group = Database :: get_course_table(GROUP_TABLE);
//$table_forum = Database :: get_course_table(FORUM_TABLE); //$table_forum = Database :: get_course_table(TOOL_FORUM_TABLE);
$sql = "UPDATE ".$table_group." $sql = "UPDATE ".$table_group."
SET name='".trim($name)."', SET name='".trim($name)."',
doc_state = '".$doc_state."', doc_state = '".$doc_state."',

@ -2066,8 +2066,8 @@ function exportitem($id, $item_id, $item_type, $add_scorm_communications = false
//------------------------POST BEGIN--------------------------------------- //------------------------POST BEGIN---------------------------------------
case "Post" : case "Post" :
//1 Get the forum post data from the database //1 Get the forum post data from the database
$tbl_posts =Database::get_course_table(FORUM_POST_TABLE); $tbl_posts =Database::get_course_table(TOOL_FORUM_POST_TABLE);
$tbl_posts_text =Database::get_course_table(FORUM_POST_TEXT_TABLE); $tbl_posts_text =Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE);
$result = api_sql_query("SELECT * FROM $tbl_posts where post_id=$item_id", __FILE__, __LINE__); $result = api_sql_query("SELECT * FROM $tbl_posts where post_id=$item_id", __FILE__, __LINE__);
$myrow = mysql_fetch_array($result); $myrow = mysql_fetch_array($result);
// grabbing the title of the post // grabbing the title of the post

@ -319,8 +319,8 @@ function display_addedresource_link($type, $id, $style='')
echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$myrow['topic_id'].'&amp;forum='.$myrow['forum_id'].'&amp;md5='.$myrow['md5'].'"'.$styling.'>'.$myrow_title['post_title']."</a><br />\n"; echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$myrow['topic_id'].'&amp;forum='.$myrow['forum_id'].'&amp;md5='.$myrow['md5'].'"'.$styling.'>'.$myrow_title['post_title']."</a><br />\n";
break; break;
case 'Post': case 'Post':
$tbl_post = Database::get_course_table(FORUM_POST_TABLE); $tbl_post = Database::get_course_table(TOOL_FORUM_POST_TABLE);
$tbl_post_text = Database::get_course_table(FORUM_POST_TEXT_TABLE); $tbl_post_text = Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE);
$sql = "SELECT * FROM $tbl_post p, $tbl_post_text t WHERE p.post_id = t.post_id AND p.post_id = $id"; $sql = "SELECT * FROM $tbl_post p, $tbl_post_text t WHERE p.post_id = t.post_id AND p.post_id = $id";
$result = api_sql_query($sql,__FILE__,__LINE__); $result = api_sql_query($sql,__FILE__,__LINE__);
$post = mysql_fetch_object($result); $post = mysql_fetch_object($result);

@ -1,4 +1,4 @@
<?php // $Id: resourcelinker.inc.php 10083 2006-11-21 19:43:29Z pcool $ <?php // $Id: resourcelinker.inc.php 10154 2006-11-23 08:48:12Z elixir_inter $
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
@ -316,8 +316,8 @@ function display_addedresource_link($type, $id, $style='')
echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$myrow['topic_id'].'&amp;forum='.$myrow['forum_id'].'&amp;md5='.$myrow['md5'].'"'.$styling.'>'.$myrow_title['post_title']."</a><br />\n"; echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$myrow['topic_id'].'&amp;forum='.$myrow['forum_id'].'&amp;md5='.$myrow['md5'].'"'.$styling.'>'.$myrow_title['post_title']."</a><br />\n";
break; break;
case 'Post': case 'Post':
$tbl_post = Database::get_course_table(FORUM_POST_TABLE); $tbl_post = Database::get_course_table(TOOL_FORUM_POST_TABLE);
$tbl_post_text = Database::get_course_table(FORUM_POST_TEXT_TABLE); $tbl_post_text = Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE);
$sql = "SELECT * FROM $tbl_post p, $tbl_post_text t WHERE p.post_id = t.post_id AND p.post_id = $id"; $sql = "SELECT * FROM $tbl_post p, $tbl_post_text t WHERE p.post_id = t.post_id AND p.post_id = $id";
$result = api_sql_query($sql,__FILE__,__LINE__); $result = api_sql_query($sql,__FILE__,__LINE__);
$post = mysql_fetch_object($result); $post = mysql_fetch_object($result);

@ -741,11 +741,11 @@ if ($content == "Ad_Valvas")
*/ */
if ($content == "Forum") if ($content == "Forum")
{ {
$TBL_FORUMS = Database::get_course_table(FORUM_TABLE); $TBL_FORUMS = Database::get_course_table(TOOL_FORUM_TABLE);
$TBL_CATAGORIES = Database::get_course_table(FORUM_CATEGORY_TABLE); $TBL_CATAGORIES = Database::get_course_table(TOOL_FORUM_CATEGORY_TABLE);
$TBL_FORUMTOPICS = Database::get_course_table(FORUM_TOPIC_TABLE); $TBL_FORUMTOPICS = Database::get_course_table(TOOL_FORUM_TOPIC_TABLE);
$tbl_posts = Database::get_course_table(FORUM_POST_TABLE); $tbl_posts = Database::get_course_table(TOOL_FORUM_POST_TABLE);
$tbl_posts_text = Database::get_course_table(FORUM_POST_TEXT_TABLE); $tbl_posts_text = Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE);
echo "<table width='100%'>"; echo "<table width='100%'>";

Loading…
Cancel
Save