diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index d27756e95ad..1691cb32ee6 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -28,12 +28,11 @@ */ require("./pre.inc.php"); +if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); +if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); if (!$user->rights->commercial->main->lire) accessforbidden(); - -if ($conf->contrat->enabled) - require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); $langs->load("commercial"); $langs->load("orders"); @@ -49,7 +48,10 @@ if ($user->societe_id > 0) $max=5; -llxHeader(); + +$propalstatic=new Propal($db); + + /* * Actions @@ -80,16 +82,15 @@ if (isset($_GET["action"]) && $_GET["action"] == 'del_bookmark') * Affichage page */ +llxHeader(); + print_fiche_titre($langs->trans("CommercialArea")); print ''; print '
'; - -/* - * Recherche Propal - */ +// Recherche Propal if ($conf->propal->enabled && $user->rights->propale->lire) { $var=false; @@ -547,7 +548,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) $var=true; print ''; - print ''; + print ''; while ($i < $num) { $obj = $db->fetch_object($result); @@ -558,12 +559,14 @@ if ($conf->propal->enabled && $user->rights->propale->lire) print "\n"; print "\n"; - print "\n"; + print ""; + print "\n"; + print "\n"; $i++; $total += $obj->price; } if ($total>0) { - print '"; + print '"; } print "
'.$langs->trans("ProposalsOpened").'
'.$langs->trans("ProposalsOpened").'
idp\">".img_object($langs->trans("ShowCompany"),"company")." ".dolibarr_trunc($obj->nom,44).""; print dolibarr_print_date($obj->dp)."".price($obj->price)."
".price($obj->price)."".$propalstatic->LibStatut($objp->fk_statut,3)."
'.$langs->trans("Total")."".price($total)."
'.$langs->trans("Total")."".price($total)." 

"; } @@ -595,9 +598,6 @@ if ($conf->propal->enabled && $user->rights->propale->lire) { $sql .= " ORDER BY p.rowid DESC"; $sql .= $db->plimit($NBMAX, 0); - include_once(DOL_DOCUMENT_ROOT."/propal.class.php"); - $propalstatic=new Propal($db); - if ( $db->query($sql) ) { $num = $db->num_rows();