Fix: Corrige probleme affichage du nom du service dans fiche contrat.
This commit is contained in:
parent
47eeddf511
commit
2fd7d9c2d4
@ -1,5 +1,6 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -46,19 +47,19 @@ if ($action == 'add')
|
|||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($HTTP_POST_VARS["action"] == 'miseenservice')
|
if ($_POST["action"] == 'miseenservice')
|
||||||
{
|
{
|
||||||
$contrat = new Contrat($db);
|
$contrat = new Contrat($db);
|
||||||
$contrat->id = $id;
|
$contrat->id = $id;
|
||||||
$contrat->fetch($id);
|
$contrat->fetch($id);
|
||||||
$contrat->mise_en_service($user,
|
$contrat->mise_en_service($user,
|
||||||
mktime($HTTP_POST_VARS["rehour"],
|
mktime($_POST["rehour"],
|
||||||
$HTTP_POST_VARS["remin"],
|
$_POST["remin"],
|
||||||
0,
|
0,
|
||||||
$HTTP_POST_VARS["remonth"],
|
$_POST["remonth"],
|
||||||
$HTTP_POST_VARS["reday"],
|
$_POST["reday"],
|
||||||
$HTTP_POST_VARS["reyear"]),
|
$_POST["reyear"]),
|
||||||
$HTTP_POST_VARS["duration"]
|
$_POST["duration"]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,14 +74,14 @@ if ($action == 'update' && $cancel <> 'Annuler')
|
|||||||
{
|
{
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
|
|
||||||
$product->ref = $HTTP_POST_VARS["ref"];
|
$product->ref = $_POST["ref"];
|
||||||
$product->libelle = $HTTP_POST_VARS["libelle"];
|
$product->libelle = $_POST["libelle"];
|
||||||
$product->price = $HTTP_POST_VARS["price"];
|
$product->price = $_POST["price"];
|
||||||
$product->tva_tx = $HTTP_POST_VARS["tva_tx"];
|
$product->tva_tx = $_POST["tva_tx"];
|
||||||
$product->description = $HTTP_POST_VARS["desc"];
|
$product->description = $_POST["desc"];
|
||||||
$product->envente = $HTTP_POST_VARS["statut"];
|
$product->envente = $_POST["statut"];
|
||||||
$product->duration_value = $HTTP_POST_VARS["duration_value"];
|
$product->duration_value = $_POST["duration_value"];
|
||||||
$product->duration_unit = $HTTP_POST_VARS["duration_unit"];
|
$product->duration_unit = $_POST["duration_unit"];
|
||||||
|
|
||||||
if ( $product->update($id, $user))
|
if ( $product->update($id, $user))
|
||||||
{
|
{
|
||||||
@ -145,17 +146,8 @@ else
|
|||||||
|
|
||||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td width="20%">Service</td><td width="40%">'.$contrat->product->label_url.'</td>';
|
print '<td width="20%">Service</td><td colspan=4>'.($contrat->product->ref).' - '.($contrat->product->libelle).'</td>';
|
||||||
print '<td colspan="2">';
|
print '</tr><tr>';
|
||||||
if ($contrat->enservice)
|
|
||||||
{
|
|
||||||
print "En service";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "<b>Ce contrat n'est pas en service</b>";
|
|
||||||
}
|
|
||||||
print '</td></tr><tr>';
|
|
||||||
if ($contrat->factureid)
|
if ($contrat->factureid)
|
||||||
{
|
{
|
||||||
print '<td>Société</td><td>'.$contrat->societe->nom_url.'</td>';
|
print '<td>Société</td><td>'.$contrat->societe->nom_url.'</td>';
|
||||||
@ -166,6 +158,16 @@ else
|
|||||||
print '<td>Société</td><td colspan="4">'.$contrat->societe->nom_url.'</td></tr>';
|
print '<td>Société</td><td colspan="4">'.$contrat->societe->nom_url.'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<tr><td>Etat</td><td colspan="3">';
|
||||||
|
if ($contrat->enservice)
|
||||||
|
{
|
||||||
|
print "En service";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<b>Ce contrat n'est pas en service</b>";
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
if ($request == 'miseenservice')
|
if ($request == 'miseenservice')
|
||||||
{
|
{
|
||||||
print '<form action="fiche.php?id='.$id.'" method="post">';
|
print '<form action="fiche.php?id='.$id.'" method="post">';
|
||||||
@ -212,28 +214,19 @@ else
|
|||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
print '<br><table width="100%" id="actions" cellspacing="0" cellpadding="3">';
|
|
||||||
print '<td width="20%" align="center">-</td>';
|
|
||||||
|
|
||||||
if ($contrat->enservice)
|
print '<br>';
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
if (! $contrat->enservice)
|
||||||
{
|
{
|
||||||
print '<td width="20%" align="center">-</td>';
|
print '<a class="tabAction" href="fiche.php?request=miseenservice&id='.$id.'">Mise en service</a>';
|
||||||
}
|
}
|
||||||
else
|
elseif ($contrat->enservice == 1)
|
||||||
{
|
{
|
||||||
print '<td width="20%" align="center">[<a href="fiche.php?request=miseenservice&id='.$id.'">Mise en service</a>]</td>';
|
print '<a class="tabAction" href="fiche.php?action=cloture&id='.$id.'">Clôturer</a>';
|
||||||
}
|
}
|
||||||
print '<td width="20%" align="center">-</td>';
|
print '</div>';
|
||||||
print '<td width="20%" align="center">-</td>';
|
|
||||||
if ($contrat->enservice == 1)
|
|
||||||
{
|
|
||||||
print '<td width="20%" align="center">[<a href="fiche.php?action=cloture&id='.$id.'">Clôturer</a>]</td>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td width="20%" align="center">-</td>';
|
|
||||||
}
|
|
||||||
print '</table><br>';
|
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user