diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index d028322987a..f44aea29ed8 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -378,6 +378,7 @@ function clean_url($url,$http=1) return $CleanUrl; } + else return $url; } /** diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 7958c4d49ba..c35c85f87ea 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -451,6 +451,21 @@ if (empty($reshook)) } } } + + // Remove file in doc form + else if ($action == 'remove_file') + { + if ($object->fetch($socid)) + { + require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); + + $langs->load("other"); + $upload_dir = $conf->societe->dir_output; + $file = $upload_dir . '/' . GETPOST('file'); + dol_delete_file($file,0,0,0,$object); + $mesg = '
'.$langs->trans("FileWasRemoved",GETPOST('file')).'
'; + } + } }