\n";
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index 07610bb88ba..9d5a707aac1 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -4,10 +4,9 @@
* Copyright (C) 2004-2013 Laurent Destailleur
* Copyright (C) 2005 Eric Seigne
* Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2008 Patrick Raguin
+ * Copyright (C) 2008 Patrick Raguin
* Copyright (C) 2010-2013 Juanjo Menent
- * Copyright (C) 2011-2013 Alexandre Spangaro
- *
+ * Copyright (C) 2011-2013 Alexandre Spangaro
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -280,7 +279,7 @@ if (empty($reshook))
}
}
- // Gestion du logo de la société
+ // Logo/Photo save
$dir = $conf->societe->multidir_output[$conf->entity]."/".$object->id."/logos/";
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
if ($file_OK)
@@ -311,6 +310,19 @@ if (empty($reshook))
}
}
}
+ else
+ {
+ switch($_FILES['photo']['error'])
+ {
+ case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini
+ case 2: //uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form
+ $errors[] = "ErrorFileSizeTooLarge";
+ break;
+ case 3: //uploaded file was only partially uploaded
+ $errors[] = "ErrorFilePartiallyUploaded";
+ break;
+ }
+ }
// Gestion du logo de la société
}
else
@@ -354,7 +366,7 @@ if (empty($reshook))
$error = $object->error; $errors = $object->errors;
}
- // Gestion du logo de la société
+ // Logo/Photo save
$dir = $conf->societe->multidir_output[$object->entity]."/".$object->id."/logos";
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
if ($file_OK)
@@ -393,10 +405,23 @@ if (empty($reshook))
}
}
else
- {
+ {
$errors[] = "ErrorBadImageFormat";
}
}
+ else
+ {
+ switch($_FILES['photo']['error'])
+ {
+ case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini
+ case 2: //uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form
+ $errors[] = "ErrorFileSizeTooLarge";
+ break;
+ case 3: //uploaded file was only partially uploaded
+ $errors[] = "ErrorFilePartiallyUploaded";
+ break;
+ }
+ }
// Gestion du logo de la société
@@ -855,7 +880,7 @@ else
{
print '