From 4683a35532b63219ea6268f308bd7fe4efdecfc1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Jan 2018 12:52:30 +0100 Subject: [PATCH] Fix: wrong image path with multicompany sharing --- htdocs/contact/card.php | 14 ++++++-------- htdocs/contact/document.php | 7 ++++--- 2 files changed, 10 insertions(+), 11 deletions(-) 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';