Parcourir la source

Minor - format function "Database ::" to "Database::"

jmontoyaa il y a 8 ans
Parent
commit
4af8524c05
69 fichiers modifiés avec 349 ajouts et 349 suppressions
  1. 4 4
      main/admin/access_url_add_courses_to_url.php
  2. 3 3
      main/admin/access_url_add_usergroup_to_url.php
  3. 2 2
      main/admin/access_url_add_users_to_url.php
  4. 1 1
      main/admin/access_url_edit_courses_to_url.php
  5. 8 8
      main/admin/course_information.php
  6. 2 2
      main/admin/sub_language_add.php
  7. 3 3
      main/admin/user_export.php
  8. 5 5
      main/admin/user_information.php
  9. 4 4
      main/course_info/infocours.php
  10. 1 1
      main/document/create_audio.php
  11. 4 4
      main/exercise/exercise.php
  12. 1 1
      main/exercise/exercise_report.php
  13. 1 1
      main/exercise/exercise_result.class.php
  14. 2 2
      main/exercise/hotpotatoes_exercise_report.php
  15. 1 1
      main/exercise/question_create.php
  16. 9 9
      main/forum/forumconfig.inc.php
  17. 59 59
      main/forum/forumfunction.inc.php
  18. 1 1
      main/gradebook/gradebook_add_link.php
  19. 2 2
      main/gradebook/gradebook_edit_all.php
  20. 2 2
      main/gradebook/gradebook_edit_link.php
  21. 2 2
      main/gradebook/gradebook_showlog_link.php
  22. 2 2
      main/gradebook/index.php
  23. 5 5
      main/gradebook/lib/GradebookUtils.php
  24. 2 2
      main/gradebook/lib/be/abstractlink.class.php
  25. 1 1
      main/gradebook/lib/be/attendancelink.class.php
  26. 2 2
      main/gradebook/lib/be/learnpathlink.class.php
  27. 1 1
      main/group/group_category.php
  28. 4 4
      main/group/group_space.php
  29. 1 1
      main/inc/ajax/course.ajax.php
  30. 1 1
      main/inc/ajax/lp.ajax.php
  31. 1 1
      main/inc/ajax/work.ajax.php
  32. 2 2
      main/inc/lib/add_course.lib.inc.php
  33. 6 6
      main/inc/lib/agenda.lib.php
  34. 2 2
      main/inc/lib/api.lib.php
  35. 3 3
      main/inc/lib/attendance.lib.php
  36. 23 23
      main/inc/lib/course.lib.php
  37. 13 13
      main/inc/lib/exercise.lib.php
  38. 10 10
      main/inc/lib/groupmanager.lib.php
  39. 19 19
      main/inc/lib/link.lib.php
  40. 9 9
      main/inc/lib/specific_fields_manager.lib.php
  41. 3 3
      main/inc/lib/statistics.lib.php
  42. 1 1
      main/inc/lib/system_announcements.lib.php
  43. 3 3
      main/inc/lib/thematic.lib.php
  44. 6 6
      main/inc/lib/tracking.lib.php
  45. 3 3
      main/inc/lib/usermanager.lib.php
  46. 2 2
      main/inc/lib/userportal.lib.php
  47. 1 1
      main/inc/local.inc.php
  48. 5 5
      main/lp/learnpath.class.php
  49. 1 1
      main/lp/lp_edit_item.php
  50. 3 3
      main/mySpace/current_courses.php
  51. 2 2
      main/mySpace/myStudents.php
  52. 2 2
      main/mySpace/user_edit.php
  53. 1 1
      main/search/search_suggestions.php
  54. 1 1
      main/session/add_many_session_to_category.php
  55. 1 1
      main/survey/create_new_survey.php
  56. 5 5
      main/survey/fillsurvey.php
  57. 6 6
      main/survey/preview.php
  58. 6 6
      main/survey/question.php
  59. 2 2
      main/survey/reporting.php
  60. 4 4
      main/survey/survey.download.inc.php
  61. 3 3
      main/survey/survey.lib.php
  62. 6 6
      main/survey/survey.php
  63. 14 14
      main/survey/surveyUtil.class.php
  64. 6 6
      main/survey/survey_invitation.php
  65. 6 6
      main/survey/survey_invite.php
  66. 4 4
      main/survey/survey_list.php
  67. 3 3
      main/user/user_export.php
  68. 22 22
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php
  69. 3 3
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php

+ 4 - 4
main/admin/access_url_add_courses_to_url.php

@@ -25,10 +25,10 @@ $courses = array ();
 $url_list = array();
 $users = array();
 
-$tbl_access_url_rel_course = Database:: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
-$tbl_access_url = Database:: get_main_table(TABLE_MAIN_ACCESS_URL);
-$tbl_user = Database:: get_main_table(TABLE_MAIN_USER);
-$tbl_course = Database:: get_main_table(TABLE_MAIN_COURSE);
+$tbl_access_url_rel_course = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
+$tbl_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL);
+$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
+$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
 
 /*	Header   */
 $tool_name = get_lang('AddCoursesToURL');

+ 3 - 3
main/admin/access_url_add_usergroup_to_url.php

@@ -24,9 +24,9 @@ $courses = array();
 $url_list = array();
 
 $tbl_access_url_rel_course = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
-$tbl_access_url = Database:: get_main_table(TABLE_MAIN_ACCESS_URL);
-$tbl_user = Database:: get_main_table(TABLE_MAIN_USER);
-$tbl_course = Database:: get_main_table(TABLE_MAIN_COURSE);
+$tbl_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL);
+$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
+$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
 
 $tool_name = get_lang('AddUserGroupToURL');
 $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));

+ 2 - 2
main/admin/access_url_add_users_to_url.php

@@ -25,8 +25,8 @@ $url_list = array();
 $users = array();
 
 $tbl_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
-$tbl_access_url = Database:: get_main_table(TABLE_MAIN_ACCESS_URL);
-$tbl_user = Database:: get_main_table(TABLE_MAIN_USER);
+$tbl_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL);
+$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
 
 /*	Header	*/
 $tool_name = get_lang('AddUsersToURL');

+ 1 - 1
main/admin/access_url_edit_courses_to_url.php

@@ -127,7 +127,7 @@ if ($ajax_search) {
         }
     }
 
-    $tbl_course = Database:: get_main_table(TABLE_MAIN_COURSE);
+    $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
     $sql = "SELECT id, code, title
             FROM $tbl_course u
             ORDER BY title, code";

+ 8 - 8
main/admin/course_information.php

