Fix: meilleur mise en page si modules désactivés

This commit is contained in:
Regis Houssin 2009-04-29 09:39:12 +00:00
parent 86aea55e61
commit 974e0d36fe
2 changed files with 38 additions and 14 deletions

View File

@ -37,7 +37,6 @@ if (!$user->rights->societe->lire)
accessforbidden(); accessforbidden();
$langs->load("commercial"); $langs->load("commercial");
$langs->load("orders");
// Securite acces client // Securite acces client
$socid=''; $socid='';
@ -50,11 +49,6 @@ if ($user->societe_id > 0)
$max=5; $max=5;
if ($conf->propal->enabled) $propalstatic=new Propal($db);
/* /*
* Actions * Actions
*/ */
@ -97,7 +91,13 @@ print_fiche_titre($langs->trans("CustomerArea"));
print '<table border="0" width="100%" class="notopnoleftnoright">'; print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%" class="notopnoleft">'; print '<tr>';
if (($conf->propal->enabled && $user->rights->propale->lire) ||
($conf->contrat->enabled && $user->rights->contrat->lire) ||
($conf->commande->enabled && $user->rights->commande->lire))
{
print '<td valign="top" width="30%" class="notopnoleft">';
}
// Recherche Propal // Recherche Propal
if ($conf->propal->enabled && $user->rights->propale->lire) if ($conf->propal->enabled && $user->rights->propale->lire)
@ -202,6 +202,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
if ($conf->commande->enabled && $user->rights->commande->lire) if ($conf->commande->enabled && $user->rights->commande->lire)
{ {
$langs->load("orders"); $langs->load("orders");
$sql = "SELECT c.rowid, c.ref, c.total_ttc, s.rowid as socid, s.nom, s.client"; $sql = "SELECT c.rowid, c.ref, c.total_ttc, s.rowid as socid, s.nom, s.client";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
@ -250,7 +251,17 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
} }
} }
print '</td><td valign="top" width="70%" class="notopnoleftnoright">'; if (($conf->propal->enabled && $user->rights->propale->lire) ||
($conf->contrat->enabled && $user->rights->contrat->lire) ||
($conf->commande->enabled && $user->rights->commande->lire))
{
print '</td>';
print '<td valign="top" width="70%" class="notopnoleftnoright">';
}
else
{
print '<td valign="top" width="100%" class="notopnoleftnoright">';
}
@ -264,7 +275,6 @@ $max=3;
if ($conf->propal->enabled && $user->rights->propale->lire) if ($conf->propal->enabled && $user->rights->propale->lire)
{ {
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total_ht, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp"; $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total_ht, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p"; $sql.= ", ".MAIN_DB_PREFIX."propal as p";

View File

@ -99,12 +99,18 @@ print_fiche_titre($langs->trans("AccountancyTreasuryArea"));
print '<table border="0" width="100%" class="notopnoleftnoright">'; print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%" class="notopnoleft">'; print '<tr>';
if (($conf->facture->enabled && $user->rights->facture->lire) ||
($conf->fournisseur->enabled && $user->rights->fournisseur->lire))
{
print '<td valign="top" width="30%" class="notopnoleft">';
}
/* /*
* Find invoices * Find invoices
*/ */
if ($conf->facture->enabled) if ($conf->facture->enabled && $user->rights->facture->lire)
{ {
print '<form method="post" action="'.DOL_URL_ROOT.'/compta/facture.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/compta/facture.php">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -117,7 +123,7 @@ if ($conf->facture->enabled)
print "</table></form><br>"; print "</table></form><br>";
} }
if ($conf->fournisseur->enabled) if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire)
{ {
print '<form method="post" action="'.DOL_URL_ROOT.'/fourn/facture/index.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/fourn/facture/index.php">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -279,8 +285,16 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
} }
} }
if (($conf->facture->enabled && $user->rights->facture->lire) ||
print '</td><td valign="top" width="70%" class="notopnoleftnoright">'; ($conf->fournisseur->enabled && $user->rights->fournisseur->lire))
{
print '</td>';
print '<td valign="top" width="70%" class="notopnoleftnoright">';
}
else
{
print '<td valign="top" width="100%" class="notopnoleftnoright">';
}
// Last customers // Last customers