diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index d019e4004d8..399cc712297 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -321,6 +321,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $result=$object->update($user,0,$nosyncuser,$nosyncuserpass); if ($result >= 0 && ! count($object->errors)) { + // Logo/Photo save $dir= $conf->adherent->dir_output . '/' . get_exdir($object->id,2,0,1).'/photos'; $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); if ($file_OK) @@ -361,8 +362,21 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $errmsgs[] = "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; + } + } - $rowid=$object->id; + $rowid=$object->id; $action=''; if (! empty($backtopage)) @@ -848,11 +862,11 @@ else print ''.$langs->trans("PhoneMobile").''; // Skype - if (! empty($conf->skype->enabled)) + if (! empty($conf->skype->enabled)) { print ''.$langs->trans("Skype").''; } - + // Birthday print "".$langs->trans("Birthday")."\n"; $form->select_date(($object->naiss ? $object->naiss : -1),'naiss','','',1,'formsoc'); @@ -1093,7 +1107,7 @@ else if (! empty($conf->skype->enabled)) { print ''.$langs->trans("Skype").'skype).'">'; } - + // Birthday print "".$langs->trans("Birthday")."\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 ''.$langs->trans('Skype').''; } - + // Phone / Fax print ''.$langs->trans('Phone').''; print ''.$langs->trans('Fax').''; @@ -1273,13 +1298,13 @@ else // EMail / Web print ''.$langs->trans('EMail').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').''; print ''.$langs->trans('Web').''; - + // Skype if (! empty($conf->skype->enabled)) { print ''.$langs->trans('Skype').''; } - + // Phone / Fax print ''.$langs->trans('Phone').''; print ''.$langs->trans('Fax').''; @@ -1587,7 +1612,7 @@ else print ''.$langs->trans('Web').''; print dol_print_url($object->url); print ''; - + // Skype if (! empty($conf->skype->enabled)) {