@@ -26,34 +26,34 @@ function get_course_usage($course, $session_id = 0)
 {
     $courseId = $course['real_id'];
     // Learnpaths
-    $table   = Database :: get_course_table(TABLE_LP_MAIN);
+    $table   = Database::get_course_table(TABLE_LP_MAIN);
     $usage[] = array(
         get_lang(ucfirst(TOOL_LEARNPATH)),
         CourseManager::count_rows_course_table($table, $session_id, $courseId)
     );
     // Forums
-    $table   = Database :: get_course_table(TABLE_FORUM);
+    $table   = Database::get_course_table(TABLE_FORUM);
     $usage[] = array(get_lang('Forums'), CourseManager::count_rows_course_table($table, $session_id, $courseId));
     // Quizzes
-    $table   = Database :: get_course_table(TABLE_QUIZ_TEST);
+    $table   = Database::get_course_table(TABLE_QUIZ_TEST);
     $usage[] = array(
         get_lang(ucfirst(TOOL_QUIZ)),
         CourseManager::count_rows_course_table($table, $session_id, $courseId)
     );
     // Documents
-    $table   = Database :: get_course_table(TABLE_DOCUMENT);
+    $table   = Database::get_course_table(TABLE_DOCUMENT);
     $usage[] = array(
         get_lang(ucfirst(TOOL_DOCUMENT)),
         CourseManager::count_rows_course_table($table, $session_id, $courseId)
     );
     // Groups
-    $table   = Database :: get_course_table(TABLE_GROUP);
+    $table   = Database::get_course_table(TABLE_GROUP);
     $usage[] = array(
         get_lang(ucfirst(TOOL_GROUP)),
         CourseManager::count_rows_course_table($table, $session_id, $courseId)
     );
     // Calendar
-    $table   = Database :: get_course_table(TABLE_AGENDA);
+    $table   = Database::get_course_table(TABLE_AGENDA);
     $usage[] = array(
         get_lang(ucfirst(TOOL_CALENDAR_EVENT)),
         CourseManager::count_rows_course_table($table, $session_id, $courseId)
@@ -100,8 +100,8 @@ $table->display();
  */
 echo Display::page_header(get_lang('Users'));
 
-$table_course_user = Database:: get_main_table(TABLE_MAIN_COURSE_USER);
-$table_user = Database:: get_main_table(TABLE_MAIN_USER);
+$table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
+$table_user = Database::get_main_table(TABLE_MAIN_USER);
 $sql = "SELECT *, cu.status as course_status
         FROM $table_course_user cu, $table_user u";
 if (api_is_multiple_url_enabled()) {

+ 2 - 2
main/admin/sub_language_add.php

@@ -32,7 +32,7 @@ $interbreadcrumb[] = array('url' => 'languages.php', 'name' => get_lang('Platfor
  */
 function add_sub_language($original_name, $english_name, $isocode, $sublanguage_available, $parent_id)
 {
-    $tbl_admin_languages = Database:: get_main_table(TABLE_MAIN_LANGUAGE);
+    $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
     $original_name = Database::escape_string($original_name);
     $english_name = Database::escape_string($english_name);
     $isocode = Database::escape_string($isocode);
@@ -64,7 +64,7 @@ function add_sub_language($original_name, $english_name, $isocode, $sublanguage_
  */
 function check_if_language_exist($original_name, $english_name, $isocode, $sublanguage_available)
 {
-    $tbl_admin_languages = Database:: get_main_table(TABLE_MAIN_LANGUAGE);
+    $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
     $sql_original_name = 'SELECT count(*) AS count_original_name FROM ' . $tbl_admin_languages . ' WHERE original_name="' . Database::escape_string($original_name) . '" ';
     $sql_english_name = 'SELECT count(*) AS count_english_name FROM ' . $tbl_admin_languages . ' WHERE english_name="' . Database::escape_string($english_name) . '" ';
     //$sql_isocode='SELECT count(*) AS count_isocode FROM '.$tbl_admin_languages.' WHERE isocode="'.Database::escape_string($isocode).'" ';

+ 3 - 3
main/admin/user_export.php

@@ -12,9 +12,9 @@ $this_section = SECTION_PLATFORM_ADMIN;
 api_protect_admin_script();
 
 // Database table definitions
-$course_table = Database:: get_main_table(TABLE_MAIN_COURSE);
-$user_table = Database:: get_main_table(TABLE_MAIN_USER);
-$course_user_table = Database:: get_main_table(TABLE_MAIN_COURSE_USER);
+$course_table = Database::get_main_table(TABLE_MAIN_COURSE);
+$user_table = Database::get_main_table(TABLE_MAIN_USER);
+$course_user_table = Database::get_main_table(TABLE_MAIN_COURSE_USER);
 $session_course_user_table = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
 
 $tool_name = get_lang('ExportUserListXMLCSV');

+ 5 - 5
main/admin/user_information.php

@@ -249,11 +249,11 @@ foreach ($data as $label => $item) {
 }
 $trackingInformation = $table->toHtml();
 
-$tbl_session_course = Database:: get_main_table(TABLE_MAIN_SESSION_COURSE);
-$tbl_session_course_user = Database:: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
-$tbl_session = Database:: get_main_table(TABLE_MAIN_SESSION);
-$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_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
+$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
+$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
+$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
 
 $socialInformation = '';
 

+ 4 - 4
main/course_info/infocours.php

@@ -53,10 +53,10 @@ if (api_get_setting('pdf_export_watermark_by_course') == 'true') {
         $show_delete_watermark_text_message = true;
     }
 }
-$tbl_user = Database:: get_main_table(TABLE_MAIN_USER);
-$tbl_admin = Database:: get_main_table(TABLE_MAIN_ADMIN);
-$tbl_course_user = Database:: get_main_table(TABLE_MAIN_COURSE_USER);
-$tbl_course = Database:: get_main_table(TABLE_MAIN_COURSE);
+$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
+$tbl_admin = Database::get_main_table(TABLE_MAIN_ADMIN);
+$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
+$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
 
 $sql = "SELECT tutor_name FROM $tbl_course WHERE id = $courseId";
 $q_tutor = Database::query($sql);

+ 1 - 1
main/document/create_audio.php

@@ -207,7 +207,7 @@ if (isset($_POST['text2voice_mode']) && $_POST['text2voice_mode'] == 'google') {
     downloadMP3_pediaphon($filepath, $dir);
 }
 
-$tbl_admin_languages = Database:: get_main_table(TABLE_MAIN_LANGUAGE);
+$tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
 $sql_select = "SELECT * FROM $tbl_admin_languages";
 $result_select = Database::query($sql_select);
 

+ 4 - 4
main/exercise/exercise.php

@@ -41,10 +41,10 @@ $isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh(
     $courseInfo
 );
 
-$TBL_DOCUMENT = Database :: get_course_table(TABLE_DOCUMENT);
-$TBL_ITEM_PROPERTY = Database :: get_course_table(TABLE_ITEM_PROPERTY);
-$TBL_EXERCISE_QUESTION = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION);
-$TBL_EXERCISES = Database :: get_course_table(TABLE_QUIZ_TEST);
+$TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT);
+$TBL_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
+$TBL_EXERCISE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
+$TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST);
 $TBL_TRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
 
 // document path

+ 1 - 1
main/exercise/exercise_report.php

@@ -39,7 +39,7 @@ $is_tutor = api_is_allowed_to_edit(true);
 $TBL_TRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
 $TBL_TRACK_ATTEMPT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
 $TBL_TRACK_ATTEMPT_RECORDING = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
-$TBL_LP_ITEM_VIEW = Database :: get_course_table(TABLE_LP_ITEM_VIEW);
+$TBL_LP_ITEM_VIEW = Database::get_course_table(TABLE_LP_ITEM_VIEW);
 
 $allowCoachFeedbackExercises = api_get_setting('allow_coach_feedback_exercises') === 'true';
 

+ 1 - 1
main/exercise/exercise_result.class.php

@@ -50,7 +50,7 @@ class ExerciseResult
         $TBL_TABLE_LP_MAIN = Database::get_course_table(TABLE_LP_MAIN);
         $TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
         $TBL_TRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
-        $TBL_TRACK_ATTEMPT_RECORDING = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
+        $TBL_TRACK_ATTEMPT_RECORDING = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
 
         $cid = api_get_course_id();
         $course_id = api_get_course_int_id();

+ 2 - 2
main/exercise/hotpotatoes_exercise_report.php

@@ -30,10 +30,10 @@ $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path']."/document";
 $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_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
 $TBL_TRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
 $TBL_TRACK_HOTPOTATOES_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
-$TBL_LP_ITEM_VIEW = Database :: get_course_table(TABLE_LP_ITEM_VIEW);
+$TBL_LP_ITEM_VIEW = Database::get_course_table(TABLE_LP_ITEM_VIEW);
 
 $course_id = api_get_course_int_id();
 $hotpotatoes_path = isset($_REQUEST['path']) ? Security::remove_XSS($_REQUEST['path']) : null;

+ 1 - 1
main/exercise/question_create.php

@@ -41,7 +41,7 @@ $form->addElement(
 $session_id  = api_get_session_id();
 
 // the exercises
-$tbl_exercises = Database :: get_course_table(TABLE_QUIZ_TEST);
+$tbl_exercises = Database::get_course_table(TABLE_QUIZ_TEST);
 $course_id = api_get_course_int_id();
 
 $sql = "SELECT id,title,type,description, results_disabled

+ 9 - 9
main/forum/forumconfig.inc.php

@@ -13,20 +13,20 @@
 /*
     Database Variables
 */
-$table_categories = Database :: get_course_table(TABLE_FORUM_CATEGORY);
-$table_forums = Database :: get_course_table(TABLE_FORUM);
-$table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
-$table_posts = Database :: get_course_table(TABLE_FORUM_POST);
-$table_mailcue = Database :: get_course_table(TABLE_FORUM_MAIL_QUEUE);
-$table_threads_qualify = Database :: get_course_table(
+$table_categories = Database::get_course_table(TABLE_FORUM_CATEGORY);
+$table_forums = Database::get_course_table(TABLE_FORUM);
+$table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
+$table_posts = Database::get_course_table(TABLE_FORUM_POST);
+$table_mailcue = Database::get_course_table(TABLE_FORUM_MAIL_QUEUE);
+$table_threads_qualify = Database::get_course_table(
     TABLE_FORUM_THREAD_QUALIFY
 );
-$table_threads_qualify_historical = Database :: get_course_table(
+$table_threads_qualify_historical = Database::get_course_table(
     TABLE_FORUM_THREAD_QUALIFY_LOG
 );
 
-$forum_table_attachment = Database :: get_course_table(TABLE_FORUM_ATTACHMENT);
-$table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
+$forum_table_attachment = Database::get_course_table(TABLE_FORUM_ATTACHMENT);
+$table_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
 $table_users = Database::get_main_table(TABLE_MAIN_USER);
 
 /*

+ 59 - 59
main/forum/forumfunction.inc.php

@@ -912,7 +912,7 @@ function deleteForumCategoryThread($content, $id)
  */
 function delete_post($post_id)
 {
-    $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
+    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
     $post_id = intval($post_id);
     $course_id = api_get_course_int_id();
     $em = Database::getManager();
@@ -984,7 +984,7 @@ function delete_post($post_id)
  */
 function check_if_last_post_of_thread($thread_id)
 {
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
     $course_id = api_get_course_int_id();
     $sql = "SELECT * FROM $table_posts
             WHERE c_id = $course_id AND thread_id = ".intval($thread_id)."
@@ -1174,9 +1174,9 @@ function change_visibility($content, $id, $target_visibility)
  */
 function change_lock_status($content, $id, $action)
 {
-    $table_categories = Database :: get_course_table(TABLE_FORUM_CATEGORY);
-    $table_forums = Database :: get_course_table(TABLE_FORUM);
-    $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
+    $table_categories = Database::get_course_table(TABLE_FORUM_CATEGORY);
+    $table_forums = Database::get_course_table(TABLE_FORUM);
+    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
 
     // Determine the relevant table.
     if ($content == 'forumcategory') {
@@ -1231,9 +1231,9 @@ function change_lock_status($content, $id, $action)
  */
 function move_up_down($content, $direction, $id)
 {
-    $table_categories = Database:: get_course_table(TABLE_FORUM_CATEGORY);
-    $table_forums = Database:: get_course_table(TABLE_FORUM);
-    $table_item_property = Database:: get_course_table(TABLE_ITEM_PROPERTY);
+    $table_categories = Database::get_course_table(TABLE_FORUM_CATEGORY);
+    $table_forums = Database::get_course_table(TABLE_FORUM);
+    $table_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
     $course_id = api_get_course_int_id();
     $id = intval($id);
 
@@ -1334,8 +1334,8 @@ function move_up_down($content, $direction, $id)
  */
 function get_forum_categories($id = '', $courseId = 0, $sessionId = 0)
 {
-    $table_categories = Database :: get_course_table(TABLE_FORUM_CATEGORY);
-    $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
+    $table_categories = Database::get_course_table(TABLE_FORUM_CATEGORY);
+    $table_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
 
     // Condition for the session
     $session_id = $sessionId ?: api_get_session_id();
@@ -1670,7 +1670,7 @@ function get_last_post_by_thread($course_id, $thread_id, $forum_id, $show_visibl
     $forum_id = intval($forum_id);
     $course_id = intval($course_id);
 
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
     $sql = "SELECT * FROM $table_posts
             WHERE 
                 c_id = $course_id AND 
@@ -1711,10 +1711,10 @@ function get_last_post_information($forum_id, $show_invisibles = false, $course_
     }
     $sessionId = api_get_session_id();
 
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
-    $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
+    $table_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
     $table_users = Database::get_main_table(TABLE_MAIN_USER);
-    $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
+    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
 
     $forum_id = intval($forum_id);
     $return_array = array();
@@ -1810,8 +1810,8 @@ function get_threads($forum_id, $courseId = null, $sessionId = null)
 {
     $groupId = api_get_group_id();
     $sessionId = $sessionId !== null ? intval($sessionId) : api_get_session_id();
-    $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
-    $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
+    $table_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
+    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
     $table_users = Database::get_main_table(TABLE_MAIN_USER);
 
     $courseId = $courseId !== null ? intval($courseId) : api_get_course_int_id();
@@ -2068,7 +2068,7 @@ function getPosts(
  */
 function get_post_information($post_id)
 {
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
     $table_users = Database::get_main_table(TABLE_MAIN_USER);
     $course_id = api_get_course_int_id();
 
@@ -2096,8 +2096,8 @@ function get_post_information($post_id)
  */
 function get_thread_information($forumId, $thread_id, $sessionId = null)
 {
-    $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
-    $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
+    $table_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
+    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
     $thread_id = intval($thread_id);
     $sessionId = $sessionId !== null ? intval($sessionId) : api_get_session_id();
     $sessionCondition = api_get_session_condition($sessionId, true, false, 'threads.session_id');
@@ -2134,7 +2134,7 @@ function get_thread_information($forumId, $thread_id, $sessionId = null)
  */
 function get_thread_users_details($thread_id)
 {
-    $t_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $t_posts = Database::get_course_table(TABLE_FORUM_POST);
     $t_users = Database::get_main_table(TABLE_MAIN_USER);
     $t_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
     $t_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
@@ -2188,8 +2188,8 @@ function get_thread_users_details($thread_id)
  */
 function get_thread_users_qualify($thread_id)
 {
-    $t_posts = Database :: get_course_table(TABLE_FORUM_POST);
-    $t_qualify = Database :: get_course_table(TABLE_FORUM_THREAD_QUALIFY);
+    $t_posts = Database::get_course_table(TABLE_FORUM_POST);
+    $t_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY);
     $t_users = Database::get_main_table(TABLE_MAIN_USER);
     $t_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
     $t_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
@@ -2256,8 +2256,8 @@ function get_thread_users_qualify($thread_id)
  */
 function get_thread_users_not_qualify($thread_id)
 {
-    $t_posts = Database :: get_course_table(TABLE_FORUM_POST);
-    $t_qualify = Database :: get_course_table(TABLE_FORUM_THREAD_QUALIFY);
+    $t_posts = Database::get_course_table(TABLE_FORUM_POST);
+    $t_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY);
     $t_users = Database::get_main_table(TABLE_MAIN_USER);
     $t_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
     $t_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
@@ -2327,8 +2327,8 @@ function get_thread_users_not_qualify($thread_id)
  */
 function get_forum_information($forum_id, $courseId = 0)
 {
-    $table_forums = Database :: get_course_table(TABLE_FORUM);
-    $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
+    $table_forums = Database::get_course_table(TABLE_FORUM);
+    $table_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
     $courseId = empty($courseId) ? api_get_course_int_id(): intval($courseId);
     $forum_id = intval($forum_id);
 
@@ -2362,8 +2362,8 @@ function get_forum_information($forum_id, $courseId = 0)
  */
 function get_forumcategory_information($cat_id)
 {
-    $table_categories = Database :: get_course_table(TABLE_FORUM_CATEGORY);
-    $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
+    $table_categories = Database::get_course_table(TABLE_FORUM_CATEGORY);
+    $table_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
 
     $course_id = api_get_course_int_id();
     $sql = "SELECT *
@@ -2393,7 +2393,7 @@ function get_forumcategory_information($cat_id)
  */
 function count_number_of_forums_in_category($cat_id)
 {
-    $table_forums = Database :: get_course_table(TABLE_FORUM);
+    $table_forums = Database::get_course_table(TABLE_FORUM);
     $course_id = api_get_course_int_id();
     $sql = "SELECT count(*) AS number_of_forums
             FROM ".$table_forums."
@@ -2413,7 +2413,7 @@ function count_number_of_forums_in_category($cat_id)
  */
 function updateThread($values)
 {
-    $threadTable = Database :: get_course_table(TABLE_FORUM_THREAD);
+    $threadTable = Database::get_course_table(TABLE_FORUM_THREAD);
     $courseId = api_get_course_int_id();
 
     $params = [
@@ -2502,7 +2502,7 @@ function store_thread($current_forum, $values, $courseInfo = array(), $showMessa
     $sessionId = $sessionId ?: api_get_session_id();
 
     $em = Database::getManager();
-    $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
+    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
 
     $gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : '';
     $upload_ok = 1;
@@ -3313,7 +3313,7 @@ function store_reply($current_forum, $values, $courseId = 0, $userId = 0)
 {
     $courseId = !empty($courseId) ? $courseId : api_get_course_int_id();
     $_course = api_get_course_info_by_id($courseId);
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
     $post_date = api_get_utc_datetime();
     $userId = $userId ?: api_get_user_id();
 
@@ -3657,8 +3657,8 @@ function show_edit_post_form(
  */
 function store_edit_post($forumInfo, $values)
 {
-    $threadTable = Database :: get_course_table(TABLE_FORUM_THREAD);
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $threadTable = Database::get_course_table(TABLE_FORUM_THREAD);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
     $gradebook = Security::remove_XSS($_GET['gradebook']);
     $course_id = api_get_course_int_id();
 
@@ -3806,7 +3806,7 @@ function display_user_image($user_id, $name, $origin = '')
  */
 function increase_thread_view($thread_id)
 {
-    $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
+    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
     $course_id = api_get_course_int_id();
 
     $sql = "UPDATE $table_threads SET thread_views=thread_views+1
@@ -3826,7 +3826,7 @@ function increase_thread_view($thread_id)
  */
 function updateThreadInfo($thread_id, $last_post_id, $post_date)
 {
-    $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
+    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
     $course_id = api_get_course_int_id();
     $sql = "UPDATE $table_threads SET 
             thread_replies = thread_replies+1,
@@ -3871,7 +3871,7 @@ function get_whats_new()
         return false;
     }
 
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
     $tracking_last_tool_access = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LASTACCESS);
 
     $tool = TOOL_FORUM;
@@ -3920,7 +3920,7 @@ function get_whats_new()
  */
 function approve_post($post_id, $action)
 {
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
     $course_id = api_get_course_int_id();
 
     if ($action == 'invisible') {
@@ -3954,7 +3954,7 @@ function approve_post($post_id, $action)
  */
 function get_unaproved_messages($forum_id)
 {
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
     $course_id = api_get_course_int_id();
 
     $return_array = array();
@@ -4052,10 +4052,10 @@ function send_notification_mails($forumId, $thread_id, $reply_info)
  */
 function handle_mail_cue($content, $id)
 {
-    $table_mailcue = Database :: get_course_table(TABLE_FORUM_MAIL_QUEUE);
-    $table_forums = Database :: get_course_table(TABLE_FORUM);
-    $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $table_mailcue = Database::get_course_table(TABLE_FORUM_MAIL_QUEUE);
+    $table_forums = Database::get_course_table(TABLE_FORUM);
+    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
     $table_users = Database::get_main_table(TABLE_MAIN_USER);
 
     $course_id = api_get_course_int_id();
@@ -4270,9 +4270,9 @@ function store_move_post($values)
     $_course = api_get_course_info();
     $course_id = api_get_course_int_id();
 
-    $table_forums = Database :: get_course_table(TABLE_FORUM);
-    $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $table_forums = Database::get_course_table(TABLE_FORUM);
+    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
 
     if ($values['thread'] == '0') {
         $current_post = get_post_information($values['post_id']);
@@ -4389,8 +4389,8 @@ function store_move_post($values)
  */
 function store_move_thread($values)
 {
-    $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
 
     $courseId = api_get_course_int_id();
     $sessionId = api_get_session_id();
@@ -4412,7 +4412,7 @@ function store_move_thread($values)
     if (!empty($forumInfo['to_group_id'])) {
         $groupId = $forumInfo['to_group_id'];
         $item = api_get_item_property_info($courseId, TABLE_FORUM_THREAD, $threadId, $sessionId, $groupId);
-        $table = Database:: get_course_table(TABLE_ITEM_PROPERTY);
+        $table = Database::get_course_table(TABLE_ITEM_PROPERTY);
         $sessionCondition = api_get_session_condition($sessionId);
 
         if (!empty($item)) {
@@ -4528,9 +4528,9 @@ function forum_search()
  */
 function display_forum_search_results($search_term)
 {
-    $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
-    $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
+    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
+    $table_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
     $session_id = api_get_session_id();
     $gradebook = Security::remove_XSS($_GET['gradebook']);
     $course_id = api_get_course_int_id();
@@ -4830,7 +4830,7 @@ function edit_forum_attachment_file($file_comment, $post_id, $id_attach)
  */
 function get_attachment($post_id)
 {
-    $forum_table_attachment = Database :: get_course_table(TABLE_FORUM_ATTACHMENT);
+    $forum_table_attachment = Database::get_course_table(TABLE_FORUM_ATTACHMENT);
     $course_id = api_get_course_int_id();
     $row = array();
     $post_id = intval($post_id);
@@ -4852,7 +4852,7 @@ function get_attachment($post_id)
  */
 function getAllAttachment($postId)
 {
-    $forumAttachmentTable = Database :: get_course_table(TABLE_FORUM_ATTACHMENT);
+    $forumAttachmentTable = Database::get_course_table(TABLE_FORUM_ATTACHMENT);
     $courseId = api_get_course_int_id();
     $postId = intval($postId);
     $columns = array('iid', 'path', 'filename', 'comment');
@@ -4932,10 +4932,10 @@ function delete_attachment($post_id, $id_attach = 0, $display = true)
  */
 function get_forums_of_group($groupInfo)
 {
-    $table_forums = Database :: get_course_table(TABLE_FORUM);
-    $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
-    $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
+    $table_forums = Database::get_course_table(TABLE_FORUM);
+    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
+    $table_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
     $course_id = api_get_course_int_id();
     $groupId = (int) $groupInfo['id'];
 
@@ -5275,7 +5275,7 @@ function get_notifications_of_user($user_id = 0, $force = false)
  */
 function count_number_of_post_in_thread($thread_id)
 {
-    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $table_posts = Database::get_course_table(TABLE_FORUM_POST);
     $course_id = api_get_course_int_id();
     if (empty($course_id)) {
         return 0;

+ 1 - 1
main/gradebook/gradebook_add_link.php

@@ -17,7 +17,7 @@ $courseCode = isset($_GET['course_code']) ? Security::remove_XSS($_GET['course_c
 $selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
 
 $course_info = api_get_course_info($courseCode);
-$tbl_forum_thread = Database :: get_course_table(TABLE_FORUM_THREAD);
+$tbl_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD);
 $tbl_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
 
 $session_id = api_get_session_id();

+ 2 - 2
main/gradebook/gradebook_edit_all.php

@@ -30,8 +30,8 @@ $course_id = GradebookUtils::get_course_id_by_link_id($my_selectcat);
 
 $table_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
 $table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
-$tbl_forum_thread = Database:: get_course_table(TABLE_FORUM_THREAD);
-$tbl_attendance = Database:: get_course_table(TABLE_ATTENDANCE);
+$tbl_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD);
+$tbl_attendance = Database::get_course_table(TABLE_ATTENDANCE);
 
 $table_evaluated[LINK_EXERCISE] = array(
     TABLE_QUIZ_TEST,

+ 2 - 2
main/gradebook/gradebook_edit_link.php

@@ -12,8 +12,8 @@ GradebookUtils::block_students();
 $tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
 //selected name of database
 $course_id = GradebookUtils::get_course_id_by_link_id($_GET['editlink']);
-$tbl_forum_thread = Database:: get_course_table(TABLE_FORUM_THREAD);
-$tbl_attendance = Database:: get_course_table(TABLE_ATTENDANCE);
+$tbl_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD);
+$tbl_attendance = Database::get_course_table(TABLE_ATTENDANCE);
 $em = Database::getManager();
 
 $linkarray = LinkFactory :: load($_GET['editlink']);

+ 2 - 2
main/gradebook/gradebook_showlog_link.php

@@ -31,8 +31,8 @@ echo '<div class="actions">';
 api_display_tool_title(get_lang('GradebookQualifyLog'));
 echo '</div>';
 
-$t_user = Database:: get_main_table(TABLE_MAIN_USER);
-$t_link_log = Database:: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
+$t_user = Database::get_main_table(TABLE_MAIN_USER);
+$t_link_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
 $visible_link = Security::remove_XSS($_GET['visiblelink']);
 $evaledit = EvalLink:: load($visible_link);
 $sql = "SELECT lk.name,lk.description,lk.weight,lk.visible,lk.type,lk.created_at,us.username

+ 2 - 2
main/gradebook/index.php

@@ -85,8 +85,8 @@ function confirmation() {
 }
 </script>';
 
-$tbl_forum_thread = Database :: get_course_table(TABLE_FORUM_THREAD);
-$tbl_attendance   = Database :: get_course_table(TABLE_ATTENDANCE);
+$tbl_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD);
+$tbl_attendance   = Database::get_course_table(TABLE_ATTENDANCE);
 $tbl_grade_links  = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
 $filter_confirm_msg = true;
 $filter_warning_msg = true;

+ 5 - 5
main/gradebook/lib/GradebookUtils.php

@@ -996,9 +996,9 @@ class GradebookUtils
      */
     public static function get_users_in_course($courseCode)
     {
-        $tbl_course_user = Database:: get_main_table(TABLE_MAIN_COURSE_USER);
-        $tbl_session_course_user = Database:: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
-        $tbl_user = Database:: get_main_table(TABLE_MAIN_USER);
+        $tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
+        $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
+        $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
         $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname ASC' : ' ORDER BY lastname, firstname ASC';
 
         $current_session = api_get_session_id();
@@ -1167,8 +1167,8 @@ class GradebookUtils
         $table_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
 
         $em = Database::getManager();
-        $tbl_forum_thread = Database:: get_course_table(TABLE_FORUM_THREAD);
-        $tbl_attendance = Database:: get_course_table(TABLE_ATTENDANCE);
+        $tbl_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD);
+        $tbl_attendance = Database::get_course_table(TABLE_ATTENDANCE);
 
         $sql = 'UPDATE '.$table_link.' SET weight = '."'".Database::escape_string($weight)."'".'
                 WHERE id = '.$linkId;

+ 2 - 2
main/gradebook/lib/be/abstractlink.class.php

@@ -348,7 +348,7 @@ abstract class AbstractLink implements GradebookItem
             isset($this->weight) &&
             isset($this->visible)
         ) {
-            $tbl_grade_links = Database:: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
+            $tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
             $sql = "SELECT count(*) FROM ".$tbl_grade_links."
                     WHERE
                         ref_id=".$this->get_ref_id()." AND
@@ -416,7 +416,7 @@ abstract class AbstractLink implements GradebookItem
      */
     public static function add_link_log($idevaluation, $nameLog = null)
     {
-        $table = Database:: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
+        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
         $dateobject = self::load($idevaluation, null, null, null, null);
         $current_date_server = api_get_utc_datetime();
         $arreval = get_object_vars($dateobject[0]);

+ 1 - 1
main/gradebook/lib/be/attendancelink.class.php

@@ -111,7 +111,7 @@ class AttendanceLink extends AbstractLink
 	 */
 	public function has_results()
 	{
-		$tbl_attendance_result = Database :: get_course_table(TABLE_ATTENDANCE_RESULT);
+		$tbl_attendance_result = Database::get_course_table(TABLE_ATTENDANCE_RESULT);
 		$session_id = api_get_session_id();
 		$sql = 'SELECT count(*) AS number FROM '.$tbl_attendance_result."
 				WHERE

+ 2 - 2
main/gradebook/lib/be/learnpathlink.class.php

@@ -33,7 +33,7 @@ class LearnpathLink extends AbstractLink
             die('Error in get_not_created_links() : course code not set');
         }
 
-        $tbl_grade_links = Database:: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
+        $tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
 
         $sql = 'SELECT id, name FROM ' . $this->get_learnpath_table() . ' lp
 				WHERE c_id = ' . $this->course_id . ' AND id NOT IN '
@@ -250,7 +250,7 @@ class LearnpathLink extends AbstractLink
      */
     private function get_learnpath_table()
     {
-        $this->learnpath_table = Database:: get_course_table(TABLE_LP_MAIN);
+        $this->learnpath_table = Database::get_course_table(TABLE_LP_MAIN);
         return $this->learnpath_table;
     }
 

+ 1 - 1
main/group/group_category.php

@@ -96,7 +96,7 @@ if (isset($_GET['id'])) {
 	$form->addElement('hidden', 'id');
 } else {
     // Checks if the field was created in the table Category. It creates it if is neccesary
-    $table_category = Database :: get_course_table(TABLE_GROUP_CATEGORY);
+    $table_category = Database::get_course_table(TABLE_GROUP_CATEGORY);
     if (!Database::query("SELECT wiki_state FROM $table_category WHERE c_id = $course_id")) {
         Database::query("ALTER TABLE $table_category ADD wiki_state tinyint(3) UNSIGNED NOT NULL default '1' WHERE c_id = $course_id");
     }

+ 4 - 4
main/group/group_space.php

@@ -388,7 +388,7 @@ function get_number_of_group_users()
     }
 
     // Database table definition
-    $table = Database :: get_course_table(TABLE_GROUP_USER);
+    $table = Database::get_course_table(TABLE_GROUP_USER);
 
     // Query
     $sql = "SELECT count(iid) AS number_of_users
@@ -424,9 +424,9 @@ function get_group_user_data($from, $number_of_items, $column, $direction)
     }
 
     // Database table definition
-    $table_group_user = Database:: get_course_table(TABLE_GROUP_USER);
-    $table_user = Database:: get_main_table(TABLE_MAIN_USER);
-    $tableGroup = Database:: get_course_table(TABLE_GROUP);
+    $table_group_user = Database::get_course_table(TABLE_GROUP_USER);
+    $table_user = Database::get_main_table(TABLE_MAIN_USER);
+    $tableGroup = Database::get_course_table(TABLE_GROUP);
 
     // Query
     if (api_get_setting('show_email_addresses') === 'true') {

+ 1 - 1
main/inc/ajax/course.ajax.php

@@ -231,7 +231,7 @@ switch ($action) {
         break;
     case 'search_survey_by_course':
         if (api_is_platform_admin()) {
-            $survey = Database :: get_course_table(TABLE_SURVEY);
+            $survey = Database::get_course_table(TABLE_SURVEY);
 
             $sql = "SELECT survey_id as id, title, anonymous
                     FROM $survey

+ 1 - 1
main/inc/ajax/lp.ajax.php

@@ -12,7 +12,7 @@ api_protect_course_script(true);
 $action = $_REQUEST['a'];
 
 $course_id = api_get_course_int_id();
-$tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
+$tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
 $sessionId = api_get_session_id();
 
 switch ($action) {

+ 1 - 1
main/inc/ajax/work.ajax.php

@@ -111,7 +111,7 @@ switch ($action) {
                 echo 'false';
                 break;
             }
-            $work_table = Database:: get_course_table(
+            $work_table = Database::get_course_table(
                 TABLE_STUDENT_PUBLICATION
             );
 

+ 2 - 2
main/inc/lib/add_course.lib.inc.php

@@ -1206,8 +1206,8 @@ class AddCourse
         $teachers = isset($params['teachers']) ? $params['teachers'] : null;
         $status = isset($params['status']) ? $params['status'] : null;
 
-        $TABLECOURSE = Database:: get_main_table(TABLE_MAIN_COURSE);
-        $TABLECOURSUSER = Database:: get_main_table(TABLE_MAIN_COURSE_USER);
+        $TABLECOURSE = Database::get_main_table(TABLE_MAIN_COURSE);
+        $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
 
         $ok_to_register_course = true;
 

+ 6 - 6
main/inc/lib/agenda.lib.php

@@ -3273,8 +3273,8 @@ class Agenda
         // get agenda-items for every course
         foreach ($courses_dbs as $key => $array_course_info) {
             //databases of the courses
-            $TABLEAGENDA = Database:: get_course_table(TABLE_AGENDA);
-            $TABLE_ITEMPROPERTY = Database:: get_course_table(
+            $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA);
+            $TABLE_ITEMPROPERTY = Database::get_course_table(
                 TABLE_ITEM_PROPERTY
             );
 
@@ -3536,7 +3536,7 @@ class Agenda
         $week = "",
         $type
     ) {
-        $tbl_personal_agenda = Database:: get_main_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
@@ -3949,8 +3949,8 @@ class Agenda
         foreach ($courses as $id => $course) {
             $c = api_get_course_info_by_id($course['real_id']);
             //databases of the courses
-            $t_a = Database:: get_course_table(TABLE_AGENDA, $course['db']);
-            $t_ip = Database:: get_course_table(
+            $t_a = Database::get_course_table(TABLE_AGENDA, $course['db']);
+            $t_ip = Database::get_course_table(
                 TABLE_ITEM_PROPERTY,
                 $course['db']
             );
@@ -4049,7 +4049,7 @@ class Agenda
      */
     public static function get_personal_agenda_item($id)
     {
-        $tbl_personal_agenda = Database:: get_main_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();

+ 2 - 2
main/inc/lib/api.lib.php

@@ -1502,7 +1502,7 @@ function api_get_user_info(
         }
     }
 
-    $sql = "SELECT * FROM " . Database:: get_main_table(TABLE_MAIN_USER) . "
+    $sql = "SELECT * FROM " . Database::get_main_table(TABLE_MAIN_USER) . "
             WHERE id = $user_id";
     $result = Database::query($sql);
     if (Database::num_rows($result) > 0) {
@@ -4715,7 +4715,7 @@ function copy_folder_course_session(
     $document,
     $source_course_id
 ) {
-    $table = Database :: get_course_table(TABLE_DOCUMENT);
+    $table = Database::get_course_table(TABLE_DOCUMENT);
     $session_id = intval($session_id);
     $source_course_id = intval($source_course_id);
 

+ 3 - 3
main/inc/lib/attendance.lib.php

@@ -283,7 +283,7 @@ class Attendance
     {
         $_course = api_get_course_info();
         $tbl_attendance = Database::get_course_table(TABLE_ATTENDANCE);
-        $table_link = Database:: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
+        $table_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
         $session_id = api_get_session_id();
         $user_id = api_get_user_id();
         $course_code = $_course['code'];
@@ -359,8 +359,8 @@ class Attendance
     public function attendance_edit($attendance_id, $link_to_gradebook = false)
     {
         $_course = api_get_course_info();
-        $tbl_attendance = Database:: get_course_table(TABLE_ATTENDANCE);
-        $table_link = Database:: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
+        $tbl_attendance = Database::get_course_table(TABLE_ATTENDANCE);
+        $table_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
 
         $session_id = api_get_session_id();
         $user_id = api_get_user_id();

+ 23 - 23
main/inc/lib/course.lib.php

@@ -2021,8 +2021,8 @@ class CourseManager
             $courseId = api_get_course_int_id();
         }
 
-        $tbl_user = Database:: get_main_table(TABLE_MAIN_USER);
-        $tbl_session_course_user = Database:: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
+        $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
+        $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
 
         $sql = "SELECT DISTINCT 
                     u.user_id,
@@ -2580,16 +2580,16 @@ class CourseManager
      */
     public static function get_special_course_list()
     {
-        $courseTable = Database:: get_main_table(TABLE_MAIN_COURSE);
-        $tbl_course_field = Database:: get_main_table(TABLE_EXTRA_FIELD);
-        $tbl_course_field_value = Database:: get_main_table(TABLE_EXTRA_FIELD_VALUES);
+        $courseTable = Database::get_main_table(TABLE_MAIN_COURSE);
+        $tbl_course_field = Database::get_main_table(TABLE_EXTRA_FIELD);
+        $tbl_course_field_value = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES);
 
         //we filter the courses from the URL
         $join_access_url = $where_access_url = '';
         if (api_get_multiple_access_url()) {
             $access_url_id = api_get_current_access_url_id();
             if ($access_url_id != -1) {
-                $tbl_url_course = Database:: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
+                $tbl_url_course = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
                 $join_access_url = "LEFT JOIN $tbl_url_course url_rel_course
                                     ON url_rel_course.c_id = tcfv.item_id ";
                 $where_access_url = " AND access_url_id = $access_url_id ";
@@ -2632,8 +2632,8 @@ class CourseManager
      */
     public static function getCatalogueCourseList($allowed = true, $byUserId = -1)
     {
-        $courseTable = Database:: get_main_table(TABLE_MAIN_COURSE);
-        $tblCourseRelUserCatalogue = Database:: get_main_table(TABLE_MAIN_COURSE_CATALOGUE_USER);
+        $courseTable = Database::get_main_table(TABLE_MAIN_COURSE);
+        $tblCourseRelUserCatalogue = Database::get_main_table(TABLE_MAIN_COURSE_CATALOGUE_USER);
         $visibility = $allowed ? 1 : 0;
 
         // Restriction by user id
@@ -2649,7 +2649,7 @@ class CourseManager
         if (api_get_multiple_access_url()) {
             $accessUrlId = api_get_current_access_url_id();
             if ($accessUrlId != -1) {
-                $tblUrlCourse = Database:: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
+                $tblUrlCourse = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
                 $joinAccessUrl = "LEFT JOIN $tblUrlCourse url_rel_course
                                     ON url_rel_course.c_id = c.id ";
                 $whereAccessUrl = " AND access_url_id = $accessUrlId ";
@@ -3672,7 +3672,7 @@ class CourseManager
         if ($coursesNotCategory) {
             $listItems['not_category'] = $coursesNotCategory;
         }
-        
+
         return $listItems;
     }
 
@@ -3689,9 +3689,9 @@ class CourseManager
         $user_category_id = (int) $user_category_id;
 
         // Table definitions
-        $TABLECOURS = Database:: get_main_table(TABLE_MAIN_COURSE);
-        $TABLECOURSUSER = Database:: get_main_table(TABLE_MAIN_COURSE_USER);
-        $TABLE_ACCESS_URL_REL_COURSE = Database:: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
+        $TABLECOURS = Database::get_main_table(TABLE_MAIN_COURSE);
+        $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
+        $TABLE_ACCESS_URL_REL_COURSE = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
         $current_url_id = api_get_current_access_url_id();
 
         // Get course list auto-register
@@ -3843,9 +3843,9 @@ class CourseManager
     {
         $user_id = api_get_user_id();
         // Table definitions
-        $TABLECOURS = Database:: get_main_table(TABLE_MAIN_COURSE);
-        $TABLECOURSUSER = Database:: get_main_table(TABLE_MAIN_COURSE_USER);
-        $TABLE_ACCESS_URL_REL_COURSE = Database:: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
+        $TABLECOURS = Database::get_main_table(TABLE_MAIN_COURSE);
+        $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
+        $TABLE_ACCESS_URL_REL_COURSE = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
         $current_url_id = api_get_current_access_url_id();
         $courseList = [];
 
@@ -4837,13 +4837,13 @@ class CourseManager
                 $course_info,
                 $my_course_code_list
             );
-            
+
             $userRegisterdInCourse = self::is_user_subscribed_in_course($user_id, $course_info['code']);
             $userRegisterdInCourseAsTeacher = self::is_course_teacher($user_id, $course_info['code']);
             $userRegisterd = ($userRegisterdInCourse && $userRegisterdInCourseAsTeacher);
-            
+
             $my_course['is_registerd'] = $userRegisterd;
-            
+
             $my_course['title_cut'] = cut($course_info['title'], 45);
             // if user registered as student
             /* if ($userRegisterdInCourse) {
@@ -5443,7 +5443,7 @@ class CourseManager
      */
     public static function getCourseAccessPerSessionAndUser($sessionId, $userId, $limit = null)
     {
-        $table = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
+        $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
 
         $sessionId = intval($sessionId);
         $userId = intval($userId);
@@ -5474,7 +5474,7 @@ class CourseManager
         $startDate,
         $endDate
     ) {
-        $table = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
+        $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
         $courseId = intval($courseId);
         $sessionId = intval($sessionId);
         $startDate = Database::escape_string($startDate);
@@ -5504,7 +5504,7 @@ class CourseManager
         $sessionId = intval($sessionId);
         $userId = intval($userId);
 
-        $table = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
+        $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
         $sql = "SELECT * FROM $table
                 WHERE session_id = $sessionId AND user_id = $userId
                 ORDER BY login_course_date ASC
@@ -5617,7 +5617,7 @@ class CourseManager
      */
     public static function getCourseNameFromCode($code)
     {
-        $tbl_main_categories = Database:: get_main_table(TABLE_MAIN_COURSE);
+        $tbl_main_categories = Database::get_main_table(TABLE_MAIN_COURSE);
         $sql = 'SELECT title
                 FROM ' . $tbl_main_categories . '
                 WHERE code = "' . Database::escape_string($code) . '"';

+ 13 - 13
main/inc/lib/exercise.lib.php

@@ -1523,10 +1523,10 @@ HOTSPOT;
         $in_number_of_items = intval($in_number_of_items);
         $in_from = intval($in_from);
 
-        $TBL_TRACK_HOTPOTATOES = Database:: get_main_table(
+        $TBL_TRACK_HOTPOTATOES = Database::get_main_table(
             TABLE_STATISTIC_TRACK_E_HOTPOTATOES
         );
-        $TBL_USER = Database:: get_main_table(TABLE_MAIN_USER);
+        $TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
 
         $sql = "SELECT * FROM $TBL_TRACK_HOTPOTATOES thp
             JOIN $TBL_USER u ON thp.exe_user_id = u.user_id
@@ -1590,7 +1590,7 @@ HOTSPOT;
         $courseId,
         $sessionId
     ) {
-        $table = Database:: get_main_table(
+        $table = Database::get_main_table(
             TABLE_STATISTIC_TRACK_E_HOTPOTATOES
         );
         $exercisePath = Database::escape_string($exercisePath);
@@ -1643,13 +1643,13 @@ HOTSPOT;
         $sessionId = api_get_session_id();
         $is_allowedToEdit = api_is_allowed_to_edit(null, true) || api_is_allowed_to_edit(true) || api_is_drh() || api_is_student_boss();
 
-        $TBL_USER = Database:: get_main_table(TABLE_MAIN_USER);
-        $TBL_EXERCICES = Database:: get_course_table(TABLE_QUIZ_TEST);
-        $TBL_GROUP_REL_USER = Database:: get_course_table(TABLE_GROUP_USER);
-        $TBL_GROUP = Database:: get_course_table(TABLE_GROUP);
-        $TBL_TRACK_EXERCICES = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
-        $TBL_TRACK_HOTPOTATOES = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
-        $TBL_TRACK_ATTEMPT_RECORDING = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
+        $TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
+        $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
+        $TBL_GROUP_REL_USER = Database::get_course_table(TABLE_GROUP_USER);
+        $TBL_GROUP = Database::get_course_table(TABLE_GROUP);
+        $TBL_TRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
+        $TBL_TRACK_HOTPOTATOES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
+        $TBL_TRACK_ATTEMPT_RECORDING = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
 
         $session_id_and = ' AND te.session_id = ' . $sessionId . ' ';
         $exercise_id = intval($exercise_id);
@@ -2503,7 +2503,7 @@ HOTSPOT;
             }
         }
 
-        $table = Database:: get_course_table(TABLE_QUIZ_TEST);
+        $table = Database::get_course_table(TABLE_QUIZ_TEST);
 
         return Database::select('*', $table, $conditions);
     }
@@ -2516,7 +2516,7 @@ HOTSPOT;
      */
     public static function get_exercise_by_id($exerciseId = 0, $courseId = null)
     {
-        $TBL_EXERCICES = Database:: get_course_table(TABLE_QUIZ_TEST);
+        $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
         if (empty($courseId)) {
             $courseId = api_get_course_int_id();
         } else {
@@ -2550,7 +2550,7 @@ HOTSPOT;
         $course_id = 0,
         $only_active_exercises = true
     ) {
-        $TBL_EXERCISES = Database:: get_course_table(TABLE_QUIZ_TEST);
+        $TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST);
 
         if ($only_active_exercises) {
             // Only active exercises.

+ 10 - 10
main/inc/lib/groupmanager.lib.php

@@ -387,8 +387,8 @@ class GroupManager
         $course_id = $course_info['real_id'];
 
         // Database table definitions
-        $group_table = Database:: get_course_table(TABLE_GROUP);
-        $forum_table = Database:: get_course_table(TABLE_FORUM);
+        $group_table = Database::get_course_table(TABLE_GROUP);
+        $forum_table = Database::get_course_table(TABLE_FORUM);
         $groupInfo = self::get_group_properties($groupInfo['iid'], true);
         if ($groupInfo) {
             $groupIid = $groupInfo['iid'];
@@ -729,8 +729,8 @@ class GroupManager
      */
     public static function get_category_from_group($group_id, $course_code = null)
     {
-        $table_group = Database:: get_course_table(TABLE_GROUP);
-        $table_group_cat = Database:: get_course_table(TABLE_GROUP_CATEGORY);
+        $table_group = Database::get_course_table(TABLE_GROUP);
+        $table_group_cat = Database::get_course_table(TABLE_GROUP_CATEGORY);
 
         $group_id = intval($group_id);
 
@@ -771,8 +771,8 @@ class GroupManager
         $course_info = api_get_course_info($course_code);
         $course_id = $course_info['real_id'];
 
-        $table_group = Database:: get_course_table(TABLE_GROUP);
-        $table_group_cat = Database:: get_course_table(TABLE_GROUP_CATEGORY);
+        $table_group = Database::get_course_table(TABLE_GROUP);
+        $table_group_cat = Database::get_course_table(TABLE_GROUP_CATEGORY);
         $cat_id = intval($cat_id);
         $sql = "SELECT iid FROM $table_group
                 WHERE c_id = $course_id AND category_id='".$cat_id."'";
@@ -1227,8 +1227,8 @@ class GroupManager
 
         $category = self::get_category_from_group($groupIid);
         $groups_per_user = isset($category['groups_per_user']) ? $category['groups_per_user'] : self::GROUP_PER_MEMBER_NO_LIMIT;
-        $group_table = Database:: get_course_table(TABLE_GROUP);
-        $group_user_table = Database:: get_course_table(TABLE_GROUP_USER);
+        $group_table = Database::get_course_table(TABLE_GROUP);
+        $group_user_table = Database::get_course_table(TABLE_GROUP_USER);
         $session_id = api_get_session_id();
 
         $complete_user_list = CourseManager::get_real_and_linked_user_list(
@@ -1365,8 +1365,8 @@ class GroupManager
      */
     public static function user_in_number_of_groups($user_id, $cat_id = null)
     {
-        $table_group_user = Database:: get_course_table(TABLE_GROUP_USER);
-        $table_group = Database:: get_course_table(TABLE_GROUP);
+        $table_group_user = Database::get_course_table(TABLE_GROUP_USER);
+        $table_group = Database::get_course_table(TABLE_GROUP);
         $user_id = intval($user_id);
         $cat_id = intval($cat_id);
 

+ 19 - 19
main/inc/lib/link.lib.php

@@ -124,7 +124,7 @@ class Link extends Model
         $courseId = null,
         $sessionId = null
     ) {
-        $tblLink = Database:: get_course_table(TABLE_LINK);
+        $tblLink = Database::get_course_table(TABLE_LINK);
         $linkUrl = Database::escape_string($linkUrl);
         $linkId = intval($linkId);
         if (is_null($courseId)) {
@@ -270,7 +270,7 @@ class Link extends Model
 
                     // Add category name if set.
                     if (isset($selectcategory) && $selectcategory > 0) {
-                        $table_link_category = Database:: get_course_table(
+                        $table_link_category = Database::get_course_table(
                             TABLE_LINK_CATEGORY
                         );
                         $sql_cat = 'SELECT * FROM %s WHERE id=%d AND c_id = %d LIMIT 1';
@@ -301,7 +301,7 @@ class Link extends Model
                     $did = $di->index();
                     if ($did) {
                         // Save it to db.
-                        $tbl_se_ref = Database:: get_main_table(
+                        $tbl_se_ref = Database::get_main_table(
                             TABLE_MAIN_SEARCH_ENGINE_REF
                         );
                         $sql = 'INSERT INTO %s (id, course_code, tool_id, ref_id_high_level, search_did)
@@ -321,7 +321,7 @@ class Link extends Model
                 Display::addFlash(Display::return_message(get_lang('LinkAdded')));
             }
         } elseif ($type == 'category') {
-            $tbl_categories = Database:: get_course_table(TABLE_LINK_CATEGORY);
+            $tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY);
 
             $category_title = trim($_POST['category_title']);
             $description = trim($_POST['description']);
@@ -376,8 +376,8 @@ class Link extends Model
     public static function deletelinkcategory($id, $type)
     {
         $courseInfo = api_get_course_info();
-        $tbl_link = Database:: get_course_table(TABLE_LINK);
-        $tbl_categories = Database:: get_course_table(TABLE_LINK_CATEGORY);
+        $tbl_link = Database::get_course_table(TABLE_LINK);
+        $tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY);
 
         $course_id = $courseInfo['real_id'];
         $id = intval($id);
@@ -444,7 +444,7 @@ class Link extends Model
     {
         // Remove from search engine if enabled.
         if (api_get_setting('search_enabled') === 'true') {
-            $tbl_se_ref = Database:: get_main_table(
+            $tbl_se_ref = Database::get_main_table(
                 TABLE_MAIN_SEARCH_ENGINE_REF
             );
             $sql = 'SELECT * FROM %s WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_high_level=%s LIMIT 1';
@@ -476,7 +476,7 @@ class Link extends Model
      **/
     public static function get_link_info($id)
     {
-        $tbl_link = Database:: get_course_table(TABLE_LINK);
+        $tbl_link = Database::get_course_table(TABLE_LINK);
         $course_id = api_get_course_int_id();
 
         if (empty($id) || empty($course_id)) {
@@ -499,7 +499,7 @@ class Link extends Model
      */
     public static function editLink($id, $values = array())
     {
-        $tbl_link = Database:: get_course_table(TABLE_LINK);
+        $tbl_link = Database::get_course_table(TABLE_LINK);
         $_course = api_get_course_info();
         $course_id = $_course['real_id'];
         $id = intval($id);
@@ -581,7 +581,7 @@ class Link extends Model
             // Actually, it consists on delete terms from db,
             // insert new ones, create a new search engine document, and remove the old one.
             // Get search_did.
-            $tbl_se_ref = Database:: get_main_table(
+            $tbl_se_ref = Database::get_main_table(
                 TABLE_MAIN_SEARCH_ENGINE_REF
             );
             $sql = 'SELECT * FROM %s WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_high_level=%s LIMIT 1';
@@ -654,7 +654,7 @@ class Link extends Model
 
                 // Add category name if set.
                 if (isset($categoryId) && $categoryId > 0) {
-                    $table_link_category = Database:: get_course_table(
+                    $table_link_category = Database::get_course_table(
                         TABLE_LINK_CATEGORY
                     );
                     $sql_cat = 'SELECT * FROM %s WHERE id=%d and c_id = %d LIMIT 1';
@@ -729,7 +729,7 @@ class Link extends Model
      */
     public static function editCategory($id, $values)
     {
-        $tbl_categories = Database:: get_course_table(TABLE_LINK_CATEGORY);
+        $tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY);
         $course_id = api_get_course_int_id();
         $id = intval($id);
 
@@ -789,8 +789,8 @@ class Link extends Model
      */
     public static function getLinkCategories($courseId, $sessionId, $withBaseContent = true)
     {
-        $tblLinkCategory = Database:: get_course_table(TABLE_LINK_CATEGORY);
-        $tblItemProperty = Database:: get_course_table(TABLE_ITEM_PROPERTY);
+        $tblLinkCategory = Database::get_course_table(TABLE_LINK_CATEGORY);
+        $tblItemProperty = Database::get_course_table(TABLE_ITEM_PROPERTY);
         $courseId = intval($courseId);
 
         // Condition for the session.
@@ -868,8 +868,8 @@ class Link extends Model
         $sessionId,
         $withBaseContent = true
     ) {
-        $tbl_link = Database:: get_course_table(TABLE_LINK);
-        $TABLE_ITEM_PROPERTY = Database:: get_course_table(TABLE_ITEM_PROPERTY);
+        $tbl_link = Database::get_course_table(TABLE_LINK);
+        $TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
         $courseId = (int) $courseId;
         $sessionId = (int) $sessionId;
         $categoryId = (int) $categoryId;
@@ -1227,7 +1227,7 @@ class Link extends Model
      */
     public static function movecatlink($action, $catlinkid, $courseId = null, $sessionId = null)
     {
-        $tbl_categories = Database:: get_course_table(TABLE_LINK_CATEGORY);
+        $tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY);
 
         if (is_null($courseId)) {
             $courseId = api_get_course_int_id();
@@ -1298,7 +1298,7 @@ class Link extends Model
     public static function get_cat($catname)
     {
         // Get category id (existing or make new).
-        $tbl_categories = Database:: get_course_table(TABLE_LINK_CATEGORY);
+        $tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY);
         $course_id = api_get_course_int_id();
 
         $result = Database:: query(
@@ -1339,7 +1339,7 @@ class Link extends Model
         $_course = api_get_course_info();
         $_user = api_get_user_info();
 
-        $tbl_link = Database:: get_course_table(TABLE_LINK);
+        $tbl_link = Database::get_course_table(TABLE_LINK);
         $course_id = api_get_course_int_id();
 
         $urleq = "url='" . Database:: escape_string($url) . "'";

+ 9 - 9
main/inc/lib/specific_fields_manager.lib.php

@@ -14,7 +14,7 @@ $table_sf_val = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
  */
 function add_specific_field($name)
 {
-    $table_sf = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
+    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
     $name = trim($name);
     if (empty($name)) {
         return false;
@@ -41,7 +41,7 @@ function add_specific_field($name)
  */
 function delete_specific_field($id)
 {
-    $table_sf = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
+    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
     $id = (int)$id;
     if (!is_numeric($id)) {
         return false;
@@ -59,7 +59,7 @@ function delete_specific_field($id)
  */
 function edit_specific_field($id, $name)
 {
-    $table_sf = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
+    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
     $id = (int)$id;
     if (!is_numeric($id)) {
         return false;
@@ -76,7 +76,7 @@ function edit_specific_field($id, $name)
  */
 function get_specific_field_list($conditions = array(), $order_by = array())
 {
-    $table_sf = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
+    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
     $return_array = array();
     $sql = "SELECT * FROM $table_sf";
     if (count($conditions) > 0) {
@@ -107,7 +107,7 @@ function get_specific_field_values_list(
     $conditions = array(),
     $order_by = array()
 ) {
-    $table_sfv = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
+    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
     $return_array = array();
     $sql = "SELECT * FROM $table_sfv";
     if (count($conditions) > 0) {
@@ -154,8 +154,8 @@ function get_specific_field_values_list_by_prefix(
     $tool_id,
     $ref_id
 ) {
-    $table_sf = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
-    $table_sfv = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
+    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
+    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
     $sql = 'SELECT sfv.value FROM %s sf LEFT JOIN %s sfv ON sf.id = sfv.field_id'.
         ' WHERE sf.code = \'%s\' AND sfv.c_id = \'%s\' AND tool_id = \'%s\' AND sfv.ref_id = %s';
     $sql = sprintf(
@@ -190,7 +190,7 @@ function add_specific_field_value(
     $ref_id,
     $value
 ) {
-    $table_sf_values = Database:: get_main_table(
+    $table_sf_values = Database::get_main_table(
         TABLE_MAIN_SPECIFIC_FIELD_VALUES
     );
     $value = trim($value);
@@ -278,7 +278,7 @@ function get_specific_field_code_from_name($name) {
         'X',
         'Y',
     );
-    $table_sf = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
+    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
     $sql = "SELECT code FROM $table_sf ORDER BY code";
     $res = Database::query($sql);
     $code = strtoupper(substr($name, 0, 1));

+ 3 - 3
main/inc/lib/statistics.lib.php

@@ -101,9 +101,9 @@ class Statistics
     public static function countUsers($status = null, $categoryCode = null, $countInvisibleCourses = true, $onlyActive = false)
     {
         // Database table definitions
-        $course_user_table = Database:: get_main_table(TABLE_MAIN_COURSE_USER);
-        $course_table = Database:: get_main_table(TABLE_MAIN_COURSE);
-        $user_table = Database:: get_main_table(TABLE_MAIN_USER);
+        $course_user_table = Database::get_main_table(TABLE_MAIN_COURSE_USER);
+        $course_table = Database::get_main_table(TABLE_MAIN_COURSE);
+        $user_table = Database::get_main_table(TABLE_MAIN_USER);
         $access_url_rel_user_table= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
         $current_url_id = api_get_current_access_url_id();
         $active_filter = $onlyActive?' AND active=1':'';

+ 1 - 1
main/inc/lib/system_announcements.lib.php

@@ -432,7 +432,7 @@ class SystemAnnouncementManager
     **/
     public static function announcement_for_groups($announcement_id, $group_array)
     {
-        $tbl_announcement_group = Database:: get_main_table(
+        $tbl_announcement_group = Database::get_main_table(
             TABLE_MAIN_SYSTEM_ANNOUNCEMENTS_GROUPS
         );
         //first delete all group associations for this announcement

+ 3 - 3
main/inc/lib/thematic.lib.php

@@ -253,7 +253,7 @@ class Thematic
         $session_id = null
     ) {
         // set current course and session
-        $tbl_thematic = Database:: get_course_table(TABLE_THEMATIC);
+        $tbl_thematic = Database::get_course_table(TABLE_THEMATIC);
         $course_info = api_get_course_info($course_code);
         $course_id = $course_info['real_id'];
 
@@ -647,7 +647,7 @@ class Thematic
                                 $session_star = api_get_session_image(api_get_session_id(), $uinfo['status']);
                             }
                         }
-                        
+
                         $return[$id]['title'] = Security::remove_XSS($data[$thematic_id][$id]['title'], STUDENT).$session_star;
                         $return[$id]['description'] = Security::remove_XSS($data[$thematic_id][$id]['description'], STUDENT);
                     }
@@ -658,7 +658,7 @@ class Thematic
             if ($no_data) {
                 $return .= '<div><em>'.get_lang('StillDoNotHaveAThematicPlan').'</em></div>';
             }
-            */            
+            */
         }
 
         return $final_return;

+ 6 - 6
main/inc/lib/tracking.lib.php

@@ -2488,9 +2488,9 @@ class Tracking
         if (!empty($course)) {
             // Get course tables names
             $tbl_quiz_questions = Database::get_course_table(TABLE_QUIZ_QUESTION);
-            $lp_table = Database:: get_course_table(TABLE_LP_MAIN);
-            $lp_item_table = Database:: get_course_table(TABLE_LP_ITEM);
-            $lp_view_table = Database:: get_course_table(TABLE_LP_VIEW);
+            $lp_table = Database::get_course_table(TABLE_LP_MAIN);
+            $lp_item_table = Database::get_course_table(TABLE_LP_ITEM);
+            $lp_view_table = Database::get_course_table(TABLE_LP_VIEW);
             $lp_item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW);
             $course_id = $course['real_id'];
 
@@ -3010,9 +3010,9 @@ class Tracking
 
         if (!empty($course)) {
             $course_id = $course['real_id'];
-            $lp_table = Database:: get_course_table(TABLE_LP_MAIN);
-            $t_lpv = Database:: get_course_table(TABLE_LP_VIEW);
-            $t_lpiv = Database:: get_course_table(TABLE_LP_ITEM_VIEW);
+            $lp_table = Database::get_course_table(TABLE_LP_MAIN);
+            $t_lpv = Database::get_course_table(TABLE_LP_VIEW);
+            $t_lpiv = Database::get_course_table(TABLE_LP_ITEM_VIEW);
 
             // Check the real number of LPs corresponding to the filter in the
             // database (and if no list was given, get them all)

+ 3 - 3
main/inc/lib/usermanager.lib.php

@@ -879,7 +879,7 @@ class UserManager
      */
     public static function update_openid($user_id, $openid)
     {
-        $table_user = Database:: get_main_table(TABLE_MAIN_USER);
+        $table_user = Database::get_main_table(TABLE_MAIN_USER);
         if ($user_id != strval(intval($user_id))) {
             return false;
         }
@@ -1564,7 +1564,7 @@ class UserManager
 
         $id = intval($id);
         if (empty($userInfo)) {
-            $user_table = Database:: get_main_table(TABLE_MAIN_USER);
+            $user_table = Database::get_main_table(TABLE_MAIN_USER);
             $sql = "SELECT email, picture_uri FROM $user_table
                     WHERE id=".$id;
             $res = Database::query($sql);
@@ -1631,7 +1631,7 @@ class UserManager
         $id = intval($id);
 
         if (empty($userInfo)) {
-            $user_table = Database:: get_main_table(TABLE_MAIN_USER);
+            $user_table = Database::get_main_table(TABLE_MAIN_USER);
             $sql = "SELECT email, picture_uri FROM $user_table WHERE id=$id";
             $res = Database::query($sql);
 

+ 2 - 2
main/inc/lib/userportal.lib.php

@@ -472,8 +472,8 @@ class IndexManager
         $setting_show_also_closed_courses = api_get_setting('show_closed_courses') == 'true';
 
         // Database table definitions.
-        $main_course_table = Database:: get_main_table(TABLE_MAIN_COURSE);
-        $main_category_table = Database:: get_main_table(TABLE_MAIN_CATEGORY);
+        $main_course_table = Database::get_main_table(TABLE_MAIN_COURSE);
+        $main_category_table = Database::get_main_table(TABLE_MAIN_CATEGORY);
 
         // Get list of courses in category $category.
         $sql = "SELECT * FROM $main_course_table cours

+ 1 - 1
main/inc/local.inc.php

@@ -885,7 +885,7 @@ if (!isset($_SESSION['login_as'])) {
         }
 
         if ($save_course_access) {
-            $course_tracking_table = Database:: get_main_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)
             * the function Tracking::get_time_spent_on_the_course() returns big values (200h) due the condition:

+ 5 - 5
main/lp/learnpath.class.php

@@ -322,7 +322,7 @@ class learnpath
                     $lp_item_id_list_to_string = implode("','", $lp_item_id_list);
                     if (!empty($lp_item_id_list_to_string)) {
                         // Get last viewing vars.
-                        $itemViewTable = Database:: get_course_table(TABLE_LP_ITEM_VIEW);
+                        $itemViewTable = Database::get_course_table(TABLE_LP_ITEM_VIEW);
                         // This query should only return one or zero result.
                         $sql = "SELECT lp_item_id, status
                                 FROM $itemViewTable
@@ -1042,10 +1042,10 @@ class learnpath
             return false;
         }
 
-        $lp = Database:: get_course_table(TABLE_LP_MAIN);
-        $lp_item = Database:: get_course_table(TABLE_LP_ITEM);
-        $lp_view = Database:: get_course_table(TABLE_LP_VIEW);
-        $lp_item_view = Database:: get_course_table(TABLE_LP_ITEM_VIEW);
+        $lp = Database::get_course_table(TABLE_LP_MAIN);
+        $lp_item = Database::get_course_table(TABLE_LP_ITEM);
+        $lp_view = Database::get_course_table(TABLE_LP_VIEW);
+        $lp_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW);
 
         // Delete lp item id.
         foreach ($this->items as $id => $dummy) {

+ 1 - 1
main/lp/lp_edit_item.php

@@ -166,7 +166,7 @@ echo '<div class="row">';
 echo '<div id="lp_sidebar" class="col-md-4">';
 $path_item = isset($_GET['path_item']) ? $_GET['path_item'] : 0;
 $path_item = Database::escape_string($path_item);
-$tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
+$tbl_doc = Database::get_course_table(TABLE_DOCUMENT);
 $sql_doc = "SELECT path FROM ".$tbl_doc."
             WHERE c_id = $course_id AND id = '".$path_item."' ";
 

+ 3 - 3
main/mySpace/current_courses.php

@@ -54,12 +54,12 @@ if (!empty($my_courses)) {
 			$students[] = $student['user_id'];
 		}
 
-		$t_lp = Database :: get_course_table(TABLE_LP_MAIN);
+		$t_lp = Database::get_course_table(TABLE_LP_MAIN);
 		$sql_lp = "SELECT lp.name, lp.id FROM $t_lp lp
 				   WHERE c_id = $course_id AND lp.session_id = 0";
 		$rs_lp 	= Database::query($sql_lp);
-		$t_lpi 	= Database :: get_course_table(TABLE_LP_ITEM);
-		$t_news = Database :: get_course_table(TABLE_ANNOUNCEMENT);
+		$t_lpi 	= Database::get_course_table(TABLE_LP_ITEM);
+		$t_news = Database::get_course_table(TABLE_ANNOUNCEMENT);
 
 		$total_tools_list = Tracking::get_tools_most_used_by_course(
 			$course_id,

+ 2 - 2
main/mySpace/myStudents.php

@@ -861,7 +861,7 @@ if (!empty($student_id)) {
         if ($user_info['status'] != INVITEE) {
             $csv_content[] = array();
             $csv_content[] = array(str_replace('&nbsp;', '', $table_title));
-            $t_lp = Database :: get_course_table(TABLE_LP_MAIN);
+            $t_lp = Database::get_course_table(TABLE_LP_MAIN);
 
             // csv export headers
             $csv_content[] = array();
@@ -1160,7 +1160,7 @@ if (!empty($student_id)) {
             get_lang('Attempts')
         );
 
-        $t_quiz = Database :: get_course_table(TABLE_QUIZ_TEST);
+        $t_quiz = Database::get_course_table(TABLE_QUIZ_TEST);
         $sessionCondition = api_get_session_condition(
             $sessionId,
             true,

+ 2 - 2
main/mySpace/user_edit.php

@@ -18,8 +18,8 @@ if (!api_is_platform_admin()) {
 }
 
 // Database table definitions
-$table_admin = Database:: get_main_table(TABLE_MAIN_ADMIN);
-$table_user = Database:: get_main_table(TABLE_MAIN_USER);
+$table_admin = Database::get_main_table(TABLE_MAIN_ADMIN);
+$table_user = Database::get_main_table(TABLE_MAIN_USER);
 $database = Database::get_main_database();
 
 $userId = isset($_REQUEST['user_id']) ? intval($_REQUEST['user_id']) : '';

+ 1 - 1
main/search/search_suggestions.php

@@ -13,7 +13,7 @@ function get_suggestions_from_search_engine($q)
     global $charset;
 
     $json = [];
-    $table_sfv = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
+    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
     $q = Database::escape_string($q);
     $cid = api_get_course_id();
     $sql_add = '';

+ 1 - 1
main/session/add_many_session_to_category.php

@@ -38,7 +38,7 @@ if (isset($_GET['add_type']) && $_GET['add_type'] != '') {
 }
 
 if (!api_is_platform_admin() && !api_is_session_admin()) {
-    $sql = 'SELECT session_admin_id FROM ' . Database:: get_main_table(TABLE_MAIN_SESSION) . ' WHERE id=' . $id_session;
+    $sql = 'SELECT session_admin_id FROM ' . Database::get_main_table(TABLE_MAIN_SESSION) . ' WHERE id=' . $id_session;
     $rs = Database::query($sql);
     if (Database::result($rs, 0, 0) != $_user['user_id']) {
         api_not_allowed(true);

+ 1 - 1
main/survey/create_new_survey.php

@@ -18,7 +18,7 @@ require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_COURSES;
 
 // Database table definitions
-$table_survey = Database :: get_course_table(TABLE_SURVEY);
+$table_survey = Database::get_course_table(TABLE_SURVEY);
 $table_user = Database::get_main_table(TABLE_MAIN_USER);
 $table_course = Database::get_main_table(TABLE_MAIN_COURSE);
 $table_gradebook_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);

+ 5 - 5
main/survey/fillsurvey.php

@@ -29,11 +29,11 @@ if (!empty($_user)) {
 }
 
 // Database table definitions
-$table_survey = Database :: get_course_table(TABLE_SURVEY);
-$table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER);
-$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
-$table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
-$table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION);
+$table_survey = Database::get_course_table(TABLE_SURVEY);
+$table_survey_answer = Database::get_course_table(TABLE_SURVEY_ANSWER);
+$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
+$table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION);
+$table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
 $table_user = Database::get_main_table(TABLE_MAIN_USER);
 
 // Check if user is anonymous or not

+ 6 - 6
main/survey/preview.php

@@ -14,12 +14,12 @@ require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_COURSES;
 
 // Database table definitions
-$table_survey = Database:: get_course_table(TABLE_SURVEY);
-$table_survey_question = Database:: get_course_table(TABLE_SURVEY_QUESTION);
-$table_survey_question_option = Database:: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
-$table_course = Database:: get_main_table(TABLE_MAIN_COURSE);
-$table_user = Database:: get_main_table(TABLE_MAIN_USER);
-$table_survey_invitation = Database:: get_course_table(TABLE_SURVEY_INVITATION);
+$table_survey = Database::get_course_table(TABLE_SURVEY);
+$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
+$table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION);
+$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
+$table_user = Database::get_main_table(TABLE_MAIN_USER);
+$table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
 
 $course_id = api_get_course_int_id();
 $userId = api_get_user_id();

+ 6 - 6
main/survey/question.php

@@ -32,11 +32,11 @@ if (empty($surveyData)) {
 $is_valid_request = isset($_REQUEST['is_executable']) ? $_REQUEST['is_executable'] : null;
 
 // Database table definitions
-$table_survey = Database:: get_course_table(TABLE_SURVEY);
-$table_survey_question = Database:: get_course_table(TABLE_SURVEY_QUESTION);
-$table_survey_question_option = Database:: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
-$table_course = Database:: get_main_table(TABLE_MAIN_COURSE);
-$table_user = Database:: get_main_table(TABLE_MAIN_USER);
+$table_survey = Database::get_course_table(TABLE_SURVEY);
+$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
+$table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION);
+$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
+$table_user = Database::get_main_table(TABLE_MAIN_USER);
 $course_id = api_get_course_int_id();
 $urlname = api_substr(api_html_entity_decode($surveyData['title'], ENT_QUOTES), 0, 40);
 if (api_strlen(strip_tags($surveyData['title'])) > 40) {
@@ -44,7 +44,7 @@ if (api_strlen(strip_tags($surveyData['title'])) > 40) {
 }
 
 if ($surveyData['survey_type'] == 1) {
-    $sql = 'SELECT id FROM '.Database :: get_course_table(TABLE_SURVEY_QUESTION_GROUP).'
+    $sql = 'SELECT id FROM '.Database::get_course_table(TABLE_SURVEY_QUESTION_GROUP).'
             WHERE
                 c_id = '.$course_id.' AND
                 survey_id = '.(int)$_GET['survey_id'].' LIMIT 1';

+ 2 - 2
main/survey/reporting.php

@@ -101,8 +101,8 @@ if (!api_is_allowed_to_edit(false, true) || $isDrhOfCourse) {
 }
 
 // Database table definitions
-$table_course = Database:: get_main_table(TABLE_MAIN_COURSE);
-$table_user = Database:: get_main_table(TABLE_MAIN_USER);
+$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
+$table_user = Database::get_main_table(TABLE_MAIN_USER);
 $urlname = strip_tags(api_substr(api_html_entity_decode($survey_data['title'], ENT_QUOTES), 0, 40));
 if (api_strlen(strip_tags($survey_data['title'])) > 40) {
     $urlname .= '...';

+ 4 - 4
main/survey/survey.download.inc.php

@@ -18,10 +18,10 @@ function check_download_survey($course, $invitation, $doc_url)
     $course_id = $_course['real_id'];
 
     // Database table definitions
-    $table_survey = Database:: get_course_table(TABLE_SURVEY);
-    $table_survey_question = Database:: get_course_table(TABLE_SURVEY_QUESTION);
-    $table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
-    $table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION);
+    $table_survey = Database::get_course_table(TABLE_SURVEY);
+    $table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
+    $table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION);
+    $table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
 
     // Now we check if the invitationcode is valid
     $sql = "SELECT * FROM $table_survey_invitation

+ 3 - 3
main/survey/survey.lib.php

@@ -188,7 +188,7 @@ class SurveyManager
         $course_id = api_get_course_int_id();
         $session_id = api_get_session_id();
         $courseCode = api_get_course_id();
-        $table_survey = Database:: get_course_table(TABLE_SURVEY);
+        $table_survey = Database::get_course_table(TABLE_SURVEY);
         $shared_survey_id = 0;
 
         if (!isset($values['survey_id'])) {
@@ -1615,8 +1615,8 @@ class SurveyManager
     public static function get_people_who_filled_survey($survey_id, $all_user_info = false, $course_id = null)
     {
         // Database table definition
-        $table_survey_answer = Database:: get_course_table(TABLE_SURVEY_ANSWER);
-        $table_user = Database:: get_main_table(TABLE_MAIN_USER);
+        $table_survey_answer = Database::get_course_table(TABLE_SURVEY_ANSWER);
+        $table_user = Database::get_main_table(TABLE_MAIN_USER);
 
         // Variable initialisation
         $return = array();

+ 6 - 6
main/survey/survey.php

@@ -36,12 +36,12 @@ if (!api_is_allowed_to_edit(false, true) ||
 }
 
 // Database table definitions
-$table_survey = Database:: get_course_table(TABLE_SURVEY);
-$table_survey_question = Database:: get_course_table(TABLE_SURVEY_QUESTION);
-$table_survey_question_option = Database:: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
-$table_survey_question_group = Database:: get_course_table(TABLE_SURVEY_QUESTION_GROUP);
-$table_course = Database:: get_main_table(TABLE_MAIN_COURSE);
-$table_user = Database:: get_main_table(TABLE_MAIN_USER);
+$table_survey = Database::get_course_table(TABLE_SURVEY);
+$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
+$table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION);
+$table_survey_question_group = Database::get_course_table(TABLE_SURVEY_QUESTION_GROUP);
+$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
+$table_user = Database::get_main_table(TABLE_MAIN_USER);
 
 $survey_id = intval($_GET['survey_id']);
 $course_id = api_get_course_int_id();

+ 14 - 14
main/survey/surveyUtil.class.php

@@ -250,9 +250,9 @@ class SurveyUtil
      */
     public static function delete_user_report($survey_id, $user_id)
     {
-        $table_survey_answer = Database:: get_course_table(TABLE_SURVEY_ANSWER);
-        $table_survey_invitation = Database:: get_course_table(TABLE_SURVEY_INVITATION);
-        $table_survey = Database:: get_course_table(TABLE_SURVEY);
+        $table_survey_answer = Database::get_course_table(TABLE_SURVEY_ANSWER);
+        $table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
+        $table_survey = Database::get_course_table(TABLE_SURVEY);
 
         $course_id = api_get_course_int_id();
         $survey_id = (int) $survey_id;
@@ -480,9 +480,9 @@ class SurveyUtil
         $singlePage = isset($_GET['single_page']) ? intval($_GET['single_page']) : 0;
         $course_id = api_get_course_int_id();
         // Database table definitions
-        $table_survey_question = Database:: get_course_table(TABLE_SURVEY_QUESTION);
-        $table_survey_question_option = Database:: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
-        $table_survey_answer = Database:: get_course_table(TABLE_SURVEY_ANSWER);
+        $table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
+        $table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION);
+        $table_survey_answer = Database::get_course_table(TABLE_SURVEY_ANSWER);
 
         // Determining the offset of the sql statement (the n-th question of the survey)
         $offset = !isset($_GET['question']) ? 0 : intval($_GET['question']);
@@ -2868,9 +2868,9 @@ class SurveyUtil
             $direction = 'asc';
         }
 
-        $table_survey = Database:: get_course_table(TABLE_SURVEY);
-        $table_survey_question = Database:: get_course_table(TABLE_SURVEY_QUESTION);
-        $table_user = Database:: get_main_table(TABLE_MAIN_USER);
+        $table_survey = Database::get_course_table(TABLE_SURVEY);
+        $table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
+        $table_user = Database::get_main_table(TABLE_MAIN_USER);
 
         $course_id = api_get_course_int_id();
 
@@ -2921,7 +2921,7 @@ class SurveyUtil
         // Database table definitions
         $table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
         $table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
-        $table_survey = Database:: get_course_table(TABLE_SURVEY);
+        $table_survey = Database::get_course_table(TABLE_SURVEY);
 
         $sql = "SELECT question_id
                 FROM $table_survey_question
@@ -3151,10 +3151,10 @@ class SurveyUtil
      */
     public static function show_link_available($user_id, $survey_code, $user_answer)
     {
-        $table_survey = Database:: get_course_table(TABLE_SURVEY);
-        $table_survey_invitation = Database:: get_course_table(TABLE_SURVEY_INVITATION);
-        $table_survey_answer = Database:: get_course_table(TABLE_SURVEY_ANSWER);
-        $table_survey_question = Database:: get_course_table(TABLE_SURVEY_QUESTION);
+        $table_survey = Database::get_course_table(TABLE_SURVEY);
+        $table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
+        $table_survey_answer = Database::get_course_table(TABLE_SURVEY_ANSWER);
+        $table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
 
         $survey_code = Database::escape_string($survey_code);
         $user_id = intval($user_id);

+ 6 - 6
main/survey/survey_invitation.php

@@ -16,12 +16,12 @@ if (!api_is_allowed_to_edit(false, true)) {
 }
 
 // Database table definitions
-$table_survey = Database:: get_course_table(TABLE_SURVEY);
-$table_survey_question = Database:: get_course_table(TABLE_SURVEY_QUESTION);
-$table_survey_question_option = Database:: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
-$table_course = Database:: get_main_table(TABLE_MAIN_COURSE);
-$table_user = Database:: get_main_table(TABLE_MAIN_USER);
-$table_survey_invitation = Database:: get_course_table(TABLE_SURVEY_INVITATION);
+$table_survey = Database::get_course_table(TABLE_SURVEY);
+$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
+$table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION);
+$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
+$table_user = Database::get_main_table(TABLE_MAIN_USER);
+$table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
 $tool_name = get_lang('SurveyInvitations');
 
 // Getting the survey information

+ 6 - 6
main/survey/survey_invite.php

@@ -31,11 +31,11 @@ if (empty($survey_data)) {
 }
 
 // Database table definitions
-$table_survey = Database:: get_course_table(TABLE_SURVEY);
-$table_survey_question = Database:: get_course_table(TABLE_SURVEY_QUESTION);
-$table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
-$table_course = Database:: get_main_table(TABLE_MAIN_COURSE);
-$table_user = Database:: get_main_table(TABLE_MAIN_USER);
+$table_survey = Database::get_course_table(TABLE_SURVEY);
+$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
+$table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION);
+$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
+$table_user = Database::get_main_table(TABLE_MAIN_USER);
 
 $urlname = strip_tags(api_substr(api_html_entity_decode($survey_data['title'], ENT_QUOTES), 0, 40));
 if (api_strlen(strip_tags($survey_data['title'])) > 40) {
@@ -231,7 +231,7 @@ if ($form->validate()) {
 	// Updating the invited field in the survey table
 	SurveyUtil::update_count_invited($survey_data['code']);
 	$total_count = $count_course_users + $counter_additional_users;
-    $table_survey = Database :: get_course_table(TABLE_SURVEY);
+    $table_survey = Database::get_course_table(TABLE_SURVEY);
 	// Counting the number of people that are invited
 	$sql = "SELECT * FROM $table_survey
 	        WHERE

+ 4 - 4
main/survey/survey_list.php

@@ -53,10 +53,10 @@ if (!api_is_allowed_to_edit(false, true)) {
 $extend_rights_for_coachs = api_get_setting('extend_rights_for_coach_on_survey');
 
 // Database table definitions
-$table_survey = Database:: get_course_table(TABLE_SURVEY);
-$table_survey_question = Database:: get_course_table(TABLE_SURVEY_QUESTION);
-$table_course = Database:: get_main_table(TABLE_MAIN_COURSE);
-$table_user = Database:: get_main_table(TABLE_MAIN_USER);
+$table_survey = Database::get_course_table(TABLE_SURVEY);
+$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
+$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
+$table_user = Database::get_main_table(TABLE_MAIN_USER);
 
 // Language variables
 if (isset($_GET['search']) && $_GET['search'] == 'advanced') {

+ 3 - 3
main/user/user_export.php

@@ -15,9 +15,9 @@ $export['addcsvheader'] = isset($_REQUEST['addcsvheader']) ? $_REQUEST['addcsvhe
 $export['session'] = isset($_REQUEST['session']) ? $_REQUEST['session'] : null;
 
 // Database table definitions
-$course_table = Database:: get_main_table(TABLE_MAIN_COURSE);
-$user_table = Database:: get_main_table(TABLE_MAIN_USER);
-$course_user_table = Database:: get_main_table(TABLE_MAIN_COURSE_USER);
+$course_table = Database::get_main_table(TABLE_MAIN_COURSE);
+$user_table = Database::get_main_table(TABLE_MAIN_USER);
+$course_user_table = Database::get_main_table(TABLE_MAIN_COURSE_USER);
 $session_course_user_table = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
 $session_user_table = Database::get_main_table(TABLE_MAIN_SESSION_USER);
 

+ 22 - 22
src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php

@@ -139,7 +139,7 @@ class CourseBuilder
         $courseCode = '',
         $with_base_content = false
     ) {
-        $table_properties = Database:: get_course_table(TABLE_ITEM_PROPERTY);
+        $table_properties = Database::get_course_table(TABLE_ITEM_PROPERTY);
         $course = api_get_course_info($courseCode);
         $courseId = $course['real_id'];
 
@@ -334,7 +334,7 @@ class CourseBuilder
         $with_base_content = false,
         $id_list = array()
     ) {
-        $table = Database:: get_course_table(TABLE_FORUM);
+        $table = Database::get_course_table(TABLE_FORUM);
 
         $sessionCondition = api_get_session_condition(
             $session_id,
@@ -365,7 +365,7 @@ class CourseBuilder
         $with_base_content = false,
         $id_list = array()
     ) {
-        $table = Database:: get_course_table(TABLE_FORUM_CATEGORY);
+        $table = Database::get_course_table(TABLE_FORUM_CATEGORY);
 
         $sessionCondition = api_get_session_condition(
             $session_id,
@@ -398,7 +398,7 @@ class CourseBuilder
         $with_base_content = false,
         $id_list = array()
     ) {
-        $table = Database:: get_course_table(TABLE_FORUM_THREAD);
+        $table = Database::get_course_table(TABLE_FORUM_THREAD);
 
         $sessionCondition = api_get_session_condition(
             $session_id,
@@ -510,7 +510,7 @@ class CourseBuilder
         $with_base_content = false,
         $id_list = array()
     ) {
-        $table = Database:: get_course_table(TABLE_TOOL_INTRO);
+        $table = Database::get_course_table(TABLE_TOOL_INTRO);
 
         $sessionCondition = api_get_session_condition(
             $session_id,
@@ -564,9 +564,9 @@ class CourseBuilder
         $with_base_content = false,
         $idList = array()
     ) {
-        $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);
+        $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);
 
         if (!empty($courseId) && !empty($session_id)) {
             $session_id = intval($session_id);
@@ -795,10 +795,10 @@ class CourseBuilder
      */
     public function build_quiz_orphan_questions()
     {
-        $table_qui = Database:: get_course_table(TABLE_QUIZ_TEST);
-        $table_rel = Database:: get_course_table(TABLE_QUIZ_TEST_QUESTION);
-        $table_que = Database:: get_course_table(TABLE_QUIZ_QUESTION);
-        $table_ans = Database:: get_course_table(TABLE_QUIZ_ANSWER);
+        $table_qui = Database::get_course_table(TABLE_QUIZ_TEST);
+        $table_rel = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
+        $table_que = Database::get_course_table(TABLE_QUIZ_QUESTION);
+        $table_ans = Database::get_course_table(TABLE_QUIZ_ANSWER);
 
         $courseId = api_get_course_int_id();
 
@@ -901,8 +901,8 @@ class CourseBuilder
         $with_base_content = false,
         $id_list = array()
     ) {
-        $table_survey = Database:: get_course_table(TABLE_SURVEY);
-        $table_question = Database:: get_course_table(TABLE_SURVEY_QUESTION);
+        $table_survey = Database::get_course_table(TABLE_SURVEY);
+        $table_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
 
         $sessionCondition = api_get_session_condition(
             $session_id,
@@ -979,7 +979,7 @@ class CourseBuilder
         $with_base_content = false,
         $id_list = array()
     ) {
-        $table = Database:: get_course_table(TABLE_ANNOUNCEMENT);
+        $table = Database::get_course_table(TABLE_ANNOUNCEMENT);
 
         $sessionCondition = api_get_session_condition(
             $session_id,
@@ -990,7 +990,7 @@ class CourseBuilder
         $sql = 'SELECT * FROM '.$table.'
                 WHERE c_id = '.$courseId.' '.$sessionCondition;
         $db_result = Database::query($sql);
-        $table_attachment = Database:: get_course_table(
+        $table_attachment = Database::get_course_table(
             TABLE_ANNOUNCEMENT_ATTACHMENT
         );
         while ($obj = Database::fetch_object($db_result)) {
@@ -1040,7 +1040,7 @@ class CourseBuilder
         $with_base_content = false,
         $id_list = array()
     ) {
-        $table = Database:: get_course_table(TABLE_AGENDA);
+        $table = Database::get_course_table(TABLE_AGENDA);
 
         $sessionCondition = api_get_session_condition(
             $session_id,
@@ -1052,7 +1052,7 @@ class CourseBuilder
                 WHERE c_id = '.$courseId.' '.$sessionCondition;
         $db_result = Database::query($sql);
         while ($obj = Database::fetch_object($db_result)) {
-            $table_attachment = Database:: get_course_table(
+            $table_attachment = Database::get_course_table(
                 TABLE_AGENDA_ATTACHMENT
             );
             $sql = 'SELECT path, comment, filename, size
@@ -1097,7 +1097,7 @@ class CourseBuilder
         $with_base_content = false,
         $id_list = array()
     ) {
-        $table = Database:: get_course_table(TABLE_COURSE_DESCRIPTION);
+        $table = Database::get_course_table(TABLE_COURSE_DESCRIPTION);
 
         if (!empty($session_id) && !empty($courseId)) {
             $session_id = intval($session_id);
@@ -1116,7 +1116,7 @@ class CourseBuilder
             $sql = 'SELECT * FROM '.$table.'
                     WHERE c_id = '.$courseId.' '.$session_condition;
         } else {
-            $table = Database:: get_course_table(TABLE_COURSE_DESCRIPTION);
+            $table = Database::get_course_table(TABLE_COURSE_DESCRIPTION);
             $sql = 'SELECT * FROM '.$table.'
                     WHERE c_id = '.$courseId.'  AND session_id = 0';
         }
@@ -1303,7 +1303,7 @@ class CourseBuilder
                         WHERE g.c_id = '.$courseId.' '.$session_condition;
             }
         } else {
-            $table_glossary = Database:: get_course_table(TABLE_GLOSSARY);
+            $table_glossary = Database::get_course_table(TABLE_GLOSSARY);
             //@todo check this queries are the same ... ayayay
             if (!empty($this->course->type) && $this->course->type == 'partial') {
                 $sql = 'SELECT * FROM '.$table_glossary.' g
@@ -1535,7 +1535,7 @@ class CourseBuilder
         $with_base_content = false,
         $id_list = array()
     ) {
-        $table_work = Database:: get_course_table(TABLE_STUDENT_PUBLICATION);
+        $table_work = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
         $sessionCondition = api_get_session_condition(
             $session_id,
             true,

+ 3 - 3
src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php

@@ -2764,9 +2764,9 @@ class CourseRestorer
 	public function restore_student_publication($sessionId = 0)
 	{
         $sessionId = intval($sessionId);
-        $work_assignment_table = Database:: get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT);
-        $work_table = Database:: get_course_table(TABLE_STUDENT_PUBLICATION);
-        $item_property_table = Database:: get_course_table(TABLE_ITEM_PROPERTY);
+        $work_assignment_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT);
+        $work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
+        $item_property_table = Database::get_course_table(TABLE_ITEM_PROPERTY);
 
 		// Query in student publication
 		$sql = 'SELECT * FROM '.$work_table.'