database.constants.inc.php 14 KB

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