diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index c27ec52072acafdb7e4f1885d0bdb64be323986c..89dfa00dc80045ff5e306b7c2d50dbb1305fad16 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -88,8 +88,19 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update') } } +if ($_GET["action"] == 'removelogo') +{ + $logofile=$conf->societe->dir_logos.'/'.$mysoc->logo; + @unlink($logofile); + dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO"); +} + +/* + * Affichage page + */ + llxHeader(); $form = new Form($db); @@ -178,9 +189,11 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit') print '<tr '.$bc[$var].'><td>'.$langs->trans("Logo").' (png,jpg)</td><td>'; print '<table width="100%" class="notopnoleftnoright"><tr><td valign="center">'; print '<input type="file" class="flat" name="logo" size="30">'; - print '</td><td valign="center" align="right">'; - if (file_exists($conf->societe->dir_logos.'/'.$mysoc->logo)) + print '</td><td valign="middle" align="right">'; + if ($mysoc->logo && file_exists($conf->societe->dir_logos.'/'.$mysoc->logo)) { + print '<a href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a>'; + print ' '; print '<img height="30" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.$mysoc->logo.'">'; } else @@ -410,7 +423,7 @@ else print '<table width="100%" class="notopnoleftnoright"><tr><td valign="center">'; print $mysoc->logo; print '</td><td valign="center" align="right">'; - if (file_exists($conf->societe->dir_logos.'/'.$mysoc->logo)) + if ($mysoc->logo && file_exists($conf->societe->dir_logos.'/'.$mysoc->logo)) { print '<img height="30" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.$mysoc->logo.'">'; } diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php index fbdd6e18cb0f93bfd2f13ca2548103da23ae8710..ad18150c28f30204804ded5344a56601b8d286e5 100644 --- a/htdocs/includes/modules/commande/pdf_einstein.modules.php +++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php @@ -641,7 +641,7 @@ class pdf_einstein extends ModelePDFCommandes // Logo $logo=$conf->societe->dir_logos.'/'.$mysoc->logo; - if ($logo) + if ($mysoc->logo) { if (is_readable($logo)) {