Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/filefunc.inc.php
	htdocs/install/upgrade2.php
This commit is contained in:
Laurent Destailleur 2018-12-07 19:08:53 +01:00
commit 2621af96d6
3 changed files with 58 additions and 46 deletions

View File

@ -0,0 +1 @@
htdocs/install/doctemplates/websites/website_template-corporate.zip

View File

@ -2922,9 +2922,9 @@ function migrate_project_task_actors($db,$langs,$conf)
* @param Conf $conf Object conf * @param Conf $conf Object conf
* @param string $table Table name * @param string $table Table name
* @param int $fk_source Id of element source * @param int $fk_source Id of element source
* @param type $sourcetype Type of element source * @param string $sourcetype Type of element source
* @param int $fk_target Id of element target * @param int $fk_target Id of element target
* @param type $targettype Type of element target * @param string $targettype Type of element target
* @return void * @return void
*/ */
function migrate_relationship_tables($db,$langs,$conf,$table,$fk_source,$sourcetype,$fk_target,$targettype) function migrate_relationship_tables($db,$langs,$conf,$table,$fk_source,$sourcetype,$fk_target,$targettype)
@ -4833,7 +4833,7 @@ function migrate_reload_menu($db,$langs,$conf,$versionto)
*/ */
function migrate_user_photospath() function migrate_user_photospath()
{ {
global $conf, $db, $langs; global $conf, $db, $langs, $user;
print '<tr><td colspan="4">'; print '<tr><td colspan="4">';
@ -4842,6 +4842,8 @@ function migrate_user_photospath()
include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
$fuser = new User($db); $fuser = new User($db);
if (! is_object($user)) $user = $fuser; // To avoid error during migration
$sql = "SELECT rowid as uid from ".MAIN_DB_PREFIX."user"; // Get list of all users $sql = "SELECT rowid as uid from ".MAIN_DB_PREFIX."user"; // Get list of all users
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
@ -4858,47 +4860,56 @@ function migrate_user_photospath()
} else { } else {
$dir = $conf->user->multidir_output[$entity]; // $conf->user->multidir_output[] for each entity is construct by the multicompany module $dir = $conf->user->multidir_output[$entity]; // $conf->user->multidir_output[] for each entity is construct by the multicompany module
} }
if ($dir) if ($dir)
{ {
$origin = $dir .'/'. get_exdir($fuser->id,2,0,0,$fuser,'user'); $origin = $dir .'/'. get_exdir($fuser->id,2,0,0,$fuser,'user');
$destin = $dir .'/'. $fuser->id; $destin = $dir .'/'. $fuser->id;
$error = 0; $origin_osencoded=dol_osencode($origin);
$origin_osencoded=dol_osencode($origin); dol_mkdir($destin);
$destin_osencoded=dol_osencode($destin);
dol_mkdir($destin); //echo '<hr>'.$origin.' -> '.$destin;
//echo '<hr>'.$origin.' -> '.$destin; if (dol_is_dir($origin))
if (dol_is_dir($origin)) {
{ $handle=opendir($origin_osencoded);
$handle=opendir($origin_osencoded); if (is_resource($handle))
if (is_resource($handle)) {
{ while (($file = readdir($handle)) !== false)
while (($file = readdir($handle)) !== false) {
{ if ($file == '.' || $file == '..') continue;
if ($file != '.' && $file != '..' && is_dir($origin_osencoded.'/'.$file))
{ if (dol_is_dir($origin.'/'.$file)) // it is a dir (like 'thumbs')
$thumbs = opendir($origin_osencoded.'/'.$file); {
if (is_resource($thumbs)) $thumbs = opendir($origin_osencoded.'/'.$file);
{ if (is_resource($thumbs))
dol_mkdir($destin.'/'.$file); {
while (($thumb = readdir($thumbs)) !== false) dol_mkdir($destin.'/'.$file);
{ while (($thumb = readdir($thumbs)) !== false)
dol_move($origin.'/'.$file.'/'.$thumb, $destin.'/'.$file.'/'.$thumb); {
} if (! dol_is_file($destin.'/'.$file.'/'.$thumb))
// dol_delete_dir($origin.'/'.$file); {
} if ($thumb == '.' || $thumb == '..') continue;
}
else print '.';
{ dol_move($origin.'/'.$file.'/'.$thumb, $destin.'/'.$file.'/'.$thumb, 0, 0, 0, 0);
if (dol_is_file($origin.'/'.$file) ) }
{ }
dol_move($origin.'/'.$file, $destin.'/'.$file); // dol_delete_dir($origin.'/'.$file);
} }
} }
} else // it is a file
} {
} if (! dol_is_file($destin.'/'.$file))
{
print '.';
dol_move($origin.'/'.$file, $destin.'/'.$file, 0, 0, 0, 1);
}
}
}
}
}
} }
} }
} }

View File

@ -149,13 +149,13 @@ TaskCreatedInDolibarr=Task %s created
TaskModifiedInDolibarr=Task %s modified TaskModifiedInDolibarr=Task %s modified
TaskDeletedInDolibarr=Task %s deleted TaskDeletedInDolibarr=Task %s deleted
OpportunityStatus=Lead status OpportunityStatus=Lead status
OpportunityStatusShort=Opp. status OpportunityStatusShort=Lead status
OpportunityProbability=Lead probability OpportunityProbability=Lead probability
OpportunityProbabilityShort=Opp. probab. OpportunityProbabilityShort=Lead probab.
OpportunityAmount=Lead amount OpportunityAmount=Lead amount
OpportunityAmountShort=Opp. amount OpportunityAmountShort=Lead amount
OpportunityAmountAverageShort=Average Opp. amount OpportunityAmountAverageShort=Average lead amount
OpportunityAmountWeigthedShort=Weighted Opp. amount OpportunityAmountWeigthedShort=Weighted lead amount
WonLostExcluded=Won/Lost excluded WonLostExcluded=Won/Lost excluded
##### Types de contacts ##### ##### Types de contacts #####
TypeContact_project_internal_PROJECTLEADER=Project leader TypeContact_project_internal_PROJECTLEADER=Project leader
@ -234,4 +234,4 @@ DontHaveTheValidateStatus=The project %s must be open to be closed
RecordsClosed=%s project(s) closed RecordsClosed=%s project(s) closed
SendProjectRef=Information project %s SendProjectRef=Information project %s
ModuleSalaryToDefineHourlyRateMustBeEnabled=Module 'Payment of employee wages' must be enabled to define employee hourly rate to have time spent valorized ModuleSalaryToDefineHourlyRateMustBeEnabled=Module 'Payment of employee wages' must be enabled to define employee hourly rate to have time spent valorized
NewTaskRefSuggested=Task ref already used, a new task ref is suggested NewTaskRefSuggested=Task ref already used, a new task ref is suggested