[svn r10197] fourth run of cleanup of the table names

http://www.dokeos.com/forum/viewtopic.php?t=7982
skala
Patrick Cool 19 years ago
parent 88c53bdefb
commit 27685c2472
  1. 4
      index.php
  2. 6
      main/admin/course_information.php
  3. 6
      main/admin/statistics/statistics.lib.php
  4. 4
      main/admin/user_list.php
  5. 4
      main/announcements/announcements.php
  6. 6
      main/auth/courses.php
  7. 914
      main/blog/blog.php
  8. 4
      main/calendar/agenda.php
  9. 32
      main/calendar/myagenda.php
  10. 2
      main/course_home/activity.php
  11. 6
      main/course_info/infocours.php
  12. 18
      main/coursecopy/classes/CourseBuilder.class.php
  13. 14
      main/coursecopy/classes/CourseRecycler.class.php
  14. 20
      main/coursecopy/classes/CourseRestorer.class.php
  15. 22
      main/exercice/adminhp.php
  16. 4
      main/exercice/answer.class.php
  17. 6
      main/exercice/exercice.php
  18. 18
      main/exercice/exercise.class.php
  19. 4
      main/exercice/exercise_result.php
  20. 2
      main/exercice/savescores.php
  21. 2
      main/group/group.php
  22. 2
      main/inc/global.inc.php
  23. 150
      main/inc/lib/blog.lib.php
  24. 8
      main/inc/lib/course.lib.php
  25. 98
      main/inc/lib/database.lib.php
  26. 4
      main/inc/lib/events.lib.inc.php
  27. 50
      main/inc/lib/groupmanager.lib.php
  28. 2
      main/inc/lib/main_api.lib.php
  29. 8
      main/inc/lib/online.inc.php
  30. 16
      main/inc/lib/surveymanager.lib.php
  31. 6
      main/inc/lib/usermanager.lib.php
  32. 4
      main/inc/local.inc.php
  33. 2
      main/inc/update_course_tracking.php
  34. 4
      main/install/update_db.inc.php
  35. 2
      main/mySpace/coaches.php
  36. 2
      main/mySpace/myStudents.php
  37. 4
      main/newscorm/learnpath.class.php
  38. 60
      main/newscorm/learnpath_functions.inc.php
  39. 8
      main/newscorm/resourcelinker.inc.php
  40. 10
      main/newscorm/resourcelinker.php
  41. 2
      main/online/online_hidden1.php
  42. 4
      main/online/online_links.php
  43. 4
      main/online/online_master.php
  44. 8
      main/online/online_whoisonline.php
  45. 1348
      main/permissions/permissions_functions.inc.php
  46. 10
      main/permissions/roles.php
  47. 4
      main/resourcelinker/resourcelinker.inc.php
  48. 8
      main/resourcelinker/resourcelinker.php
  49. 174
      main/survey/new_survey.php
  50. 8
      main/survey/preview_mcma.php
  51. 8
      main/survey/preview_open.php
  52. 10
      main/survey/preview_yesno.php
  53. 214
      main/survey/question_type.php
  54. 12
      main/tracking/courseLog.php
  55. 4
      main/tracking/logins_details.php
  56. 12
      main/tracking/userLog.php
  57. 4
      main/user/user.php
  58. 4
      main/user/userInfo.php
  59. 4
      user_portal.php

