Merge pull request #7344 from atm-florian/6.0_fixphotocateg

6.0 fixphotocateg
This commit is contained in:
Laurent Destailleur 2017-09-08 21:21:26 +02:00 committed by GitHub
commit 23c5b0366f

View File

@ -1540,20 +1540,33 @@ class Categorie extends CommonObject
dol_mkdir($dir); dol_mkdir($dir);
} }
if (file_exists($dir)) if (file_exists($dir)) {
{ if (is_array($file['name']) && count($file['name']) > 0) {
for($i = 0; $i <= count($file['name']); $i ++) {
$originImage = $dir . $file['name'][$i];
// Cree fichier en taille origine
dol_move_uploaded_file($file['tmp_name'][$i], $originImage, 1, 0, 0);
if (file_exists($originImage)) {
// Create thumbs
$this->addThumbs($originImage);
}
}
} else {
$originImage = $dir . $file['name']; $originImage = $dir . $file['name'];
// Cree fichier en taille origine // Cree fichier en taille origine
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0); dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
if (file_exists($originImage)) if (file_exists($originImage)) {
{
// Create thumbs // Create thumbs
$this->addThumbs($originImage); $this->addThumbs($originImage);
} }
} }
} }
}
/** /**
* Return tableau de toutes les photos de la categorie * Return tableau de toutes les photos de la categorie