diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index a10a76e2619..51fbf4e17fb 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -334,7 +334,7 @@ else * Derniers contrat * */ -if ($conf->contrat->enabled && 0) // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT +if ($conf->contrat->enabled && 0) // \todo A REFAIRE DEPUIS NOUVEAU CONTRAT { $langs->load("contracts"); @@ -385,27 +385,25 @@ if ($conf->contrat->enabled && 0) // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT if ($conf->propal->enabled) { $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut = 1"; - if ($socidp) - { - $sql .= " AND s.idp = $socidp"; - } + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c"; + $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut = 1"; + if ($socidp) $sql .= " AND s.idp = $socidp"; $sql .= " ORDER BY p.rowid DESC"; -// $sql .= $db->plimit(5, 0); - if ( $db->query($sql) ) + $result=$db->query($sql); + if ($result) { $total = 0; - $num = $db->num_rows(); + $num = $db->num_rows($result); $i = 0; if ($num > 0) { print ''; - print ''; + print ''; $var=false; while ($i < $num) { - $obj = $db->fetch_object(); + $obj = $db->fetch_object($result); print ""; print "\n"; print "
Propositions commerciales ouvertes et validées
'.$langs->trans("ProposalsOpened").'
propalid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref."idp\">".img_object($langs->trans("ShowCompany"),"company")." ".$obj->nom.""; @@ -430,15 +428,17 @@ if ($conf->propal->enabled) { */ if ($conf->propal->enabled) { - + $NBMAX=5; + $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut > 1"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c"; + $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut > 1"; if ($socidp) { $sql .= " AND s.idp = $socidp"; } $sql .= " ORDER BY p.rowid DESC"; - $sql .= $db->plimit(5, 0); + $sql .= $db->plimit($NBMAX, 0); if ( $db->query($sql) ) { @@ -446,7 +446,7 @@ if ($conf->propal->enabled) { $i = 0; print ''; - print ''; + print ''; $var=False; while ($i < $num) { @@ -455,7 +455,7 @@ if ($conf->propal->enabled) { print ''; - print "\n"; + print "\n"; $now = time(); $lim = 3600 * 24 * 15 ; diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index aeec527b98c..af1aaf6a2fe 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -3,6 +3,7 @@ Proposals=Commercial proposals Proposal=Commercial proposal ProposalsDraft=Draft commercial proposals ProposalDraft=Draft commercial proposal +ProposalsOpened=Opened commercial proposals Prop=Commercial proposals NewProp=New commercial proposal Prospect=Prospect @@ -11,6 +12,7 @@ DeleteProp=Delete commercial proposal AddProp=Add proposal ConfirmDeleteProp=Are you sure you want to delete this commercial proposal ? LastPropals=Last %s proposals +LastClosedProposals=Last %s closed proposals AllPropals=All proposals SearchAProposal=Search a proposal ProposalsStatistics=Commercial proposals' statistics diff --git a/htdocs/langs/fr_FR/propal.lang b/htdocs/langs/fr_FR/propal.lang index b5eec35b1a4..80b11d6e48f 100644 --- a/htdocs/langs/fr_FR/propal.lang +++ b/htdocs/langs/fr_FR/propal.lang @@ -4,6 +4,7 @@ Proposal=Proposition commerciale ProposalsDraft=Propositions commerciales brouillons ProposalDraft=Proposition commerciale brouillon Prop=Propositions commerc. +ProposalsOpened=Propositions commerciales ouvertes NewProp=Nouvelle proposition commerciale Prospect=Prospect ProspectList=Liste des prospects @@ -11,6 +12,7 @@ DeleteProp=Supprimer proposition AddProp=Créer proposition ConfirmDeleteProp=Etes-vous sûr de vouloir effacer cette proposition commerciale ? LastPropals=Les %s dernieres propales +LastClosedProposals=Les %s dernières propositions commerciales fermées AllPropals=Toutes les propales SearchAProposal=Rechercher une propale ProposalsStatistics=Statistiques des propositions commerciales
Les 5 dernières propositions commerciales fermées
'.$langs->trans("LastClosedProposals",$NBMAX).'
'; print ''.img_file().''; print ' '.$objp->ref.'idp\">$objp->nomidp\">$objp->nom