diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index 11e42602f03..37f54fb780a 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -137,7 +137,7 @@ if (! dol_is_dir($upload_dir))
}
print ''."\n";
-print ''."\n";
+print ''."\n";
$param='';
$param.=($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:'');
@@ -176,10 +176,8 @@ if ($type == 'directory')
$relativepath='facture';
$upload_dir = $conf->fournisseur->dir_output.'/'.$relativepath;
$filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
-
$param.='&module='.$module;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));
-
$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
}
else if ($module == 'propal') // Auto area for customers orders
diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php
index 012da1f25a6..4ca70302e0a 100644
--- a/htdocs/core/ajax/ajaxdirtree.php
+++ b/htdocs/core/ajax/ajaxdirtree.php
@@ -74,6 +74,7 @@ if ($modulepart == 'ecm')
top_httphead();
+//print ''."\n";
$userstatic=new User($db);
$form=new Form($db);
$ecmdirstatic = new EcmDirectory($db);
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index b67e05defc7..f9eb554a945 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -789,7 +789,7 @@ class FormFile
$var=true;
foreach($filearray as $key => $file)
{
- if (!is_dir($file['name'])
+ if (!is_dir($file['name'])
&& $file['name'] != '.'
&& $file['name'] != '..'
&& $file['name'] != 'CVS'
@@ -821,10 +821,10 @@ class FormFile
}
else
{
- //print 'Fetch '.$idorref.'
';
+ //print 'Fetch '.$id." - ".$ref.'
';
$result=$object_instance->fetch($id,$ref);
if ($result > 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]=dol_clone($object_instance); } // Save object into a cache
- if ($result == 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]='notfound'; }
+ if ($result == 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]='notfound'; unset($filearray[$key]); }
}
if (! $found > 0 || ! is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) continue; // We do not show orphelins files
@@ -856,6 +856,7 @@ class FormFile
print "\n";
}
}
+
if (count($filearray) == 0)
{
print '