From f1d5b708e17666bbc2b6ebb2ad8ac94dd2bd7009 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 7 Mar 2007 12:55:56 +0000 Subject: [PATCH] Ajout d'une confirmation de suppression des fichiers dans l'onglet document de la fiche tiers --- htdocs/docsoc.php | 18 ++++++++++++++---- htdocs/langs/en_US/companies.lang | 2 ++ htdocs/langs/fr_FR/companies.lang | 2 ++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/htdocs/docsoc.php b/htdocs/docsoc.php index 64e0b733f69..b953e8ff1d4 100644 --- a/htdocs/docsoc.php +++ b/htdocs/docsoc.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2005 Laurent Destailleur - * Copyright (C) 2005-2006 Regis Houssin + * Copyright (C) 2005-2007 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 @@ -89,7 +89,7 @@ if ( $_POST["sendit"] && $conf->upload != 0) } // Suppression fichier -if ($_GET["action"]=='delete') +if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes') { $file = $upload_dir . "/" . urldecode($_GET["urlfile"]); dol_delete_file($file); @@ -112,8 +112,19 @@ if ($socid > 0) */ $head = societe_prepare_head($societe); + $html=new Form($db); + dolibarr_fiche_head($head, 'document', $societe->nom); + /* + * Confirmation de la suppression d'une ligne produit + */ + if ($_GET['action'] == 'delete_file') + { + $html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); + print '
'; + } + // Construit liste des fichiers clearstatcache(); @@ -164,7 +175,6 @@ if ($socid > 0) if ($mesg) { print "$mesg
"; } // Affiche formulaire upload - $html=new Form($db); $html->form_attach_new_file('docsoc.php?socid='.$socid); // Affiche liste des documents existant @@ -185,7 +195,7 @@ if ($socid > 0) print ''.filesize($upload_dir."/".$file). ' '.$langs->trans("bytes").''; print ''.dolibarr_print_date(filemtime($upload_dir."/".$file),"%d %b %Y %H:%M:%S").''; print ''; - echo ''.img_delete().''; + echo ''.img_delete().''; print "\n"; } } diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index bd8801e0801..e204beaa90b 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -205,3 +205,5 @@ AddDeliveryAddress=Add address AddAddress=Add address NoOtherDeliveryAddress=No alternative delivery address defined JuridicalStatus200=Independant +DeleteFile=Delete file +ConfirmDeleteFile=Are you sure you want to delete this file? \ No newline at end of file diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index af96a74bea6..b2c53808247 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -206,3 +206,5 @@ AddDeliveryAddress=Ajouter l'adresse AddAddress=Ajouter adresse NoOtherDeliveryAddress=Pas d'adresses alternatives définies SupplierCategory=Catégorie du fournisseur +DeleteFile=Suppression d'un fichier +ConfirmDeleteFile=Êtes-vous sûr de vouloir supprimer ce fichier ? \ No newline at end of file