';
$constforvar = 'EVENTORGANIZATION_'.strtoupper($myTmpObjectKey).'_ADDON';
- if ($conf->global->$constforvar == $name) {
+ if (getDolGlobalString($constforvar) == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
print 'scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'';
diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php
index aea86069f4d..f5bbb5c648f 100644
--- a/htdocs/admin/hrm.php
+++ b/htdocs/admin/hrm.php
@@ -279,7 +279,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print '
';
$constforvar = 'HRMTEST_'.strtoupper($myTmpObjectKey).'_ADDON';
- if ($conf->global->$constforvar == $name) {
+ if (getDolGlobalString($constforvar) == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
print 'scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'';
diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php
index c2440bbb885..041216014b0 100644
--- a/htdocs/admin/knowledgemanagement.php
+++ b/htdocs/admin/knowledgemanagement.php
@@ -403,7 +403,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print '
';
+
+ $fieldsforcontent = array('topic', 'joinfiles', 'content');
+ if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) {
+ $fieldsforcontent = array('topic', 'joinfiles', 'content', 'content_lines');
}
- }
-
- $keyforobj = 'type_template';
- if (!in_array($obj->$keyforobj, array_keys($elementList))) {
- $i++;
- continue; // It means this is a type of template not into elementList (may be because enabled condition of this type is false because module is not enabled)
- }
- // Test on 'enabled'
- if (!dol_eval($obj->enabled, 1, 1, '1')) {
- $i++;
- continue; // Email template not qualified
- }
-
- print '
\n";
} else {
- print ''.$actl[$obj->active].'';
- }
- print "";
+ // If template is for a module, check module is enabled.
+ if ($obj->module) {
+ $tempmodulekey = $obj->module;
+ if (empty($conf->$tempmodulekey) || empty($conf->$tempmodulekey->enabled)) {
+ $i++;
+ continue;
+ }
+ }
- // Modify link / Delete link
- print '
';
- if ($canbemodified) {
- print ''.img_edit().'';
- }
- if ($iserasable) {
- print ''.img_delete().'';
- //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin
- }
- print '
';
+ $keyforobj = 'type_template';
+ if (!in_array($obj->$keyforobj, array_keys($elementList))) {
+ $i++;
+ continue; // It means this is a type of template not into elementList (may be because enabled condition of this type is false because module is not enabled)
+ }
+ // Test on 'enabled'
+ if (!dol_eval($obj->enabled, 1, 1, '1')) {
+ $i++;
+ continue; // Email template not qualified
+ }
- print "\n";
+ print '
';
+
+ $tmpaction = 'view';
+ $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
+ $reshook = $hookmanager->executeHooks('viewEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
+
+ $error = $hookmanager->error; $errors = $hookmanager->errors;
+
+ if (empty($reshook)) {
+ foreach ($fieldlist as $field => $value) {
+ if (in_array($fieldlist[$field], array('content', 'content_lines'))) {
+ continue;
+ }
+ $showfield = 1;
+ $align = "";
+ $class = "tddict";
+ $title = '';
+ $valuetoshow = $obj->{$fieldlist[$field]};
+ if ($value == 'label' || $value == 'topic') {
+ if ($langs->trans($valuetoshow) != $valuetoshow) {
+ $valuetoshow = $langs->trans($valuetoshow);
+ }
+ $valuetoshow = dol_escape_htmltag($valuetoshow);
+ }
+ if ($value == 'label') {
+ $class .= ' tdoverflowmax100';
+ }
+ if ($value == 'topic') {
+ $class .= 'tdoverflowmax200 small';
+ }
+ if ($value == 'type_template') {
+ $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
+ $align = "center";
+ }
+ if ($value == 'lang' && $valuetoshow) {
+ $valuetoshow = $valuetoshow.' - '.$langs->trans("Language_".$valuetoshow);
+ }
+ if ($value == 'fk_user') {
+ if ($valuetoshow > 0) {
+ $fuser = new User($db);
+ $fuser->fetch($valuetoshow);
+ $valuetoshow = $fuser->getNomUrl(1);
+ }
+ }
+ if ($value == 'private') {
+ $align = "center";
+ if ($valuetoshow) {
+ $valuetoshow = yn($valuetoshow);
+ } else {
+ $valuetoshow = '';
+ }
+ }
+ if ($value == 'position') {
+ $align = "center";
+ }
+ if ($value == 'joinfiles') {
+ $align = "center";
+ if ($valuetoshow) {
+ $valuetoshow = 1;
+ } else {
+ $valuetoshow = '';
+ }
+ }
+ if ($align) {
+ $class .= ' '.$align;
+ }
+
+ // Show value for field
+ if ($showfield) {
+ print '';
+ print '
';
+ if ($canbemodified) {
+ print ''.img_edit().'';
+ }
+ if ($iserasable) {
+ print ''.img_delete().'';
+ //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin
+ }
+ print '
';
+
+ print "
\n";
+ }
}
-
$i++;
}
}
diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php
index 716dbc32ca7..0c53bebfc52 100644
--- a/htdocs/admin/modulehelp.php
+++ b/htdocs/admin/modulehelp.php
@@ -172,6 +172,10 @@ foreach ($modulesdir as $dir) {
$moduleposition = '80'; // External modules at end by default
}
+ if (empty($familyinfo[$familykey]['position'])) {
+ $familyinfo[$familykey]['position'] = '0';
+ }
+
$orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
$dirmod[$i] = $dir;
//print $i.'-'.$dirmod[$i].' ';
@@ -250,19 +254,19 @@ if (!empty($conf->global->$const_name)) {
$text .= $langs->trans("Disabled");
}
$tmp = $objMod->getLastActivationInfo();
-$authorid = $tmp['authorid'];
+$authorid = (empty($tmp['authorid']) ? '' : $tmp['authorid']);
if ($authorid > 0) {
$tmpuser = new User($db);
$tmpuser->fetch($authorid);
$text .= ' '.$langs->trans("LastActivationAuthor").': ';
$text .= $tmpuser->getNomUrl(1);
}
-$ip = $tmp['ip'];
+$ip = (empty($tmp['ip']) ? '' : $tmp['ip']);
if ($ip) {
$text .= ' '.$langs->trans("LastActivationIP").': ';
$text .= $ip;
}
-$lastactivationversion = $tmp['lastactivationversion'];
+$lastactivationversion = (empty($tmp['lastactivationversion']) ? '' : $tmp['lastactivationversion']);
if ($lastactivationversion) {
$text .= ' '.$langs->trans("LastActivationVersion").': ';
$text .= $lastactivationversion;
diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php
index 58118827ed4..6ac7a425246 100644
--- a/htdocs/admin/workstation.php
+++ b/htdocs/admin/workstation.php
@@ -295,7 +295,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print '
';
$constforvar = 'ASSET_'.strtoupper($myTmpObjectKey).'_ADDON';
- if ($conf->global->$constforvar == $name) {
+ if (getDolGlobalString($constforvar) == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'';
diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php
index 27f3ca1c836..94bd36799fc 100644
--- a/htdocs/core/class/translate.class.php
+++ b/htdocs/core/class/translate.class.php
@@ -1089,11 +1089,12 @@ class Translate
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
-
- // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
- $this->cache_currencies[$obj->code_iso]['label'] = ($obj->code_iso && $this->trans("Currency".$obj->code_iso) != "Currency".$obj->code_iso ? $this->trans("Currency".$obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
- $this->cache_currencies[$obj->code_iso]['unicode'] = (array) json_decode($obj->unicode, true);
- $label[$obj->code_iso] = $this->cache_currencies[$obj->code_iso]['label'];
+ if ($obj) {
+ // If a translation exists, we use it lese we use the default label
+ $this->cache_currencies[$obj->code_iso]['label'] = ($obj->code_iso && $this->trans("Currency".$obj->code_iso) != "Currency".$obj->code_iso ? $this->trans("Currency".$obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
+ $this->cache_currencies[$obj->code_iso]['unicode'] = (array) json_decode($obj->unicode, true);
+ $label[$obj->code_iso] = $this->cache_currencies[$obj->code_iso]['label'];
+ }
$i++;
}
if (empty($currency_code)) {
diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php
index 74abf7a1e36..4ab7b4d65a1 100644
--- a/htdocs/core/db/pgsql.class.php
+++ b/htdocs/core/db/pgsql.class.php
@@ -116,7 +116,7 @@ class DoliDBPgsql extends DoliDB
$this->connected = false;
$this->ok = false;
$this->error = 'Host, login or password incorrect';
- dol_syslog(get_class($this)."::DoliDBPgsql : Erreur Connect ".$this->error, LOG_ERR);
+ dol_syslog(get_class($this)."::DoliDBPgsql : Erreur Connect ".$this->error.'. Failed to connect to host='.$host.' port='.$port.' user='.$user, LOG_ERR);
}
// Si connexion serveur ok et si connexion base demandee, on essaie connexion base
@@ -423,7 +423,7 @@ class DoliDBPgsql extends DoliDB
}
// if local connection failed or not requested, use TCP/IP
- if (!$this->db) {
+ if (empty($this->db)) {
if (!$host) {
$host = "localhost";
}
@@ -432,7 +432,11 @@ class DoliDBPgsql extends DoliDB
}
$con_string = "host='".$host."' port='".$port."' dbname='".$name."' user='".$login."' password='".$passwd."'";
- $this->db = @pg_connect($con_string);
+ try {
+ $this->db = @pg_connect($con_string);
+ } catch (Exception $e) {
+ print $e->getMessage();
+ }
}
// now we test if at least one connect method was a success
@@ -916,7 +920,8 @@ class DoliDBPgsql extends DoliDB
// Test charset match LC_TYPE (pgsql error otherwise)
//print $charset.' '.setlocale(LC_CTYPE,'0'); exit;
- $sql = "CREATE DATABASE '".$this->escape($database)."' OWNER '".$this->escape($owner)."' ENCODING '".$this->escape($charset)."'";
+ // NOTE: Do not use ' around the database name
+ $sql = "CREATE DATABASE ".$this->escape($database)." OWNER '".$this->escape($owner)."' ENCODING '".$this->escape($charset)."'";
dol_syslog($sql, LOG_DEBUG);
$ret = $this->query($sql);
return $ret;
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index 9bc0a59cf86..e14302da340 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -29,10 +29,10 @@
/**
* Prepare array with list of tabs
*
- * @param Object $object Object related to tabs
+ * @param User $object Object related to tabs
* @return array Array of tabs to show
*/
-function user_prepare_head($object)
+function user_prepare_head(User $object)
{
global $langs, $conf, $user, $db;
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index 71abeda1f03..b579c9b0059 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -956,11 +956,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$err++;
} else {
$obj = $this->db->fetch_object($resql);
- $tmp = array();
- if ($obj->note) {
- $tmp = json_decode($obj->note, true);
- }
if ($obj) {
+ $tmp = array();
+ if ($obj->note) {
+ $tmp = json_decode($obj->note, true);
+ }
return array(
'authorid' => $tmp['authorid'],
'ip' => $tmp['ip'],
@@ -1054,16 +1054,16 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps,PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Create tables and keys required by module:
- * - Files module.sql with create table instructions
- * - Then modules.key.sql with create keys instructions
+ * - Files table.sql or table-module.sql with create table instructions
+ * - Then table.key.sql or table-module.key.sql with create keys instructions
* - Then data_xxx.sql (usualy provided by external modules only)
* - Then update_xxx.sql (usualy provided by external modules only)
- * Files must be stored in directory defined by reldir (Example: '/install/mysql/tables' or '/module/sql/')
+ * Files must be stored in subdirectory 'tables' or 'data' into directory $reldir (Example: '/install/mysql/' or '/module/sql/')
* This function may also be called by :
- * - _load_tables('/install/mysql/tables/', 'modulename') into the this->init() of core module descriptors.
+ * - _load_tables('/install/mysql/', 'modulename') into the this->init() of core module descriptors.
* - _load_tables('/mymodule/sql/') into the this->init() of external module descriptors.
*
- * @param string $reldir Relative directory where to scan files. Example: '/install/mysql/tables' or '/module/sql/'
+ * @param string $reldir Relative directory where to scan files. Example: '/install/mysql/' or '/module/sql/'
* @param string $onlywithsuffix Only with the defined suffix
* @return int <=0 if KO, >0 if OK
*/
@@ -1084,112 +1084,147 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$ok = 1;
foreach ($conf->file->dol_document_root as $dirroot) {
if ($ok) {
- $dir = $dirroot.$reldir;
+ $dirsql = $dirroot.$reldir;
$ok = 0;
- $handle = @opendir($dir); // Dir may not exists
- if (is_resource($handle)) {
- $dirfound++;
+ // We will loop on xxx/, xxx/tables/, xxx/data/
+ $listofsubdir = array('', 'tables/', 'data/');
+ if ($this->db->type == 'pgsql') {
+ $listofsubdir[] = '../pgsql/functions/';
+ }
- // Run llx_mytable.sql files, then llx_mytable_*.sql
- $files = array();
- while (($file = readdir($handle)) !== false) {
- $files[] = $file;
- }
- sort($files);
- foreach ($files as $file) {
- if ($onlywithsuffix) {
- if (!preg_match('/\-'.preg_quote($onlywithsuffix, '/').'\./i', $file)) {
- //print 'File '.$file.' does not match suffix '.$onlywithsuffix.' so it is discarded '."\n";
- continue;
- } else {
- //print 'File '.$file.' match suffix '.$onlywithsuffix.' so we keep it '."\n";
+ foreach ($listofsubdir as $subdir) {
+ $dir = $dirsql.$subdir;
+
+ $handle = @opendir($dir); // Dir may not exists
+ if (is_resource($handle)) {
+ $dirfound++;
+
+ // Run llx_mytable.sql files, then llx_mytable_*.sql
+ $files = array();
+ while (($file = readdir($handle)) !== false) {
+ $files[] = $file;
+ }
+ sort($files);
+ foreach ($files as $file) {
+ if ($onlywithsuffix) {
+ if (!preg_match('/\-'.preg_quote($onlywithsuffix, '/').'\./i', $file)) {
+ //print 'File '.$file.' does not match suffix '.$onlywithsuffix.' so it is discarded '."\n";
+ continue;
+ } else {
+ //print 'File '.$file.' match suffix '.$onlywithsuffix.' so we keep it '."\n";
+ }
+ }
+ if (preg_match('/\.sql$/i', $file) && !preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 4) == 'llx_') {
+ $result = run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0, '', 1);
+ if ($result <= 0) {
+ $error++;
+ }
}
}
- if (preg_match('/\.sql$/i', $file) && !preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 4) == 'llx_' && substr($file, 0, 4) != 'data') {
- $result = run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0, '', 1);
- if ($result <= 0) {
- $error++;
+
+ rewinddir($handle);
+
+ // Run llx_mytable.key.sql files (Must be done after llx_mytable.sql) then then llx_mytable_*.key.sql
+ $files = array();
+ while (($file = readdir($handle)) !== false) {
+ $files[] = $file;
+ }
+ sort($files);
+ foreach ($files as $file) {
+ if ($onlywithsuffix) {
+ if (!preg_match('/\-'.preg_quote($onlywithsuffix, '/').'\./i', $file)) {
+ //print 'File '.$file.' does not match suffix '.$onlywithsuffix.' so it is discarded '."\n";
+ continue;
+ } else {
+ //print 'File '.$file.' match suffix '.$onlywithsuffix.' so we keep it '."\n";
+ }
+ }
+ if (preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 4) == 'llx_') {
+ $result = run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0, '', 1);
+ if ($result <= 0) {
+ $error++;
+ }
}
}
- }
- rewinddir($handle);
+ rewinddir($handle);
- // Run llx_mytable.key.sql files (Must be done after llx_mytable.sql) then then llx_mytable_*.key.sql
- $files = array();
- while (($file = readdir($handle)) !== false) {
- $files[] = $file;
- }
- sort($files);
- foreach ($files as $file) {
- if ($onlywithsuffix) {
- if (!preg_match('/\-'.preg_quote($onlywithsuffix, '/').'\./i', $file)) {
- //print 'File '.$file.' does not match suffix '.$onlywithsuffix.' so it is discarded '."\n";
- continue;
- } else {
- //print 'File '.$file.' match suffix '.$onlywithsuffix.' so we keep it '."\n";
+ // Run functions-xxx.sql files (Must be done after llx_mytable.key.sql)
+ $files = array();
+ while (($file = readdir($handle)) !== false) {
+ $files[] = $file;
+ }
+ sort($files);
+ foreach ($files as $file) {
+ if ($onlywithsuffix) {
+ if (!preg_match('/\-'.preg_quote($onlywithsuffix, '/').'\./i', $file)) {
+ //print 'File '.$file.' does not match suffix '.$onlywithsuffix.' so it is discarded '."\n";
+ continue;
+ } else {
+ //print 'File '.$file.' match suffix '.$onlywithsuffix.' so we keep it '."\n";
+ }
+ }
+ if (preg_match('/\.sql$/i', $file) && !preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 9) == 'functions') {
+ $result = run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0, '', 1);
+ if ($result <= 0) {
+ $error++;
+ }
}
}
- if (preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 4) == 'llx_' && substr($file, 0, 4) != 'data') {
- $result = run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0, '', 1);
- if ($result <= 0) {
- $error++;
+
+ rewinddir($handle);
+
+ // Run data_xxx.sql files (Must be done after llx_mytable.key.sql)
+ $files = array();
+ while (($file = readdir($handle)) !== false) {
+ $files[] = $file;
+ }
+ sort($files);
+ foreach ($files as $file) {
+ if ($onlywithsuffix) {
+ if (!preg_match('/\-'.preg_quote($onlywithsuffix, '/').'\./i', $file)) {
+ //print 'File '.$file.' does not match suffix '.$onlywithsuffix.' so it is discarded '."\n";
+ continue;
+ } else {
+ //print 'File '.$file.' match suffix '.$onlywithsuffix.' so we keep it '."\n";
+ }
+ }
+ if (preg_match('/\.sql$/i', $file) && !preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 4) == 'data') {
+ $result = run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0, '', 1);
+ if ($result <= 0) {
+ $error++;
+ }
}
}
- }
- rewinddir($handle);
+ rewinddir($handle);
- // Run data_xxx.sql files (Must be done after llx_mytable.key.sql)
- $files = array();
- while (($file = readdir($handle)) !== false) {
- $files[] = $file;
- }
- sort($files);
- foreach ($files as $file) {
- if ($onlywithsuffix) {
- if (!preg_match('/\-'.preg_quote($onlywithsuffix, '/').'\./i', $file)) {
- //print 'File '.$file.' does not match suffix '.$onlywithsuffix.' so it is discarded '."\n";
- continue;
- } else {
- //print 'File '.$file.' match suffix '.$onlywithsuffix.' so we keep it '."\n";
+ // Run update_xxx.sql files
+ $files = array();
+ while (($file = readdir($handle)) !== false) {
+ $files[] = $file;
+ }
+ sort($files);
+ foreach ($files as $file) {
+ if ($onlywithsuffix) {
+ if (!preg_match('/\-'.preg_quote($onlywithsuffix, '/').'\./i', $file)) {
+ //print 'File '.$file.' does not match suffix '.$onlywithsuffix.' so it is discarded '."\n";
+ continue;
+ } else {
+ //print 'File '.$file.' match suffix '.$onlywithsuffix.' so we keep it '."\n";
+ }
+ }
+ if (preg_match('/\.sql$/i', $file) && !preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 6) == 'update') {
+ $result = run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0, '', 1);
+ if ($result <= 0) {
+ $error++;
+ }
}
}
- if (preg_match('/\.sql$/i', $file) && !preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 4) == 'data') {
- $result = run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0, '', 1);
- if ($result <= 0) {
- $error++;
- }
- }
- }
- rewinddir($handle);
-
- // Run update_xxx.sql files
- $files = array();
- while (($file = readdir($handle)) !== false) {
- $files[] = $file;
+ closedir($handle);
}
- sort($files);
- foreach ($files as $file) {
- if ($onlywithsuffix) {
- if (!preg_match('/\-'.preg_quote($onlywithsuffix, '/').'\./i', $file)) {
- //print 'File '.$file.' does not match suffix '.$onlywithsuffix.' so it is discarded '."\n";
- continue;
- } else {
- //print 'File '.$file.' match suffix '.$onlywithsuffix.' so we keep it '."\n";
- }
- }
- if (preg_match('/\.sql$/i', $file) && !preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 6) == 'update') {
- $result = run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0, '', 1);
- if ($result <= 0) {
- $error++;
- }
- }
- }
-
- closedir($handle);
}
if ($error == 0) {
diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php
index 2146de367e1..a217cb8d72c 100644
--- a/htdocs/core/modules/modAsset.class.php
+++ b/htdocs/core/modules/modAsset.class.php
@@ -240,7 +240,7 @@ class modAsset extends DolibarrModules
*/
public function init($options = '')
{
- $result = $this->_load_tables('/install/mysql/tables/', 'asset');
+ $result = $this->_load_tables('/install/mysql/', 'asset');
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')
}
diff --git a/htdocs/core/modules/modDeplacement.class.php b/htdocs/core/modules/modDeplacement.class.php
index bceb313e120..450aa76258e 100644
--- a/htdocs/core/modules/modDeplacement.class.php
+++ b/htdocs/core/modules/modDeplacement.class.php
@@ -159,7 +159,7 @@ class modDeplacement extends DolibarrModules
*/
public function init($options = '')
{
- $result = $this->_load_tables('/install/mysql/tables/', 'deplacement');
+ $result = $this->_load_tables('/install/mysql/', 'deplacement');
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')
}
diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php
index f2564cd3cc6..c5c790ca28c 100644
--- a/htdocs/core/modules/modDon.class.php
+++ b/htdocs/core/modules/modDon.class.php
@@ -155,7 +155,7 @@ class modDon extends DolibarrModules
{
global $conf;
- $result = $this->_load_tables('/install/mysql/tables/', 'deplacement');
+ $result = $this->_load_tables('/install/mysql/', 'don');
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')
}
diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php
index bd81f06dae7..7df3bcc6dcf 100644
--- a/htdocs/core/modules/modHRM.class.php
+++ b/htdocs/core/modules/modHRM.class.php
@@ -280,7 +280,7 @@ class modHRM extends DolibarrModules
// Permissions
$this->remove($options);
- $result = $this->_load_tables('/install/mysql/tables/', 'hrm');
+ $result = $this->_load_tables('/install/mysql/', 'hrm');
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')
}
diff --git a/htdocs/core/modules/modIntracommreport.class.php b/htdocs/core/modules/modIntracommreport.class.php
index 50758f90f0c..25f26050ed0 100644
--- a/htdocs/core/modules/modIntracommreport.class.php
+++ b/htdocs/core/modules/modIntracommreport.class.php
@@ -138,7 +138,7 @@ class modIntracommreport extends DolibarrModules
{
global $conf;
- $result = $this->_load_tables('/install/mysql/tables/', 'intracommreport');
+ $result = $this->_load_tables('/install/mysql/', 'intracommreport');
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')
}
diff --git a/htdocs/core/modules/modKnowledgeManagement.class.php b/htdocs/core/modules/modKnowledgeManagement.class.php
index 93b44f31204..434cc9d6faf 100644
--- a/htdocs/core/modules/modKnowledgeManagement.class.php
+++ b/htdocs/core/modules/modKnowledgeManagement.class.php
@@ -442,7 +442,7 @@ class modKnowledgeManagement extends DolibarrModules
{
global $conf, $langs;
- $result = $this->_load_tables('/install/mysql/tables/', 'knowledgemanagement');
+ $result = $this->_load_tables('/install/mysql/', 'knowledgemanagement');
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')
}
diff --git a/htdocs/core/modules/modLoan.class.php b/htdocs/core/modules/modLoan.class.php
index e19ec1b81f8..8f9de88b83f 100644
--- a/htdocs/core/modules/modLoan.class.php
+++ b/htdocs/core/modules/modLoan.class.php
@@ -160,7 +160,7 @@ class modLoan extends DolibarrModules
{
global $conf;
- $result = $this->_load_tables('/install/mysql/tables/', 'loan');
+ $result = $this->_load_tables('/install/mysql/', 'loan');
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')
}
diff --git a/htdocs/core/modules/modMailing.class.php b/htdocs/core/modules/modMailing.class.php
index 1a31aad9c8b..7e3d4b6aeb1 100644
--- a/htdocs/core/modules/modMailing.class.php
+++ b/htdocs/core/modules/modMailing.class.php
@@ -159,7 +159,7 @@ class modMailing extends DolibarrModules
*/
public function init($options = '')
{
- $result = $this->_load_tables('/install/mysql/tables/', 'mailing');
+ $result = $this->_load_tables('/install/mysql/', 'mailing');
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')
}
diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php
index 9cc9310cd19..04a8cd54082 100644
--- a/htdocs/core/modules/modOpenSurvey.class.php
+++ b/htdocs/core/modules/modOpenSurvey.class.php
@@ -184,7 +184,7 @@ class modOpenSurvey extends DolibarrModules
{
global $conf, $langs;
- $result = $this->_load_tables('/install/mysql/tables/', 'opensurvey');
+ $result = $this->_load_tables('/install/mysql/', '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')
}
diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php
index c08cf66db06..f37d7d2403d 100644
--- a/htdocs/core/modules/modPartnership.class.php
+++ b/htdocs/core/modules/modPartnership.class.php
@@ -410,7 +410,7 @@ class modPartnership extends DolibarrModules
{
global $conf, $langs;
- $result = $this->_load_tables('/install/mysql/tables/', 'partnership');
+ $result = $this->_load_tables('/install/mysql/', 'partnership');
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')
}
diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php
index c4bbd573fa9..fb64e43486d 100644
--- a/htdocs/core/modules/modRecruitment.class.php
+++ b/htdocs/core/modules/modRecruitment.class.php
@@ -403,7 +403,7 @@ class modRecruitment extends DolibarrModules
{
global $conf, $langs;
- $result = $this->_load_tables('/install/mysql/tables/', 'recruitment');
+ $result = $this->_load_tables('/install/mysql/', 'recruitment');
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')
}
diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php
index 839a62325f3..52a3843fd12 100644
--- a/htdocs/core/modules/modStock.class.php
+++ b/htdocs/core/modules/modStock.class.php
@@ -434,7 +434,7 @@ class modStock extends DolibarrModules
{
global $conf, $langs;
- $result = $this->_load_tables('/install/mysql/tables/', 'stock');
+ $result = $this->_load_tables('/install/mysql/', 'stock');
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')
}
diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php
index 86a657c0509..688da3061d9 100644
--- a/htdocs/core/modules/modTicket.class.php
+++ b/htdocs/core/modules/modTicket.class.php
@@ -331,7 +331,7 @@ class modTicket extends DolibarrModules
{
global $conf, $langs;
- $result = $this->_load_tables('/install/mysql/tables/', 'ticket');
+ $result = $this->_load_tables('/install/mysql/', 'ticket');
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')
}
diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php
index 7ea6b5a890c..e27e7a2f6b0 100644
--- a/htdocs/core/modules/modWebsite.class.php
+++ b/htdocs/core/modules/modWebsite.class.php
@@ -164,7 +164,7 @@ class modWebsite extends DolibarrModules
{
global $conf, $langs;
- $result = $this->_load_tables('/install/mysql/tables/', 'website');
+ $result = $this->_load_tables('/install/mysql/', 'website');
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')
}
diff --git a/htdocs/core/modules/modWorkstation.class.php b/htdocs/core/modules/modWorkstation.class.php
index 854dd45b969..80a401b4846 100644
--- a/htdocs/core/modules/modWorkstation.class.php
+++ b/htdocs/core/modules/modWorkstation.class.php
@@ -390,7 +390,7 @@ class modWorkstation extends DolibarrModules
{
global $conf, $langs;
- $result = $this->_load_tables('/install/mysql/tables/', 'workstation');
+ $result = $this->_load_tables('/install/mysql/', 'workstation');
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')
}
diff --git a/htdocs/core/modules/modZapier.class.php b/htdocs/core/modules/modZapier.class.php
index e638d906693..b6ef25e150e 100644
--- a/htdocs/core/modules/modZapier.class.php
+++ b/htdocs/core/modules/modZapier.class.php
@@ -281,7 +281,7 @@ class modZapier extends DolibarrModules
*/
public function init($options = '')
{
- $result = $this->_load_tables('/install/mysql/tables/', 'zapier');
+ $result = $this->_load_tables('/install/mysql/', 'zapier');
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')
}
diff --git a/htdocs/hrm/admin/evaluation_extrafields.php b/htdocs/hrm/admin/evaluation_extrafields.php
index a9614ccd03f..133be0c0f08 100644
--- a/htdocs/hrm/admin/evaluation_extrafields.php
+++ b/htdocs/hrm/admin/evaluation_extrafields.php
@@ -91,6 +91,8 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
* View
*/
+$textobject = $langs->transnoentitiesnoconv("Evaluation");
+
$help_url = '';
$page_name = "HrmSetup";
diff --git a/htdocs/hrm/admin/job_extrafields.php b/htdocs/hrm/admin/job_extrafields.php
index 4b0d76e5187..f521b8addb4 100644
--- a/htdocs/hrm/admin/job_extrafields.php
+++ b/htdocs/hrm/admin/job_extrafields.php
@@ -91,6 +91,8 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
* View
*/
+$textobject = $langs->transnoentitiesnoconv("Job");
+
$help_url = '';
$page_name = "HrmSetup";
diff --git a/htdocs/hrm/admin/skill_extrafields.php b/htdocs/hrm/admin/skill_extrafields.php
index f8d123cce74..e77feaa5002 100644
--- a/htdocs/hrm/admin/skill_extrafields.php
+++ b/htdocs/hrm/admin/skill_extrafields.php
@@ -91,6 +91,8 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
* View
*/
+$textobject = $langs->transnoentitiesnoconv("Skills");
+
$help_url = '';
$page_name = "HrmSetup";
diff --git a/htdocs/install/mysql/data/llx_c_partnership_type.sql b/htdocs/install/mysql/data/llx_c_partnership_type-partnership.sql
similarity index 100%
rename from htdocs/install/mysql/data/llx_c_partnership_type.sql
rename to htdocs/install/mysql/data/llx_c_partnership_type-partnership.sql
diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
index daa0e755865..4c9d85dc1dd 100644
--- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
+++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
@@ -105,6 +105,8 @@ ALTER TABLE llx_bank ADD COLUMN amount_main_currency double(24,8) NULL;
-- v16
+ALTER TABLE llx_societe_account DROP FOREIGN KEY llx_societe_account_fk_website;
+
UPDATE llx_cronjob set label = 'RecurringInvoicesJob' where label = 'RecurringInvoices';
UPDATE llx_cronjob set label = 'RecurringSupplierInvoicesJob' where label = 'RecurringSupplierInvoices';
diff --git a/htdocs/install/mysql/tables/llx_societe_account.key.sql b/htdocs/install/mysql/tables/llx_societe_account.key.sql
index e86c12aa306..e889a38d527 100644
--- a/htdocs/install/mysql/tables/llx_societe_account.key.sql
+++ b/htdocs/install/mysql/tables/llx_societe_account.key.sql
@@ -25,6 +25,8 @@ ALTER TABLE llx_societe_account ADD INDEX idx_societe_account_fk_soc (fk_soc);
ALTER TABLE llx_societe_account ADD UNIQUE INDEX uk_societe_account_login_website_soc(entity, fk_soc, login, site, fk_website);
ALTER TABLE llx_societe_account ADD UNIQUE INDEX uk_societe_account_key_account_soc(entity, fk_soc, key_account, site, fk_website);
-ALTER TABLE llx_societe_account ADD CONSTRAINT llx_societe_account_fk_website FOREIGN KEY (fk_website) REFERENCES llx_website(rowid);
+-- Table website does not always exists
+--ALTER TABLE llx_societe_account ADD CONSTRAINT llx_societe_account_fk_website FOREIGN KEY (fk_website) REFERENCES llx_website(rowid);
+
ALTER TABLE llx_societe_account ADD CONSTRAINT llx_societe_account_fk_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid);
diff --git a/htdocs/install/pgsql/functions/functions-don.sql b/htdocs/install/pgsql/functions/functions-don.sql
new file mode 100644
index 00000000000..a1a51b57e6d
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-don.sql
@@ -0,0 +1,20 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/install/pgsql/functions/functions-loan.sql b/htdocs/install/pgsql/functions/functions-loan.sql
new file mode 100644
index 00000000000..d63e394e5c9
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-loan.sql
@@ -0,0 +1,19 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_loan FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/install/pgsql/functions/functions-mailing.sql b/htdocs/install/pgsql/functions/functions-mailing.sql
new file mode 100644
index 00000000000..d45d620399f
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-mailing.sql
@@ -0,0 +1,20 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing_cibles FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/install/pgsql/functions/functions-opensurvey.sql b/htdocs/install/pgsql/functions/functions-opensurvey.sql
new file mode 100644
index 00000000000..d42a8311cb2
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-opensurvey.sql
@@ -0,0 +1,21 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_comments FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_sondage FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_user_studs FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/install/pgsql/functions/functions-partnership.sql b/htdocs/install/pgsql/functions/functions-partnership.sql
new file mode 100644
index 00000000000..61e991e1197
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-partnership.sql
@@ -0,0 +1,20 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_partnership FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_partnership_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/install/pgsql/functions/functions-recruitment.sql b/htdocs/install/pgsql/functions/functions-recruitment.sql
new file mode 100644
index 00000000000..9fa6023be1a
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-recruitment.sql
@@ -0,0 +1,23 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentjobposition FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentjobposition_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentcandidature FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentcandidature_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+
diff --git a/htdocs/install/pgsql/functions/functions-website.sql b/htdocs/install/pgsql/functions/functions-website.sql
new file mode 100644
index 00000000000..a5597837466
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-website.sql
@@ -0,0 +1,21 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website_page FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+
diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql
index d73678bcbab..35bc4e05c11 100644
--- a/htdocs/install/pgsql/functions/functions.sql
+++ b/htdocs/install/pgsql/functions/functions.sql
@@ -100,9 +100,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_contratdet_extrafiel
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_contratdet_log FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_subscription FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_cronjob FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_deplacement FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_directories FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_files FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_element_resources FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
@@ -126,19 +123,13 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_fichinter FOR EACH R
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_fichinter_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_fichinterdet_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_delivery FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_loan FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_localtax FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing_cibles FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_menu FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_mo FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_mo_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_production FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_notify FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_notify_def FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_comments FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_sondage FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_user_studs FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_paiement FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_paiementcharge FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_paiementfourn FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
@@ -165,10 +156,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_propal_extrafields F
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_propal_merge_pdf_product FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_propaldet_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_resource FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentjobposition FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentjobposition_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentcandidature FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentcandidature_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_salary FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_address FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
@@ -187,5 +174,3 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user FOR EACH ROW EX
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_usergroup FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_usergroup_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website_page FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php
index 63b8d66539b..9613e1a86b5 100644
--- a/htdocs/install/step1.php
+++ b/htdocs/install/step1.php
@@ -261,6 +261,7 @@ if (!$error) {
$error++;
}
}
+
// If we need simple access
if (!$error && (empty($db_create_database) && empty($db_create_user))) {
$db = getDoliDBInstance($db_type, $db_host, $db_user, $db_pass, $db_name, $db_port);
diff --git a/htdocs/install/step4.php b/htdocs/install/step4.php
index e1890656f4b..c8be975c19f 100644
--- a/htdocs/install/step4.php
+++ b/htdocs/install/step4.php
@@ -82,9 +82,9 @@ if ($db->ok) {
print '
';
$constforvar = 'RECRUITMENT_'.strtoupper($myTmpObjectKey).'_ADDON_PDF';
- if ($conf->global->$constforvar == $name) {
+ if (getDolGlobalString($constforvar) == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'';
diff --git a/htdocs/recruitment/admin/setup_candidatures.php b/htdocs/recruitment/admin/setup_candidatures.php
index 726e24e89b1..58172c2e767 100644
--- a/htdocs/recruitment/admin/setup_candidatures.php
+++ b/htdocs/recruitment/admin/setup_candidatures.php
@@ -328,7 +328,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print '
';
$constforvar = 'RECRUITMENT_'.strtoupper($myTmpObjectKey).'_ADDON';
- if ($conf->global->$constforvar == $name) {
+ if (getDolGlobalString($constforvar) == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'';
diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php
index e2b7c545aa9..c28bd4a9589 100644
--- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php
+++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php
@@ -130,7 +130,7 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
// List of directories area
$texte .= '
';
- if (is_array($permsgroupbyentity[$entity])) {
+ if (!empty($permsgroupbyentity[$entity]) && is_array($permsgroupbyentity[$entity])) {
if (in_array($obj->id, $permsgroupbyentity[$entity])) {
// Own permission by group
if ($caneditperms) {