diff --git a/htdocs/telephonie/ligne/fiche.php b/htdocs/telephonie/ligne/fiche.php index 6f0cbf5cebe..81e6e5a9b60 100644 --- a/htdocs/telephonie/ligne/fiche.php +++ b/htdocs/telephonie/ligne/fiche.php @@ -58,6 +58,17 @@ if ($_POST["action"] == 'add') } } +if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') +{ + $ligne = new LigneTel($db); + $ligne->fetch_by_id($_GET["id"]); + + if ( $ligne->delete($user) == 0) + { + Header("Location: index.php"); + } +} + if ($_POST["action"] == 'updateremise') { $ligne = new LigneTel($db); @@ -129,7 +140,6 @@ if ($_GET["action"] == 'refuse') { Header("Location: fiche.php?id=".$ligne->id); } - } if ($_GET["action"] == 'resilier') @@ -522,7 +532,22 @@ else dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero); print_fiche_titre('Fiche Ligne', $mesg); - + + /* + * + */ + if ($_GET["action"] == 'delete' && $ligne->statut == -1) + { + $html = new Form($db); + + $html->form_confirm("fiche.php"."?id=".$_GET["id"],"Suppression de ligne","Etes-vous sûr de vouloir supprimer la ligne : ".dolibarr_print_phone($ligne->numero)." ?","confirm_delete"); + print '
'; + } + + /* + * + */ + print ''; if ($ligne->contrat) @@ -554,8 +579,6 @@ else print $client->cp . " " .$client->ville; print ''; - - $client_facture = new Societe($db); $client_facture->fetch($ligne->client_facture_id); @@ -698,7 +721,6 @@ else } - /* * Edition @@ -862,10 +884,7 @@ else * * */ - - print ''; - print '
Remise LMN'.$ligne->remise.' %
Note'; print '