database.constants.inc.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This is the database constants definition for Chamilo
  5. * This file is called by database.lib.php and database.mysqli.lib.php
  6. *
  7. * @todo the table constants have all to start with TABLE_
  8. * This is because of the analogy with the tool constants TOOL_
  9. *
  10. * @package chamilo.library
  11. */
  12. /**
  13. * CONSTANTS
  14. */
  15. //See #3910 defines the default prefix for the single course database
  16. // Modified by hubert.borderiou 2011-10-21 Add course category
  17. define('DB_COURSE_PREFIX', 'c_');
  18. // Main database tables
  19. define('TABLE_MAIN_COURSE', 'course');
  20. define('TABLE_MAIN_USER', 'user');
  21. define('TABLE_MAIN_CLASS', 'class');
  22. define('TABLE_MAIN_ADMIN', 'admin');
  23. define('TABLE_MAIN_COURSE_CLASS', 'course_rel_class');
  24. define('TABLE_MAIN_COURSE_USER', 'course_rel_user');
  25. define('TABLE_MAIN_CLASS_USER', 'class_user');
  26. define('TABLE_MAIN_CATEGORY', 'course_category');
  27. define('TABLE_MAIN_COURSE_MODULE', 'course_module');
  28. define('TABLE_MAIN_SYSTEM_ANNOUNCEMENTS', 'sys_announcement');
  29. define('TABLE_MAIN_SYSTEM_ANNOUNCEMENTS_GROUPS', 'announcement_rel_group');
  30. define('TABLE_MAIN_LANGUAGE', 'language');
  31. define('TABLE_MAIN_SETTINGS_OPTIONS', 'settings_options');
  32. define('TABLE_MAIN_SETTINGS_CURRENT', 'settings_current');
  33. define('TABLE_MAIN_SESSION', 'session');
  34. define('TABLE_MAIN_SESSION_CATEGORY', 'session_category');
  35. define('TABLE_MAIN_SESSION_COURSE', 'session_rel_course');
  36. define('TABLE_MAIN_SESSION_USER', 'session_rel_user');
  37. define('TABLE_MAIN_SESSION_CLASS', 'session_rel_class');
  38. define('TABLE_MAIN_SESSION_COURSE_USER', 'session_rel_course_rel_user');
  39. define('TABLE_MAIN_SHARED_SURVEY', 'shared_survey');
  40. define('TABLE_MAIN_SHARED_SURVEY_QUESTION', 'shared_survey_question');
  41. define('TABLE_MAIN_SHARED_SURVEY_QUESTION_OPTION', 'shared_survey_question_option');
  42. define('TABLE_MAIN_TEMPLATES', 'templates');
  43. define('TABLE_MAIN_SYSTEM_TEMPLATE', 'system_template');
  44. define('TABLE_MAIN_OPENID_ASSOCIATION', 'openid_association');
  45. define('TABLE_MAIN_COURSE_REQUEST', 'course_request');
  46. // Gradebook
  47. define('TABLE_MAIN_GRADEBOOK_CATEGORY', 'gradebook_category');
  48. define('TABLE_MAIN_GRADEBOOK_EVALUATION', 'gradebook_evaluation');
  49. define('TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG', 'gradebook_linkeval_log');
  50. define('TABLE_MAIN_GRADEBOOK_RESULT', 'gradebook_result');
  51. define('TABLE_MAIN_GRADEBOOK_RESULT_LOG', 'gradebook_result_log');
  52. define('TABLE_MAIN_GRADEBOOK_LINK', 'gradebook_link');
  53. define('TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY','gradebook_score_display');
  54. define('TABLE_MAIN_GRADEBOOK_CERTIFICATE', 'gradebook_certificate');
  55. // Profiling
  56. define('TABLE_MAIN_USER_FIELD', 'user_field');
  57. define('TABLE_MAIN_USER_FIELD_OPTIONS', 'user_field_options');
  58. define('TABLE_MAIN_USER_FIELD_VALUES', 'user_field_values');
  59. define('TABLE_MAIN_LP_FIELD', 'lp_field');
  60. define('TABLE_MAIN_LP_FIELD_OPTIONS', 'lp_field_options');
  61. define('TABLE_MAIN_LP_FIELD_VALUES', 'lp_field_values');
  62. define('TABLE_MAIN_CALENDAR_EVENT_FIELD', 'calendar_event_field');
  63. define('TABLE_MAIN_CALENDAR_EVENT_OPTIONS', 'calendar_event_options');
  64. define('TABLE_MAIN_CALENDAR_EVENT_VALUES', 'calendar_event_values');
  65. //User tags
  66. define('TABLE_MAIN_TAG', 'tag');
  67. define('TABLE_MAIN_USER_REL_TAG', 'user_rel_tag');
  68. //User groups
  69. define('TABLE_MAIN_GROUP', 'groups');
  70. define('TABLE_MAIN_USER_REL_GROUP', 'group_rel_user');
  71. define('TABLE_MAIN_GROUP_REL_TAG', 'group_rel_tag');
  72. define('TABLE_MAIN_GROUP_REL_GROUP', 'group_rel_group');
  73. // Search engine
  74. define('TABLE_MAIN_SPECIFIC_FIELD', 'specific_field');
  75. define('TABLE_MAIN_SPECIFIC_FIELD_VALUES', 'specific_field_values');
  76. define('TABLE_MAIN_SEARCH_ENGINE_REF', 'search_engine_ref');
  77. // Access URLs
  78. define('TABLE_MAIN_ACCESS_URL', 'access_url');
  79. define('TABLE_MAIN_ACCESS_URL_REL_USER', 'access_url_rel_user');
  80. define('TABLE_MAIN_ACCESS_URL_REL_COURSE', 'access_url_rel_course');
  81. define('TABLE_MAIN_ACCESS_URL_REL_SESSION', 'access_url_rel_session');
  82. define('TABLE_MAIN_ACCESS_URL_REL_USERGROUP', 'access_url_rel_usergroup');
  83. define('TABLE_MAIN_ACCESS_URL_REL_COURSE_CATEGORY', 'access_url_rel_course_category');
  84. // Global calendar
  85. define('TABLE_MAIN_SYSTEM_CALENDAR', 'sys_calendar');
  86. // Reservation System
  87. define('TABLE_MAIN_RESERVATION_ITEM', 'reservation_item');
  88. define('TABLE_MAIN_RESERVATION_RESERVATION', 'reservation_main');
  89. define('TABLE_MAIN_RESERVATION_SUBSCRIBTION', 'reservation_subscription');
  90. define('TABLE_MAIN_RESERVATION_CATEGORY', 'reservation_category');
  91. define('TABLE_MAIN_RESERVATION_ITEM_RIGHTS', 'reservation_item_rights');
  92. // Social networking
  93. define('TABLE_MAIN_USER_REL_USER', 'user_rel_user');
  94. define('TABLE_MAIN_USER_FRIEND_RELATION_TYPE', 'user_friend_relation_type');
  95. // Web services
  96. define('TABLE_MAIN_USER_API_KEY', 'user_api_key');
  97. define('TABLE_MAIN_COURSE_FIELD', 'course_field');
  98. define('TABLE_MAIN_COURSE_FIELD_VALUES', 'course_field_values');
  99. define('TABLE_MAIN_SESSION_FIELD', 'session_field');
  100. define('TABLE_MAIN_SESSION_FIELD_VALUES', 'session_field_values');
  101. // Message
  102. define('TABLE_MAIN_MESSAGE', 'message');
  103. // Term and conditions
  104. define('TABLE_MAIN_LEGAL', 'legal');
  105. // Dashboard blocks plugin
  106. define('TABLE_MAIN_BLOCK', 'block');
  107. // Statistic database tables
  108. define('TABLE_STATISTIC_TRACK_E_LASTACCESS', 'track_e_lastaccess');
  109. define('TABLE_STATISTIC_TRACK_E_ACCESS', 'track_e_access');
  110. define('TABLE_STATISTIC_TRACK_E_LOGIN', 'track_e_login');
  111. define('TABLE_STATISTIC_TRACK_E_DOWNLOADS', 'track_e_downloads');
  112. define('TABLE_STATISTIC_TRACK_E_LINKS', 'track_e_links');
  113. define('TABLE_STATISTIC_TRACK_E_ONLINE', 'track_e_online');
  114. define('TABLE_STATISTIC_TRACK_E_HOTPOTATOES', 'track_e_hotpotatoes');
  115. define('TABLE_STATISTIC_TRACK_E_COURSE_ACCESS', 'track_e_course_access');
  116. define('TABLE_STATISTIC_TRACK_E_EXERCICES', 'track_e_exercices');
  117. define('TABLE_STATISTIC_TRACK_E_ATTEMPT', 'track_e_attempt');
  118. define('TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING', 'track_e_attempt_recording');
  119. define('TABLE_STATISTIC_TRACK_E_DEFAULT', 'track_e_default');
  120. define('TABLE_STATISTIC_TRACK_E_UPLOADS', 'track_e_uploads');
  121. define('TABLE_STATISTIC_TRACK_E_HOTSPOT', 'track_e_hotspot');
  122. define('TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY', 'track_e_item_property');
  123. define('TABLE_STATISTIC_TRACK_E_OPEN', 'track_e_open');
  124. define('TABLE_STATISTIC_TRACK_FILTERED_TERMS', 'track_filtered_terms');
  125. define('TABLE_STATISTIC_TRACK_C_BROWSERS', 'track_c_browsers');
  126. define('TABLE_STATISTIC_TRACK_C_COUNTRIES', 'track_c_countries');
  127. define('TABLE_STATISTIC_TRACK_C_OS', 'track_c_os');
  128. define('TABLE_STATISTIC_TRACK_C_PROVIDERS', 'track_c_providers');
  129. define('TABLE_STATISTIC_TRACK_C_REFERERS', 'track_c_referers');
  130. //Course catalog stats see #4191
  131. define('TABLE_STATISTIC_TRACK_COURSE_RANKING', 'track_course_ranking');
  132. define('TABLE_MAIN_USER_REL_COURSE_VOTE', 'user_rel_course_vote');
  133. // SCORM database tables this is used only during the migration from 1.6 to 1.8 see update-db-scorm-1.6.x-1.8.0.inc
  134. define('TABLE_SCORM_MAIN', 'scorm_main');
  135. define('TABLE_SCORM_SCO_DATA', 'scorm_sco_data');
  136. // Course tables
  137. define('TABLE_AGENDA', 'calendar_event');
  138. define('TABLE_AGENDA_REPEAT', 'calendar_event_repeat');
  139. define('TABLE_AGENDA_REPEAT_NOT', 'calendar_event_repeat_not');
  140. define('TABLE_AGENDA_ATTACHMENT', 'calendar_event_attachment');
  141. define('TABLE_ANNOUNCEMENT', 'announcement');
  142. define('TABLE_ANNOUNCEMENT_ATTACHMENT', 'announcement_attachment');
  143. define('TABLE_CHAT_CONNECTED', 'chat_connected');
  144. define('TABLE_COURSE_DESCRIPTION', 'course_description');
  145. define('TABLE_DOCUMENT', 'document');
  146. define('TABLE_ITEM_PROPERTY', 'item_property');
  147. define('TABLE_LINK', 'link');
  148. define('TABLE_LINK_CATEGORY', 'link_category');
  149. define('TABLE_TOOL_LIST', 'tool');
  150. define('TABLE_TOOL_INTRO', 'tool_intro');
  151. define('TABLE_SCORMDOC', 'scormdocument');
  152. define('TABLE_STUDENT_PUBLICATION', 'student_publication');
  153. define('TABLE_STUDENT_PUBLICATION_ASSIGNMENT', 'student_publication_assignment');
  154. define('TABLE_STUDENT_PUBLICATION_REL_DOCUMENT', 'student_publication_rel_document');
  155. define('TABLE_STUDENT_PUBLICATION_REL_USER', 'student_publication_rel_user');
  156. define('TABLE_STUDENT_PUBLICATION_ASSIGNMENT_COMMENT', 'student_publication_comment');
  157. // Course forum tables
  158. define('TABLE_FORUM_CATEGORY', 'forum_category');
  159. define('TABLE_FORUM', 'forum_forum');
  160. define('TABLE_FORUM_THREAD', 'forum_thread');
  161. define('TABLE_FORUM_POST', 'forum_post');
  162. define('TABLE_FORUM_ATTACHMENT', 'forum_attachment');
  163. define('TABLE_FORUM_MAIL_QUEUE', 'forum_mailcue');
  164. define('TABLE_FORUM_THREAD_QUALIFY', 'forum_thread_qualify');
  165. define('TABLE_FORUM_THREAD_QUALIFY_LOG', 'forum_thread_qualify_log');
  166. define('TABLE_FORUM_NOTIFICATION', 'forum_notification');
  167. // Course group tables
  168. define('TABLE_GROUP', 'group_info');
  169. define('TABLE_GROUP_USER', 'group_rel_user');
  170. define('TABLE_GROUP_TUTOR', 'group_rel_tutor');
  171. define('TABLE_GROUP_CATEGORY', 'group_category');
  172. // Course dropbox tables
  173. define('TABLE_DROPBOX_CATEGORY','dropbox_category');
  174. define('TABLE_DROPBOX_FEEDBACK','dropbox_feedback');
  175. define('TABLE_DROPBOX_POST', 'dropbox_post');
  176. define('TABLE_DROPBOX_FILE', 'dropbox_file');
  177. define('TABLE_DROPBOX_PERSON', 'dropbox_person');
  178. // Course quiz (or test, or exercice) tables
  179. define('TABLE_QUIZ_QUESTION', 'quiz_question');
  180. define('TABLE_QUIZ_TEST', 'quiz');
  181. define('TABLE_QUIZ_ORDER', 'quiz_order');
  182. define('TABLE_QUIZ_ANSWER', 'quiz_answer');
  183. define('TABLE_QUIZ_TEST_QUESTION', 'quiz_rel_question');
  184. define('TABLE_QUIZ_QUESTION_OPTION', 'quiz_question_option');
  185. define('TABLE_QUIZ_QUESTION_CATEGORY', 'quiz_question_category');
  186. define('TABLE_QUIZ_QUESTION_REL_CATEGORY', 'quiz_question_rel_category');
  187. define('TABLE_QUIZ_REL_CATEGORY', 'quiz_rel_category');
  188. // Linked resource table
  189. //@todo table exists?
  190. define('TABLE_LINKED_RESOURCES', 'resource');
  191. // New SCORM tables
  192. define('TABLE_LP_MAIN', 'lp');
  193. define('TABLE_LP_ITEM', 'lp_item');
  194. define('TABLE_LP_VIEW', 'lp_view');
  195. define('TABLE_LP_ITEM_VIEW', 'lp_item_view');
  196. define('TABLE_LP_IV_INTERACTION', 'lp_iv_interaction'); // IV = Item View
  197. define('TABLE_LP_IV_OBJECTIVE', 'lp_iv_objective'); // IV = Item View
  198. // Smartblogs (Kevin Van Den Haute::kevin@develop-it.be)
  199. // Permission tables
  200. define('TABLE_PERMISSION_USER', 'permission_user');
  201. define('TABLE_PERMISSION_TASK', 'permission_task');
  202. define('TABLE_PERMISSION_GROUP', 'permission_group');
  203. // Role tables
  204. define('TABLE_ROLE', 'role');
  205. define('TABLE_ROLE_PERMISSION', 'role_permissions');
  206. define('TABLE_ROLE_USER', 'role_user');
  207. define('TABLE_ROLE_GROUP', 'role_group');
  208. // Blog tables
  209. define('TABLE_BLOGS', 'blog');
  210. define('TABLE_BLOGS_POSTS', 'blog_post');
  211. define('TABLE_BLOGS_COMMENTS', 'blog_comment');
  212. define('TABLE_BLOGS_REL_USER', 'blog_rel_user');
  213. define('TABLE_BLOGS_TASKS', 'blog_task');
  214. define('TABLE_BLOGS_TASKS_REL_USER', 'blog_task_rel_user');
  215. define('TABLE_BLOGS_RATING', 'blog_rating');
  216. define('TABLE_BLOGS_ATTACHMENT', 'blog_attachment');
  217. define('TABLE_BLOGS_TASKS_PERMISSIONS', 'permission_task');
  218. //end of Smartblogs
  219. // User information tables
  220. define('TABLE_USER_INFO', 'userinfo_def');
  221. define('TABLE_USER_INFO_CONTENT', 'userinfo_content');
  222. // Course settings table
  223. define('TABLE_COURSE_SETTING', 'course_setting');
  224. // Course online tables
  225. define('TABLE_ONLINE_LINK', 'online_link');
  226. define('TABLE_ONLINE_CONNECTED','online_connected');
  227. // User database
  228. define('TABLE_PERSONAL_AGENDA', 'personal_agenda');
  229. define('TABLE_PERSONAL_AGENDA_REPEAT', 'personal_agenda_repeat');
  230. define('TABLE_PERSONAL_AGENDA_REPEAT_NOT', 'personal_agenda_repeat_not');
  231. define('TABLE_USER_COURSE_CATEGORY', 'user_course_category');
  232. // Survey
  233. // @TODO: Are these MAIN tables or course tables?
  234. // @TODO: Probably these constants are obsolete.
  235. define('TABLE_MAIN_SURVEY', 'survey');
  236. define('TABLE_MAIN_SURVEYQUESTION', 'questions');
  237. // Survey
  238. define('TABLE_SURVEY', 'survey');
  239. define('TABLE_SURVEY_QUESTION', 'survey_question');
  240. define('TABLE_SURVEY_QUESTION_OPTION', 'survey_question_option');
  241. define('TABLE_SURVEY_INVITATION', 'survey_invitation');
  242. define('TABLE_SURVEY_ANSWER', 'survey_answer');
  243. define('TABLE_SURVEY_QUESTION_GROUP', 'survey_group');
  244. define('TABLE_SURVEY_REPORT', 'survey_report');
  245. // Wiki tables
  246. define('TABLE_WIKI', 'wiki');
  247. define('TABLE_WIKI_CONF', 'wiki_conf');
  248. define('TABLE_WIKI_DISCUSS', 'wiki_discuss');
  249. define('TABLE_WIKI_MAILCUE', 'wiki_mailcue');
  250. // Glossary
  251. define('TABLE_GLOSSARY', 'glossary');
  252. // Notebook
  253. define('TABLE_NOTEBOOK', 'notebook');
  254. // Message
  255. define('TABLE_MESSAGE', 'message');
  256. define('TABLE_MESSAGE_ATTACHMENT', 'message_attachment');
  257. // Metadata
  258. define('TABLE_METADATA', 'metadata');
  259. // Attendance Sheet
  260. define('TABLE_ATTENDANCE', 'attendance');
  261. define('TABLE_ATTENDANCE_CALENDAR', 'attendance_calendar');
  262. define('TABLE_ATTENDANCE_SHEET_LOG','attendance_sheet_log');
  263. define('TABLE_ATTENDANCE_SHEET', 'attendance_sheet');
  264. define('TABLE_ATTENDANCE_RESULT', 'attendance_result');
  265. // Thematic
  266. define('TABLE_THEMATIC','thematic');
  267. define('TABLE_THEMATIC_PLAN', 'thematic_plan');
  268. define('TABLE_THEMATIC_ADVANCE','thematic_advance');
  269. // Careers, promotions, Usergroups
  270. define('TABLE_CAREER', 'career');
  271. define('TABLE_PROMOTION', 'promotion');
  272. define('TABLE_USERGROUP', 'usergroup');
  273. define('TABLE_USERGROUP_REL_USER', 'usergroup_rel_user');
  274. define('TABLE_USERGROUP_REL_COURSE', 'usergroup_rel_course');
  275. define('TABLE_USERGROUP_REL_SESSION', 'usergroup_rel_session');
  276. // Mail notifications
  277. define('TABLE_NOTIFICATION', 'notification');
  278. //Storage api tables
  279. define('TABLE_TRACK_STORED_VALUES', 'track_stored_values');
  280. define('TABLE_TRACK_STORED_VALUES_STACK', 'track_stored_values_stack');
  281. //Event tables
  282. define('TABLE_EVENT_EMAIL_TEMPLATE', 'event_email_template');
  283. define('TABLE_EVENT_TYPE_REL_USER', 'user_rel_event_type');
  284. define('TABLE_EVENT_SENT', 'event_sent');
  285. define('TABLE_MAIN_SKILL', 'skill');
  286. define('TABLE_MAIN_SKILL_REL_SKILL', 'skill_rel_skill');
  287. define('TABLE_MAIN_SKILL_REL_GRADEBOOK', 'skill_rel_gradebook');
  288. define('TABLE_MAIN_SKILL_REL_USER', 'skill_rel_user');
  289. define('TABLE_MAIN_SKILL_PROFILE', 'skill_profile');
  290. define('TABLE_MAIN_SKILL_REL_PROFILE', 'skill_rel_profile');
  291. define('TABLE_MAIN_CHAT', 'chat');
  292. define('TABLE_TIMELINE', 'timeline');
  293. //Gradebook model
  294. define('TABLE_GRADE_MODEL', 'grade_model');
  295. define('TABLE_GRADE_MODEL_COMPONENTS', 'grade_components');