forked from Wavyzz/dolibarr
Merge pull request #7344 from atm-florian/6.0_fixphotocateg
6.0 fixphotocateg
This commit is contained in:
@@ -1540,17 +1540,30 @@ class Categorie extends CommonObject
|
||||
dol_mkdir($dir);
|
||||
}
|
||||
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$originImage = $dir . $file['name'];
|
||||
if (file_exists($dir)) {
|
||||
if (is_array($file['name']) && count($file['name']) > 0) {
|
||||
for($i = 0; $i <= count($file['name']); $i ++) {
|
||||
|
||||
// Cree fichier en taille origine
|
||||
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
|
||||
$originImage = $dir . $file['name'][$i];
|
||||
|
||||
if (file_exists($originImage))
|
||||
{
|
||||
// Create thumbs
|
||||
$this->addThumbs($originImage);
|
||||
// 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'];
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user