From bdc0b01be055d94e127a4d44853802607451140a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Sep 2005 16:39:18 +0000 Subject: [PATCH] Fix: Pb register_global=off --- htdocs/comm/action/document.php | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 4f93ba59fab..24706eff488 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -41,20 +41,21 @@ $langs->load("commercial"); $langs->load("other"); $langs->load("bills"); +if (isset($_GET["error"])) $error=$_GET["error"]; +$upload_dir = $conf->actionscomm->dir_output.'/'.$_GET['id']; + // Sécurité accés client if ($user->societe_id > 0) { $action = ''; $socidp = $user->societe_id; } -if (isset($_GET["error"])) $error=$_GET["error"]; -$upload_dir = $conf->actionscomm->dir_output.'/'.$_GET['id']; /* * Action envoie fichier */ -if ( $_POST["sendit"] && $conf->upload) +if ( $_POST["sendit"] && $conf->upload ) { /* * Creation répertoire si n'existe pas @@ -77,8 +78,20 @@ if ( $_POST["sendit"] && $conf->upload) } } +/* + * Efface fichier + */ +if ($_GET["action"] == 'delete') +{ + $file = $upload_dir . '/' . urldecode($_GET['urlfile']); + dol_delete_file($file); +} +/* + * Affiche onglet + */ + llxHeader(); @@ -95,12 +108,6 @@ if ($_GET["id"] > 0) $res=$act->author->fetch(); // Le paramètre est le login, hors seul l'id est chargé. $res=$act->contact->fetch($act->contact->id); - if ($action=='delete') - { - $file = $upload_dir . '/' . urldecode($_GET['urlfile']); - dol_delete_file($file); - } - $h=0; $head[$h][0] = DOL_URL_ROOT.'/comm/action/fiche.php?id='.$_GET["id"]; @@ -221,14 +228,7 @@ if ($_GET["id"] > 0) print ''.filesize($upload_dir.'/'.$file). ' bytes'; print ''.strftime('%d %b %Y %H:%M:%S',filemtime($upload_dir.'/'.$file)).''; print ''; - if ($file == $propref . '.pdf') - { - echo '-'; - } - else - { - echo ''.img_delete($langs->trans('Delete')).''; - } + print ''.img_delete($langs->trans('Delete')).''; print "\n"; } }