From 41ee56c9e9ca25c59b644b80cfe9c1030311bd81 Mon Sep 17 00:00:00 2001 From: aurelien goudeneche <44634756+AurelGDN@users.noreply.github.com> Date: Mon, 3 Dec 2018 09:30:47 +0100 Subject: [PATCH 1/5] Apply andreubisquerra's fix to cheque payment Apply andreubisquerra's fix (#10147) to cheque payment button --- htdocs/takepos/pay.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index e47ce27009d..711bbe6c186 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -109,7 +109,7 @@ $langs->loadLangs(array("main", "bills", "cashdesk")); - + From 1f089d3ee2c44afd66bc05d7b3ef06c0818b0cdc Mon Sep 17 00:00:00 2001 From: aurelien goudeneche <44634756+AurelGDN@users.noreply.github.com> Date: Mon, 3 Dec 2018 09:37:45 +0100 Subject: [PATCH 2/5] Update pay.php --- htdocs/takepos/pay.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 711bbe6c186..6c0c79f7689 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -109,7 +109,7 @@ $langs->loadLangs(array("main", "bills", "cashdesk")); - + From a2f514d4a15ec9902930875289ec7c4a6f258c58 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 3 Dec 2018 13:12:42 +0100 Subject: [PATCH 3/5] FIX possibility to force install lock with GET/POST or script --- build/perl/virtualmin/dolibarr.pl | 24 +++++++++++++++--------- htdocs/install/step5.php | 5 +++-- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index 589e2a3f55c..b72ec7db98d 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -30,7 +30,7 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "7.0.0", "6.0.5", "5.0.7" ); +return ( "9.0.0", "8.0.3", "7.0.4", "6.0.8", "5.0.7" ); } sub script_dolibarr_release @@ -263,15 +263,16 @@ if ($upgrade) { local @params = ( [ "action", "upgrade" ], [ "versionfrom", $upgrade->{'version'} ], [ "versionto", $ver ], + [ "installlock", "1" ], ); local $p = $ver >= 3.8 ? "step5" : "etape5"; local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); - # Remove the installation directory. - local $dinstall = "$opts->{'dir'}/install"; - $dinstall =~ s/\/$//; - $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall)); + # Remove the installation directory. (deprecated) + # local $dinstall = "$opts->{'dir'}/install"; + # $dinstall =~ s/\/$//; + # $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall)); } else { @@ -306,15 +307,18 @@ else { [ "login", "admin" ], [ "pass", $dompass ], [ "pass_verif", $dompass ], + [ "installlock", "1" ], ); local $p = $ver >= 3.8 ? "step5" : "etape5"; local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); - # Remove the installation directory and protect config file. - local $dinstall = "$opts->{'dir'}/install"; - $dinstall =~ s/\/$//; - $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall)); + # Remove the installation directory (deprecated) + # local $dinstall = "$opts->{'dir'}/install"; + # $dinstall =~ s/\/$//; + # $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall)); + + # Protect config file &set_permissions_as_domain_user($d, 0644, $cfile); &set_permissions_as_domain_user($d, 0755, $cfiledir); } @@ -386,6 +390,8 @@ sub script_dolibarr_check_latest { local ($ver) = @_; local @vers = &osdn_package_versions("dolibarr", + $ver >= 9.0 ? "dolibarr\\-(9\\.0\\.[0-9\\.]+)\\.tgz" : + $ver >= 8.0 ? "dolibarr\\-(8\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 7.0 ? "dolibarr\\-(7\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 6.0 ? "dolibarr\\-(6\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 5.0 ? "dolibarr\\-(5\\.0\\.[0-9\\.]+)\\.tgz" : diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index 97770d39e9d..58d5ead27e6 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -38,6 +38,7 @@ $versionto=GETPOST("versionto",'alpha',3)?GETPOST("versionto",'alpha',3):(empty( $setuplang=GETPOST('selectlang','aZ09',3)?GETPOST('selectlang','aZ09',3):(empty($argv[3])?'auto':$argv[3]); $langs->setDefaultLang($setuplang); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):(empty($argv[4])?'':$argv[4]); +$installlock=GETPOST('installlock','int')?GETPOST('installlock','int'):(empty($argv[5])?'':$argv[5]); // Define targetversion used to update MAIN_VERSION_LAST_INSTALL for first install // or MAIN_VERSION_LAST_UPGRADE for upgrade. @@ -362,7 +363,7 @@ if ($action == "set" && $success) $createlock=0; - if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) + if (! empty($force_install_lockinstall) || ! empty($installlock) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) { // Install is finished, we create the lock file $lockfile=DOL_DATA_ROOT.'/install.lock'; @@ -412,7 +413,7 @@ elseif (empty($action) || preg_match('/upgrade/i',$action)) $createlock=0; - if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) + if (! empty($force_install_lockinstall) || ! empty($installlock) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) { // Upgrade is finished, we create the lock file $lockfile=DOL_DATA_ROOT.'/install.lock'; From dcbb7c49fca0f670bd283d5bb0e60cc53ed66673 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 3 Dec 2018 13:31:28 +0100 Subject: [PATCH 4/5] FIX wrong value for instal lock --- build/perl/virtualmin/dolibarr.pl | 4 ++-- htdocs/install/step5.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index b72ec7db98d..a28fc430caa 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -263,7 +263,7 @@ if ($upgrade) { local @params = ( [ "action", "upgrade" ], [ "versionfrom", $upgrade->{'version'} ], [ "versionto", $ver ], - [ "installlock", "1" ], + [ "installlock", "444" ], ); local $p = $ver >= 3.8 ? "step5" : "etape5"; local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); @@ -307,7 +307,7 @@ else { [ "login", "admin" ], [ "pass", $dompass ], [ "pass_verif", $dompass ], - [ "installlock", "1" ], + [ "installlock", "444" ], ); local $p = $ver >= 3.8 ? "step5" : "etape5"; local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index 58d5ead27e6..b39f67dd3ba 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -38,7 +38,6 @@ $versionto=GETPOST("versionto",'alpha',3)?GETPOST("versionto",'alpha',3):(empty( $setuplang=GETPOST('selectlang','aZ09',3)?GETPOST('selectlang','aZ09',3):(empty($argv[3])?'auto':$argv[3]); $langs->setDefaultLang($setuplang); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):(empty($argv[4])?'':$argv[4]); -$installlock=GETPOST('installlock','int')?GETPOST('installlock','int'):(empty($argv[5])?'':$argv[5]); // Define targetversion used to update MAIN_VERSION_LAST_INSTALL for first install // or MAIN_VERSION_LAST_UPGRADE for upgrade. @@ -58,6 +57,7 @@ $langs->loadLangs(array("admin", "install")); $login = GETPOST('login', 'alpha')?GETPOST('login', 'alpha'):(empty($argv[5])?'':$argv[5]); $pass = GETPOST('pass', 'alpha')?GETPOST('pass', 'alpha'):(empty($argv[6])?'':$argv[6]); $pass_verif = GETPOST('pass_verif', 'alpha')?GETPOST('pass_verif', 'alpha'):(empty($argv[7])?'':$argv[7]); +$force_install_lockinstall = (int) (! empty($force_install_lockinstall)?$force_install_lockinstall:(GETPOST('installlock','aZ09')?GETPOST('installlock','aZ09'):(empty($argv[8])?'':$argv[8]))); $success=0; @@ -363,7 +363,7 @@ if ($action == "set" && $success) $createlock=0; - if (! empty($force_install_lockinstall) || ! empty($installlock) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) + if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) { // Install is finished, we create the lock file $lockfile=DOL_DATA_ROOT.'/install.lock'; @@ -413,7 +413,7 @@ elseif (empty($action) || preg_match('/upgrade/i',$action)) $createlock=0; - if (! empty($force_install_lockinstall) || ! empty($installlock) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) + if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) { // Upgrade is finished, we create the lock file $lockfile=DOL_DATA_ROOT.'/install.lock'; From aa3e52072522d9442f42110237cd2add7dd542dd Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 4 Dec 2018 09:12:36 +0100 Subject: [PATCH 5/5] FIX wrong path, multidir_output[] for each entity is construct by the multicompany module --- htdocs/install/upgrade2.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 08fa147fb0d..6ea7940d7a0 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4834,11 +4834,11 @@ function migrate_reload_menu($db,$langs,$conf,$versionto) function migrate_user_photospath() { global $conf, $db, $langs; - + print ''; print ''.$langs->trans('MigrationUserPhotoPath')."
\n"; - + include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $fuser = new User($db); @@ -4851,12 +4851,16 @@ function migrate_user_photospath() $fuser->fetch($obj->uid); //echo '
'.$fuser->id.' -> '.$fuser->entity; $entity = (!empty($fuser->entity)) ? $fuser->entity : 1; - $dir = $conf->user->multidir_output[$entity]; + if ($entity > 1) { + $dir = DOL_DATA_ROOT . '/' . $entity . '/users'; + } else { + $dir = $conf->user->multidir_output[$entity]; // $conf->user->multidir_output[] for each entity is construct by the multicompany module + } $origin = $dir .'/'. get_exdir($fuser->id,2,0,0,$fuser,'user'); $destin = $dir.'/'.$fuser->id; - + $error = 0; - + $origin_osencoded=dol_osencode($origin); $destin_osencoded=dol_osencode($destin); dol_mkdir($destin);