From 46d2e704a0b3e6c379161aef35659cb4984081a2 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 6 Sep 2005 10:24:22 +0000 Subject: [PATCH] Bugfix --- htdocs/telephonie/client/facture.php | 90 +++++++++++++++------------- 1 file changed, 50 insertions(+), 40 deletions(-) diff --git a/htdocs/telephonie/client/facture.php b/htdocs/telephonie/client/facture.php index d13d4fbd9af..133f0c60d7a 100644 --- a/htdocs/telephonie/client/facture.php +++ b/htdocs/telephonie/client/facture.php @@ -190,49 +190,55 @@ if ($_GET["facid"] > 0) $fac = New Facture($db); if ( $fac->fetch($_GET["facid"], $user->societe_id) > 0) - { - + { $soc = new Societe($db, $fac->socidp); $soc->fetch($fac->socidp); + + if (!$soc->perm_read) + { + print "Lecture non authorisée"; + } - $author = new User($db); - $author->id = $fac->user_author; - $author->fetch(); - - $h = 0; - - $head[$h][0] = DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$soc->id; - $head[$h][1] = $langs->trans("Fiche client"); - $h++; - - $head[$h][0] = DOL_URL_ROOT.'/telephonie/client/factures.php?id='.$soc->id; - $head[$h][1] = $langs->trans("Factures"); - $h++; - - $head[$h][0] = DOL_URL_ROOT.'/telephonie/client/facture.php?facid='.$fac->id; - $head[$h][1] = $langs->trans("CardBill"); - $hselected = $h; - $h++; - - dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref"); - - /* - * Facture - */ - print ''; - print ''; - print ''; - - print ""; - - print ''; - print "\n"; - print '"; - - print ''; - + if ($soc->perm_read) + { + $author = new User($db); + $author->id = $fac->user_author; + $author->fetch(); + + $h = 0; + + $head[$h][0] = DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$soc->id; + $head[$h][1] = $langs->trans("Fiche client"); + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/telephonie/client/factures.php?id='.$soc->id; + $head[$h][1] = $langs->trans("Factures"); + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/telephonie/client/facture.php?facid='.$fac->id; + $head[$h][1] = $langs->trans("CardBill"); + $hselected = $h; + $h++; + + dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref"); + + /* + * Facture + */ + print '
'.$langs->trans("Company").''; - print ''.$soc->nom.'Conditions de réglement" . $fac->cond_reglement ."
'.$langs->trans("Date").'".dolibarr_print_date($fac->date,"%A %d %B %Y")."'.$langs->trans("DateClosing").'' . dolibarr_print_date($fac->date_lim_reglement,"%A %d %B %Y"); - print "
'; + print ''; + print ''; + + print ""; + + print ''; + print "\n"; + print '"; + + print ''; + // Projet if ($conf->projet->enabled) { @@ -729,12 +735,16 @@ if ($_GET["facid"] > 0) print '
'; } + } + + } else { /* Facture non trouvée */ print $langs->trans("ErrorBillNotFound",$_GET["facid"]); } + } $db->close();
'.$langs->trans("Company").''; + print ''.$soc->nom.'Conditions de réglement" . $fac->cond_reglement ."
'.$langs->trans("Date").'".dolibarr_print_date($fac->date,"%A %d %B %Y")."'.$langs->trans("DateClosing").'' . dolibarr_print_date($fac->date_lim_reglement,"%A %d %B %Y"); + print "