diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 12dc4ac3e9d..bc0031b5992 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -279,15 +279,13 @@ if (empty($reshook)) $action = 'edit'; } + if (! $error) + { + $contactid=GETPOST("contactid",'int'); + $object->fetch($contactid); - if (! $error) - { - $contactid=GETPOST("contactid",'int'); - - $object->fetch($contactid); - - // Photo save - $dir = $conf->societe->dir_output."/contact/".$object->id."/photos"; + // Photo save + $dir = $conf->societe->multidir_output[$object->entity]."/contact/".$object->id."/photos"; $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); if (GETPOST('deletephoto') && $object->photo) { diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index a016fa87b31..37b2436c226 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -1,6 +1,7 @@ - * Copyright (C) 2015 Frederic France +/* Copyright (C) 2014 Alexandre Spangaro + * Copyright (C) 2015 Frederic France + * Copyright (C) 2017 Regis Houssin * * 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 @@ -69,7 +70,7 @@ if (! $sortfield) $sortfield="name"; if ($id > 0) $object->fetch($id); -$upload_dir = $conf->societe->dir_output.'/contact/'.dol_sanitizeFileName($object->ref); +$upload_dir = $conf->societe->multidir_output[$object->entity].'/contact/'.dol_sanitizeFileName($object->ref); $modulepart='contact';