diff --git a/main/calendar/agenda.inc.php b/main/calendar/agenda.inc.php index 6aaae98623..8295d21b6f 100755 --- a/main/calendar/agenda.inc.php +++ b/main/calendar/agenda.inc.php @@ -257,7 +257,7 @@ function get_calendar_items($select_month, $select_year, $select_day = false) //Check my personal calendar items if (api_get_setting('allow_personal_agenda') == 'true' && empty($_SESSION['user']) && empty($_SESSION['group'])) { - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); // 1. creating the SQL statement for getting the personal agenda items in MONTH view $sql = "SELECT id, title, text as content , date as start_date, enddate as end_date, parent_event_id FROM ".$tbl_personal_agenda." WHERE user='".api_get_user_id()."' ".$show_all_current_personal; diff --git a/main/calendar/myagenda.inc.php b/main/calendar/myagenda.inc.php index 0270a624f1..cee0680891 100755 --- a/main/calendar/myagenda.inc.php +++ b/main/calendar/myagenda.inc.php @@ -331,7 +331,7 @@ function display_myminimonthcalendar($agendaitems, $month, $year, $monthName) { */ function store_personal_item($day, $month, $year, $hour, $minute, $title, $content, $id = "") { - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); //constructing the date $date = $year."-".$month."-".$day." ".$hour.":".$minute.":00"; @@ -415,7 +415,7 @@ 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_agenda_items($user_id, $agendaitems, $day = "", $month = "", $year = "", $week = "", $type) { - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); $user_id = intval($user_id); // 1. creating the SQL statement for getting the personal agenda items in MONTH view @@ -517,7 +517,7 @@ function get_personal_agenda_items($user_id, $agendaitems, $day = "", $month = " * @return array The results of the database query, or null if not found */ function get_personal_agenda_item($id) { - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); $id = intval($id); // make sure events of the personal agenda can only be seen by the user himself $user = api_get_user_id(); @@ -537,7 +537,7 @@ function get_personal_agenda_item($id) { function show_personal_agenda() { global $MonthsLong, $charset; - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); // The SQL statement that retrieves all the personal agenda items of this user $sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".api_get_user_id()."' ORDER BY date DESC"; @@ -641,7 +641,7 @@ function show_personal_agenda() { function show_simple_personal_agenda($user_id) { global $MonthsLong, $charset; - $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); + $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA); // The SQL statement that retrieves all the personal agenda items of this user $sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$user_id."' ORDER BY date DESC"; diff --git a/main/calendar/myagenda.php b/main/calendar/myagenda.php index e0e1369730..0a55ad047a 100755 --- a/main/calendar/myagenda.php +++ b/main/calendar/myagenda.php @@ -62,7 +62,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); -$tbl_personal_agenda= Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); +$tbl_personal_agenda= Database :: get_main_table(TABLE_PERSONAL_AGENDA); // the variables for the days and the months // Defining the shorts for the days diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index 85d0b4a1f2..8b48a435fc 100755 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -51,7 +51,7 @@ $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(TABLE_QUIZ_TEST_QUESTION); $TBL_EXERCICES = Database :: get_course_table(TABLE_QUIZ_TEST); -$TBL_TRACK_EXERCICES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES); +$TBL_TRACK_EXERCICES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); // document path $documentPath = api_get_path(SYS_COURSE_PATH).$courseInfo['path']."/document"; diff --git a/main/exercice/exercise_result.php b/main/exercice/exercise_result.php index 7ba03f48ec..61514dd5aa 100755 --- a/main/exercice/exercise_result.php +++ b/main/exercice/exercise_result.php @@ -140,7 +140,7 @@ ExerciseLib::display_question_list_by_attempt($objExercise, $exe_id, true); /* $session_control_key = ExerciseLib::get_session_time_control_key($objExercise->id, $learnpath_id, $learnpath_item_id); if (isset($session_control_key) && !ExerciseLib::exercise_time_control_is_valid($objExercise->id, $learnpath_id, $learnpath_item_id)) { - $TBL_TRACK_ATTEMPT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); + $TBL_TRACK_ATTEMPT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); $sql_fraud = "UPDATE $TBL_TRACK_ATTEMPT SET answer = 0, marks = 0, position = 0 WHERE exe_id = $exe_id "; Database::query($sql_fraud); }*/ diff --git a/main/exercice/exercise_show.php b/main/exercice/exercise_show.php index 8284e3a3be..8424f5dc1a 100755 --- a/main/exercice/exercise_show.php +++ b/main/exercice/exercise_show.php @@ -33,8 +33,8 @@ if ($origin == 'learnpath') { // Database table definitions $TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION); $TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION); -$TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES); -$TBL_TRACK_ATTEMPT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); +$TBL_TRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); +$TBL_TRACK_ATTEMPT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); // General parameters passed via POST/GET if ($debug) { error_log('Entered exercise_result.php: '.print_r($_POST,1)); } diff --git a/main/exercice/exercise_submit.php b/main/exercice/exercise_submit.php index 507e1da3d4..6f565d2055 100755 --- a/main/exercice/exercise_submit.php +++ b/main/exercice/exercise_submit.php @@ -79,7 +79,7 @@ $currentAnswer = isset($_REQUEST['num_answer']) ? intval($_REQUEST['num_answer'] $error = ''; //Table calls -$exercice_attemp_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); +$exercice_attemp_table = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); /* Teacher takes an exam and want to see a preview, we delete the objExercise from the session in order to get the latest diff --git a/main/exercice/hotpotatoes.lib.php b/main/exercice/hotpotatoes.lib.php index d3188a4d80..f8fe505926 100755 --- a/main/exercice/hotpotatoes.lib.php +++ b/main/exercice/hotpotatoes.lib.php @@ -455,7 +455,7 @@ function HotPotGCt($folder, $flag, $user_id) */ function deleteAttempt($id) { - $table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES); + $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES); $id = intval($id); $sql = "DELETE FROM $table WHERE id = $id"; Database::query($sql); diff --git a/main/exercice/hotpotatoes_exercise_report.php b/main/exercice/hotpotatoes_exercise_report.php index 8a2fc6c43c..1ca8436290 100755 --- a/main/exercice/hotpotatoes_exercise_report.php +++ b/main/exercice/hotpotatoes_exercise_report.php @@ -35,8 +35,8 @@ $is_allowedToEdit = api_is_allowed_to_edit(null, true) || api_is_drh(); $is_tutor = api_is_allowed_to_edit(true); $TBL_QUESTIONS = Database :: get_course_table(TABLE_QUIZ_QUESTION); -$TBL_TRACK_EXERCICES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES); -$TBL_TRACK_HOTPOTATOES_EXERCICES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES); +$TBL_TRACK_EXERCICES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); +$TBL_TRACK_HOTPOTATOES_EXERCICES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES); $TBL_LP_ITEM_VIEW = Database :: get_course_table(TABLE_LP_ITEM_VIEW); $course_id = api_get_course_int_id(); diff --git a/main/exercice/hotpotatoes_exercise_result.class.php b/main/exercice/hotpotatoes_exercise_result.class.php index dcf57be36d..085f14ebcf 100755 --- a/main/exercice/hotpotatoes_exercise_result.class.php +++ b/main/exercice/hotpotatoes_exercise_result.class.php @@ -23,7 +23,7 @@ class HotpotatoesExerciseResult { $return = array(); $TBL_USER = Database::get_main_table(TABLE_MAIN_USER); - $TBL_TRACK_HOTPOTATOES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES); + $TBL_TRACK_HOTPOTATOES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES); $cid = api_get_course_id(); $course_id = api_get_course_int_id(); diff --git a/main/exercice/hotspot_answers.as.php b/main/exercice/hotspot_answers.as.php index d6bea208f9..06faac2975 100755 --- a/main/exercice/hotspot_answers.as.php +++ b/main/exercice/hotspot_answers.as.php @@ -88,7 +88,7 @@ if(isset($_SESSION['exerciseResultCoordinates']) && $from_db==0) { } } else { // get it from db - $tbl_track_e_hotspot = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTSPOT); + $tbl_track_e_hotspot = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT); $sql = "SELECT hotspot_coordinate FROM $tbl_track_e_hotspot WHERE hotspot_question_id = $questionId AND diff --git a/main/exercice/hotspot_updatescore.inc.php b/main/exercice/hotspot_updatescore.inc.php index a4dab2e46d..881885608c 100755 --- a/main/exercice/hotspot_updatescore.inc.php +++ b/main/exercice/hotspot_updatescore.inc.php @@ -47,7 +47,7 @@ foreach ($coords as $coord) { } $coordinates = substr($coordinates,0,-1); -$TBL_TRACK_E_HOTSPOT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTSPOT); +$TBL_TRACK_E_HOTSPOT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT); // update db $update_id = $_SESSION['exerciseResult'][$questionId]['ids'][$answerId]; diff --git a/main/exercice/mark_free_answer.php b/main/exercice/mark_free_answer.php index c3779c0f18..b0f55a6147 100755 --- a/main/exercice/mark_free_answer.php +++ b/main/exercice/mark_free_answer.php @@ -82,7 +82,7 @@ if ($action == 'mark') { if (!empty($_POST['score']) AND $_POST['score'] < $obj_question->selectWeighting() AND $_POST['score'] >= 0) { //mark the user mark into the database using something similar to the following function: - $exercise_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES); + $exercise_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); #global $origin, $tbl_learnpath_user, $learnpath_id, $learnpath_item_id; $sql = "SELECT * FROM $exercise_table WHERE exe_user_id = ".intval($my_usr)." AND exe_cours_id = '".Database::escape_string($my_cid)."' AND exe_exo_id = ".intval($my_exe)." diff --git a/main/exercice/savescores.php b/main/exercice/savescores.php index 012c73f6ab..65e69800e3 100755 --- a/main/exercice/savescores.php +++ b/main/exercice/savescores.php @@ -21,7 +21,7 @@ $full_file_path = $documentPath.$test; my_delete($full_file_path.$_user['user_id'].".t.html"); -$TABLETRACK_HOTPOTATOES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES); +$TABLETRACK_HOTPOTATOES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES); $TABLE_LP_ITEM_VIEW = Database::get_course_table(TABLE_LP_ITEM_VIEW); $score = $_REQUEST['score']; diff --git a/main/exercice/testcategory.class.php b/main/exercice/testcategory.class.php index 5349f58be3..be536e0f3b 100755 --- a/main/exercice/testcategory.class.php +++ b/main/exercice/testcategory.class.php @@ -497,7 +497,7 @@ class Testcategory */ public static function getCatScoreForExeidForUserid($in_cat_id, $in_exe_id, $in_user_id) { - $tbl_track_attempt = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); + $tbl_track_attempt = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); $tbl_question_rel_category = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY); $in_cat_id = intval($in_cat_id); $in_exe_id = intval($in_exe_id); diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index 42ef77dcec..8958680761 100755 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -3138,7 +3138,7 @@ function get_whats_new() $_course = api_get_course_info(); $table_posts = Database :: get_course_table(TABLE_FORUM_POST); - $tracking_last_tool_access = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LASTACCESS); + $tracking_last_tool_access = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LASTACCESS); // Note: This has to be replaced by the tool constant later. But temporarily bb_forum is used since this is the only thing that is in the tracking currently. //$tool = TOOL_FORUM; diff --git a/main/gradebook/gradebook_result.class.php b/main/gradebook/gradebook_result.class.php index 56b4ab815d..3a3d5ce817 100755 --- a/main/gradebook/gradebook_result.class.php +++ b/main/gradebook/gradebook_result.class.php @@ -88,8 +88,8 @@ class GradeBookResult $return = array(); $TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST); $TBL_USER = Database::get_main_table(TABLE_MAIN_USER); - $TBL_TRACK_EXERCISES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES); - $TBL_TRACK_HOTPOTATOES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES); + $TBL_TRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); + $TBL_TRACK_HOTPOTATOES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES); $cid = api_get_course_id(); $course_id = api_get_course_int_id(); diff --git a/main/inc/ajax/exercise.ajax.php b/main/inc/ajax/exercise.ajax.php index f9618ef9d2..de87f5cb33 100755 --- a/main/inc/ajax/exercise.ajax.php +++ b/main/inc/ajax/exercise.ajax.php @@ -42,9 +42,9 @@ switch ($action) { $sidx = 1; } - $track_exercise = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES); + $track_exercise = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); $user_table = Database::get_main_table(TABLE_MAIN_USER); - $track_attempt = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); + $track_attempt = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); $minutes = intval($_REQUEST['minutes']); $now = time() - 60 * $minutes; diff --git a/main/inc/ajax/message.ajax.php b/main/inc/ajax/message.ajax.php index fffcef82a4..0867a76ab2 100755 --- a/main/inc/ajax/message.ajax.php +++ b/main/inc/ajax/message.ajax.php @@ -29,7 +29,7 @@ switch ($action) { echo ''; break; } - $track_online_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ONLINE); + $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); $tbl_my_user = Database::get_main_table(TABLE_MAIN_USER); $tbl_my_user_friend = Database::get_main_table(TABLE_MAIN_USER_REL_USER); $tbl_user = Database::get_main_table(TABLE_MAIN_USER); diff --git a/main/inc/lib/agenda.lib.php b/main/inc/lib/agenda.lib.php index d6efcf814f..8054bc64ed 100644 --- a/main/inc/lib/agenda.lib.php +++ b/main/inc/lib/agenda.lib.php @@ -25,7 +25,7 @@ class Agenda { //Table definitions $this->tbl_global_agenda = Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR); - $this->tbl_personal_agenda = Database::get_user_personal_table(TABLE_PERSONAL_AGENDA); + $this->tbl_personal_agenda = Database::get_main_table(TABLE_PERSONAL_AGENDA); $this->tbl_course_agenda = Database::get_course_table(TABLE_AGENDA); $this->table_repeat = Database::get_course_table(TABLE_AGENDA_REPEAT); diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index 9347043b40..feb5bd5e36 100644 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -3871,7 +3871,7 @@ function api_track_item_property_update($tool, $ref, $title, $content, $progress */ function api_get_track_item_property_history($tool, $ref) { - $tbl_stats_item_property = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY); + $tbl_stats_item_property = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY); $course_id = api_get_real_course_id(); //numeric $course_code = api_get_course_id(); //alphanumeric $item_property_id = api_get_item_property_id($course_code, $tool, $ref); diff --git a/main/inc/lib/auth.lib.php b/main/inc/lib/auth.lib.php index a45cf0be76..6631562ca7 100755 --- a/main/inc/lib/auth.lib.php +++ b/main/inc/lib/auth.lib.php @@ -91,7 +91,7 @@ class Auth public function get_user_course_categories() { $user_id = api_get_user_id(); - $table_category = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY); + $table_category = Database::get_main_table(TABLE_USER_COURSE_CATEGORY); $sql = "SELECT * FROM " . $table_category . " WHERE user_id=$user_id ORDER BY sort ASC"; $result = Database::query($sql); $output = array(); @@ -246,7 +246,7 @@ class Auth public function move_category($direction, $category2move) { // the database definition of the table that stores the user defined course categories - $table_user_defined_category = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY); + $table_user_defined_category = Database::get_main_table(TABLE_USER_COURSE_CATEGORY); $current_user_id = api_get_user_id(); $user_coursecategories = $this->get_user_course_categories(); @@ -288,7 +288,7 @@ class Auth public function get_user_course_categories_info() { $current_user_id = api_get_user_id(); - $table_category = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY); + $table_category = Database::get_main_table(TABLE_USER_COURSE_CATEGORY); $sql = "SELECT * FROM " . $table_category . " WHERE user_id='" . $current_user_id . "' ORDER BY sort ASC"; @@ -311,7 +311,7 @@ class Auth $title = Database::escape_string($title); $category_id = intval($category_id); $result = false; - $tucc = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY); + $tucc = Database::get_main_table(TABLE_USER_COURSE_CATEGORY); $sql = "UPDATE $tucc SET title='" . api_htmlentities($title, ENT_QUOTES, api_get_system_encoding()) . "' WHERE id='" . $category_id . "'"; @@ -330,7 +330,7 @@ class Auth public function delete_course_category($category_id) { $current_user_id = api_get_user_id(); - $tucc = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY); + $tucc = Database::get_main_table(TABLE_USER_COURSE_CATEGORY); $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER); $category_id = intval($category_id); $result = false; @@ -383,7 +383,7 @@ class Auth */ public function store_course_category($category_title) { - $tucc = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY); + $tucc = Database::get_main_table(TABLE_USER_COURSE_CATEGORY); // protect data $current_user_id = api_get_user_id(); diff --git a/main/inc/lib/course_description.lib.php b/main/inc/lib/course_description.lib.php index 1dafbb6b65..7bdeb961d8 100755 --- a/main/inc/lib/course_description.lib.php +++ b/main/inc/lib/course_description.lib.php @@ -89,7 +89,7 @@ class CourseDescription * @return array */ public function get_description_history($description_type) { - $tbl_stats_item_property = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY); + $tbl_stats_item_property = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY); $tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY); $description_id = $this->get_id_by_description_type($description_type); @@ -226,7 +226,7 @@ class CourseDescription */ public function insert_stats($description_type) { - $tbl_stats_item_property = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY); + $tbl_stats_item_property = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY); $description_id = $this->get_id_by_description_type($description_type); $course_id = api_get_real_course_id(); $course_code = api_get_course_id(); diff --git a/main/inc/lib/display.lib.php b/main/inc/lib/display.lib.php index 58794f165f..86a4f7fc75 100755 --- a/main/inc/lib/display.lib.php +++ b/main/inc/lib/display.lib.php @@ -1254,7 +1254,7 @@ class Display */ public static function show_notification($course_info) { - $t_track_e_access = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LASTACCESS); + $t_track_e_access = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LASTACCESS); $course_tool_table = Database::get_course_table(TABLE_TOOL_LIST); $tool_edit_table = Database::get_course_table(TABLE_ITEM_PROPERTY); $course_code = Database::escape_string($course_info['code']); diff --git a/main/inc/lib/events.lib.inc.php b/main/inc/lib/events.lib.inc.php index acedc4c2c4..15c560f31d 100755 --- a/main/inc/lib/events.lib.inc.php +++ b/main/inc/lib/events.lib.inc.php @@ -348,7 +348,7 @@ class Event $status = Database::escape_string($status); } - $TABLETRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES); + $TABLETRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); if (!empty($question_list)) { $question_list = array_map('intval', $question_list); diff --git a/main/inc/lib/login.lib.php b/main/inc/lib/login.lib.php index 4b05a5710c..38c2a0ad2c 100755 --- a/main/inc/lib/login.lib.php +++ b/main/inc/lib/login.lib.php @@ -222,7 +222,7 @@ class Login // a uid is given (log in succeeded) $user_table = Database::get_main_table(TABLE_MAIN_USER); $admin_table = Database::get_main_table(TABLE_MAIN_ADMIN); - $track_e_login = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN); + $track_e_login = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); $sql = "SELECT user.*, a.user_id is_admin, UNIX_TIMESTAMP(login.login_date) login_date FROM $user_table @@ -452,7 +452,7 @@ class Login } if ($save_course_access) { - $course_tracking_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS); + $course_tracking_table = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS); /* * When $_configuration['session_lifetime'] is too big 100 hours (in order to let users take exercises with no problems) diff --git a/main/inc/lib/nanogong.lib.php b/main/inc/lib/nanogong.lib.php index d0a111ec34..be9c8ba41b 100755 --- a/main/inc/lib/nanogong.lib.php +++ b/main/inc/lib/nanogong.lib.php @@ -237,7 +237,7 @@ class Nanogong if (isset($this->params['exe_id']) && isset($this->params['user_id']) && isset($this->params['question_id']) && isset($this->params['session_id']) && isset($this->params['course_id']) ) { - $attempt_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); + $attempt_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); $sql = "SELECT filename FROM $attempt_table WHERE exe_id = ".$this->params['exe_id']." AND diff --git a/main/inc/lib/sessionmanager.lib.php b/main/inc/lib/sessionmanager.lib.php index 42146a82ee..4c6733e443 100755 --- a/main/inc/lib/sessionmanager.lib.php +++ b/main/inc/lib/sessionmanager.lib.php @@ -66,7 +66,7 @@ class SessionManager * @param string $duration * @param string $description Optional. The session description * @param int $showDescription Optional. Whether show the session description - * @param array $extrafields + * @param array $extrafields * @todo use an array to replace all this parameters or use the model.lib.php ... * @return mixed Session ID on success, error message otherwise * */ @@ -825,8 +825,8 @@ class SessionManager $forum_post = Database::get_course_table(TABLE_FORUM_POST); $tbl_course_lp = Database::get_course_table(TABLE_LP_MAIN); $wiki = Database::get_course_table(TABLE_WIKI); - $table_stats_default = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_DEFAULT); - $table_stats_access = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ACCESS); + $table_stats_default = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DEFAULT); + $table_stats_access = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS); $course = api_get_course_info_by_id($courseId); @@ -5403,7 +5403,7 @@ class SessionManager { $userId = intval($userId); - $trackLoginTable = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN); + $trackLoginTable = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); $whereConditions = array( 'login_user_id = ? ' => $userId @@ -5446,8 +5446,8 @@ class SessionManager } /** - * Returns list of a few data from session (name, short description, start - * date, end date) and the given extra fields if defined based on a + * Returns list of a few data from session (name, short description, start + * date, end date) and the given extra fields if defined based on a * session category Id. * @param int $categoryId The internal ID of the session category * @param string $target Value to search for in the session field values diff --git a/main/inc/lib/zombie/zombie_manager.class.php b/main/inc/lib/zombie/zombie_manager.class.php index 37c4498178..0f57e6d094 100755 --- a/main/inc/lib/zombie/zombie_manager.class.php +++ b/main/inc/lib/zombie/zombie_manager.class.php @@ -32,7 +32,7 @@ class ZombieManager $ceiling = date('Y-m-d H:i:s', $ceiling); $user_table = Database::get_main_table(TABLE_MAIN_USER); - $login_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN); + $login_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); $sql = 'SELECT user.user_id, diff --git a/main/mySpace/coaches.php b/main/mySpace/coaches.php index 8a2649c642..31a66eb183 100755 --- a/main/mySpace/coaches.php +++ b/main/mySpace/coaches.php @@ -38,7 +38,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(TABLE_STATISTIC_TRACK_E_LOGIN); +$tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); /** * MAIN PART diff --git a/main/mySpace/myStudents.php b/main/mySpace/myStudents.php index a4e429ddf0..6a2bb323b9 100755 --- a/main/mySpace/myStudents.php +++ b/main/mySpace/myStudents.php @@ -162,7 +162,7 @@ if (isset($_GET['details'])) { // Database Table Definitions $tbl_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER); -$tbl_stats_exercices = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES); +$tbl_stats_exercices = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); if (isset($_GET['user_id']) && $_GET['user_id'] != "") { $user_id = intval($_GET['user_id']); diff --git a/main/mySpace/progression.php b/main/mySpace/progression.php index 73ce2a8bc1..2f41c0c299 100755 --- a/main/mySpace/progression.php +++ b/main/mySpace/progression.php @@ -29,7 +29,7 @@ $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); $tbl_user = Database :: get_main_table(TABLE_MAIN_USER); $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE); $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); -$tbl_track_exercice = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES); +$tbl_track_exercice = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); /* MAIN CODE diff --git a/main/mySpace/reussite.php b/main/mySpace/reussite.php index 2bf5f67ce8..38b59601a3 100755 --- a/main/mySpace/reussite.php +++ b/main/mySpace/reussite.php @@ -27,7 +27,7 @@ $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); $tbl_user = Database :: get_main_table(TABLE_MAIN_USER); $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE); $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); -$tbl_track_exercice = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES); +$tbl_track_exercice = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); /* =============================================================================== diff --git a/main/newscorm/learnpathItem.class.php b/main/newscorm/learnpathItem.class.php index 730b468ed0..3716bec78d 100755 --- a/main/newscorm/learnpathItem.class.php +++ b/main/newscorm/learnpathItem.class.php @@ -2541,7 +2541,7 @@ class learnpathItem // Checking in the database. $sql = 'SELECT exe_result, exe_weighting - FROM ' . Database :: get_statistic_table( + FROM ' . Database :: get_main_table( TABLE_STATISTIC_TRACK_E_EXERCISES ) . ' WHERE exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path . ' @@ -3867,7 +3867,7 @@ class learnpathItem $my_status = ' '; $total_time = ' '; if (!empty($_REQUEST['exeId'])) { - $TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES); + $TBL_TRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); $safe_exe_id = intval($_REQUEST['exeId']); $sql = "SELECT start_date,exe_date diff --git a/main/newscorm/lp_ajax_save_item.php b/main/newscorm/lp_ajax_save_item.php index 6fd00114f3..4a05fe65c6 100755 --- a/main/newscorm/lp_ajax_save_item.php +++ b/main/newscorm/lp_ajax_save_item.php @@ -444,7 +444,7 @@ function save_item( if (!isset($_SESSION['login_as'])) { // If $_SESSION['login_as'] is set, then the user is an admin logged as the user. - $tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN); + $tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); $sql = "SELECT login_id, login_date FROM $tbl_track_login diff --git a/main/newscorm/lp_comm.server.php b/main/newscorm/lp_comm.server.php index 5ca20741f4..1b26e2a352 100755 --- a/main/newscorm/lp_comm.server.php +++ b/main/newscorm/lp_comm.server.php @@ -143,7 +143,7 @@ function save_item($lp_id, $user_id, $view_id, $item_id, $score = -1, $max = -1, if (!isset($_SESSION['login_as'])) { // If $_SESSION['login_as'] is set, then the user is an admin logged as the user. - $tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN); + $tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); $sql_last_connection = "SELECT login_id, login_date FROM $tbl_track_login WHERE login_user_id='".api_get_user_id()."' ORDER BY login_date DESC LIMIT 0,1"; diff --git a/main/newscorm/lp_view.php b/main/newscorm/lp_view.php index 067fead706..09513ed4fa 100755 --- a/main/newscorm/lp_view.php +++ b/main/newscorm/lp_view.php @@ -215,7 +215,7 @@ if (!empty($_REQUEST['exeId']) && global $src; $_SESSION['oLP']->items[$_SESSION['oLP']->current]->write_to_db(); - $TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES); + $TBL_TRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); $TBL_LP_ITEM_VIEW = Database::get_course_table(TABLE_LP_ITEM_VIEW); $TBL_LP_ITEM = Database::get_course_table(TABLE_LP_ITEM); $safe_item_id = intval($_GET['lp_item_id']); diff --git a/main/newscorm/resourcelinker.inc.php b/main/newscorm/resourcelinker.inc.php index 10b5e9b2d3..4961a93310 100755 --- a/main/newscorm/resourcelinker.inc.php +++ b/main/newscorm/resourcelinker.inc.php @@ -1508,7 +1508,7 @@ function showorhide_addresourcelink($type, $id) { * @todo use the constants for the type definitions. */ function rl_get_html_resource_link($course_code, $type, $id, $style='', $new_window = true) { - $_course = Database::get_course_info($course_code); + $_course = api_get_course_info($course_code); $course_id = api_get_course_int_id(); @@ -1741,7 +1741,7 @@ function rl_get_resource_link_for_learnpath($course_id, $learnpath_id, $id_in_pa */ function rl_get_resource_name($course_code, $learnpath_id, $id_in_path) { - $_course = Database::get_course_info($course_code); + $_course = api_get_course_info($course_code); $course_id = $_course['real_id']; $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM); $learnpath_id = intval($learnpath_id); diff --git a/main/tracking/course_access_details.php b/main/tracking/course_access_details.php index 87ac0110ec..6f7a9a5baf 100755 --- a/main/tracking/course_access_details.php +++ b/main/tracking/course_access_details.php @@ -39,7 +39,7 @@ td {border-bottom: thin dashed gray;} /*]]>*/ "; //@todo use Database library -$TABLETRACK_ACCESS = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ACCESS); +$TABLETRACK_ACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS); Display::display_header($nameTools,"Tracking"); // the variables for the days and the months diff --git a/main/tracking/exams.php b/main/tracking/exams.php index de67d1fc21..4c9f0a22fe 100755 --- a/main/tracking/exams.php +++ b/main/tracking/exams.php @@ -468,7 +468,7 @@ function export_complete_report_xls($filename, $array) function processStudentList($filter_score, $global, $exercise, $courseInfo, $sessionId, $newSessionList) { - $exerciseStatsTable = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES); + $exerciseStatsTable = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); if (empty($sessionId)) { $students = CourseManager::get_student_list_from_course_code( diff --git a/main/tracking/logins_details.php b/main/tracking/logins_details.php index 2c2a8f69da..520d8cb8cb 100755 --- a/main/tracking/logins_details.php +++ b/main/tracking/logins_details.php @@ -50,7 +50,7 @@ td {border-bottom: thin dashed gray;} $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER); $TABLECOURSE_GROUPSUSER = Database::get_course_table(TABLE_GROUP_USER); $TABLEUSER = Database::get_main_table(TABLE_MAIN_USER); -$TABLETRACK_ACCESS = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ACCESS); +$TABLETRACK_ACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS); Display::display_header($nameTools, "Tracking"); $courseId = api_get_course_int_id(); diff --git a/main/tracking/toolaccess_details.php b/main/tracking/toolaccess_details.php index f15bd4c1fd..c950736a9b 100755 --- a/main/tracking/toolaccess_details.php +++ b/main/tracking/toolaccess_details.php @@ -68,7 +68,7 @@ $reqdate=$_REQUEST['reqdate']; ?> dbase->generate_abstract_course_field_names($result_array); - $this->assertTrue(is_array($res)); - } - - function testGenerateAbstractUserFieldNames() { - $result_array=''; - $res=$this->dbase->generate_abstract_user_field_names($result_array); - $this->assertTrue(is_array($res)); - } - function get_course_by_category() { $category_id='1'; $res=$this->dbase->get_course_by_category($category_id); $this->assertTrue(is_string($res)); } - function testGetCourseChatConnectedTable() { - $database_name='dokeosla'; - $res=$this->dbase->get_course_chat_connected_table($database_name); - $this->assertTrue(is_string($res)); - } - function testGetCourseInfo() { $course_code='AYDD'; $res=$this->dbase->get_course_info($course_code); @@ -217,20 +199,6 @@ class TestDatabase extends UnitTestCase { $this->assertTrue(is_array($res)); } - function testGetUserPersonalDatabase() { - global $_configuration; - $res=$this->dbase->get_user_personal_database($_configuration); - $this->assertTrue(is_string($res)); - $this->assertTrue($res); - } - - function testGetUserPersonalTable(){ - $short_table_name=''; - $res=$this->dbase-> get_user_personal_table($short_table_name); - $this->assertTrue(is_string($res)); - $this->assertTrue($res); - } - /* // Contains a private unaccessible method, Database::glue_course_database_name(). function testGlueCourseDatabaseName() { $database_name='';