浏览代码

Load tables for opensurvey only when module opensurvey is enabled

Laurent Destailleur 3 年之前
父节点
当前提交
f9c9e518c3

+ 7 - 0
htdocs/core/modules/modOpenSurvey.class.php

@@ -182,6 +182,13 @@ class modOpenSurvey extends DolibarrModules
 	 */
 	public function init($options = '')
 	{
+		global $conf, $langs;
+
+		$result = $this->_load_tables('/install/mysql/tables/', 'opensurvey');
+		if ($result < 0) {
+			return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
+		}
+
 		// Permissions
 		$this->remove($options);
 

+ 0 - 0
htdocs/install/mysql/tables/llx_opensurvey_comments.key.sql → htdocs/install/mysql/tables/llx_opensurvey_comments-opensurvey.key.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_opensurvey_comments.sql → htdocs/install/mysql/tables/llx_opensurvey_comments-opensurvey.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_opensurvey_formquestions.sql → htdocs/install/mysql/tables/llx_opensurvey_formquestions-opensurvey.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_opensurvey_sondage.key.sql → htdocs/install/mysql/tables/llx_opensurvey_sondage-opensurvey.key.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_opensurvey_sondage.sql → htdocs/install/mysql/tables/llx_opensurvey_sondage-opensurvey.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_opensurvey_user_formanswers.sql → htdocs/install/mysql/tables/llx_opensurvey_user_formanswers-opensurvey.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_opensurvey_user_studs.key.sql → htdocs/install/mysql/tables/llx_opensurvey_user_studs-opensurvey.key.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql → htdocs/install/mysql/tables/llx_opensurvey_user_studs-opensurvey.sql