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,17 +1540,30 @@ 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) {
$originImage = $dir . $file['name']; for($i = 0; $i <= count($file['name']); $i ++) {
// Cree fichier en taille origine $originImage = $dir . $file['name'][$i];
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
if (file_exists($originImage)) // Cree fichier en taille origine
{ dol_move_uploaded_file($file['tmp_name'][$i], $originImage, 1, 0, 0);
// Create thumbs
$this->addThumbs($originImage); if (file_exists($originImage)) {
// Create thumbs
$this->addThumbs($originImage);
}
}
} else {
$originImage = $dir . $file['name'];
// Cree fichier en taille origine
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
if (file_exists($originImage)) {
// Create thumbs
$this->addThumbs($originImage);
}
} }
} }
} }