mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 17:48:25 +01:00
Save MAIN_VERSION_FIRST_INSTALL that is not erased.
This commit is contained in:
@@ -846,7 +846,7 @@ function dol_strtoupper($utf8_string)
|
||||
* SYSLOG_HANDLERS = ["mod_syslog_syslog"] facility is then defined by SYSLOG_FACILITY
|
||||
* Warning, syslog functions are bugged on Windows, generating memory protection faults. To solve
|
||||
* this, use logging to files instead of syslog (see setup of module).
|
||||
* Note: If SYSLOG_FILE_NO_ERROR defined, we never output any error message when writing to log fails.
|
||||
* Note: If constant 'SYSLOG_FILE_NO_ERROR' defined, we never output any error message when writing to log fails.
|
||||
* Note: You can get log message into html sources by adding parameter &logtohtml=1 (constant MAIN_LOGTOHTML must be set)
|
||||
* This function works only if syslog module is enabled.
|
||||
* This must not use any call to other function calling dol_syslog (avoid infinite loop).
|
||||
|
||||
@@ -127,12 +127,13 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
|
||||
|
||||
$logfile = $this->getFilename($suffixinfilename);
|
||||
|
||||
if (! empty($conf->global->SYSLOG_FILE_NO_ERROR)) $filefd = @fopen($logfile, 'a+');
|
||||
// Test constant SYSLOG_FILE_NO_ERROR (should stay a constant defined with define('SYSLOG_FILE_NO_ERROR',1);
|
||||
if (defined('SYSLOG_FILE_NO_ERROR')) $filefd = @fopen($logfile, 'a+');
|
||||
else $filefd = fopen($logfile, 'a+');
|
||||
|
||||
if (! $filefd)
|
||||
{
|
||||
if (empty($conf->global->SYSLOG_FILE_NO_ERROR))
|
||||
if (! defined('SYSLOG_FILE_NO_ERROR') || ! constant('SYSLOG_FILE_NO_ERROR'))
|
||||
{
|
||||
// Do not break dolibarr usage if log fails
|
||||
//throw new Exception('Failed to open log file '.basename($logfile));
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
ALTER TABLE llx_extrafields ADD COLUMN fieldcomputed text;
|
||||
ALTER TABLE llx_extrafields ADD COLUMN fielddefault varchar(255);
|
||||
|
||||
ALTER TABLE llx_c_typent MODIFY COLUMN libelle varchar(64);
|
||||
|
||||
ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP;
|
||||
|
||||
ALTER TABLE llx_opensurvey_sondage ADD COLUMN fk_user_creat integer NOT NULL DEFAULT 0;
|
||||
|
||||
@@ -21,7 +21,7 @@ create table llx_c_typent
|
||||
(
|
||||
id integer PRIMARY KEY,
|
||||
code varchar(12) NOT NULL,
|
||||
libelle varchar(48),
|
||||
libelle varchar(64),
|
||||
fk_country integer NULL, -- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B)
|
||||
active tinyint DEFAULT 1 NOT NULL,
|
||||
module varchar(32) NULL,
|
||||
|
||||
@@ -33,7 +33,7 @@ include 'inc.php';
|
||||
global $langs;
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$setuplang=(GETPOST('selectlang','',3)?GETPOST('selectlang','',3):'auto');
|
||||
$setuplang=(GETPOST('selectlang','aZ09',3)?GETPOST('selectlang','aZ09',3):'auto');
|
||||
$langs->setDefaultLang($setuplang);
|
||||
|
||||
$langs->load("admin");
|
||||
@@ -341,7 +341,7 @@ if (! $error && $db->connected && $action == "set")
|
||||
}
|
||||
|
||||
// Show title of step
|
||||
print '<h3>'.$langs->trans("ConfigurationFile").'</h3>';
|
||||
print '<h3><img class="valigntextbottom" src="../theme/common/octicons/lib/svg/gear.svg" width="20" alt="Configuration"> '.$langs->trans("ConfigurationFile").'</h3>';
|
||||
print '<table cellspacing="0" width="100%" cellpadding="1" border="0">';
|
||||
|
||||
// Check parameter main_dir
|
||||
|
||||
@@ -86,7 +86,7 @@ if (! is_writable($conffile))
|
||||
|
||||
if ($action == "set")
|
||||
{
|
||||
print '<h3>'.$langs->trans("Database").'</h3>';
|
||||
print '<h3><img class="valigntextbottom" src="../theme/common/octicons/lib/svg/database.svg" width="20" alt="Database"> '.$langs->trans("Database").'</h3>';
|
||||
|
||||
print '<table cellspacing="0" style="padding: 4px 4px 4px 0px" border="0" width="100%">';
|
||||
$error=0;
|
||||
|
||||
@@ -216,10 +216,15 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action))
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
dolibarr_install_syslog('step5: set MAIN_VERSION_FIRST_INSTALL const to ' . $targetversion, LOG_DEBUG);
|
||||
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_FIRST_INSTALL',1).",".$db->encrypt($targetversion,1).",'chaine',0,'Dolibarr version when first install',0)");
|
||||
//if (! $resql) dol_print_error($db,'Error in setup program'); // We ignore errors. Key may already exists
|
||||
$conf->global->MAIN_VERSION_FIRST_INSTALL=$targetversion;
|
||||
|
||||
dolibarr_install_syslog('step5: set MAIN_VERSION_LAST_INSTALL const to ' . $targetversion, LOG_DEBUG);
|
||||
$resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_VERSION_LAST_INSTALL'");
|
||||
if (! $resql) dol_print_error($db,'Error in setup program');
|
||||
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_LAST_INSTALL',1).",".$db->encrypt($targetversion,1).",'chaine',0,'Dolibarr version when install',0)");
|
||||
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_LAST_INSTALL',1).",".$db->encrypt($targetversion,1).",'chaine',0,'Dolibarr version when last install',0)");
|
||||
if (! $resql) dol_print_error($db,'Error in setup program');
|
||||
$conf->global->MAIN_VERSION_LAST_INSTALL=$targetversion;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user