forked from Wavyzz/dolibarr
Clean code
This commit is contained in:
@@ -161,7 +161,7 @@ function versiondolibarrarray()
|
||||
* @param int $nocommentremoval Do no try to remove comments (in such a case, we consider that each line is a request, so use also $linelengthlimit=0)
|
||||
* @param int $offsetforchartofaccount Offset to use to load chart of account table to update sql on the fly to add offset to rowid and account_parent value
|
||||
* @param int $colspan 2=Add a colspan=2 on td
|
||||
* @param int $onlysqltoimportwebsite Only sql resquests used to import a website template is allowed
|
||||
* @param int $onlysqltoimportwebsite Only sql resquests used to import a website template are allowed
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handler = '', $okerror = 'default', $linelengthlimit = 32768, $nocommentremoval = 0, $offsetforchartofaccount = 0, $colspan = 0, $onlysqltoimportwebsite = 0)
|
||||
|
||||
@@ -1721,7 +1721,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
$val = '';
|
||||
}
|
||||
|
||||
$sql = "SELECT count(*)";
|
||||
$sql = "SELECT count(*) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."const";
|
||||
$sql .= " WHERE ".$this->db->decrypt('name')." = '".$this->db->escape($name)."'";
|
||||
$sql .= " AND entity = ".((int) $entity);
|
||||
@@ -1745,7 +1745,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
$err++;
|
||||
}
|
||||
} else {
|
||||
dol_syslog(get_class($this)."::insert_const constant '".$name."' already exists", LOG_WARNING);
|
||||
dol_syslog(get_class($this)."::insert_const constant '".$name."' already exists", LOG_DEBUG);
|
||||
}
|
||||
} else {
|
||||
$err++;
|
||||
|
||||
@@ -427,6 +427,13 @@ class modEventOrganization extends DolibarrModules
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
|
||||
/*$result = run_sql(DOL_DOCUMENT_ROOT.'/install/mysql/data/llx_c_email_templates.sql', 1, '', 1);
|
||||
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')
|
||||
}
|
||||
TODO Instead use the array merge of the sql found into llx_c_email_templates for this module
|
||||
*/
|
||||
|
||||
// Permissions
|
||||
$this->remove($options);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user