From c73eb220d03506de8e2562d7c4ceb980e31303c9 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 9 Feb 2004 08:57:34 +0000 Subject: [PATCH] Renvoie vers la fiche prospect ou client suivant le type --- htdocs/comm/action/index.php | 67 +++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index ed72249c6d6..73bc21c85f9 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2004 Rodolphe Quiedeville * Copyright (C) 2003 Éric Seigne * Copyright (C) 2004 Laurent Destailleur * @@ -126,7 +126,7 @@ if ($sortfield == "") $sortfield="a.datea"; } -$sql = "SELECT s.nom as societe, s.idp as socidp,a.id,".$db->pdate("a.datea")." as da, a.datea, c.libelle, u.code, a.fk_contact, a.note, a.percent as percent"; +$sql = "SELECT s.nom as societe, s.idp as socidp, s.client, a.id,".$db->pdate("a.datea")." as da, a.datea, c.libelle, u.code, a.fk_contact, a.note, a.percent as percent"; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.rowid"; @@ -172,29 +172,30 @@ if ( $db->query($sql) ) print 'Société'; print 'Contact'; print "CommentairesAuteur"; - print "\n"; - $var=True; - while ($i < min($num,$limit)) { - $obj = $db->fetch_object( $i); - - $var=!$var; - - print ""; - - if ($oldyear == strftime("%Y",$obj->da) ) - { - print ' '; - } - else - { - print "" .strftime("%Y",$obj->da)."\n"; - $oldyear = strftime("%Y",$obj->da); - } - - if ($oldmonth == strftime("%Y%b",$obj->da) ) - { - print ' '; - } + print "\n"; + $var=True; + while ($i < min($num,$limit)) + { + $obj = $db->fetch_object( $i); + + $var=!$var; + + print ""; + + if ($oldyear == strftime("%Y",$obj->da) ) + { + print ' '; + } + else + { + print "" .strftime("%Y",$obj->da)."\n"; + $oldyear = strftime("%Y",$obj->da); + } + + if ($oldmonth == strftime("%Y%b",$obj->da) ) + { + print ' '; + } else { print "" .strftime("%b",$obj->da)."\n"; @@ -211,8 +212,20 @@ if ( $db->query($sql) ) } print ''.$obj->libelle.''; - print ''; - print ' '.$obj->societe.''; + print ''; + + if ($obj->client == 1) + { + print ' '.$obj->societe.''; + } + elseif ($obj->client == 2) + { + print ' '.$obj->societe.''; + } + else + { + print ' '.$obj->societe.''; + } /* * Contact */