diff --git a/htdocs/telephonie/adsl/fiche.php b/htdocs/telephonie/adsl/fiche.php
index 03220bef875..1444e536158 100644
--- a/htdocs/telephonie/adsl/fiche.php
+++ b/htdocs/telephonie/adsl/fiche.php
@@ -113,7 +113,19 @@ if ($_GET["action"] == 'resilier')
$ligne = new LigneAdsl($db);
$ligne->fetch_by_id($_GET["id"]);
- if ( $ligne->set_statut($user, 4) == 0)
+ $datea = $db->idate(mktime($h, $m , $s,
+ $_POST["remonth"],
+ $_POST["reday"],
+ $_POST["reyear"]));
+
+ if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 4)
+ {
+ if ( $ligne->set_statut($user, 5, $datea, $_POST["commentaire"]) == 0)
+ {
+ Header("Location: fiche.php?id=".$ligne->id);
+ }
+ }
+ else
{
Header("Location: fiche.php?id=".$ligne->id);
}
@@ -124,7 +136,60 @@ if ($_GET["action"] == 'annuleresilier')
$ligne = new LigneAdsl($db);
$ligne->fetch_by_id($_GET["id"]);
- if ( $ligne->set_statut($user, 3) == 0)
+ if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 5)
+ {
+ if ( $ligne->set_statut($user, 4) == 0)
+ {
+ Header("Location: fiche.php?id=".$ligne->id);
+ }
+ }
+ else
+ {
+ Header("Location: fiche.php?id=".$ligne->id);
+ }
+}
+
+if ($_GET["action"] == 'resilierfourn')
+{
+ $ligne = new LigneAdsl($db);
+ $ligne->fetch_by_id($_GET["id"]);
+
+ $datea = $db->idate(mktime($h, $m , $s,
+ $_POST["remonth"],
+ $_POST["reday"],
+ $_POST["reyear"]));
+
+ if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 5)
+ {
+ if ( $ligne->set_statut($user, 6, $datea, $_POST["commentaire"]) == 0)
+ {
+ Header("Location: fiche.php?id=".$ligne->id);
+ }
+ }
+ else
+ {
+ Header("Location: fiche.php?id=".$ligne->id);
+ }
+}
+
+if ($_GET["action"] == 'acquitresilierfourn')
+{
+ $ligne = new LigneAdsl($db);
+ $ligne->fetch_by_id($_GET["id"]);
+
+ $datea = $db->idate(mktime($h, $m , $s,
+ $_POST["remonth"],
+ $_POST["reday"],
+ $_POST["reyear"]));
+
+ if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 6)
+ {
+ if ( $ligne->set_statut($user, 7, $datea, $_POST["commentaire"]) == 0)
+ {
+ Header("Location: fiche.php?id=".$ligne->id);
+ }
+ }
+ else
{
Header("Location: fiche.php?id=".$ligne->id);
}
@@ -606,13 +671,13 @@ else
}
}
+$form = new Form($db);
if ( $user->rights->telephonie->adsl->commander && $ligne->statut == 1)
{
/**
*
*/
- $form = new Form($db);
print '
';
@@ -636,7 +701,6 @@ if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 2)
/**
*
*/
- $form = new Form($db);
print '';
@@ -667,7 +731,6 @@ if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 3)
/**
*
*/
- $form = new Form($db);
print '| ';
@@ -684,6 +747,50 @@ if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 3)
print ' | ';
}
+if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 4)
+{
+ print '';
+}
+
+if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 5)
+{
+ print '';
+}
+
+if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 6)
+{
+ print '';
+}
/* ************************************************************************** */
/* */
@@ -707,6 +814,12 @@ if ($_GET["action"] == '')
}
+ if ( $user->rights->telephonie->adsl->requete && $ligne->statut == 5)
+ {
+ print "id\">".$langs->trans("Annuler la demande de résiliation")."";
+
+ }
+
if ( $user->rights->telephonie->adsl->creer && $ligne->statut == -1)
{
print "id\">".$langs->trans("Delete")."";
|
|