@ -96,7 +96,7 @@ if ($_GET['logout'])
}
$tbl_track_login = Database :: get_statistic_table(STATISTIC_TRACK_E_LOGIN_TABLE);
$tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql_last_connection="SELECT login_id, login_date FROM $tbl_track_login WHERE login_user_id='".$_GET["uid"]."' ORDER BY login_date DESC LIMIT 0,1";
@ -123,7 +123,7 @@ if ($_GET['logout'])
*/
$main_course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$main_category_table = Database :: get_main_table(TABLE_MAIN_CATEGORY);
$track_login_table = Database :: get_statistic_table(STATISTIC_TRACK_E_LOGIN_TABLE);
$track_login_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
/*
-----------------------------------------------------------
Constants and CONFIGURATION parameters

@ -1,5 +1,5 @@
<?php
// $Id: course_information.php 10195 2006-11-25 15:26:00Z pcool $
// $Id: course_information.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -50,13 +50,13 @@ function get_course_usage($course_code)
$res = api_sql_query($sql,__FILE__,__LINE__);
$course = mysql_fetch_object($res);
// Learnpaths
$table = Database :: get_course_table(LEARNPATH_MAIN_TABLE, $course->db_name);
$table = Database :: get_course_table(TABLE_LEARNPATH_MAIN, $course->db_name);
$usage[] = array (get_lang(TOOL_LEARNPATH), Database::count_rows($table));
// Forums
$table = Database :: get_course_table(TABLE_FORUM, $course->db_name);
$usage[] = array (get_lang(TOOL_BB_FORUM), Database::count_rows($table));
// Quizzes
$table = Database :: get_course_table(QUIZ_TEST_TABLE, $course->db_name);
$table = Database :: get_course_table(TABLE_QUIZ_TEST, $course->db_name);
$usage[] = array (get_lang(TOOL_QUIZ), Database::count_rows($table));
// Documents
$table = Database :: get_course_table(TABLE_DOCUMENT, $course->db_name);

@ -184,7 +184,7 @@ class Statistics
*/
function print_login_stats($type)
{
$table = Database::get_statistic_table(STATISTIC_TRACK_E_LOGIN_TABLE);
$table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
switch($type)
{
case 'month':
@ -214,7 +214,7 @@ class Statistics
function print_recent_login_stats()
{
$total_logins = array();
$table = Database::get_statistic_table(STATISTIC_TRACK_E_LOGIN_TABLE);
$table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql[get_lang('Thisday')] = "SELECT count(login_user_id) AS number FROM $table WHERE DATE_ADD(login_date, INTERVAL 1 DAY) >= NOW()";
$sql[get_lang('Last7days')] = "SELECT count(login_user_id) AS number FROM $table WHERE DATE_ADD(login_date, INTERVAL 7 DAY) >= NOW()";
$sql[get_lang('Last31days')] = "SELECT count(login_user_id) AS number FROM $table WHERE DATE_ADD(login_date, INTERVAL 31 DAY) >= NOW()";
@ -232,7 +232,7 @@ class Statistics
*/
function print_tool_stats()
{
$table = Database::get_statistic_table(STATISTIC_TRACK_E_ACCESS_TABLE);
$table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ACCESS);
$tools = array('announcement','assignment','calendar_event','chat','conference','course_description','document','dropbox','group','learnpath','link','quiz','student_publication','user','bb_forum');
$sql = "SELECT access_tool, count( access_id ) AS number_of_logins FROM $table WHERE access_tool IN ('".implode("','",$tools)."') GROUP BY access_tool ";
$res = api_sql_query($sql,__FILE__,__LINE__);

@ -1,6 +1,6 @@
<?php
// $Id: user_list.php 10190 2006-11-24 00:23:20Z pcool $
// $Id: user_list.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -54,7 +54,7 @@ function login_user($user_id)
$main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
$main_admin_table = Database :: get_main_table(TABLE_MAIN_ADMIN);
$track_e_login_table = Database :: get_statistic_table(STATISTIC_TRACK_E_LOGIN_TABLE);
$track_e_login_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
//logic --------------------------------------------------------------------
//unset($_user['user_id']); // uid not in session ? prevent any hacking

@ -1,4 +1,4 @@
<?php //$Id: announcements.php 10195 2006-11-25 15:26:00Z pcool $
<?php //$Id: announcements.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -83,7 +83,7 @@ $tbl_courses = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_sessions = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_course_user= Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_group = Database::get_course_table(TABLE_GROUP);
$tbl_groupUser = Database::get_course_table(GROUP_USER_TABLE);
$tbl_groupUser = Database::get_course_table(TABLE_GROUP_USER);
$tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT);
$tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);

@ -1,4 +1,4 @@
<?php // $Id: courses.php 10191 2006-11-24 08:09:14Z pcool $
<?php // $Id: courses.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -643,7 +643,7 @@ function move_category($direction, $category2move)
{
global $_user;
// the database definition of the table that stores the user defined course categories
$table_user_defined_category = Database::get_user_personal_table(USER_COURSE_CATEGORY_TABLE);
$table_user_defined_category = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY);
$user_coursecategories=get_user_course_categories();
@ -1053,7 +1053,7 @@ function get_courses_of_user($user_id)
function get_user_course_categories()
{
global $_user;
$table_category = Database::get_user_personal_table(USER_COURSE_CATEGORY_TABLE);
$table_category = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY);
$sql = "SELECT * FROM ".$table_category." WHERE user_id='".$_user['user_id']."' ORDER BY sort ASC";
$result = api_sql_query($sql,__FILE__,__LINE__);
while ($row = mysql_fetch_array($result))

@ -1,458 +1,458 @@
<?php
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
BLOG HOMEPAGE
This file takes care of all blog navigation and displaying.
@package dokeos.blogs
==============================================================================
*/
/*
==============================================================================
INIT
==============================================================================
*/
$langFile = "blog";
$blog_id = intval($_GET['blog_id']);
include ('../inc/global.inc.php');
//session
if(isset($_GET['id_session']))
$_SESSION['id_session'] = $_GET['id_session'];
require_once (api_get_path(LIBRARY_PATH)."/display.lib.php");
require_once (api_get_path(LIBRARY_PATH)."/text.lib.php");
require_once (api_get_path(LIBRARY_PATH)."/blog.lib.php");
require_once (api_get_path(LIBRARY_PATH)."/fckeditor.lib.php");
$nameTools = get_lang("blogs");
$DaysShort = array (get_lang("SundayShort"), get_lang("MondayShort"), get_lang("TuesdayShort"), get_lang("WednesdayShort"), get_lang("ThursdayShort"), get_lang("FridayShort"), get_lang("SaturdayShort"));
$DaysLong = array (get_lang("SundayLong"), get_lang("MondayLong"), get_lang("TuesdayLong"), get_lang("WednesdayLong"), get_lang("ThursdayLong"), get_lang("FridayLong"), get_lang("SaturdayLong"));
$MonthsLong = array (get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong"));
$current_page = $_GET['action'];
/*
==============================================================================
PROCESSING
==============================================================================
*/
if ($_POST['new_post_submit'])
{
Blog :: create_post(mysql_real_escape_string($_POST['post_title']), mysql_real_escape_string($_POST['post_full_text']), $blog_id);
}
if ($_POST['edit_post_submit'])
{
Blog :: edit_post(mysql_real_escape_string($_POST['post_id']), mysql_real_escape_string($_POST['post_title']), mysql_real_escape_string($_POST['post_full_text']), $blog_id);
}
if ($_POST['new_comment_submit'])
{
Blog :: create_comment(mysql_real_escape_string($_POST['comment_title']), mysql_real_escape_string($_POST['comment_text']), $blog_id, mysql_real_escape_string($_GET['post_id']), mysql_real_escape_string($_POST['comment_parent_id']));
}
if ($_POST['new_task_submit'])
{
Blog :: create_task($blog_id, mysql_real_escape_string($_POST['task_name']), mysql_real_escape_string($_POST['task_description']), mysql_real_escape_string($_POST['chkArticleDelete']), mysql_real_escape_string($_POST['chkArticleEdit']), mysql_real_escape_string($_POST['chkCommentsDelete']), mysql_real_escape_string($_POST['task_color']));
}
if ($_POST['edit_task_submit'])
{
Blog :: edit_task(mysql_real_escape_string($_POST['blog_id']), mysql_real_escape_string($_POST['task_id']), mysql_real_escape_string($_POST['task_name']), mysql_real_escape_string($_POST['task_description']), mysql_real_escape_string($_POST['chkArticleDelete']), mysql_real_escape_string($_POST['chkArticleEdit']), mysql_real_escape_string($_POST['chkCommentsDelete']), mysql_real_escape_string($_POST['task_color']));
}
if ($_POST['assign_task_submit'])
{
Blog :: assign_task($blog_id, mysql_real_escape_string($_POST['task_user_id']), mysql_real_escape_string($_POST['task_task_id']), mysql_real_escape_string($_POST['task_year'])."-".mysql_real_escape_string($_POST['task_month'])."-".mysql_real_escape_string($_POST['task_day']));
}
if ($_POST['assign_task_edit_submit'])
{
Blog :: edit_assigned_task($blog_id, mysql_real_escape_string($_POST['task_user_id']), mysql_real_escape_string($_POST['task_task_id']), mysql_real_escape_string($_POST['task_year'])."-".mysql_real_escape_string($_POST['task_month'])."-".mysql_real_escape_string($_POST['task_day']), mysql_real_escape_string($_POST['old_user_id']), mysql_real_escape_string($_POST['old_task_id']), mysql_real_escape_string($_POST['old_target_date']));
}
if ($_POST['new_task_execution_submit'])
{
Blog :: create_comment(mysql_real_escape_string($_POST['comment_title']), mysql_real_escape_string($_POST['comment_text']), $blog_id, mysql_real_escape_string($_GET['post_id']), mysql_real_escape_string($_POST['comment_parent_id']), mysql_real_escape_string($_POST['task_id']));
}
if ($_POST['register'])
{
foreach ($_POST['user'] as $index => $user_id)
{
Blog :: set_user_subscribed(mysql_real_escape_string($_GET['blog_id']), mysql_real_escape_string($user_id));
}
}
if ($_POST['unregister'])
{
foreach ($_POST['user'] as $index => $user_id)
{
Blog :: set_user_unsubscribed(mysql_real_escape_string($_GET['blog_id']), mysql_real_escape_string($user_id));
}
}
if ($_GET['register'])
{
Blog :: set_user_subscribed(mysql_real_escape_string($_GET['blog_id']), mysql_real_escape_string($_GET['user_id']));
$flag = 1;
}
if ($_GET['unregister'])
{
Blog :: set_user_unsubscribed(mysql_real_escape_string($_GET['blog_id']), mysql_real_escape_string($_GET['user_id']));
}
if ($_GET['action'] == 'manage_tasks')
{
if ($_GET['do'] == 'delete')
Blog :: delete_task($blog_id, mysql_real_escape_string($_GET['task_id']));
if ($_GET['do'] == 'delete_assignment')
Blog :: delete_assigned_task($blog_id, mysql_real_escape_string($_GET['assignment_id']));
}
if ($_GET['action'] == 'view_post')
{
$task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
if ($_GET['do'] == 'delete_comment')
{
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_comments_delete', $task_id))
{
Blog :: delete_comment($blog_id, mysql_real_escape_string($_GET['comment_id']));
}
else
{
$error = true;
$message = get_lang('ActionNotAllowed');
}
}
if ($_GET['do'] == 'delete_article')
{
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_delete', $task_id))
{
Blog :: delete_post($blog_id, mysql_real_escape_string($_GET['article_id']));
$current_page = ''; // Article is gone, go to blog home
}
else
{
$error = true;
$message = get_lang('ActionNotAllowed');
}
}
if ($_GET['do'] == 'rate')
{
if ($_GET['type'] == 'post')
{
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_rate'))
{
Blog :: add_rating('post', $blog_id, mysql_real_escape_string($_GET['post_id']), mysql_real_escape_string($_GET['rating']));
}
}
if ($_GET['type'] == 'comment')
{
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_comments_add'))
{
Blog :: add_rating('comment', $blog_id, mysql_real_escape_string($_GET['comment_id']), mysql_real_escape_string($_GET['rating']));
}
}
}
}
/*
==============================================================================
DISPLAY
==============================================================================
*/
$htmlHeadXtra[] = "<script src=\"tbl_change.js\" type=\"text/javascript\" language=\"javascript\"></script>";
// Set bredcrumb
switch ($current_page)
{
case "new_post" :
$nameTools = get_lang('NewPost');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "manage_tasks" :
$nameTools = get_lang('TaskManager');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "manage_members" :
$nameTools = get_lang('MemberManager');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "manage_rights" :
$nameTools = get_lang('RightsManager');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "view_search_result" :
$nameTools = get_lang('SearchResults');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "execute_task" :
$nameTools = get_lang('ExecuteThisTask');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
default :
$nameTools = Blog :: get_blog_title($blog_id);
Display :: display_header($nameTools, 'blogs');
}
//Display::display_header($nameTools,'Blogs');
?>
<span class="blog_title"><?php echo Blog::get_blog_title($blog_id) ?></span><br />
<span class="blog_subtitle"><?php echo Blog::get_blog_subtitle($blog_id) ?></span>
<br /><br />
<table width="100%">
<tr>
<td width="220" class="blog_left" valign="top">
<?php
$month = $_GET['month'] ? $_GET['month'] : (int) date('m');
$year = $_GET['year'] ? $_GET['year'] : date('Y');
Blog :: display_minimonthcalendar($month, $year, $blog_id);
?>
<br />
<table width="100%">
<tr>
<td class="blog_menu_title"><?php echo get_lang('ThisBlog') ?></td>
</tr>
<tr>
<td class="blog_menu">
<ul>
<li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('Home') ?>"><?php echo get_lang('Home') ?></a></li>
<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_add')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=new_post&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('NewPost') ?>"><?php echo get_lang('NewPost') ?></a></li><?php } ?>
<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'task_management')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=manage_tasks&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageTasks') ?>"><?php echo get_lang('TaskManager') ?></a></li> <?php } ?>
<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'member_management')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=manage_members&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageMembers') ?>"><?php echo get_lang('MemberManager') ?></a></li><?php } ?>
</ul>
</td>
</tr>
</table>
<br />
<table width="100%">
<tr>
<td class="blog_menu_title"><?php echo get_lang('Search') ?></td>
</tr>
<tr>
<td class="blog_menu">
<form action="blog.php" method="get" enctype="multipart/form-data">
<input type="hidden" name="blog_id" value="<?php echo $blog_id ?>" />
<input type="hidden" name="action" value="view_search_result" />
<input type="text" size="20" name="q" value="<?php echo (isset($_GET['q']) ? $_GET['q'] : ''); ?>" /><input type="submit" value="Go" />
</form>
</td>
</tr>
</table>
<br />
<table width="100%">
<tr>
<td class="blog_menu_title"><?php echo get_lang('MyTasks') ?></td>
</tr>
<tr>
<td class="blog_menu">
<?php Blog::get_personal_task_list(); ?>
</td>
</tr>
</table>
<!--
<br />
<table width="100%">
<tr>
<td class="blog_menu_title"><?php echo get_lang('FavoriteBlogs') ?></td>
</tr>
<tr>
<td class="blog_menu">
<ul>
<li>Favorite 1</li>
<li>Favorite 2</li>
<li>Favorite 3</li>
</ul>
</td>
</tr>
</table>
<br />
<table width="100%">
<tr>
<td class="blog_menu_title"><?php echo get_lang('TopTen') ?></td>
</tr>
<tr>
<td class="blog_menu">
<ul>
<li>Blog 1</li>
<li>Blog 2</li>
<li>Blog 3</li>
</ul>
</td>
</tr>
</table>
-->
</td>
<td valign="top" class="blog_right">
<?php
if ($error)
Display :: display_error_message($message);
if ($flag == '1')
{
$current_page = "manage_tasks";
Blog :: display_assign_task_form($blog_id);
}
$user_task = false;
if (isset ($_GET['task_id']) && is_numeric($_GET['task_id']))
$task_id = $_GET['task_id'];
else
{
$task_id = 0;
$tbl_blogs_tasks_rel_user = Database :: get_course_table(BLOGS_TASKS_REL_USER);
$sql = "
SELECT COUNT(*) as `number`
FROM ".$tbl_blogs_tasks_rel_user."
WHERE
`blog_id` = ".$blog_id." AND
`user_id` = ".$_user['user_id']." AND
`task_id` = ".$task_id;
$result = api_sql_query($sql, __LINE__, __FILE__);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
if ($row['number'] == 1)
$user_task = true;
}
switch ($current_page)
{
case 'new_post' :
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_add', $user_task ? $task_id : 0))
{
Blog :: display_form_new_post($blog_id);
}
else
{
api_not_allowed();
}
break;
case 'view_post' :
Blog :: display_post($blog_id, mysql_real_escape_string($_GET['post_id']));
break;
case 'edit_post' :
$task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_edit', $task_id))
Blog :: display_form_edit_post($blog_id, mysql_real_escape_string($_GET['post_id']));
else
api_not_allowed();
break;
case 'manage_members' :
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'member_management'))
{
Blog :: display_form_user_subscribe($blog_id);
echo '<br /><br />';
Blog :: display_form_user_unsubscribe($blog_id);
}
else
api_not_allowed();
break;
case 'manage_rights' :
Blog :: display_form_user_rights($blog_id);
break;
case 'manage_tasks' :
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'task_management'))
{
if ($_GET['do'] == 'add')
{
Blog :: display_new_task_form($blog_id);
}
if ($_GET['do'] == 'assign')
{
Blog :: display_assign_task_form($blog_id);
}
if ($_GET['do'] == 'edit')
{
Blog :: display_edit_task_form($blog_id, mysql_real_escape_string($_GET['task_id']));
}
if ($_GET['do'] == 'edit_assignment')
{
Blog :: display_edit_assigned_task_form($blog_id, mysql_real_escape_string($_GET['assignment_id']));
}
Blog :: display_task_list($blog_id);
echo '<br /><br />';
Blog :: display_assigned_task_list($blog_id);
echo '<br /><br />';
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'role_management'))
{
?>
<a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=manage_rights&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageRights') ?>"><?php echo get_lang('RightsManager') ?></a>
<?php
}
}
else
api_not_allowed();
break;
case 'execute_task' :
if (isset ($_GET['post_id']))
Blog :: display_post($blog_id, mysql_real_escape_string($_GET['post_id']));
else
Blog :: display_select_task_post($blog_id, mysql_real_escape_string($_GET['task_id']));
break;
case 'view_search_result' :
Blog :: display_search_results($blog_id, mysql_real_escape_string($_GET['q']));
break;
case '' :
default :
if (isset ($_GET['filter']) && !empty ($_GET['filter']))
{
Blog :: display_day_results($blog_id, mysql_real_escape_string($_GET['filter']));
}
else
{
Blog :: display_blog_posts($blog_id);
}
}
?>
</td>
</tr>
</table>
<?php
// The footer is displayed only if we are not in the learnpath
if ($_GET['origin'] != 'learnpath')
{
include ($includePath."/claro_init_footer.inc.php");
}
<?php
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
BLOG HOMEPAGE
This file takes care of all blog navigation and displaying.
@package dokeos.blogs
==============================================================================
*/
/*
==============================================================================
INIT
==============================================================================
*/
$langFile = "blog";
$blog_id = intval($_GET['blog_id']);
include ('../inc/global.inc.php');
//session
if(isset($_GET['id_session']))
$_SESSION['id_session'] = $_GET['id_session'];
require_once (api_get_path(LIBRARY_PATH)."/display.lib.php");
require_once (api_get_path(LIBRARY_PATH)."/text.lib.php");
require_once (api_get_path(LIBRARY_PATH)."/blog.lib.php");
require_once (api_get_path(LIBRARY_PATH)."/fckeditor.lib.php");
$nameTools = get_lang("blogs");
$DaysShort = array (get_lang("SundayShort"), get_lang("MondayShort"), get_lang("TuesdayShort"), get_lang("WednesdayShort"), get_lang("ThursdayShort"), get_lang("FridayShort"), get_lang("SaturdayShort"));
$DaysLong = array (get_lang("SundayLong"), get_lang("MondayLong"), get_lang("TuesdayLong"), get_lang("WednesdayLong"), get_lang("ThursdayLong"), get_lang("FridayLong"), get_lang("SaturdayLong"));
$MonthsLong = array (get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong"));
$current_page = $_GET['action'];
/*
==============================================================================
PROCESSING
==============================================================================
*/
if ($_POST['new_post_submit'])
{
Blog :: create_post(mysql_real_escape_string($_POST['post_title']), mysql_real_escape_string($_POST['post_full_text']), $blog_id);
}
if ($_POST['edit_post_submit'])
{
Blog :: edit_post(mysql_real_escape_string($_POST['post_id']), mysql_real_escape_string($_POST['post_title']), mysql_real_escape_string($_POST['post_full_text']), $blog_id);
}
if ($_POST['new_comment_submit'])
{
Blog :: create_comment(mysql_real_escape_string($_POST['comment_title']), mysql_real_escape_string($_POST['comment_text']), $blog_id, mysql_real_escape_string($_GET['post_id']), mysql_real_escape_string($_POST['comment_parent_id']));
}
if ($_POST['new_task_submit'])
{
Blog :: create_task($blog_id, mysql_real_escape_string($_POST['task_name']), mysql_real_escape_string($_POST['task_description']), mysql_real_escape_string($_POST['chkArticleDelete']), mysql_real_escape_string($_POST['chkArticleEdit']), mysql_real_escape_string($_POST['chkCommentsDelete']), mysql_real_escape_string($_POST['task_color']));
}
if ($_POST['edit_task_submit'])
{
Blog :: edit_task(mysql_real_escape_string($_POST['blog_id']), mysql_real_escape_string($_POST['task_id']), mysql_real_escape_string($_POST['task_name']), mysql_real_escape_string($_POST['task_description']), mysql_real_escape_string($_POST['chkArticleDelete']), mysql_real_escape_string($_POST['chkArticleEdit']), mysql_real_escape_string($_POST['chkCommentsDelete']), mysql_real_escape_string($_POST['task_color']));
}
if ($_POST['assign_task_submit'])
{
Blog :: assign_task($blog_id, mysql_real_escape_string($_POST['task_user_id']), mysql_real_escape_string($_POST['task_task_id']), mysql_real_escape_string($_POST['task_year'])."-".mysql_real_escape_string($_POST['task_month'])."-".mysql_real_escape_string($_POST['task_day']));
}
if ($_POST['assign_task_edit_submit'])
{
Blog :: edit_assigned_task($blog_id, mysql_real_escape_string($_POST['task_user_id']), mysql_real_escape_string($_POST['task_task_id']), mysql_real_escape_string($_POST['task_year'])."-".mysql_real_escape_string($_POST['task_month'])."-".mysql_real_escape_string($_POST['task_day']), mysql_real_escape_string($_POST['old_user_id']), mysql_real_escape_string($_POST['old_task_id']), mysql_real_escape_string($_POST['old_target_date']));
}
if ($_POST['new_task_execution_submit'])
{
Blog :: create_comment(mysql_real_escape_string($_POST['comment_title']), mysql_real_escape_string($_POST['comment_text']), $blog_id, mysql_real_escape_string($_GET['post_id']), mysql_real_escape_string($_POST['comment_parent_id']), mysql_real_escape_string($_POST['task_id']));
}
if ($_POST['register'])
{
foreach ($_POST['user'] as $index => $user_id)
{
Blog :: set_user_subscribed(mysql_real_escape_string($_GET['blog_id']), mysql_real_escape_string($user_id));
}
}
if ($_POST['unregister'])
{
foreach ($_POST['user'] as $index => $user_id)
{
Blog :: set_user_unsubscribed(mysql_real_escape_string($_GET['blog_id']), mysql_real_escape_string($user_id));
}
}
if ($_GET['register'])
{
Blog :: set_user_subscribed(mysql_real_escape_string($_GET['blog_id']), mysql_real_escape_string($_GET['user_id']));
$flag = 1;
}
if ($_GET['unregister'])
{
Blog :: set_user_unsubscribed(mysql_real_escape_string($_GET['blog_id']), mysql_real_escape_string($_GET['user_id']));
}
if ($_GET['action'] == 'manage_tasks')
{
if ($_GET['do'] == 'delete')
Blog :: delete_task($blog_id, mysql_real_escape_string($_GET['task_id']));
if ($_GET['do'] == 'delete_assignment')
Blog :: delete_assigned_task($blog_id, mysql_real_escape_string($_GET['assignment_id']));
}
if ($_GET['action'] == 'view_post')
{
$task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
if ($_GET['do'] == 'delete_comment')
{
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_comments_delete', $task_id))
{
Blog :: delete_comment($blog_id, mysql_real_escape_string($_GET['comment_id']));
}
else
{
$error = true;
$message = get_lang('ActionNotAllowed');
}
}
if ($_GET['do'] == 'delete_article')
{
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_delete', $task_id))
{
Blog :: delete_post($blog_id, mysql_real_escape_string($_GET['article_id']));
$current_page = ''; // Article is gone, go to blog home
}
else
{
$error = true;
$message = get_lang('ActionNotAllowed');
}
}
if ($_GET['do'] == 'rate')
{
if ($_GET['type'] == 'post')
{
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_rate'))
{
Blog :: add_rating('post', $blog_id, mysql_real_escape_string($_GET['post_id']), mysql_real_escape_string($_GET['rating']));
}
}
if ($_GET['type'] == 'comment')
{
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_comments_add'))
{
Blog :: add_rating('comment', $blog_id, mysql_real_escape_string($_GET['comment_id']), mysql_real_escape_string($_GET['rating']));
}
}
}
}
/*
==============================================================================
DISPLAY
==============================================================================
*/
$htmlHeadXtra[] = "<script src=\"tbl_change.js\" type=\"text/javascript\" language=\"javascript\"></script>";
// Set bredcrumb
switch ($current_page)
{
case "new_post" :
$nameTools = get_lang('NewPost');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "manage_tasks" :
$nameTools = get_lang('TaskManager');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "manage_members" :
$nameTools = get_lang('MemberManager');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "manage_rights" :
$nameTools = get_lang('RightsManager');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "view_search_result" :
$nameTools = get_lang('SearchResults');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "execute_task" :
$nameTools = get_lang('ExecuteThisTask');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
default :
$nameTools = Blog :: get_blog_title($blog_id);
Display :: display_header($nameTools, 'blogs');
}
//Display::display_header($nameTools,'Blogs');
?>
<span class="blog_title"><?php echo Blog::get_blog_title($blog_id) ?></span><br />
<span class="blog_subtitle"><?php echo Blog::get_blog_subtitle($blog_id) ?></span>
<br /><br />
<table width="100%">
<tr>
<td width="220" class="blog_left" valign="top">
<?php
$month = $_GET['month'] ? $_GET['month'] : (int) date('m');
$year = $_GET['year'] ? $_GET['year'] : date('Y');
Blog :: display_minimonthcalendar($month, $year, $blog_id);
?>
<br />
<table width="100%">
<tr>
<td class="blog_menu_title"><?php echo get_lang('ThisBlog') ?></td>
</tr>
<tr>
<td class="blog_menu">
<ul>
<li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('Home') ?>"><?php echo get_lang('Home') ?></a></li>
<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_add')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=new_post&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('NewPost') ?>"><?php echo get_lang('NewPost') ?></a></li><?php } ?>
<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'task_management')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=manage_tasks&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageTasks') ?>"><?php echo get_lang('TaskManager') ?></a></li> <?php } ?>
<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'member_management')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=manage_members&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageMembers') ?>"><?php echo get_lang('MemberManager') ?></a></li><?php } ?>
</ul>
</td>
</tr>
</table>
<br />
<table width="100%">
<tr>
<td class="blog_menu_title"><?php echo get_lang('Search') ?></td>
</tr>
<tr>
<td class="blog_menu">
<form action="blog.php" method="get" enctype="multipart/form-data">
<input type="hidden" name="blog_id" value="<?php echo $blog_id ?>" />
<input type="hidden" name="action" value="view_search_result" />
<input type="text" size="20" name="q" value="<?php echo (isset($_GET['q']) ? $_GET['q'] : ''); ?>" /><input type="submit" value="Go" />
</form>
</td>
</tr>
</table>
<br />
<table width="100%">
<tr>
<td class="blog_menu_title"><?php echo get_lang('MyTasks') ?></td>
</tr>
<tr>
<td class="blog_menu">
<?php Blog::get_personal_task_list(); ?>
</td>
</tr>
</table>
<!--
<br />
<table width="100%">
<tr>
<td class="blog_menu_title"><?php echo get_lang('FavoriteBlogs') ?></td>
</tr>
<tr>
<td class="blog_menu">
<ul>
<li>Favorite 1</li>
<li>Favorite 2</li>
<li>Favorite 3</li>
</ul>
</td>
</tr>
</table>
<br />
<table width="100%">
<tr>
<td class="blog_menu_title"><?php echo get_lang('TopTen') ?></td>
</tr>
<tr>
<td class="blog_menu">
<ul>
<li>Blog 1</li>
<li>Blog 2</li>
<li>Blog 3</li>
</ul>
</td>
</tr>
</table>
-->
</td>
<td valign="top" class="blog_right">
<?php
if ($error)
Display :: display_error_message($message);
if ($flag == '1')
{
$current_page = "manage_tasks";
Blog :: display_assign_task_form($blog_id);
}
$user_task = false;
if (isset ($_GET['task_id']) && is_numeric($_GET['task_id']))
$task_id = $_GET['task_id'];
else
{
$task_id = 0;
$tbl_blogs_tasks_rel_user = Database :: get_course_table(TABLE_BLOGS_TASKS_REL_USER);
$sql = "
SELECT COUNT(*) as `number`
FROM ".$tbl_blogs_tasks_rel_user."
WHERE
`blog_id` = ".$blog_id." AND
`user_id` = ".$_user['user_id']." AND
`task_id` = ".$task_id;
$result = api_sql_query($sql, __LINE__, __FILE__);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
if ($row['number'] == 1)
$user_task = true;
}
switch ($current_page)
{
case 'new_post' :
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_add', $user_task ? $task_id : 0))
{
Blog :: display_form_new_post($blog_id);
}
else
{
api_not_allowed();
}
break;
case 'view_post' :
Blog :: display_post($blog_id, mysql_real_escape_string($_GET['post_id']));
break;
case 'edit_post' :
$task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_edit', $task_id))
Blog :: display_form_edit_post($blog_id, mysql_real_escape_string($_GET['post_id']));
else
api_not_allowed();
break;
case 'manage_members' :
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'member_management'))
{
Blog :: display_form_user_subscribe($blog_id);
echo '<br /><br />';
Blog :: display_form_user_unsubscribe($blog_id);
}
else
api_not_allowed();
break;
case 'manage_rights' :
Blog :: display_form_user_rights($blog_id);
break;
case 'manage_tasks' :
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'task_management'))
{
if ($_GET['do'] == 'add')
{
Blog :: display_new_task_form($blog_id);
}
if ($_GET['do'] == 'assign')
{
Blog :: display_assign_task_form($blog_id);
}
if ($_GET['do'] == 'edit')
{
Blog :: display_edit_task_form($blog_id, mysql_real_escape_string($_GET['task_id']));
}
if ($_GET['do'] == 'edit_assignment')
{
Blog :: display_edit_assigned_task_form($blog_id, mysql_real_escape_string($_GET['assignment_id']));
}
Blog :: display_task_list($blog_id);
echo '<br /><br />';
Blog :: display_assigned_task_list($blog_id);
echo '<br /><br />';
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'role_management'))
{
?>
<a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=manage_rights&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageRights') ?>"><?php echo get_lang('RightsManager') ?></a>
<?php
}
}
else
api_not_allowed();
break;
case 'execute_task' :
if (isset ($_GET['post_id']))
Blog :: display_post($blog_id, mysql_real_escape_string($_GET['post_id']));
else
Blog :: display_select_task_post($blog_id, mysql_real_escape_string($_GET['task_id']));
break;
case 'view_search_result' :
Blog :: display_search_results($blog_id, mysql_real_escape_string($_GET['q']));
break;
case '' :
default :
if (isset ($_GET['filter']) && !empty ($_GET['filter']))
{
Blog :: display_day_results($blog_id, mysql_real_escape_string($_GET['filter']));
}
else
{
Blog :: display_blog_posts($blog_id);
}
}
?>
</td>
</tr>
</table>
<?php
// The footer is displayed only if we are not in the learnpath
if ($_GET['origin'] != 'learnpath')
{
include ($includePath."/claro_init_footer.inc.php");
}
?>

@ -1,4 +1,4 @@
<?php //$Id: agenda.php 10195 2006-11-25 15:26:00Z pcool $
<?php //$Id: agenda.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -206,7 +206,7 @@ $TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_courseUser = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_group = Database::get_course_table(TABLE_GROUP);
$tbl_groupUser = Database::get_course_table(GROUP_USER_TABLE);
$tbl_groupUser = Database::get_course_table(TABLE_GROUP_USER);
$tbl_session_course_user= Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);

