diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 04b104ff0f1..831b0f50f04 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -870,7 +870,7 @@ class FormFile // Show share link $out .= ''; - if ($file['share']) { + if (!empty($file['share'])) { // Define $urlwithroot $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index d2ad361034f..1bf43864cdd 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -6,6 +6,7 @@ * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2015 Marcos García + * Copyright (C) 2021 Frédéric France * * 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 @@ -129,8 +130,8 @@ if ($socid) { print dol_get_fiche_end(); $params = ''; - - $newcardbutton .= dolGetButtonTitle($langs->trans("NewProject"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?action=create&socid='.$object->id.'&backtopage='.urlencode($backtopage), '', 1, $params); + $backtopage = $_SERVER['PHP_SELF'].'?socid='.$object->id; + $newcardbutton = dolGetButtonTitle($langs->trans("NewProject"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?action=create&socid='.$object->id.'&backtopage='.urlencode($backtopage), '', 1, $params); print '
';