Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0

Conflicts:
	htdocs/core/class/html.formfile.class.php
This commit is contained in:
Laurent Destailleur
2018-03-08 16:33:51 +01:00

View File

@@ -301,10 +301,26 @@ function dol_dir_list_in_database($path, $filter="", $excludefilter=null, $sortc
*/
function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir)
{
global $db, $user;
global $conf, $db, $user;
$filearrayindatabase = dol_dir_list_in_database($relativedir, '', null, 'name', SORT_ASC);
// TODO Remove this when PRODUCT_USE_OLD_PATH_FOR_PHOTO will be removed
global $modulepart;
if ($modulepart == 'produit' && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
global $object;
if (! empty($object->id))
{
if (! empty($conf->product->enabled)) $upload_dirold = $conf->product->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2),1,1).'/'.substr(substr("000".$object->id, -2),0,1).'/'.$object->id."/photos";
else $upload_dirold = $conf->service->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2),1,1).'/'.substr(substr("000".$object->id, -2),0,1).'/'.$object->id."/photos";
$relativedirold = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $upload_dirold);
$relativedirold = preg_replace('/^[\\/]/','',$relativedirold);
$filearrayindatabase = array_merge($filearrayindatabase, dol_dir_list_in_database($relativedirold, '', null, 'name', SORT_ASC));
}
}
//var_dump($filearray);
//var_dump($filearrayindatabase);