@ -90,7 +90,7 @@ $TABLECOURS = Database :: get_main_table(TABLE_MAIN_COURSE);
$TABLECOURSUSER = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$TABLEAGENDA = Database :: get_course_table(TABLE_AGENDA);
$TABLE_ITEMPROPERTY = Database :: get_course_table(TABLE_ITEM_PROPERTY);
$TABLE_PERSONAL_AGENDA = Database :: get_user_personal_table(PERSONAL_AGENDA);
$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
// the variables for the days and the months
// Defining the shorts for the days
@ -114,7 +114,7 @@ if (get_setting("allow_personal_agenda") == "true")
// the main dokeos database by changing $DATABASE_USER_TOOLS above to $_configuration['main_database']
$sql_create_database = "CREATE DATABASE IF NOT EXISTS `$DATABASE_USER_TOOLS`";
$result = api_sql_query($sql_create_database);
$sql_create_table = "CREATE TABLE IF NOT EXISTS $TABLE_PERSONAL_AGENDA (
$sql_create_table = "CREATE TABLE IF NOT EXISTS $tbl_personal_agenda (
`id` int(11) NOT NULL auto_increment,
`user` int(11),
`title` text,
@ -944,7 +944,7 @@ function get_week_agendaitems($courses_dbs, $month, $year, $week = '')
function show_new_item_form($id = "")
{
global $year, $MonthsLong;
global $TABLE_PERSONAL_AGENDA;
global $tbl_personal_agenda;
global $_user;
// we construct the default time and date data (used if we are not editing a personal agenda item)
$today = getdate();
@ -958,7 +958,7 @@ function show_new_item_form($id = "")
// to overwrite the default information)
if ($id <> "")
{
$sql = "SELECT * FROM ".$TABLE_PERSONAL_AGENDA." WHERE user='".$_user['user_id']."' AND id='".$id."'";
$sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$_user['user_id']."' AND id='".$id."'";
$result = api_sql_query($sql, __FILE__, __LINE__);
$aantal = mysql_num_rows($result);
if ($aantal <> 0)
@ -1112,17 +1112,17 @@ function show_new_item_form($id = "")
// This function shows all the forms that are needed form adding a new personal agenda item
function store_personal_item($day, $month, $year, $hour, $minute, $title, $content, $id = "")
{
global $TABLE_PERSONAL_AGENDA;
global $tbl_personal_agenda;
global $_user;
//constructing the date
$date = $year."-".$month."-".$day." ".$hour.":".$minute.":00";
if ($id <> "")
{ // we are updating
$sql = "UPDATE ".$TABLE_PERSONAL_AGENDA." SET user='".$_user['user_id']."', title='".$title."', text='".$content."', date='".$date."' WHERE id='".$id."'";
$sql = "UPDATE ".$tbl_personal_agenda." SET user='".$_user['user_id']."', title='".$title."', text='".$content."', date='".$date."' WHERE id='".$id."'";
}
else
{ // we are adding a new item
$sql = "INSERT INTO $TABLE_PERSONAL_AGENDA (user, title, text, date) VALUES ('".$_user['user_id']."','$title', '$content', '$date')";
$sql = "INSERT INTO $tbl_personal_agenda (user, title, text, date) VALUES ('".$_user['user_id']."','$title', '$content', '$date')";
}
$result = api_sql_query($sql, __FILE__, __LINE__);
}
@ -1156,13 +1156,13 @@ function get_courses_of_user()
// This function retrieves all the personal agenda items and add them to the agenda items found by the other functions.
function get_personal_agendaitems($agendaitems, $day = "", $month = "", $year = "", $week = "", $type)
{
global $TABLE_PERSONAL_AGENDA;
global $tbl_personal_agenda;
global $_user;
global $_configuration;
// 1. creating the SQL statement for getting the personal agenda items in MONTH view
if ($type == "month_view" or $type == "") // we are in month view
{
$sql = "SELECT * FROM ".$TABLE_PERSONAL_AGENDA." WHERE user='".$_user['user_id']."' and MONTH(date)='".$month."' AND YEAR(date) = '".$year."' ORDER BY date ASC";
$sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$_user['user_id']."' and MONTH(date)='".$month."' AND YEAR(date) = '".$year."' ORDER BY date ASC";
}
// 2. creating the SQL statement for getting the personal agenda items in WEEK view
if ($type == "week_view") // we are in week view
@ -1177,7 +1177,7 @@ function get_personal_agendaitems($agendaitems, $day = "", $month = "", $year =
// in sql statements you have to use year-month-day for date calculations
$start_filter = $start_year."-".$start_month."-".$start_day;
$end_filter = $end_year."-".$end_month."-".$end_day;
$sql = " SELECT * FROM ".$TABLE_PERSONAL_AGENDA." WHERE user='".$_user['user_id']."'
$sql = " SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$_user['user_id']."'
AND date>='".$start_filter."' AND date<='".$end_filter."'";
}
// 3. creating the SQL statement for getting the personal agenda items in DAY view
@ -1186,7 +1186,7 @@ function get_personal_agendaitems($agendaitems, $day = "", $month = "", $year =
// we could use mysql date() function but this is only available from 4.1 and higher
$start_filter = $year."-".$month."-".$day." 00:00:01";
$end_filter = $year."-".$month."-".$day." 23:59:59";
$sql = " SELECT * FROM ".$TABLE_PERSONAL_AGENDA." WHERE user='".$_user['user_id']."' AND date>='".$start_filter."' AND date<='".$end_filter."'";
$sql = " SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$_user['user_id']."' AND date>='".$start_filter."' AND date<='".$end_filter."'";
}
//echo "day:".$day."/";
//echo "month:".$month."/";
@ -1247,11 +1247,11 @@ function get_personal_agendaitems($agendaitems, $day = "", $month = "", $year =
// these items in one list (ordered by date and grouped by month (the month_bar)
function show_personal_agenda()
{
global $TABLE_PERSONAL_AGENDA;
global $tbl_personal_agenda;
global $MonthsLong;
global $_user;
// The SQL statement that retrieves all the personal agenda items of this user
$sql = "SELECT * FROM ".$TABLE_PERSONAL_AGENDA." WHERE user='".$_user['user_id']."' ORDER BY date DESC";
$sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$_user['user_id']."' ORDER BY date DESC";
$result = api_sql_query($sql, __FILE__, __LINE__);
// variable initialisation
$month_bar = "";
@ -1338,16 +1338,16 @@ function show_personal_agenda()
// does not belong to him/her
function delete_personal_agenda($id)
{
global $TABLE_PERSONAL_AGENDA;
global $tbl_personal_agenda;
global $_user;
if ($id <> '')
{
$sql = "SELECT * FROM ".$TABLE_PERSONAL_AGENDA." WHERE user='".$_user['user_id']."' AND id='".$id."'";
$sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$_user['user_id']."' AND id='".$id."'";
$result = api_sql_query($sql, __FILE__, __LINE__);
$aantal = mysql_num_rows($result);
if ($aantal <> 0)
{
$sql = "DELETE FROM ".$TABLE_PERSONAL_AGENDA." WHERE user='".$_user['user_id']."' AND id='".$id."'";
$sql = "DELETE FROM ".$tbl_personal_agenda." WHERE user='".$_user['user_id']."' AND id='".$id."'";
$result = api_sql_query($sql, __FILE__, __LINE__);
}
}

@ -168,7 +168,7 @@ function show_tools_category($course_tool_category)
if($toolsRow['image'] == 'blog.gif')
{
// Init
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
$tbl_blogs_rel_user = Database::get_course_table(TABLE_BLOGS_REL_USER);
// Get blog id
$blog_id = substr($toolsRow['link'], strrpos($toolsRow['link'], '=') + 1, strlen($toolsRow['link']));

@ -1,5 +1,5 @@
<?php
// $Id: infocours.php 10195 2006-11-25 15:26:00Z pcool $
// $Id: infocours.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -72,7 +72,7 @@ $TABLEBBCONFIG = Database :: get_course_table(TOOL_FORUM_CONFIG_TABLE);
$currentCourseID = $_course['sysCode'];
$currentCourseRepository = $_course["path"];
$is_allowedToEdit = $is_courseAdmin;
$course_setting_table = Database::get_course_table(COURSE_SETTING_TABLE);
$course_setting_table = Database::get_course_table(TABLE_COURSE_SETTING);
/*
==============================================================================
LOGIC FUNCTIONS
@ -219,7 +219,7 @@ if ($form->validate() && is_settings_editable())
WHERE code = '".$course_code."'";
api_sql_query($sql, __FILE__, __LINE__);
//update course_settings table
$table_course_setting = Database::get_course_table(COURSE_SETTING_TABLE);
$table_course_setting = Database::get_course_table(TABLE_COURSE_SETTING);
if($update_values['email_alert_manager_on_new_doc'] != $values['email_alert_manager_on_new_doc']){
$sql = "UPDATE $table_course_setting SET value = ".(int)$update_values['email_alert_manager_on_new_doc']." WHERE variable = 'email_alert_manager_on_new_doc'' ";
api_sql_query($sql,__FILE__,__LINE__);

@ -1,4 +1,4 @@
<?php // $Id: CourseBuilder.class.php 10195 2006-11-25 15:26:00Z pcool $
<?php // $Id: CourseBuilder.class.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -82,7 +82,7 @@ class CourseBuilder
$this->build_quizzes();
$this->build_learnpaths();
$this->build_scorm_documents();
$table = Database :: get_course_table(LINKED_RESOURCES_TABLE);
$table = Database :: get_course_table(TABLE_LINKED_RESOURCES);
foreach ($this->course->resources as $type => $resources)
{
foreach ($resources as $id => $resource)
@ -240,8 +240,8 @@ class CourseBuilder
*/
function build_quizzes()
{
$table_qui = Database :: get_course_table(QUIZ_TEST_TABLE);
$table_rel = Database :: get_course_table(QUIZ_TEST_QUESTION_TABLE);
$table_qui = Database :: get_course_table(TABLE_QUIZ_TEST);
$table_rel = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION);
$table_doc = Database :: get_course_table(TABLE_DOCUMENT);
$sql = 'SELECT * FROM '.$table_qui;
$db_result = api_sql_query($sql, __FILE__, __LINE__);
@ -268,8 +268,8 @@ class CourseBuilder
*/
function build_quiz_questions()
{
$table_que = Database :: get_course_table(QUIZ_QUESTION_TABLE);
$table_ans = Database :: get_course_table(QUIZ_ANSWER_TABLE);
$table_que = Database :: get_course_table(TABLE_QUIZ_QUESTION);
$table_ans = Database :: get_course_table(TABLE_QUIZ_ANSWER);
$sql = 'SELECT * FROM '.$table_que;
$db_result = api_sql_query($sql, __FILE__, __LINE__);
while ($obj = mysql_fetch_object($db_result))
@ -331,9 +331,9 @@ class CourseBuilder
*/
function build_learnpaths()
{
$table_main = Database :: get_course_table(LEARNPATH_MAIN_TABLE);
$table_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
$table_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
$table_main = Database :: get_course_table(TABLE_LEARNPATH_MAIN);
$table_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
$table_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
$table_tool = Database::get_course_table(TABLE_TOOL_LIST);
$sql = 'SELECT * FROM '.$table_main;

@ -1,5 +1,5 @@
<?php
// $Id: CourseRecycler.class.php 10195 2006-11-25 15:26:00Z pcool $
// $Id: CourseRecycler.class.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -52,7 +52,7 @@ class CourseRecycler
*/
function recycle()
{
$table_linked_resources = Database :: get_course_table(LINKED_RESOURCES_TABLE, $this->course->destination_db);
$table_linked_resources = Database :: get_course_table(TABLE_LINKED_RESOURCES, $this->course->destination_db);
$table_item_properties = Database::get_course_table(TABLE_ITEM_PROPERTY);
foreach ($this->course->resources as $type => $resources)
{
@ -200,8 +200,8 @@ class CourseRecycler
{
if ($this->course->has_resources(RESOURCE_QUIZ))
{
$table_qui = Database :: get_course_table(QUIZ_TEST_TABLE);
$table_rel = Database :: get_course_table(QUIZ_TEST_QUESTION_TABLE);
$table_qui = Database :: get_course_table(TABLE_QUIZ_TEST);
$table_rel = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION);
$ids = implode(',', (array_keys($this->course->resources[RESOURCE_QUIZ])));
$sql = "DELETE FROM ".$table_qui." WHERE id IN(".$ids.")";
api_sql_query($sql,__FILE__,__LINE__);
@ -216,9 +216,9 @@ class CourseRecycler
{
if ($this->course->has_resources(RESOURCE_LEARNPATH))
{
$table_main = Database :: get_course_table(LEARNPATH_MAIN_TABLE);
$table_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
$table_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
$table_main = Database :: get_course_table(TABLE_LEARNPATH_MAIN);
$table_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
$table_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
$table_tool = Database::get_course_table(TABLE_TOOL_LIST);
foreach($this->course->resources[RESOURCE_LEARNPATH] as $id => $learnpath)
{

@ -1,7 +1,7 @@
<?php
// $Id: CourseRestorer.class.php 10195 2006-11-25 15:26:00Z pcool $
// $Id: CourseRestorer.class.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -136,7 +136,7 @@ class CourseRestorer
}
}
// Restore the linked-resources
$table = Database :: get_course_table(LINKED_RESOURCES_TABLE, $this->course->destination_db);
$table = Database :: get_course_table(TABLE_LINKED_RESOURCES, $this->course->destination_db);
foreach ($this->course->resources as $type => $resources)
{
foreach ($resources as $id => $resource)
@ -544,8 +544,8 @@ class CourseRestorer
{
if ($this->course->has_resources(RESOURCE_QUIZ))
{
$table_qui = Database :: get_course_table(QUIZ_TEST_TABLE, $this->course->destination_db);
$table_rel = Database :: get_course_table(QUIZ_TEST_QUESTION_TABLE, $this->course->destination_db);
$table_qui = Database :: get_course_table(TABLE_QUIZ_TEST, $this->course->destination_db);
$table_rel = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION, $this->course->destination_db);
$table_doc = Database :: get_course_table(TABLE_DOCUMENT, $this->course->destination_db);
$resources = $this->course->resources;
foreach ($resources[RESOURCE_QUIZ] as $id => $quiz)
@ -590,8 +590,8 @@ class CourseRestorer
{
return $question->destination_id;
}
$table_que = Database :: get_course_table(QUIZ_QUESTION_TABLE, $this->course->destination_db);
$table_ans = Database :: get_course_table(QUIZ_ANSWER_TABLE, $this->course->destination_db);
$table_que = Database :: get_course_table(TABLE_QUIZ_QUESTION, $this->course->destination_db);
$table_ans = Database :: get_course_table(TABLE_QUIZ_ANSWER, $this->course->destination_db);
$sql = "INSERT INTO ".$table_que." SET question = '".addslashes($question->question)."', description = '".addslashes($question->description)."', ponderation = '".addslashes($question->ponderation)."', position = '".addslashes($question->position)."', type='".addslashes($question->quiz_type)."'";
api_sql_query($sql, __FILE__, __LINE__);
$new_id = mysql_insert_id();
@ -612,10 +612,10 @@ class CourseRestorer
{
if ($this->course->has_resources(RESOURCE_LEARNPATH))
{
$table_main = Database :: get_course_table(LEARNPATH_MAIN_TABLE, $this->course->destination_db);
$table_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE, $this->course->destination_db);
$table_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE, $this->course->destination_db);
$table_tool = Database::get_course_table(TABLE_TOOL_LIST, $this->course->destination_db);
$table_main = Database :: get_course_table(TABLE_LEARNPATH_MAIN, $this->course->destination_db);
$table_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER, $this->course->destination_db);
$table_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM, $this->course->destination_db);
$table_tool = Database::get_course_table(TABLE_TOOL_LIST, $this->course->destination_db);
$resources = $this->course->resources;
$prereq_old = array ();

@ -1,4 +1,4 @@
<?php // $Id: adminhp.php 10195 2006-11-25 15:26:00Z pcool $
<?php // $Id: adminhp.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -74,19 +74,13 @@ $audioPath=$documentPath.'/audio';
// tables used in the exercise tool
//$TBL_EXERCICE_QUESTION = $_course['dbNameGlu'].'quiz_rel_test_question';
//$TBL_EXERCICES = $_course['dbNameGlu'].'quiz_test';
//$TBL_QUESTIONS = $_course['dbNameGlu'].'quiz_question';
//$TBL_REPONSES = $_course['dbNameGlu'].'quiz_answer';
//$TBL_DOCUMENT = $_course['dbNameGlu']."document";
$TBL_EXERCICE_QUESTION = Database::get_course_table(QUIZ_TEST_QUESTION_TABLE);
$TBL_EXERCICES = Database::get_course_table(QUIZ_TEST_TABLE);
$TBL_QUESTIONS = Database::get_course_table(QUIZ_QUESTION_TABLE);
$TBL_REPONSES = Database::get_course_table(QUIZ_ANSWER_TABLE);
$TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT);
//$dbTable = $_course['dbNameGlu']."document";
$dbTable = $TBL_DOCUMENT;
// Database table definitions
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_REPONSES = Database::get_course_table(TABLE_QUIZ_ANSWER);
$TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT);
$dbTable = $TBL_DOCUMENT;
if(!$is_allowedToEdit)
{

@ -1,4 +1,4 @@
<?php // $Id: answer.class.php 10110 2006-11-22 15:20:46Z develop-it $
<?php // $Id: answer.class.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -264,7 +264,7 @@ $this->hotspot_coordinates[$i]=$object->hotspot_coordinates;
*/
function getQuestionType()
{
$TBL_QUESTIONS = Database::get_course_table(QUIZ_QUESTION_TABLE);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$sql = "SELECT * FROM $TBL_QUESTIONS WHERE id = '".$this->questionId."'";
$res = api_sql_query($sql,__FILE__,__LINE__);
if(Database::num_rows($res)<=0){

@ -65,9 +65,9 @@ $is_allowedToEdit = is_allowed_to_edit();
$TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
$TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT);
$TBL_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
$TBL_EXERCICE_QUESTION = Database::get_course_table(QUIZ_TEST_QUESTION_TABLE);
$TBL_EXERCICES = Database::get_course_table(QUIZ_TEST_TABLE);
$TBL_QUESTIONS = Database::get_course_table(QUIZ_QUESTION_TABLE);
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_TRACK_EXERCICES = $_configuration['statistics_database']."`.`track_e_exercices";
$TBL_TRACK_HOTPOTATOES = $_configuration['statistics_database']."`.`track_e_hotpotatoes";
$TABLETRACK_ATTEMPT = $_configuration['statistics_database']."`.`track_e_attempt";

@ -1,4 +1,4 @@
<?php // $Id: exercise.class.php 10195 2006-11-25 15:26:00Z pcool $
<?php // $Id: exercise.class.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -78,10 +78,10 @@ class Exercise
#$TBL_EXERCICES = $_course['dbNameGlu'].'quiz';
#$TBL_QUESTIONS = $_course['dbNameGlu'].'quiz_question';
#$TBL_REPONSES = $_course['dbNameGlu'].'quiz_answer';
$TBL_EXERCICE_QUESTION = Database::get_course_table(QUIZ_TEST_QUESTION_TABLE);
$TBL_EXERCICES = Database::get_course_table(QUIZ_TEST_TABLE);
$TBL_QUESTIONS = Database::get_course_table(QUIZ_QUESTION_TABLE);
#$TBL_REPONSES = Database::get_course_table(QUIZ_ANSWER_TABLE);
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
#$TBL_REPONSES = Database::get_course_table(TABLE_QUIZ_ANSWER);
$sql="SELECT title,description,sound,type,random,active FROM $TBL_EXERCICES WHERE id='$id'";
$result=api_sql_query($sql,__FILE__,__LINE__);
@ -413,8 +413,8 @@ class Exercise
*/
function save()
{
$TBL_EXERCICES = Database::get_course_table(QUIZ_TEST_TABLE);
$TBL_QUESTIONS = Database::get_course_table(QUIZ_QUESTION_TABLE);
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$id=$this->id;
$exercise=addslashes($this->exercise);
@ -597,8 +597,8 @@ class Exercise
*/
function delete()
{
$TBL_EXERCICE_QUESTION = Database::get_course_table(QUIZ_TEST_QUESTION_TABLE);
$TBL_EXERCICES = Database::get_course_table(QUIZ_TEST_TABLE);
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$id=$this->id;

@ -1,4 +1,4 @@
<?php // $Id: exercise_result.php 10191 2006-11-24 08:09:14Z pcool $
<?php // $Id: exercise_result.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -72,7 +72,7 @@ $TABLETRACK_EXERCICES = $_configuration['statistics_database']."`.`track_e_exer
$TABLETRACK_ATTEMPT = $_configuration['statistics_database']."`.`track_e_attempt";
$main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
$main_course_user_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$table_ans = Database :: get_course_table(QUIZ_ANSWER_TABLE);
$table_ans = Database :: get_course_table(TABLE_QUIZ_ANSWER);
//temp values to move to AWACS
$dsp_percent = false; //false to display total score as absolute values

@ -41,7 +41,7 @@ $full_file_path = $documentPath.$test;
my_delete($full_file_path.$_user['user_id'].".t.html");
$TABLETRACK_HOTPOTATOES = $_configuration['statistics_database']."`.`track_e_hotpotatoes";
$tbl_learnpath_user = Database::get_course_table(LEARNPATH_USER_TABLE);
$tbl_learnpath_user = Database::get_course_table(TABLE_LEARNPATH_USER);
//$_course['dbNameGlu']."learnpath_user";
$_cid = $cid;
$test = mysql_real_escape_string($_REQUEST['test']);

@ -59,7 +59,7 @@ include_once (api_get_path(LIBRARY_PATH).'events.lib.inc.php'); //necessary for
//Create default category if it doesn't exist when group categories aren't allowed
if( api_get_setting('allow_group_categories') == 'false')
{
$cat_table = Database::get_course_table(GROUP_CATEGORY_TABLE);
$cat_table = Database::get_course_table(TABLE_GROUP_CATEGORY);
$sql = "SELECT * FROM $cat_table WHERE id = '".DEFAULT_GROUP_CATEGORY."'";
$res = api_sql_query($sql,__FILE__,__LINE__);
$num = mysql_num_rows($res);

@ -395,7 +395,7 @@ foreach($language_files as $index => $language_file)
//Update of the logout_date field in the table track_e_login (needed for the calculation of the total connection time)
$tbl_track_login = Database :: get_statistic_table(STATISTIC_TRACK_E_LOGIN_TABLE);
$tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql_last_connection="SELECT login_id, login_date FROM $tbl_track_login WHERE login_user_id='".$_user["user_id"]."' ORDER BY login_date DESC LIMIT 0,1";

@ -52,7 +52,7 @@ class Blog
if(is_numeric($blog_id))
{
// init
$tbl_blogs = Database::get_course_table(BLOGS_TABLE);
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$sql = "
SELECT `blog_name`
@ -78,7 +78,7 @@ class Blog
function get_blog_subtitle($blog_id)
{
// init
$tbl_blogs = Database::get_course_table(BLOGS_TABLE);
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$sql = "SELECT `blog_subtitle` FROM $tbl_blogs WHERE `blog_id` =$blog_id";
$result = api_sql_query($sql, __FILE__, __LINE__);
$blog = mysql_fetch_array($result);
@ -99,8 +99,8 @@ class Blog
{
// Database table definitions
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs = Database::get_course_table(BLOGS_TABLE);
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$tbl_blogs_rel_user = Database::get_course_table(TABLE_BLOGS_REL_USER);
// Get blog members
$sql = "
@ -138,10 +138,10 @@ class Blog
global $_user;
// Tabel definitions
$tbl_blogs = Database::get_course_table(BLOGS_TABLE);
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$tbl_tool = Database::get_course_table(TABLE_TOOL_LIST);
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_posts = Database::get_course_table(TABLE_BLOGS_POSTS);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
// Create the blog
$sql = "INSERT INTO $tbl_blogs (`blog_name`, `blog_subtitle`, `date_creation`, `visibility` ) VALUES ('$title', '$subtitle', NOW(), '1');";
@ -177,7 +177,7 @@ class Blog
global $_user;
// Table definitions
$tbl_blogs = Database::get_course_table(BLOGS_TABLE);
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$tbl_tool = Database::get_course_table(TABLE_TOOL_LIST);
// Update the blog
@ -203,11 +203,11 @@ class Blog
function delete_blog($blog_id)
{
// Init
$tbl_blogs = Database::get_course_table(BLOGS_TABLE);
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_tool = Database::get_course_table(TABLE_TOOL_LIST);
$tbl_blogs_rating = Database::get_course_table(BLOGS_RATING);
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$tbl_blogs_posts = Database::get_course_table(TABLE_BLOGS_POSTS);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
$tbl_tool = Database::get_course_table(TABLE_TOOL_LIST);
$tbl_blogs_rating = Database::get_course_table(TABLE_BLOGS_RATING);
// Delete posts
$sql = "DELETE FROM $tbl_blogs_posts WHERE blog_id = $blog_id";
@ -247,7 +247,7 @@ class Blog
global $_user;
// Table Definitions
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_blogs_posts = Database::get_course_table(TABLE_BLOGS_POSTS);
// Create the post
$sql = "INSERT INTO " . $tbl_blogs_posts." (`title`, `full_text`, `date`, `blog_id`, `author` ) VALUES ('$title', '$full_text', NOW(), '$blog_id', '".$_user['user_id']."');";
@ -270,7 +270,7 @@ class Blog
function edit_post($post_id, $title, $full_text, $blog_id)
{
// Init
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_blogs_posts = Database::get_course_table(TABLE_BLOGS_POSTS);
// Create the post
$sql = "UPDATE $tbl_blogs_posts SET title = '" . $title."', full_text = '" . $full_text."' WHERE post_id =$post_id AND blog_id =$blog_id LIMIT 1 ;";
@ -291,9 +291,9 @@ class Blog
function delete_post($blog_id, $post_id)
{
// Init
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_blogs_comments = Database::get_course_table(BLOGS_COMMENTS_TABLE);
$tbl_blogs_rating = Database::get_course_table(BLOGS_RATING);
$tbl_blogs_posts = Database::get_course_table(TABLE_BLOGS_POSTS);
$tbl_blogs_comments = Database::get_course_table(TABLE_BLOGS_COMMENTS);
$tbl_blogs_rating = Database::get_course_table(TABLE_BLOGS_RATING);
// Delete ratings on this comment
$sql = "DELETE FROM $tbl_blogs_rating WHERE blog_id = $blog_id AND item_id = $post_id AND rating_type = 'post'";
@ -327,7 +327,7 @@ class Blog
global $_user;
// Table Definition
$tbl_blogs_comments = Database::get_course_table(BLOGS_COMMENTS_TABLE);
$tbl_blogs_comments = Database::get_course_table(TABLE_BLOGS_COMMENTS);
// Create the comment
$sql = "INSERT INTO $tbl_blogs_comments (`title`, `comment`, `author`, `date`, `blog_id`, `post_id`, `parent_comment_id`, `task_id` ) VALUES ('$title', '$full_text', '".$_user['user_id']."', NOW(), '$blog_id', '$post_id', '$parent_id', $task_id)";
@ -352,8 +352,8 @@ class Blog
function delete_comment($blog_id, $comment_id)
{
// Init
$tbl_blogs_comments = Database::get_course_table(BLOGS_COMMENTS_TABLE);
$tbl_blogs_rating = Database::get_course_table(BLOGS_RATING);
$tbl_blogs_comments = Database::get_course_table(TABLE_BLOGS_COMMENTS);
$tbl_blogs_rating = Database::get_course_table(TABLE_BLOGS_RATING);
// Delete ratings on this comment
$sql = "DELETE FROM $tbl_blogs_rating WHERE blog_id = $blog_id AND item_id = $comment_id AND rating_type = 'comment'";
@ -390,8 +390,8 @@ class Blog
function create_task($blog_id, $title, $description, $articleDelete, $articleEdit, $commentsDelete, $color)
{
// Init
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_tasks_permissions = Database::get_course_table(BLOGS_TASKS_PERMISSIONS);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
$tbl_tasks_permissions = Database::get_course_table(TABLE_BLOGS_TASKS_PERMISSIONS);
// Create the task
$sql = "INSERT INTO $tbl_blogs_tasks (`blog_id`, `title`, `description`, `color`, `system_task` ) VALUES ('$blog_id', '" . $title."', '" . $description."', '" . $color."', '0');";
@ -465,8 +465,8 @@ class Blog
function edit_task($blog_id, $task_id, $title, $description, $articleDelete, $articleEdit, $commentsDelete, $color)
{
// Init
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_tasks_permissions = Database::get_course_table(BLOGS_TASKS_PERMISSIONS);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
$tbl_tasks_permissions = Database::get_course_table(TABLE_BLOGS_TASKS_PERMISSIONS);
// Create the task
$sql = "UPDATE $tbl_blogs_tasks SET title = '$title', description = '$description', color = '$color' WHERE task_id =$task_id LIMIT 1";
@ -540,7 +540,7 @@ class Blog
function delete_task($blog_id, $task_id)
{
// Init
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
// Delete posts
$sql = "DELETE FROM $tbl_blogs_tasks WHERE `blog_id` = $blog_id AND `task_id` = $task_id";
@ -558,7 +558,7 @@ class Blog
function delete_assigned_task($blog_id, $assignment_id)
{
// Init
$tbl_blogs_tasks_rel_user = Database::get_course_table(BLOGS_TASKS_REL_USER);
$tbl_blogs_tasks_rel_user = Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER);
$parameters = explode('|',$assignment_id);
$task_id = $parameters[0];
$user_id = $parameters[1];
@ -581,9 +581,9 @@ class Blog
global $_user;
// Init
$tbl_blogs = Database::get_course_table(BLOGS_TABLE);
$tbl_blogs_tasks_rel_user = Database::get_course_table(BLOGS_TASKS_REL_USER);
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$tbl_blogs_tasks_rel_user = Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
if($_user['user_id'])
{
@ -625,7 +625,7 @@ class Blog
function change_blog_visibility($blog_id)
{
// Init
$tbl_blogs = Database::get_course_table(BLOGS_TABLE);
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$tbl_tool = Database::get_course_table(TABLE_TOOL_LIST);
// Get blog properties
@ -667,8 +667,8 @@ class Blog
function display_blog_posts($blog_id, $filter = '1=1', $max_number_of_posts = 20)
{
// Init
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_blogs_comments = Database::get_course_table(BLOGS_COMMENTS_TABLE);
$tbl_blogs_posts = Database::get_course_table(TABLE_BLOGS_POSTS);
$tbl_blogs_comments = Database::get_course_table(TABLE_BLOGS_COMMENTS);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
global $dateFormatLong;
@ -793,8 +793,8 @@ class Blog
function display_post($blog_id, $post_id)
{
// Init
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_blogs_comments = Database::get_course_table(BLOGS_COMMENTS_TABLE);
$tbl_blogs_posts = Database::get_course_table(TABLE_BLOGS_POSTS);
$tbl_blogs_comments = Database::get_course_table(TABLE_BLOGS_COMMENTS);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
global $dateFormatLong;
@ -868,7 +868,7 @@ class Blog
global $_user;
// Init
$tbl_blogs_rating = Database::get_course_table(BLOGS_RATING);
$tbl_blogs_rating = Database::get_course_table(TABLE_BLOGS_RATING);
// Check if the user has already rated this post/comment
$sql = "SELECT rating_id FROM $tbl_blogs_rating WHERE blog_id = $blog_id AND item_id = $item_id AND rating_type = '$type' AND user_id = '".$_user['user_id']."'";
@ -889,7 +889,7 @@ class Blog
function display_rating($type, $blog_id, $item_id)
{
$tbl_blogs_rating = Database::get_course_table(BLOGS_RATING);
$tbl_blogs_rating = Database::get_course_table(TABLE_BLOGS_RATING);
// Calculate rating
$sql = "SELECT AVG(rating) as rating FROM $tbl_blogs_rating WHERE blog_id = $blog_id AND item_id = $item_id AND rating_type = '$type' ";
@ -913,7 +913,7 @@ class Blog
global $_user;
// Init
$tbl_blogs_rating = Database::get_course_table(BLOGS_RATING);
$tbl_blogs_rating = Database::get_course_table(TABLE_BLOGS_RATING);
if($type == 'post')
{
@ -958,9 +958,9 @@ class Blog
function get_threaded_comments($current = 0, $current_level = 0, $blog_id, $post_id, $task_id = 0)
{
// Init
$tbl_blogs_comments = Database::get_course_table(BLOGS_COMMENTS_TABLE);
$tbl_blogs_comments = Database::get_course_table(TABLE_BLOGS_COMMENTS);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
global $dateFormatLong;
// Select top level comments
@ -1145,7 +1145,7 @@ class Blog
function display_form_edit_post($blog_id, $post_id)
{
// Init
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_blogs_posts = Database::get_course_table(TABLE_BLOGS_POSTS);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
// Get posts and author
@ -1198,7 +1198,7 @@ class Blog
if(api_is_allowed_to_edit('BLOG_' . $blog_id, 'article_add'))
{
// Init
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
$counter = 0;
global $color2;
@ -1269,8 +1269,8 @@ class Blog
{
// Init
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_tasks_rel_user = Database::get_course_table(BLOGS_TASKS_REL_USER);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
$tbl_blogs_tasks_rel_user = Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER);
$counter = 0;
global $color2;
@ -1398,7 +1398,7 @@ class Blog
function display_edit_task_form($blog_id, $task_id)
{
// Init
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
$colors = array('FFFFFF','FFFF99','FFCC99','FF9933','FF6699','CCFF99','CC9966','66FF00', '9966FF', 'CF3F3F', '990033','669933','0033FF','003366','000000');
$sql = "SELECT blog_id, task_id, title, description, color FROM $tbl_blogs_tasks WHERE task_id = $task_id";
@ -1422,7 +1422,7 @@ class Blog
</tr>';
/* edit by Kevin Van Den Haute (kevin@develop-it.be) */
$tbl_tasks_permissions = Database::get_course_table(BLOGS_TASKS_PERMISSIONS);
$tbl_tasks_permissions = Database::get_course_table(TABLE_BLOGS_TASKS_PERMISSIONS);
$sql = "
SELECT
@ -1494,8 +1494,8 @@ class Blog
{
// Init
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_rel_user = Database::get_course_table(TABLE_BLOGS_REL_USER);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
$day = date("d");
$month = date("m");
$year = date("Y");
@ -1616,10 +1616,10 @@ class Blog
/* ------------- */
// Init
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_tasks_rel_user = Database::get_course_table(BLOGS_TASKS_REL_USER);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(TABLE_BLOGS_REL_USER);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
$tbl_blogs_tasks_rel_user = Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER);
$year = date("Y");
global $MonthsLong;
@ -1779,7 +1779,7 @@ class Blog
function assign_task($blog_id, $user_id, $task_id, $target_date)
{
// Init
$tbl_blogs_tasks_rel_user = Database::get_course_table(BLOGS_TASKS_REL_USER);
$tbl_blogs_tasks_rel_user = Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER);
$sql = "
SELECT COUNT(*) as 'number'
@ -1815,7 +1815,7 @@ class Blog
function edit_assigned_task($blog_id, $user_id, $task_id, $target_date, $old_user_id, $old_task_id, $old_target_date)
{
// Init
$tbl_blogs_tasks_rel_user = Database::get_course_table(BLOGS_TASKS_REL_USER);
$tbl_blogs_tasks_rel_user = Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER);
$sql = "
SELECT COUNT(*) as 'number'
@ -1857,8 +1857,8 @@ class Blog
function display_select_task_post($blog_id, $task_id)
{
// Init
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
$tbl_blogs_posts = Database::get_course_table(TABLE_BLOGS_POSTS);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$sql = "
@ -1905,8 +1905,8 @@ class Blog
function set_user_subscribed($blog_id,$user_id)
{
// Init
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
$tbl_user_permissions = Database::get_course_table(PERMISSION_USER_TABLE);
$tbl_blogs_rel_user = Database::get_course_table(TABLE_BLOGS_REL_USER);
$tbl_user_permissions = Database::get_course_table(TABLE_PERMISSION_USER);
// Subscribe the user
$sql = "INSERT INTO $tbl_blogs_rel_user ( `blog_id`, `user_id` ) VALUES ('$blog_id', '$user_id');";
@ -1929,8 +1929,8 @@ class Blog
function set_user_unsubscribed($blog_id, $user_id)
{
// Init
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
$tbl_user_permissions = Database::get_course_table(PERMISSION_USER_TABLE);
$tbl_blogs_rel_user = Database::get_course_table(TABLE_BLOGS_REL_USER);
$tbl_user_permissions = Database::get_course_table(TABLE_PERMISSION_USER);
// Unsubscribe the user
$sql = "DELETE FROM $tbl_blogs_rel_user WHERE `blog_id` = $blog_id AND `user_id` = $user_id";
@ -1955,9 +1955,9 @@ class Blog
// Init
global $_course;
$currentCourse = $_course['sysCode'];
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
$table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(TABLE_BLOGS_REL_USER);
$table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
echo '<span class="blogpost_title">' . get_lang('SubscribeMembers') . '</span>';
$properties["width"] = "100%";
@ -2042,8 +2042,8 @@ class Blog
global $_user;
// Init
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(TABLE_BLOGS_REL_USER);
echo '<span class="blogpost_title">' . get_lang('UnsubscribeMembers') . '</span>';
@ -2077,8 +2077,8 @@ class Blog
$row[] = Display::encrypted_mailto_link($myrow["email"]);
$sql = "SELECT bt.title task
FROM " . Database::get_course_table(BLOGS_TASKS_REL_USER) . " `btu`
INNER JOIN " . Database::get_course_table(BLOGS_TASKS) . " `bt` ON `btu`.`task_id` = `bt`.`task_id`
FROM " . Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER) . " `btu`
INNER JOIN " . Database::get_course_table(TABLE_BLOGS_TASKS) . " `bt` ON `btu`.`task_id` = `bt`.`task_id`
WHERE btu.blog_id = $blog_id AND btu.user_id = " . $myrow['user_id'] . "";
$sql_res = mysql_query($sql) or die(mysql_error());
@ -2142,8 +2142,8 @@ class Blog
function display_form_user_rights($blog_id)
{
// Init
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(TABLE_BLOGS_REL_USER);
echo '<span class="blogpost_title">' . get_lang('RightsManager') . '</span>';
@ -2227,10 +2227,10 @@ class Blog
$tasks = array();
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_tasks_rel_user = Database::get_course_table(BLOGS_TASKS_REL_USER);
$tbl_blogs = Database::get_course_table(BLOGS_TABLE);
$tbl_blogs_posts = Database::get_course_table(TABLE_BLOGS_POSTS);
$tbl_blogs_tasks = Database::get_course_table(TABLE_BLOGS_TASKS);
$tbl_blogs_tasks_rel_user = Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER);
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
//Handle leap year
$numberofdays = array (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
@ -2395,7 +2395,7 @@ class Blog
function display_edit_blog_form($blog_id)
{
// Init
$tbl_blogs = Database::get_course_table(BLOGS_TABLE);
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$sql = "SELECT blog_id, blog_name, blog_subtitle FROM $tbl_blogs WHERE blog_id = $blog_id";
$result = api_sql_query($sql, __FILE__, __LINE__);
@ -2433,7 +2433,7 @@ class Blog
{
// Init
$counter = 0;
$tbl_blogs = Database::get_course_table(BLOGS_TABLE);
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$sql = "SELECT `blog_id`, `blog_name`, `blog_subtitle`, `visibility` FROM $tbl_blogs ORDER BY `blog_name`";

@ -249,15 +249,15 @@ class CourseManager
$sql = "SELECT * FROM $table_course WHERE code = '".$course_code."'";
$res = api_sql_query($sql, __FILE__, __LINE__);
$course = mysql_fetch_object($res);
$table_group = Database :: get_course_table(GROUP_USER_TABLE, $course->db_name);
$table_group = Database :: get_course_table(TABLE_GROUP_USER, $course->db_name);
$sql = "DELETE FROM $table_group WHERE user_id IN (".$user_ids.")";
api_sql_query($sql, __FILE__, __LINE__);
// Unsubscribe user from all blogs in the course
$table_blog_user = Database::get_course_table(BLOGS_REL_USER_TABLE, $course->db_name);
$table_blog_user = Database::get_course_table(TABLE_BLOGS_REL_USER, $course->db_name);
$sql = "DELETE FROM ".$table_blog_user." WHERE user_id IN (".$user_ids.")";
api_sql_query($sql,__FILE__,__LINE__);
$table_blogtask_user = Database::get_course_table(BLOGS_TASKS_REL_USER, $course->db_name);
$table_blogtask_user = Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER, $course->db_name);
$sql = "DELETE FROM ".$table_blogtask_user." WHERE user_id IN (".$user_ids.")";
api_sql_query($sql,__FILE__,__LINE__);
@ -1084,7 +1084,7 @@ class CourseManager
$course_info = Database :: get_course_info($course_code);
$database_name = $course_info['db_name'];
$group_table = Database :: get_course_table(TABLE_GROUP, $database_name);
$group_user_table = Database :: get_course_table(GROUP_USER_TABLE, $database_name);
$group_user_table = Database :: get_course_table(TABLE_GROUP_USER, $database_name);
$sql = "SELECT g.id, g.name, COUNT(gu.id) userNb
FROM $group_table AS g LEFT JOIN $group_user_table gu

@ -60,18 +60,21 @@ define('TABLE_MAIN_SESSION_COURSE_USER', 'session_rel_course_rel_user');
define('TABLE_MAIN_COURSE_SURVEY', 'course_rel_survey');
define('TABLE_MAIN_SURVEY_USER', 'survey_user_info');
define('TABLE_MAIN_SURVEY_REMINDER','survey_reminder');
//statistic database tables
define('TABLE_STATISTIC_TRACK_E_LASTACCESS', 'track_e_lastaccess');
define('STATISTIC_TRACK_E_ACCESS_TABLE', 'track_e_access');
define('STATISTIC_TRACK_E_LOGIN_TABLE', 'track_e_login');
define('STATISTIC_TRACK_E_DOWNLOADS_TABLE', 'track_e_downloads');
define('STATISTIC_TRACK_E_LINKS_TABLE', 'track_e_links');
define('STATISTIC_TRACK_E_ONLINE_TABLE', 'track_e_online');
define('STATISTIC_TRACK_E_HOTPOTATOES_TABLE', 'track_e_hotpotatoes');
define('STATISTIC_TRACK_E_COURSE_ACCESS_TABLE', 'track_e_course_access');
define('TABLE_STATISTIC_TRACK_E_ACCESS', 'track_e_access');
define('TABLE_STATISTIC_TRACK_E_LOGIN', 'track_e_login');
define('TABLE_STATISTIC_TRACK_E_DOWNLOADS', 'track_e_downloads');
define('TABLE_STATISTIC_TRACK_E_LINKS', 'track_e_links');
define('TABLE_STATISTIC_TRACK_E_ONLINE', 'track_e_online');
define('TABLE_STATISTIC_TRACK_E_HOTPOTATOES', 'track_e_hotpotatoes');
define('TABLE_STATISTIC_TRACK_E_COURSE_ACCESS', 'track_e_course_access');
//scorm database tables
define('SCORM_MAIN_TABLE', 'scorm_main');
define('TABLE_SCORM_MAIN', 'scorm_main');
define('SCORM_SCO_DATA_TABLE', 'scorm_sco_data');
//course tables
define('TABLE_AGENDA', 'calendar_event');
define('TABLE_ANNOUNCEMENT', 'announcement');
@ -92,56 +95,57 @@ define('TABLE_FORUM_THREAD','forum_thread');
define('TABLE_FORUM_POST','forum_post');
//course group tables
define('TABLE_GROUP', 'group_info');
define('GROUP_USER_TABLE', 'group_rel_user');
define('GROUP_TUTOR_TABLE', 'group_rel_tutor');
define('GROUP_CATEGORY_TABLE', 'group_category');
define('TABLE_GROUP_USER', 'group_rel_user');
define('TABLE_GROUP_TUTOR', 'group_rel_tutor');
define('TABLE_GROUP_CATEGORY', 'group_category');
//course quiz tables
define('QUIZ_QUESTION_TABLE', 'quiz_question');
define('QUIZ_TEST_TABLE', 'quiz');
define('QUIZ_ANSWER_TABLE', 'quiz_answer');
define('QUIZ_TEST_QUESTION_TABLE', 'quiz_rel_question');
define('TABLE_QUIZ_QUESTION', 'quiz_question');
define('TABLE_QUIZ_TEST', 'quiz');
define('TABLE_QUIZ_ANSWER', 'quiz_answer');
define('TABLE_QUIZ_TEST_QUESTION', 'quiz_rel_question');
//linked resource table
define('LINKED_RESOURCES_TABLE', 'resource');
define('TABLE_LINKED_RESOURCES', 'resource');
//learnpath tables
define('LEARNPATH_MAIN_TABLE', 'learnpath_main');
define('LEARNPATH_CHAPTER_TABLE', 'learnpath_chapter');
define('LEARNPATH_ITEM_TABLE', 'learnpath_item');
define('LEARNPATH_USER_TABLE', 'learnpath_user');
define('TABLE_LEARNPATH_MAIN', 'learnpath_main');
define('TABLE_LEARNPATH_CHAPTER', 'learnpath_chapter');
define('TABLE_LEARNPATH_ITEM', 'learnpath_item');
define('TABLE_LEARNPATH_USER', 'learnpath_user');
// Smartblogs (Kevin Van Den Haute::kevin@develop-it.be)
// permission tables
define('PERMISSION_USER_TABLE', 'permission_user');
define('PERMISSION_TASK_TABLE', 'permission_task');
define('PERMISSION_GROUP_TABLE', 'permission_group');
define('TABLE_PERMISSION_USER', 'permission_user');
define('TABLE_PERMISSION_TASK', 'permission_task');
define('TABLE_PERMISSION_GROUP', 'permission_group');
// roles tables
define('ROLE_TABLE', 'role');
define('ROLE_PERMISSION_TABLE', 'role_permissions');
define('ROLE_USER_TABLE', 'role_user');
define('ROLE_GROUP_TABLE', 'role_group');
define('TABLE_ROLE', 'role');
define('TABLE_ROLE_PERMISSION', 'role_permissions');
define('TABLE_ROLE_USER', 'role_user');
define('TABLE_ROLE_GROUP', 'role_group');
// blogs tables
define('BLOGS_TABLE', 'blogs');
define('BLOGS_POSTS_TABLE', 'blogs_posts');
define('BLOGS_COMMENTS_TABLE', 'blogs_comments');
define('BLOGS_REL_USER_TABLE', 'blogs_rel_user');
define('BLOGS_TASKS', 'blogs_tasks');
define('BLOGS_TASKS_REL_USER', 'blogs_tasks_rel_user');
define('BLOGS_RATING', 'blogs_rating');
define('BLOGS_TASKS_PERMISSIONS', 'permission_task');
define('TABLE_BLOGS', 'blogs');
define('TABLE_BLOGS_POSTS', 'blogs_posts');
define('TABLE_BLOGS_COMMENTS', 'blogs_comments');
define('TABLE_BLOGS_REL_USER', 'blogs_rel_user');
define('TABLE_BLOGS_TASKS', 'blogs_tasks');
define('TABLE_BLOGS_TASKS_REL_USER', 'blogs_tasks_rel_user');
define('TABLE_BLOGS_RATING', 'blogs_rating');
define('TABLE_BLOGS_TASKS_PERMISSIONS', 'permission_task');
//end of Smartblogs
// user information tables
define('USER_INFO_TABLE', 'userinfo_def');
define('USER_INFO_CONTENT_TABLE', 'userinfo_content');
define('TABLE_USER_INFO', 'userinfo_def');
define('TABLE_USER_INFO_CONTENT', 'userinfo_content');
// course settings table
define('COURSE_SETTING_TABLE', 'course_setting');
define('TABLE_COURSE_SETTING', 'course_setting');
// course online tables
define('ONLINE_LINK_TABLE', 'online_link');
define('ONLINE_CONNECTED_TABLE', 'online_connected');
define('TABLE_ONLINE_LINK', 'online_link');
define('TABLE_ONLINE_CONNECTED', 'online_connected');
// dokeos_user database
define('PERSONAL_AGENDA', 'personal_agenda');
define('USER_COURSE_CATEGORY_TABLE', 'user_course_category');
define('TABLE_PERSONAL_AGENDA', 'personal_agenda');
define('TABLE_USER_COURSE_CATEGORY', 'user_course_category');
//Survey
define('MAIN_SURVEY_TABLE', 'survey');
define('MAIN_GROUP_TABLE', 'survey_group');
define('MAIN_SURVEYQUESTION_TABLE', 'questions');
// @todo: are these MAIN tables or course tables ?
define('TABLE_MAIN_SURVEY', 'survey');
define('TABLE_MAIN_GROUP', 'survey_group');
define('TABLE_MAIN_SURVEYQUESTION', 'questions');
/*
==============================================================================
DATABASE CLASS
@ -342,11 +346,11 @@ class Database
/**
* Returns the name of the main table of the SCORM database.
* @deprecated use Database::get_scorm_table(SCORM_MAIN_TABLE);
* @deprecated use Database::get_scorm_table(TABLE_SCORM_MAIN);
*/
function get_scorm_main_table()
{
return Database::get_scorm_table(SCORM_MAIN_TABLE);
return Database::get_scorm_table(TABLE_SCORM_MAIN);
}
/**
* Returns the name of the data table of the SCORM database.

@ -479,7 +479,7 @@ function event_exercice($exo_id, $score, $weighting)
'".$weighting."',
FROM_UNIXTIME(".$reallyNow.")
)";
$tbl_learnpath_user = Database::get_course_table(LEARNPATH_USER_TABLE);
$tbl_learnpath_user = Database::get_course_table(TABLE_LEARNPATH_USER);
if ($origin == 'learnpath')
{
if ($user_id == "NULL")
@ -539,7 +539,7 @@ function exercise_attempt($score,$answer,$quesId,$exeId,$j)
'".$j."'
)";
$tbl_learnpath_user = Database::get_course_table(LEARNPATH_USER_TABLE);
$tbl_learnpath_user = Database::get_course_table(TABLE_LEARNPATH_USER);
if ($origin == 'learnpath')
{
if ($user_id == "NULL")

@ -103,7 +103,7 @@ class GroupManager
$table_group = Database :: get_course_table(TABLE_GROUP, $course_db);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$table_group_user = Database :: get_course_table(GROUP_USER_TABLE, $course_db);
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER, $course_db);
$sql = "SELECT g.id ,
g.name ,
g.description ,
@ -208,7 +208,7 @@ class GroupManager
{
GroupManager :: delete_category(VIRTUAL_COURSE_CATEGORY);
$id = GroupManager :: create_category(get_lang('GroupsFromVirtualCourses'), '', TOOL_NOT_AVAILABLE, TOOL_NOT_AVAILABLE, 0, 0, 1, 1);
$table_group_cat = Database :: get_course_table(GROUP_CATEGORY_TABLE);
$table_group_cat = Database :: get_course_table(TABLE_GROUP_CATEGORY);
$sql = "UPDATE ".$table_group_cat." SET id=".VIRTUAL_COURSE_CATEGORY." WHERE id=$id";
api_sql_query($sql,__FILE__,__LINE__);
$course = api_get_course_info();
@ -286,7 +286,7 @@ class GroupManager
// Database table definitions
$group_table = Database :: get_course_table(TABLE_GROUP, $course_db);
$group_user_table = Database :: get_course_table(GROUP_USER_TABLE, $course_db);
$group_user_table = Database :: get_course_table(TABLE_GROUP_USER, $course_db);
$forum_table = Database :: get_course_table(TABLE_FORUM, $course_db);
$forum_post_table = Database :: get_course_table(TABLE_FORUM_POST, $course_db);
$forum_post_text_table = Database :: get_course_table(TOOL_FORUM_POST_TEXT_TABLE, $course_db);
@ -407,7 +407,7 @@ class GroupManager
$course_info = Database :: get_course_info($course_code);
$course_db = $course_info['database'];
}
$table_group_cat = Database :: get_course_table(GROUP_CATEGORY_TABLE, $course_db);
$table_group_cat = Database :: get_course_table(TABLE_GROUP_CATEGORY, $course_db);
$sql = "SELECT * FROM $table_group_cat ORDER BY display_order";
$res = api_sql_query($sql,__FILE__,__LINE__);
$cats = array ();
@ -430,7 +430,7 @@ class GroupManager
$course_info = Database :: get_course_info($course_code);
$course_db = $course_info['database'];
}
$table_group_cat = Database :: get_course_table(GROUP_CATEGORY_TABLE, $course_db);
$table_group_cat = Database :: get_course_table(TABLE_GROUP_CATEGORY, $course_db);
$sql = "SELECT * FROM $table_group_cat WHERE id = $id";
$res = api_sql_query($sql,__FILE__,__LINE__);
return mysql_fetch_array($res);
@ -451,7 +451,7 @@ class GroupManager
$course_db = $course_info['database'];
}
$table_group = Database :: get_course_table(TABLE_GROUP, $course_db);
$table_group_cat = Database :: get_course_table(GROUP_CATEGORY_TABLE, $course_db);
$table_group_cat = Database :: get_course_table(TABLE_GROUP_CATEGORY, $course_db);
$sql = "SELECT gc.* FROM $table_group_cat gc, $table_group g WHERE gc.id = g.category_id AND g.id=$group_id";
$res = api_sql_query($sql,__FILE__,__LINE__);
$cat = mysql_fetch_array($res);
@ -472,7 +472,7 @@ class GroupManager
$course_db = $course_info['database'];
}
$table_group = Database :: get_course_table(TABLE_GROUP, $course_db);
$table_group_cat = Database :: get_course_table(GROUP_CATEGORY_TABLE, $course_db);
$table_group_cat = Database :: get_course_table(TABLE_GROUP_CATEGORY, $course_db);
$sql = "SELECT id FROM $table_group WHERE category_id='".$cat_id."'";
$res = api_sql_query($sql,__FILE__,__LINE__);
if (mysql_num_rows($res) > 0)
@ -498,7 +498,7 @@ class GroupManager
*/
function create_category($title, $description, $doc_state, $self_registration_allowed, $self_unregistration_allowed, $maximum_number_of_students, $groups_per_user)
{
$table_group_category = Database :: get_course_table(GROUP_CATEGORY_TABLE);
$table_group_category = Database :: get_course_table(TABLE_GROUP_CATEGORY);
$sql = "SELECT MAX(display_order)+1 as new_order FROM $table_group_category ";
$res = api_sql_query($sql,__FILE__,__LINE__);
$obj = mysql_fetch_object($res);
@ -536,7 +536,7 @@ class GroupManager
*/
function update_category($id, $title, $description, $doc_state, $self_registration_allowed, $self_unregistration_allowed, $maximum_number_of_students, $groups_per_user)
{
$table_group_category = Database :: get_course_table(GROUP_CATEGORY_TABLE);
$table_group_category = Database :: get_course_table(TABLE_GROUP_CATEGORY);
$sql = "UPDATE ".$table_group_category."
SET title='".mysql_real_escape_string($title)."',
description='".mysql_real_escape_string($description)."',
@ -561,7 +561,7 @@ class GroupManager
$course_db = $course_info['database'];
}
$group_table = Database :: get_course_table(TABLE_GROUP, $course_db);
$group_user_table = Database :: get_course_table(GROUP_USER_TABLE, $course_db);
$group_user_table = Database :: get_course_table(TABLE_GROUP_USER, $course_db);
$sql = 'SELECT COUNT(gu.group_id) AS current_max FROM '.$group_user_table.' gu, '.$group_table.' g WHERE gu.group_id = g.id ';
if ($category_id != null)
$sql .= ' AND g.category_id = '.$category_id;
@ -577,7 +577,7 @@ class GroupManager
*/
function swap_category_order($id1, $id2)
{
$table_group_cat = Database :: get_course_table(GROUP_CATEGORY_TABLE);
$table_group_cat = Database :: get_course_table(TABLE_GROUP_CATEGORY);
$sql = "SELECT id,display_order FROM $table_group_cat WHERE id IN ($id1,$id2)";
$res = api_sql_query($sql,__FILE__,__LINE__);
$cat1 = mysql_fetch_object($res);
@ -601,7 +601,7 @@ class GroupManager
*/
function get_users($group_id)
{
$group_user_table = Database :: get_course_table(GROUP_USER_TABLE, $course_db);
$group_user_table = Database :: get_course_table(TABLE_GROUP_USER, $course_db);
$sql = "SELECT user_id FROM $group_user_table WHERE group_id = $group_id";
$res = api_sql_query($sql,__FILE__,__LINE__);
$users = array ();
@ -643,7 +643,7 @@ class GroupManager
$groups_per_user = $category['groups_per_user'];
$course_user_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$group_table = Database :: get_course_table(TABLE_GROUP);
$group_user_table = Database :: get_course_table(GROUP_USER_TABLE);
$group_user_table = Database :: get_course_table(TABLE_GROUP_USER);
$complete_user_list = CourseManager :: get_real_and_linked_user_list($_course['sysCode']);
$number_groups_per_user = ($groups_per_user == GROUP_PER_MEMBER_NO_LIMIT ? INFINITE : $groups_per_user);
/*
@ -735,7 +735,7 @@ class GroupManager
*/
function number_of_students($group_id)
{
$table_group_user = Database :: get_course_table(GROUP_USER_TABLE);
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
$db_result = api_sql_query('SELECT COUNT(*) AS number_of_students FROM '.$table_group_user.' WHERE group_id = '.$group_id);
$db_object = mysql_fetch_object($db_result);
return $db_object->number_of_students;
@ -763,7 +763,7 @@ class GroupManager
*/
function user_in_number_of_groups($user_id, $cat_id)
{
$table_group_user = Database :: get_course_table(GROUP_USER_TABLE);
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
$table_group = Database :: get_course_table(TABLE_GROUP);
$sql = 'SELECT COUNT(*) AS number_of_groups FROM '.$table_group_user.' gu, '.$table_group.' g WHERE gu.user_id = \''.$user_id.'\' AND g.id = gu.group_id AND g.category_id= \''.$cat_id.'\'';
$db_result = api_sql_query($sql,__FILE__,__LINE__);
@ -809,7 +809,7 @@ class GroupManager
*/
function is_subscribed($user_id, $group_id)
{
$table_group_user = Database :: get_course_table(GROUP_USER_TABLE);
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
$db_result = api_sql_query('SELECT 1 FROM '.$table_group_user.' WHERE group_id = '.$group_id.' AND user_id = '.$user_id);
return mysql_num_rows($db_result) > 0;
}
@ -856,7 +856,7 @@ class GroupManager
function get_subscribed_users($group_id)
{
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_group_user = Database :: get_course_table(GROUP_USER_TABLE);
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
$sql = "SELECT `ug`.`id`, `u`.`user_id`, `u`.`lastname`, `u`.`firstname`, `u`.`email`
FROM ".$table_user." u, ".$table_group_user." ug
WHERE `ug`.`group_id`='".$group_id."'
@ -885,7 +885,7 @@ class GroupManager
function get_subscribed_tutors($group_id,$id_only=false)
{
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_group_tutor = Database :: get_course_table(GROUP_TUTOR_TABLE);
$table_group_tutor = Database :: get_course_table(TABLE_GROUP_TUTOR);
$sql = "SELECT `tg`.`id`, `u`.`user_id`, `u`.`lastname`, `u`.`firstname`, `u`.`email`
FROM ".$table_user." u, ".$table_group_tutor." tg
WHERE `tg`.`group_id`='".$group_id."'
@ -922,7 +922,7 @@ class GroupManager
$result = true;
foreach ($user_ids as $index => $user_id)
{
$table_group_user = Database :: get_course_table(GROUP_USER_TABLE);
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
$sql = "INSERT INTO ".$table_group_user." (user_id, group_id) VALUES ('".$user_id."', '".$group_id."')";
$result &= api_sql_query($sql,__FILE__,__LINE__);
}
@ -943,7 +943,7 @@ class GroupManager
$result = true;
foreach ($user_ids as $index => $user_id)
{
$table_group_tutor = Database :: get_course_table(GROUP_TUTOR_TABLE);
$table_group_tutor = Database :: get_course_table(TABLE_GROUP_TUTOR);
$sql = "INSERT INTO ".$table_group_tutor." (user_id, group_id) VALUES ('".$user_id."', '".$group_id."')";
$result &= api_sql_query($sql,__FILE__,__LINE__);
}
@ -959,7 +959,7 @@ class GroupManager
function unsubscribe_users($user_ids, $group_id)
{
$user_ids = is_array($user_ids) ? $user_ids : array ($user_ids);
$table_group_user = Database :: get_course_table(GROUP_USER_TABLE);
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
$result &= api_sql_query('DELETE FROM '.$table_group_user.' WHERE group_id = '.$group_id.' AND user_id IN ('.implode(',', $user_ids).')');
}
/**
@ -972,7 +972,7 @@ class GroupManager
$group_ids = is_array($group_ids) ? $group_ids : array ($group_ids);
if( count($group_ids) > 0)
{
$table_group_user = Database :: get_course_table(GROUP_USER_TABLE);
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
$sql = 'DELETE FROM '.$table_group_user.' WHERE group_id IN ('.implode(',', $group_ids).')';
$result = api_sql_query($sql,__FILE__,__LINE__);
return $result;
@ -991,7 +991,7 @@ class GroupManager
$group_ids = is_array($group_ids) ? $group_ids : array ($group_ids);
if( count($group_ids) > 0)
{
$table_group_tutor = Database :: get_course_table(GROUP_TUTOR_TABLE);
$table_group_tutor = Database :: get_course_table(TABLE_GROUP_TUTOR);
$sql = 'DELETE FROM '.$table_group_tutor.' WHERE group_id IN ('.implode(',', $group_ids).')';
$result = api_sql_query($sql,__FILE__,__LINE__);
return $result;
@ -1010,7 +1010,7 @@ class GroupManager
{
global $_course;
$table_group_tutor = Database :: get_course_table(GROUP_TUTOR_TABLE);
$table_group_tutor = Database :: get_course_table(TABLE_GROUP_TUTOR);
$sql = "SELECT * FROM ".$table_group_tutor." WHERE user_id='".$user_id."' AND group_id='".$group_id."'";
$result = api_sql_query($sql,__FILE__,__LINE__);
if (mysql_num_rows($result)>0)
@ -1103,7 +1103,7 @@ class GroupManager
*/
function get_group_ids($course_db,$user_id)
{
$tbl_group = Database::get_course_table(GROUP_USER_TABLE,$course_db);
$tbl_group = Database::get_course_table(TABLE_GROUP_USER,$course_db);
$sql = "SELECT group_id FROM $tbl_group WHERE user_id = '$user_id'";
$groupres = api_sql_query($sql);

@ -428,7 +428,7 @@ function api_get_course_path()
*/
function api_get_course_setting($setting_name)
{
$table = Database::get_course_table(COURSE_SETTING_TABLE);
$table = Database::get_course_table(TABLE_COURSE_SETTING);
$setting_name = mysql_real_escape_string($setting_name);
$sql = "SELECT * FROM $table WHERE variable = '$setting_name'";
$res = api_sql_query($sql,__FILE__,__LINE__);

@ -43,7 +43,7 @@ function LoginCheck($uid,$statistics_database)
{
global $_course;
$online_table = Database::get_statistic_table(STATISTIC_TRACK_E_ONLINE_TABLE);
$online_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ONLINE);
if ($uid!="")
{
LoginDelete($uid,$statistics_database);
@ -74,7 +74,7 @@ function LoginCheck($uid,$statistics_database)
*/
function LoginDelete($user_id)
{
$online_table = Database::get_statistic_table(STATISTIC_TRACK_E_ONLINE_TABLE);
$online_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ONLINE);
$query = "DELETE FROM ".$online_table ." WHERE login_user_id = '".mysql_real_escape_string($user_id)."'";
@api_sql_query($query,__FILE__,__LINE__);
}
@ -84,7 +84,7 @@ function LoginDelete($user_id)
*/
function WhoIsOnline($uid,$statistics_database,$valid)
{
$track_online_table = Database::get_statistic_table(STATISTIC_TRACK_E_ONLINE_TABLE);
$track_online_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ONLINE);
$query = "SELECT login_user_id,login_date FROM ".$track_online_table ." WHERE DATE_ADD(login_date,INTERVAL $valid MINUTE) >= NOW() ";
$result = @api_sql_query($query,__FILE__,__LINE__);
if (count($result)>0)
@ -246,7 +246,7 @@ function chatcall() {
*/
function who_is_online_in_this_course($uid, $valid, $coursecode)
{
$track_online_table = Database::get_statistic_table(STATISTIC_TRACK_E_ONLINE_TABLE);
$track_online_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ONLINE);
$query = "SELECT login_user_id,login_date FROM ".$track_online_table ." WHERE course='".$coursecode."' AND DATE_ADD(login_date,INTERVAL $valid MINUTE) >= NOW() ";
$result = api_sql_query($query,__FILE__,__LINE__);
if (count($result)>0)

@ -90,7 +90,7 @@ class SurveyManager
/*function getsurveyid($existing)
{
$survey_table = Database :: get_course_table(MAIN_SURVEY_TABLE);
$survey_table = Database :: get_course_table(TABLE_MAIN_SURVEY);
$sql = "SELECT survey_id FROM $survey_table WHERE title='$existing'" ;
$result = api_sql_query($sql,__FILE__,__LINE__);
$i=0;
@ -297,7 +297,7 @@ class SurveyManager
$ansd = implode(", " ,$answerD);
$table_question = Database :: get_course_table(MAIN_SURVEYQUESTION_TABLE);
$table_question = Database :: get_course_table(TABLE_MAIN_SURVEYQUESTION);
$sql = "INSERT INTO $table_question (gid,type,caption,ans1,ans2,ans3,ans4,ans5,ans6,ans7,ans8,ans9,ans10,open_ans,anst,ansd,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10) values('$gid','$type','$caption',$x'$open_ans','$anst','$ansd',$y)";
$result = api_sql_query($sql);
return mysql_insert_id();
@ -306,7 +306,7 @@ class SurveyManager
function get_question($questionid)
{
$table_question = Database :: get_course_table(MAIN_SURVEYQUESTION_TABLE);
$table_question = Database :: get_course_table(TABLE_MAIN_SURVEYQUESTION);
$sql = "SELECT * FROM $table_question where qid='$questionid'";
$res=api_sql_query($sql);
$code=@mysql_result($res,0,'caption');
@ -446,9 +446,9 @@ function get_question_data($qid,$curr_dbname)
/*
function join_survey($question_type)
{
$table_survey = Database :: get_course_table(MAIN_SURVEY_TABLE);
$table_group = Database :: get_course_table(MAIN_GROUP_TABLE);
$table_question = Database :: get_course_table(MAIN_SURVEYQUESTION_TABLE);
$table_survey = Database :: get_course_table(TABLE_MAIN_SURVEY);
$table_group = Database :: get_course_table(TABLE_MAIN_GROUP);
$table_question = Database :: get_course_table(TABLE_MAIN_SURVEYQUESTION);
echo $sql="select t1.title as stitle, t3.type as type, t3.caption as caption, t2.groupname as groupname from $table_survey t1, $table_group t2, $table_question t3 where t1.survey_id=t2.survey_id and t3.gid=t2.group_id and t3.type='$question_type'";
$sql_result = api_sql_query($sql,__FILE__,__LINE__);
$result = mysql_fetch_object($sql_result);
@ -1778,7 +1778,7 @@ function sort_table($data, $column = 0, $direction = SORT_ASC, $type = SORT_REGU
function listGroups($id_survey, $fields = '*'){
$groups_table = Database :: get_course_table(MAIN_GROUP_TABLE);
$groups_table = Database :: get_course_table(TABLE_MAIN_GROUP);
$sql = 'SELECT '.$fields.' FROM '.$groups_table.'
WHERE survey_id='.$id_survey.' ORDER BY sortby';
@ -1795,7 +1795,7 @@ function sort_table($data, $column = 0, $direction = SORT_ASC, $type = SORT_REGU
function listQuestions($id_survey, $fields = '*'){
$questions_table = Database :: get_course_table(MAIN_SURVEYQUESTION_TABLE);
$questions_table = Database :: get_course_table(TABLE_MAIN_SURVEYQUESTION);
$groups_table = Database :: get_course_table('survey_group');
$sql = 'SELECT '.$fields.'

@ -150,7 +150,7 @@ class UserManager
$res = api_sql_query($sql,__FILE__,__LINE__);
while ($course = mysql_fetch_object($res))
{
$table_group = Database :: get_course_table(GROUP_USER_TABLE, $course->db_name);
$table_group = Database :: get_course_table(TABLE_GROUP_USER, $course->db_name);
$sql = "DELETE FROM $table_group WHERE user_id = '".$user_id."'";
api_sql_query($sql,__FILE__,__LINE__);
}
@ -172,7 +172,7 @@ class UserManager
}
// Delete the personal course categories
$course_cat_table = Database::get_user_personal_table(USER_COURSE_CATEGORY_TABLE);
$course_cat_table = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY);
$sql = "DELETE FROM $course_cat_table WHERE user_id = '".$user_id."'";
api_sql_query($sql,__FILE__,__LINE__);
@ -185,7 +185,7 @@ class UserManager
api_sql_query($sql,__FILE__,__LINE__);
// Delete the personal agenda-items from this user
$agenda_table = Database :: get_user_personal_table(PERSONAL_AGENDA);
$agenda_table = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
$sql = "DELETE FROM $agenda_table WHERE user = '".$user_id."'";
api_sql_query($sql,__FILE__,__LINE__);

@ -486,7 +486,7 @@ if (isset($cidReset) && $cidReset) // course session data refresh requested or e
api_session_register('_course');
//We add a new record in the course tracking table
$course_tracking_table = Database :: get_statistic_table(STATISTIC_TRACK_E_COURSE_ACCESS_TABLE);
$course_tracking_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
$sql="INSERT INTO $course_tracking_table(course_code, user_id, login_course_date, logout_course_date, counter)" .
"VALUES('".$_course['official_code']."', '".$_user['user_id']."', NOW(), NOW(), '1')";
@ -529,7 +529,7 @@ else // continue with the previous values
$_cid = $_SESSION['_cid' ];
$_course = $_SESSION['_course'];
$course_tracking_table = Database :: get_statistic_table(STATISTIC_TRACK_E_COURSE_ACCESS_TABLE);
$course_tracking_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
//We select the last record for the current course in the course tracking table
$sql="SELECT course_access_id FROM $course_tracking_table WHERE user_id='".$_user ['user_id']."' ORDER BY login_course_date DESC LIMIT 0,1";

@ -9,7 +9,7 @@ function updateCourseTracking($i_user_id){
$course_tracking_table = Database :: get_statistic_table(STATISTIC_TRACK_E_COURSE_ACCESS_TABLE);
$course_tracking_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
//We select the last record for the current course in the course tracking table
$sql="SELECT course_access_id FROM $course_tracking_table WHERE user_id='$i_user_id' ORDER BY login_course_date DESC LIMIT 0,1";

@ -1146,7 +1146,7 @@ function migrate_posts_of_thread($phpbb_thread_id, $new_forum_thread_id, $new_fo
global $added_resources;
$table_users = Database :: get_main_table(TABLE_MAIN_USER);
$table_added_resources = Database::get_course_table(LINKED_RESOURCES_TABLE);
$table_added_resources = Database::get_course_table(TABLE_LINKED_RESOURCES);
$post_counter=0;
@ -1217,7 +1217,7 @@ function migrate_posts_of_thread($phpbb_thread_id, $new_forum_thread_id, $new_fo
*/
function get_added_resources()
{
$table_added_resources = Database::get_course_table(LINKED_RESOURCES_TABLE);
$table_added_resources = Database::get_course_table(TABLE_LINKED_RESOURCES);
$return_array=array();
// TODO: now we also migrate the added resources.

@ -33,7 +33,7 @@ $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_rel_course_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_track_login = Database :: get_statistic_table(STATISTIC_TRACK_E_LOGIN_TABLE);
$tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
/*

@ -812,7 +812,7 @@ if(!empty($_GET['student']))
* Calcul du temps passé sur le cours courant
*/
$tbl_track_lcourse_access = Database :: get_statistic_table(STATISTIC_TRACK_E_COURSE_ACCESS_TABLE);
$tbl_track_lcourse_access = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
$s_sql_connection_time="SELECT login_course_date, logout_course_date FROM $tbl_track_lcourse_access WHERE user_id ='".$_GET['student']."' AND logout_course_date <> 'null' AND course_code='".$a_cours['code']."'";

@ -4682,7 +4682,7 @@ class learnpath {
function display_quiz_form($action = 'add', $id = 0, $extra_info = '')
{
$tbl_lp_item = Database::get_course_table('lp_item');
$tbl_quiz = Database::get_course_table(QUIZ_TEST_TABLE);
$tbl_quiz = Database::get_course_table(TABLE_QUIZ_TEST);
if($id != 0 && is_array($extra_info))
{
@ -6250,7 +6250,7 @@ class learnpath {
*/
function get_exercises()
{
$tbl_quiz = Database::get_course_table(QUIZ_TEST_TABLE);
$tbl_quiz = Database::get_course_table(TABLE_QUIZ_TEST);
$sql_quiz = "
SELECT *

@ -55,8 +55,8 @@
**/
function deleteitem($id)
{
$tbl_learnpath_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
$tbl_learnpath_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
$tbl_learnpath_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
$tbl_learnpath_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
//get the display order for this item before it is deleted
$sql = "SELECT display_order, parent_item_id FROM $tbl_lp_item WHERE id=$id";
$result = api_sql_query($sql, __FILE__, __LINE__);
@ -92,8 +92,8 @@ function deleteitem($id)
function deletemodule($parent_item_id)
{
global $learnpath_id;
$tbl_learnpath_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
$tbl_learnpath_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
$tbl_learnpath_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
$tbl_learnpath_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
//Added for multi-level behaviour - slightly recursive
$sql = "SELECT * FROM $tbl_learnpath_chapter WHERE lp_id=$learnpath_id";
@ -146,9 +146,9 @@ function deletemodule($parent_item_id)
**/
function deletepath($path_id)
{
$tbl_learnpath_main = Database :: get_course_table(LEARNPATH_MAIN_TABLE);
$tbl_learnpath_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
$tbl_learnpath_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
$tbl_learnpath_main = Database :: get_course_table(TABLE_LEARNPATH_MAIN);
$tbl_learnpath_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
$tbl_learnpath_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
$sql = "DELETE FROM $tbl_learnpath_main WHERE lp_id='$path_id'";
$result = api_sql_query($sql, __FILE__, __LINE__);
@ -175,8 +175,8 @@ function deletepath($path_id)
function moveitem($direction, $id, $moduleid, $type = 'item')
{
global $learnpath_id;
$tbl_learnpath_item = Database::get_course_table(LEARNPATH_ITEM_TABLE);
$tbl_learnpath_chapter = Database::get_course_table(LEARNPATH_CHAPTER_TABLE);
$tbl_learnpath_item = Database::get_course_table(TABLE_LEARNPATH_ITEM);
$tbl_learnpath_chapter = Database::get_course_table(TABLE_LEARNPATH_CHAPTER);
$tree = get_learnpath_tree($learnpath_id);
$orig_order = 0;
@ -326,8 +326,8 @@ function movemodule($direction, $id)
*/
function insert_item($type = 'item', $name, $chapter_description = '', $parent_id = 0, $learnpath_id = 0, $params = null)
{
$tbl_learnpath_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
$tbl_learnpath_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
$tbl_learnpath_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
$tbl_learnpath_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
// getting the last order number from the chapters table, in this learnpath, for the parent chapter given
$sql = "SELECT * FROM $tbl_learnpath_chapter
@ -388,7 +388,7 @@ function array_learnpath_categories()
{
#global $tbl_learnpath_chapter;
global $learnpath_id;
$tbl_learnpath_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
$tbl_learnpath_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
$sql = "SELECT * FROM $tbl_learnpath_chapter WHERE (lp_id=$learnpath_id) ORDER BY display_order ASC";
$result = api_sql_query($sql, __FILE__, __LINE__);
@ -654,7 +654,7 @@ function display_all_learnpath()
{
global $tbl_tool, $color2;
global $xml_output, $lang_edit_learnpath, $lang_delete_learnpath, $lang_publish, $lang_no_publish, $lang_add_learnpath_chapter_to_path;
$tbl_learnpath_main = Database :: get_course_table(LEARNPATH_MAIN_TABLE);
$tbl_learnpath_main = Database :: get_course_table(TABLE_LEARNPATH_MAIN);
$sql = "SELECT * FROM $tbl_learnpath_main ORDER BY learnpath_name";
$result = api_sql_query($sql, __FILE__, __LINE__);
@ -819,7 +819,7 @@ function display_learnpath_items($categoryid)
function learnpath_items($itemid)
{
global $xml_output;
$tbl_learnpath_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
$tbl_learnpath_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
$sql_items = "SELECT parent_item_id FROM $tbl_lp_item WHERE id='$itemid'";
$moduleid_sql = api_sql_query($sql_items);
@ -846,7 +846,7 @@ function learnpath_items($itemid)
function learnpath_chapters($learnpath_id)
{
global $xml_output, $learnpath_id;
//$tbl_learnpath_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
//$tbl_learnpath_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
$tbl_lp_item = Database::get_course_table('lp_item');
@ -903,9 +903,9 @@ function prereqcheck($id_in_path)
//1 Initialise and import working vars
global $learnpath_id, $_user;
global $langPrereqToEnter, $langPrereqTestLimit1, $langPrereqTestLimit2, $langPrereqTestLimitNow, $langPrereqFirstNeedTo, $langPrereqModuleMinimum1, $langPrereqModuleMinimum2;
$tbl_learnpath_user = Database :: get_course_table(LEARNPATH_USER_TABLE);
$tbl_learnpath_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
$tbl_learnpath_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
$tbl_learnpath_user = Database :: get_course_table(TABLE_LEARNPATH_USER);
$tbl_learnpath_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
$tbl_learnpath_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
//2 Initialise return value
$prereq = false;
@ -1050,8 +1050,8 @@ function get_learnpath_tree($learnpath_id)
//init elems
#global $tbl_learnpath_item, $tbl_learnpath_chapter;
/*
$tbl_learnpath_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
$tbl_learnpath_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
$tbl_learnpath_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
$tbl_learnpath_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
*/
$tbl_lp_item = Database::get_course_table('lp_item');
@ -1153,7 +1153,7 @@ function get_ordered_items_list($tree, $chapter = 0, $include_chapters = false)
function display_toc_chapter_contents($tree, $parent_item_id = 0, $learnpath_id, $uid, $wrap, $level = 0)
{
#global $tbl_learnpath_user;
$tbl_learnpath_user = Database :: get_course_table(LEARNPATH_USER_TABLE);
$tbl_learnpath_user = Database :: get_course_table(TABLE_LEARNPATH_USER);
$num = 0;
$num_completed = 0;
foreach ($tree[$parent_item_id] as $order => $elem)
@ -1334,8 +1334,8 @@ function get_tracking_table($learnpath_id, $user_id, $parent_item_id = 0, $tree
*/
function is_empty($id)
{
$tbl_learnpath_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
$tbl_learnpath_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
$tbl_learnpath_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
$tbl_learnpath_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
$sql = "SELECT * FROM $tbl_learnpath_chapter WHERE lp_id=$id ORDER BY display_order ASC";
$result = api_sql_query($sql, __FILE__, __LINE__);
@ -1422,7 +1422,7 @@ function export_exercise($item_id)
include_once (api_get_path(LIBRARY_PATH).'/text.lib.php');
$TBL_EXERCISES = Database :: get_course_table(QUIZ_TEST_TABLE);
$TBL_EXERCISES = Database :: get_course_table(TABLE_QUIZ_TEST);
/*******************************/
/* Clears the exercise session */
@ -2211,9 +2211,9 @@ function exportpath($learnpath_id)
//1 Initialise variables
global $_course, $circle1_files, $LPnamesafe, $LPname, $expdir;
//$tbl_learnpath_main, $tbl_learnpath_chapter, $tbl_learnpath_item,
$tbl_learnpath_main = Database :: get_course_table(LEARNPATH_MAIN_TABLE);
$tbl_learnpath_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
$tbl_learnpath_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
$tbl_learnpath_main = Database :: get_course_table(TABLE_LEARNPATH_MAIN);
$tbl_learnpath_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
$tbl_learnpath_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
//where applicable, add a scorm "Done" button at the end of all contents
$add_scorm_button = true;
@ -2433,9 +2433,9 @@ function createimsmanifest($circle1_files, $learnpath_id)
{
global $_course, $LPname, $expdir, $LPnamesafe;
//$tbl_learnpath_main, $tbl_learnpath_chapter, $tbl_learnpath_item,
$tbl_learnpath_main = Database :: get_course_table(LEARNPATH_MAIN_TABLE);
$tbl_learnpath_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
$tbl_learnpath_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
$tbl_learnpath_main = Database :: get_course_table(TABLE_LEARNPATH_MAIN);
$tbl_learnpath_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
$tbl_learnpath_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
include_once ('../metadata/md_funcs.php'); // RH: export metadata

@ -236,7 +236,7 @@ function file_or_folder($filefolder)
function store_resources($source_type, $source_id)
{
global $_course;
$resource_table = Database::get_course_table(LINKED_RESOURCES_TABLE);
$resource_table = Database::get_course_table(TABLE_LINKED_RESOURCES);
$addedresource = $_SESSION['addedresource'];
$addedresourceid = $_SESSION['addedresourceid'];
@ -1729,7 +1729,7 @@ function rl_get_html_resource_link($course_code, $type, $id, $style='', $new_win
$output = '<img src="../img/links.gif" align="middle" /> <a href="#" onclick="javascript:window.open(\'../link/link_goto.php?link_id='.$myrow['id'].'&amp;link_url='.urlencode($myrow['url'])."','MyWindow','width=500,height=400,top='+((screen.height-400)/2)+',left='+((screen.width-500)/2)+',scrollbars=1,resizable=1,menubar=1'); return false;\"".$styling.'>'.$myrow['title']."</a><br />\n";
break;
case TOOL_QUIZ:
$TBL_EXERCICES = Database::get_course_table(QUIZ_TEST_TABLE,$_course['database']);
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST,$_course['database']);
$result = api_sql_query("SELECT * FROM $TBL_EXERCICES WHERE id=$id",__FILE__,__LINE__);
$myrow = Database::fetch_array($result);
$output = '<img src="../img/quiz.gif" align="middle" /> <a href="../exercice/exercice_submit.php?exerciseId='.$myrow['id'].'"'.$styling.' '.$target.'>'.$myrow['title']."</a><br />\n";
@ -1858,7 +1858,7 @@ function rl_get_resource_link_for_learnpath($course_code, $learnpath_id, $id_in_
break;
case TOOL_QUIZ:
$TBL_EXERCICES = Database::get_course_table(QUIZ_TEST_TABLE,$_course['database']);
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST,$_course['database']);
$sql = "SELECT * FROM $TBL_EXERCICES WHERE id=$id";
$result= api_sql_query($sql,__FILE__,__LINE__);
$myrow=Database::fetch_array($result);
@ -1994,7 +1994,7 @@ function rl_get_resource_name($course_code, $learnpath_id, $id_in_path)
$output = $myrow['title'];
break;
case TOOL_QUIZ:
$TBL_EXERCICES = Database::get_course_table(QUIZ_TEST_TABLE,$_course['database']);
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST,$_course['database']);
$result = api_sql_query("SELECT * FROM $TBL_EXERCICES WHERE id=$id",__FILE__,__LINE__);
$myrow = Database::fetch_array($result);
$output = $myrow['title'];

@ -60,9 +60,9 @@ include ('resourcelinker.inc.php');
$link_table = Database :: get_course_table(TABLE_LINK);
$item_property_table = Database :: get_course_table(TABLE_ITEM_PROPERTY);
//$tbl_learnpath_main = Database :: get_course_table(LEARNPATH_MAIN_TABLE);
//$tbl_learnpath_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
//$tbl_learnpath_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
//$tbl_learnpath_main = Database :: get_course_table(TABLE_LEARNPATH_MAIN);
//$tbl_learnpath_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
//$tbl_learnpath_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
$tbl_lp = Database::get_course_table('lp');
$tbl_lp_item = Database::get_course_table('lp_item');
@ -313,7 +313,7 @@ if ($add)
case 'Exercise':
$addedresource_item = TOOL_QUIZ;
//get title from tool-type table
$tooltable = Database::get_course_table(QUIZ_TEST_TABLE);
$tooltable = Database::get_course_table(TABLE_QUIZ_TEST);
$result = api_sql_query("SELECT * FROM $tooltable WHERE id=".$addedresourceid[$i],__FILE__,__LINE__);
$myrow=mysql_fetch_array($result);
$title = $myrow['title'];
@ -967,7 +967,7 @@ if ($content == "Link")
*/
if (($content == "Exercise") or ($content == "HotPotatoes"))
{
$TBL_EXERCICES = Database::get_course_table(QUIZ_TEST_TABLE);
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$result = api_sql_query("SELECT * FROM ".$TBL_EXERCICES." WHERE active='1' ORDER BY id ASC");
while ($myrow = mysql_fetch_array($result))
{

@ -38,7 +38,7 @@ include('../inc/global.inc.php');
$this_section=SECTION_COURSES;
$tbl_user=Database::get_main_table(TABLE_MAIN_USER);
$tbl_online_connected=Database::get_course_table(ONLINE_CONNECTED_TABLE);
$tbl_online_connected=Database::get_course_table(TABLE_ONLINE_CONNECTED);
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);

@ -1,4 +1,4 @@
<?php // $Id: online_links.php 10190 2006-11-24 00:23:20Z pcool $
<?php // $Id: online_links.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -43,7 +43,7 @@ $action=$_GET['action'];
$link=intval($_GET['link']);
$tbl_user=Database::get_main_table(TABLE_MAIN_USER);
$tbl_online_link=Database::get_course_table(ONLINE_LINK_TABLE);
$tbl_online_link=Database::get_course_table(TABLE_ONLINE_LINK);
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);

@ -1,4 +1,4 @@
<?php // $Id: online_master.php 10191 2006-11-24 08:09:14Z pcool $
<?php // $Id: online_master.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -41,7 +41,7 @@ $init=intval($_GET['init']);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_online_link=Database::get_course_table(ONLINE_LINK_TABLE);
$tbl_online_link=Database::get_course_table(TABLE_ONLINE_LINK);
$query="SELECT t1.user_id,username,picture_uri,t2.status FROM $tbl_user t1,$tbl_course_user t2 WHERE t1.user_id=t2.user_id AND course_code='$_cid' AND (t1.user_id='".$_user['user_id']."' OR t2.status='1')";
$result=api_sql_query($query,__FILE__,__LINE__);

@ -1,4 +1,4 @@
<?php // $Id: online_whoisonline.php 10191 2006-11-24 08:09:14Z pcool $
<?php // $Id: online_whoisonline.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -39,9 +39,9 @@ $this_section=SECTION_COURSES;
$showPic=intval($_GET['showPic']);
$tbl_user=Database::get_main_table(TABLE_MAIN_USER);
$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_online_connected=Database::get_course_table(ONLINE_CONNECTED_TABLE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_online_connected = Database::get_course_table(TABLE_ONLINE_CONNECTED);
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);

File diff suppressed because it is too large Load Diff

@ -15,7 +15,7 @@ if ($_POST['StoreRolePermissions'])
{
if (!empty($_POST['role_name']))
{
$table_role=Database::get_course_table(ROLE_TABLE);
$table_role=Database::get_course_table(TABLE_ROLE);
$sql="INSERT INTO $table_role (role_name, role_comment, default_role)
VALUES ('".mysql_real_escape_string($_POST['role_name'])."','".mysql_real_escape_string($_POST['role_comment'])."','".mysql_real_escape_string($_POST['default_role'])."')";
$result=mysql_query($sql) or die(mysql_error());
@ -40,22 +40,22 @@ if (isset($_GET['action']) AND isset($_GET['permission']) AND isset($_GET['tool'
if (isset($_GET['action']) AND isset($_GET['role_id']) AND $_GET['action']=='delete')
{
//deleting the assignments fo this role: users
$table=Database::get_course_table(ROLE_USER_TABLE);
$table=Database::get_course_table(TABLE_ROLE_USER);
$sql="DELETE FROM $table WHERE role_id='".mysql_real_escape_string($_GET['role_id'])."'";
$result=api_sql_query($sql, __LINE__, __FILE__);
// deleting the assignments of this role: groups
$table=Database::get_course_table(ROLE_GROUP_TABLE);
$table=Database::get_course_table(TABLE_ROLE_GROUP);
$sql="DELETE FROM $table WHERE role_id='".mysql_real_escape_string($_GET['role_id'])."'";
$result=api_sql_query($sql, __LINE__, __FILE__);
// deleting the permissions of this role
$table=Database::get_course_table(ROLE_PERMISSION_TABLE);
$table=Database::get_course_table(TABLE_ROLE_PERMISSION);
$sql="DELETE FROM $table WHERE role_id='".mysql_real_escape_string($_GET['role_id'])."'";
$result=api_sql_query($sql, __LINE__, __FILE__);
// deleting the role
$table_role=Database::get_course_table(ROLE_TABLE);
$table_role=Database::get_course_table(TABLE_ROLE);
$sql="DELETE FROM $table_role WHERE role_id='".mysql_real_escape_string($_GET['role_id'])."'";
$result=api_sql_query($sql, __LINE__, __FILE__);

@ -1,4 +1,4 @@
<?php // $Id: resourcelinker.inc.php 10195 2006-11-25 15:26:00Z pcool $
<?php // $Id: resourcelinker.inc.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -234,7 +234,7 @@ function file_or_folder($filefolder)
function store_resources($source_type, $source_id)
{
global $_course;
$resource_table = Database::get_course_table(LINKED_RESOURCES_TABLE);
$resource_table = Database::get_course_table(TABLE_LINKED_RESOURCES);
$addedresource = $_SESSION['addedresource'];
$addedresourceid = $_SESSION['addedresourceid'];

@ -61,9 +61,9 @@ include ('resourcelinker.inc.php');
$link_table = Database :: get_course_table(TABLE_LINK);
$item_property_table = Database :: get_course_table(TABLE_ITEM_PROPERTY);
$tbl_learnpath_main = Database :: get_course_table(LEARNPATH_MAIN_TABLE);
$tbl_learnpath_chapter = Database :: get_course_table(LEARNPATH_CHAPTER_TABLE);
$tbl_learnpath_item = Database :: get_course_table(LEARNPATH_ITEM_TABLE);
$tbl_learnpath_main = Database :: get_course_table(TABLE_LEARNPATH_MAIN);
$tbl_learnpath_chapter = Database :: get_course_table(TABLE_LEARNPATH_CHAPTER);
$tbl_learnpath_item = Database :: get_course_table(TABLE_LEARNPATH_ITEM);
$action = $_REQUEST['action'];
$add = $_REQUEST['add'];
@ -882,7 +882,7 @@ if ($content == "Link")
*/
if (($content == "Exercise") or ($content == "HotPotatoes"))
{
$TBL_EXERCICES = Database::get_course_table(QUIZ_TEST_TABLE);
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$result = api_sql_query("SELECT * FROM ".$TBL_EXERCICES." WHERE active='1' ORDER BY id ASC");
while ($myrow = mysql_fetch_array($result))
{

@ -1,87 +1,87 @@
<?php
// $Id: user_list.php,v 1.24 2005/07/01 11:51:33 olivierb78 Exp $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Olivier Brouckaert
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/**
==============================================================================
@author Bart Mollet
* @package dokeos.admin
==============================================================================
*/
$langFile = 'admin';
require ('../inc/global.inc.php');
api_protect_admin_script();
require_once(api_get_path(LIBRARY_PATH).'/usermanager.lib.php');
$interbredcrump[] = array ("url" => "index.php", "name" => get_lang('AdministrationTools'));
$interbredcrump[] = array ("url" => 'user_list.php', "name" => get_lang('UserList'));
$tool_name = get_lang('Survey');
Display::display_header($tool_name);
?>
<?php
$group_table = Database :: get_main_table(MAIN_GROUP_TABLE);
if (isset ($_GET['keyword']))
{
$keyword = addslashes($_GET['keyword']);
$sql = "SELECT * FROM ".$group_table." WHERE groupname LIKE '%".$keyword."%'";
$parameters = array ('keyword' => $_GET['keyword']);
}
else
{
$sql = "SELECT * FROM ".$group_table;
$parameters = array ();
}
$res = api_sql_query($sql,__FILE__,__LINE__);
if (mysql_num_rows($res) > 0)
{
$users = array ();
while ($obj = mysql_fetch_object($res))
{
$group = array ();
$group[] = '<input type="checkbox" name="group[]" value="'.$obj->group_id.'"/>';
$group[] = $obj->group_id;
$group[] = $obj->groupname;
$group[] = $group;
}
$table_header[] = array('',false);
$table_header[] = array (get_lang('serialno'), true);
$table_header[] = array (get_lang('FirstName'), true);
$table_header[] = array (get_lang('LastName'), true);
$table_header[] = array (get_lang('LoginName'), true);
$table_header[] = array ('', false);
echo '<form method="post" action="new_survey.php">';
Display :: display_sortable_table($table_header, $users, array (), array (), $parameters);
echo '<input type="submit" value="'.get_lang('Ok').'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang("ConfirmYourChoice")))."'".')) return false;"/>';
echo '</form>';
}
Display::display_footer();
?>
<?php
// $Id: user_list.php,v 1.24 2005/07/01 11:51:33 olivierb78 Exp $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Olivier Brouckaert
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/**
==============================================================================
@author Bart Mollet
* @package dokeos.admin
==============================================================================
*/
$langFile = 'admin';
require ('../inc/global.inc.php');
api_protect_admin_script();
require_once(api_get_path(LIBRARY_PATH).'/usermanager.lib.php');
$interbredcrump[] = array ("url" => "index.php", "name" => get_lang('AdministrationTools'));
$interbredcrump[] = array ("url" => 'user_list.php', "name" => get_lang('UserList'));
$tool_name = get_lang('Survey');
Display::display_header($tool_name);
?>
<?php
$group_table = Database :: get_main_table(TABLE_MAIN_GROUP);
if (isset ($_GET['keyword']))
{
$keyword = addslashes($_GET['keyword']);
$sql = "SELECT * FROM ".$group_table." WHERE groupname LIKE '%".$keyword."%'";
$parameters = array ('keyword' => $_GET['keyword']);
}
else
{
$sql = "SELECT * FROM ".$group_table;
$parameters = array ();
}
$res = api_sql_query($sql,__FILE__,__LINE__);
if (mysql_num_rows($res) > 0)
{
$users = array ();
while ($obj = mysql_fetch_object($res))
{
$group = array ();
$group[] = '<input type="checkbox" name="group[]" value="'.$obj->group_id.'"/>';
$group[] = $obj->group_id;
$group[] = $obj->groupname;
$group[] = $group;
}
$table_header[] = array('',false);
$table_header[] = array (get_lang('serialno'), true);
$table_header[] = array (get_lang('FirstName'), true);
$table_header[] = array (get_lang('LastName'), true);
$table_header[] = array (get_lang('LoginName'), true);
$table_header[] = array ('', false);
echo '<form method="post" action="new_survey.php">';
Display :: display_sortable_table($table_header, $users, array (), array (), $parameters);
echo '<input type="submit" value="'.get_lang('Ok').'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang("ConfirmYourChoice")))."'".')) return false;"/>';
echo '</form>';
}
Display::display_footer();
?>

@ -40,10 +40,12 @@ require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
// Database table definitions
$table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY);
$table_survey = Database :: get_main_table(MAIN_SURVEY_TABLE);
$table_group = Database :: get_main_table(MAIN_GROUP_TABLE);
$table_question = Database :: get_main_table(MAIN_SURVEYQUESTION_TABLE);
$table_survey = Database :: get_main_table(TABLE_MAIN_SURVEY);
$table_group = Database :: get_main_table(TABLE_MAIN_GROUP);
$table_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION);
$tool_name = get_lang('ViewQuestions');
$header1 = get_lang('SurveyName');
$header2 = get_lang('GroupName');

@ -40,10 +40,12 @@ require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
// Database table definitions
$table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY);
$table_survey = Database :: get_main_table(MAIN_SURVEY_TABLE);
$table_group = Database :: get_main_table(MAIN_GROUP_TABLE);
$table_question = Database :: get_main_table(MAIN_SURVEYQUESTION_TABLE);
$table_survey = Database :: get_main_table(TABLE_MAIN_SURVEY);
$table_group = Database :: get_main_table(TABLE_MAIN_GROUP);
$table_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION);
$tool_name = get_lang('ViewQuestions');
$header1 = get_lang('SurveyName');
$header2 = get_lang('GroupName');

@ -43,12 +43,14 @@ require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
$status = surveymanager::get_status();
if($status==5)
{
api_protect_admin_script();
api_protect_admin_script();
}
// Database table definitions
$table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY);
$table_survey = Database :: get_main_table(MAIN_SURVEY_TABLE);
$table_group = Database :: get_main_table(MAIN_GROUP_TABLE);
$table_question = Database :: get_main_table(MAIN_SURVEYQUESTION_TABLE);
$table_survey = Database :: get_main_table(TABLE_MAIN_SURVEY);
$table_group = Database :: get_main_table(TABLE_MAIN_GROUP);
$table_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION);
$tool_name = get_lang('ViewQuestions');
$header1 = get_lang('SurveyName');
$header2 = get_lang('GroupName');

@ -1,107 +1,109 @@
<?php
// $Id: course_add.php,v 1.10 2005/05/30 11:46:48 bmol Exp $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Olivier Brouckaert
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/**
==============================================================================
* @package dokeos.admin
==============================================================================
*/
/*
==============================================================================
INIT SECTION
==============================================================================
*/
$langFile = 'survey';
require_once ('../inc/global.inc.php');
api_protect_admin_script();
require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
$table_survey = Database :: get_main_table(MAIN_SURVEY_TABLE);
$table_group = Database :: get_main_table(MAIN_GROUP_TABLE);
$table_question = Database :: get_main_table(MAIN_SURVEYQUESTION_TABLE);
$tool_name = get_lang('SelectQuestionByType');
$interbredcrump[] = array ("url" => "index.php", "name" => get_lang('Survey'));
//$questtype=$_POST['add_question'];
Display::display_header($tool_name);
api_display_tool_title($tool_name);
?>
<SCRIPT LANGUAGE="JavaScript" src="set_default_value.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="validatelibraryitems.js"></script>
<table>
<tr>
<td>
<?api_display_tool_title($group_name);?>
</td>
</tr>
</table>
<?
if( isset($error_message) )
{
Display::display_error_message($error_message);
}
?>
<form name="question" method="post" action="question_bytype.php">
<table>
<tr>
<td>
<?php echo get_lang('Selectype');?>
</td>
<td>
<select name="add_question">
<option value="0"><?php echo get_lang('Select');?></option>
<option value="<?php echo get_lang('yesno');?>" <?php if(isset($_POST['add_question'])){if($_POST['add_question']=="1")echo "selected";}?>><?php echo get_lang('yesno');?></option>
<option value="<?php echo get_lang('MultipleChoiceSingle');?>" <?php if(isset($_POST['add_question'])){if($_POST['add_question']=="2")echo "selected";}?>><?php echo get_lang('MultipleChoiceSingle');?></option>
<option value="<?php echo get_lang('MultipleChoiceMulti');?>" <?php if(isset($_POST['add_question'])){if($_POST['add_question']=="3")echo "selected";}?>><?php echo get_lang('MultipleChoiceMulti');?></option>
<option value="<?php echo get_lang('Open');?>" <?php if(isset($_POST['add_question'])){if($_POST['add_question']=="4")echo "selected";}?>><?php echo get_lang('Open');?></option>
<option value="<?php echo get_lang('numbered');?>" <?php if(isset($_POST['add_question'])){if($_POST['add_question']=="5")echo "selected";}?>><?php echo get_lang('numbered');?></option>
</select>
</td>
</tr>
<tr></tr>
<tr>
<td></td>
<td>
<input type="submit" name= 'next' value="<?php echo get_lang('next');?>">
</td>
</tr>
</table>
</form>
<?php
Display :: display_footer();
<?php
// $Id: course_add.php,v 1.10 2005/05/30 11:46:48 bmol Exp $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Olivier Brouckaert
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/**
==============================================================================
* @package dokeos.admin
==============================================================================
*/
/*
==============================================================================
INIT SECTION
==============================================================================
*/
$langFile = 'survey';
require_once ('../inc/global.inc.php');
api_protect_admin_script();
require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
// Database table definitions
$table_survey = Database :: get_main_table(TABLE_MAIN_SURVEY);
$table_group = Database :: get_main_table(TABLE_MAIN_GROUP);
$table_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION);
$tool_name = get_lang('SelectQuestionByType');
$interbredcrump[] = array ("url" => "index.php", "name" => get_lang('Survey'));
//$questtype=$_POST['add_question'];
Display::display_header($tool_name);
api_display_tool_title($tool_name);
?>
<SCRIPT LANGUAGE="JavaScript" src="set_default_value.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="validatelibraryitems.js"></script>
<table>
<tr>
<td>
<?api_display_tool_title($group_name);?>
</td>
</tr>
</table>
<?
if( isset($error_message) )
{
Display::display_error_message($error_message);
}
?>
<form name="question" method="post" action="question_bytype.php">
<table>
<tr>
<td>
<?php echo get_lang('Selectype');?>
</td>
<td>
<select name="add_question">
<option value="0"><?php echo get_lang('Select');?></option>
<option value="<?php echo get_lang('yesno');?>" <?php if(isset($_POST['add_question'])){if($_POST['add_question']=="1")echo "selected";}?>><?php echo get_lang('yesno');?></option>
<option value="<?php echo get_lang('MultipleChoiceSingle');?>" <?php if(isset($_POST['add_question'])){if($_POST['add_question']=="2")echo "selected";}?>><?php echo get_lang('MultipleChoiceSingle');?></option>
<option value="<?php echo get_lang('MultipleChoiceMulti');?>" <?php if(isset($_POST['add_question'])){if($_POST['add_question']=="3")echo "selected";}?>><?php echo get_lang('MultipleChoiceMulti');?></option>
<option value="<?php echo get_lang('Open');?>" <?php if(isset($_POST['add_question'])){if($_POST['add_question']=="4")echo "selected";}?>><?php echo get_lang('Open');?></option>
<option value="<?php echo get_lang('numbered');?>" <?php if(isset($_POST['add_question'])){if($_POST['add_question']=="5")echo "selected";}?>><?php echo get_lang('numbered');?></option>
</select>
</td>
</tr>
<tr></tr>
<tr>
<td></td>
<td>
<input type="submit" name= 'next' value="<?php echo get_lang('next');?>">
</td>
</tr>
</table>
</form>
<?php
Display :: display_footer();
?>

@ -78,8 +78,8 @@ $htmlHeadXtra[] = "<style type='text/css'>
*/
// regroup table names for maintenance purpose
$TABLETRACK_ACCESS = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LASTACCESS);
$TABLETRACK_LINKS = Database::get_statistic_table(STATISTIC_TRACK_E_LINKS_TABLE);
$TABLETRACK_DOWNLOADS = Database::get_statistic_table(STATISTIC_TRACK_E_DOWNLOADS_TABLE);
$TABLETRACK_LINKS = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LINKS);
$TABLETRACK_DOWNLOADS = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS);
$TABLETRACK_ACCESS_2 = Database::get_statistic_table("track_e_access");
$TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$TABLECOURSE = Database::get_main_table(TABLE_MAIN_COURSE);
@ -87,10 +87,10 @@ $TABLECOURSE_LINKS = Database::get_course_table(TABLE_LINK);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
//$table_scormdata = Database::get_scorm_table(SCORM_SCO_DATA_TABLE);
//$table_scormmain = Database::get_scorm_table(SCORM_MAIN_TABLE);
//$tbl_learnpath_main = Database::get_course_table(LEARNPATH_MAIN_TABLE);
//$tbl_learnpath_item = Database::get_course_table(LEARNPATH_ITEM_TABLE);
//$tbl_learnpath_chapter = Database::get_course_table(LEARNPATH_CHAPTER_TABLE);
//$table_scormmain = Database::get_scorm_table(TABLE_SCORM_MAIN);
//$tbl_learnpath_main = Database::get_course_table(TABLE_LEARNPATH_MAIN);
//$tbl_learnpath_item = Database::get_course_table(TABLE_LEARNPATH_ITEM);
//$tbl_learnpath_chapter = Database::get_course_table(TABLE_LEARNPATH_CHAPTER);
$tbl_learnpath_main = Database::get_course_table('lp');
$tbl_learnpath_item = Database::get_course_table('lp_item');

@ -69,9 +69,9 @@ td {border-bottom: thin dashed gray;}
</style>";
$TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$TABLECOURSE_GROUPSUSER = Database::get_course_table(GROUP_USER_TABLE);
$TABLECOURSE_GROUPSUSER = Database::get_course_table(TABLE_GROUP_USER);
$TABLEUSER = Database::get_main_table(TABLE_MAIN_USER);
$TABLETRACK_ACCESS = Database::get_statistic_table(STATISTIC_TRACK_E_ACCESS_TABLE);
$TABLETRACK_ACCESS = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ACCESS);
Display::display_header($nameTools, "Tracking");
include(api_get_path(LIBRARY_PATH)."statsUtils.lib.inc.php");

@ -1,4 +1,4 @@
<?php // $Id: userLog.php 10195 2006-11-25 15:26:00Z pcool $
<?php // $Id: userLog.php 10197 2006-11-26 18:45:33Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -133,9 +133,9 @@ $TABLETRACK_EXERCICES = $_configuration['statistics_database']."`.`track_e_ex
$TABLECOURSE_LINKS = Database::get_course_table(TABLE_LINK);
$TABLECOURSE_WORK = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
$TABLECOURSE_GROUPSUSER = Database::get_course_table(GROUP_USER_TABLE);
$TABLECOURSE_EXERCICES = Database::get_course_table(QUIZ_TEST_TABLE);
$TBL_TRACK_HOTPOTATOES = Database::get_statistic_table(STATISTIC_TRACK_E_HOTPOTATOES_TABLE);
$TABLECOURSE_GROUPSUSER = Database::get_course_table(TABLE_GROUP_USER);
$TABLECOURSE_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$TBL_TRACK_HOTPOTATOES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
if(api_get_setting('use_session_mode') == "true") {
@ -201,7 +201,7 @@ function myEnc($isostring,$supposed_encoding='ISO-8859-15')
function display_login_tracking_info($view, $user_id, $course_id)
{
$MonthsLong = $GLOBALS['MonthsLong'];
$track_access_table = Database::get_statistic_table(STATISTIC_TRACK_E_ACCESS_TABLE);
$track_access_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ACCESS);
$tempView = $view;
if(substr($view,0,1) == '1')
{
@ -535,7 +535,7 @@ function display_links_tracking_info($view, $user_id, $course_id)
*/
function display_document_tracking_info($view, $user_id, $course_id)
{
$downloads_table = Database::get_statistic_table(STATISTIC_TRACK_E_DOWNLOADS_TABLE);
$downloads_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS);
if(substr($view,4,1) == '1')
{
$new_view = substr_replace($view,'0',4,1);

@ -410,7 +410,7 @@ function get_user_data($from, $number_of_items, $column, $direction)
ug.user_id,
ug.group_id group_id,
sg.name
FROM " . Database::get_course_table(GROUP_USER_TABLE) . " ug
FROM " . Database::get_course_table(TABLE_GROUP_USER) . " ug
LEFT JOIN " . Database::get_course_table(TABLE_GROUP) . " sg ON ug.group_id = sg.id
WHERE ug.user_id IN ('".implode("','", $user_ids)."')";
@ -480,7 +480,7 @@ function get_user_data($from, $number_of_items, $column, $direction)
}
$sql = "SELECT ug.user_id, ug.group_id group_id, sg.name
FROM ".Database::get_course_table(GROUP_USER_TABLE)." ug
FROM ".Database::get_course_table(TABLE_GROUP_USER)." ug
LEFT JOIN ".Database::get_course_table(TABLE_GROUP)." sg
ON ug.group_id = sg.id
WHERE ug.user_id IN ('".implode("','", $user_ids)."')";

@ -52,8 +52,8 @@ $this_section = SECTION_COURSES;
$nameTools = get_lang("Users");
api_protect_course_script();
$TBL_USERINFO_DEF = Database :: get_course_table(USER_INFO_TABLE);
$TBL_USERINFO_CONTENT = Database :: get_course_table(USER_INFO_CONTENT_TABLE);
$TBL_USERINFO_DEF = Database :: get_course_table(TABLE_USER_INFO);
$TBL_USERINFO_CONTENT = Database :: get_course_table(TABLE_USER_INFO_CONTENT);
$interbreadcrumb[] = array ("url" => "user.php", "name" => get_lang('Users'));

@ -779,7 +779,7 @@ function show_notification($my_course)
$course_database = $my_course['db'];
$course_tool_table = Database::get_course_table(TABLE_TOOL_LIST, $course_database);
$tool_edit_table = Database::get_course_table(TABLE_ITEM_PROPERTY, $course_database);
$course_group_user_table = Database :: get_course_table(GROUP_USER_TABLE, $course_database);
$course_group_user_table = Database :: get_course_table(TABLE_GROUP_USER, $course_database);
// get the user's last access dates to all tools of this course
$sqlLastTrackInCourse = "SELECT * FROM $statistic_database.track_e_lastaccess
USE INDEX (access_cours_code, access_user_id)
@ -840,7 +840,7 @@ function get_user_course_categories()
{
global $_user;
$table_category = Database::get_user_personal_table(USER_COURSE_CATEGORY_TABLE);
$table_category = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY);
$sql = "SELECT * FROM ".$table_category." WHERE user_id='".$_user['user_id']."'";
$result = api_sql_query($sql,__FILE__,__LINE__);
while ($row = mysql_fetch_array($result))

Loading…
Cancel
Save