diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 28fe6e65f6f..deed8a3d426 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -22,10 +22,10 @@ */ /** - \file htdocs/commande/fiche.php - \ingroup commande - \brief Fiche commande - \version $Revision$ + \file htdocs/commande/fiche.php + \ingroup commande + \brief Fiche commande + \version $Revision$ */ require("./pre.inc.php"); @@ -36,8 +36,7 @@ $langs->load("companies"); $user->getrights('commande'); $user->getrights('expedition'); -if (!$user->rights->commande->lire) - accessforbidden(); +if (!$user->rights->commande->lire) accessforbidden(); require("../project.class.php"); require("../propal.class.php"); @@ -53,7 +52,7 @@ if ($user->societe_id > 0) /* * */ -if ($_POST["action"] == 'classin') +if ($_POST["action"] == 'classin' && $user->rights->commande->creer) { $commande = new Commande($db); $commande->fetch($_GET["id"]); @@ -62,7 +61,7 @@ if ($_POST["action"] == 'classin') /* * */ -if ($_POST["action"] == 'add') +if ($_POST["action"] == 'add' && $user->rights->commande->creer) { $datecommande = mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); @@ -198,9 +197,8 @@ $html = new Form($db); * Mode creation * * - * ************************************************************************/ -if ($_GET["action"] == 'create') +if ($_GET["action"] == 'create' && $user->rights->commande->creer) { print_titre("Créer une commande"); @@ -220,12 +218,14 @@ if ($_GET["action"] == 'create') $sql .= "WHERE s.idp = ".$_GET["socidp"]; } - if ( $db->query($sql) ) + $resql = $db->query($sql); + + if ( $resql ) { - $num = $db->num_rows(); + $num = $db->num_rows($resql); if ($num) { - $obj = $db->fetch_object(); + $obj = $db->fetch_object($resql); $soc = new Societe($db); $soc->fetch($obj->idp); @@ -234,23 +234,24 @@ if ($_GET["action"] == 'create') print ''; print '' ."\n"; print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; + print ''; print '"; print ''; - print ''; + print ''; print ''; print '"; - print '"; + print '"; } else {
'.$langs->trans("Customer").' :'.$obj->nom.''.$langs->trans("Comments").' :
'.$langs->trans("Customer").' :'.$soc->nom_url.''.$langs->trans("Comments").' :
'.$langs->trans("Author").' :'.$user->fullname.''; - print '
'.$langs->trans("Date").' :'; $html->select_date(); print "
'.$langs->trans("Ref").' :Provisoire
'.$langs->trans("Source").' :'; $html->select_array("source_id",$new_commande->sources,2); @@ -274,7 +275,7 @@ if ($_GET["action"] == 'create') print '
'.$langs->trans("Ref").''.$obj->ref.'
'.$langs->trans("TotalTTC").''.price($amount).'
'.$langs->trans("VAT").''.price($obj->tva)."
'.$langs->trans("TotalTTC").''.price($obj->total)."
'.$langs->trans("TotalTTC").''.price($obj->total)."