diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 08ff92a9fc4..63ccd938d02 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -84,70 +84,8 @@ print_fiche_titre($langs->trans("CommercialArea")); print ''; -print '
'; - -/* - * Actions commerciales a faire - * - */ - -$sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, c.code, c.libelle, a.fk_user_author, s.nom as sname, s.idp"; -$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s"; -$sql .= " WHERE c.id=a.fk_action AND a.percent < 100 AND s.idp = a.fk_soc"; -if ($socidp) -{ - $sql .= " AND s.idp = $socidp"; -} -$sql .= " ORDER BY a.datea ASC"; - -$resql=$db->query($sql); -if ($resql) -{ - $num = $db->num_rows($resql); - if ($num > 0) - { - print ''; - print ''; - $var = true; - $i = 0; - - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $var=!$var; - - print ""; - print "'; - print ""; - print '"; - - print ''; - $i++; - } - // TODO Ajouter rappel pour "il y a des contrats à mettre en service" - // TODO Ajouter rappel pour "il y a des contrats qui arrivent à expiration" - print "
'.$langs->trans("ActionsToDo").'
id\">".img_object($langs->trans("ShowTask"),"task"); - $transcode=$langs->trans("Action".$obj->code); - $libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle); - print $libelle; - print '".$obj->label."'. dolibarr_print_date($obj->da); - if (date("U",$obj->da) < time()) - { - print img_warning("Late"); - } - print "'.img_object($langs->trans("ShowCustomer"),"company").' '.$obj->sname.'

"; - } - $db->free($resql); -} -else -{ - dolibarr_print_error($db); -} - -print '
'; -print ''; - print '
'; + /* * Recherche Propal @@ -323,6 +261,65 @@ if ( $db->query($sql) ) print ''; +/* + * Actions commerciales a faire + * + */ + +$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.code, c.libelle, a.fk_user_author, s.nom as sname, s.idp"; +$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s"; +$sql .= " WHERE c.id=a.fk_action AND a.percent < 100 AND s.idp = a.fk_soc"; +if ($socidp) +{ + $sql .= " AND s.idp = $socidp"; +} +$sql .= " ORDER BY a.datea ASC"; + +$resql=$db->query($sql); +if ($resql) +{ + $num = $db->num_rows($resql); + if ($num > 0) + { + print ''; + print ''; + $var = true; + $i = 0; + + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $var=!$var; + + print ""; + print "'; + + print '"; + + print ''; + $i++; + } + // TODO Ajouter rappel pour "il y a des contrats à mettre en service" + // TODO Ajouter rappel pour "il y a des contrats qui arrivent à expiration" + print "
'.$langs->trans("ActionsToDo").'
id\">".img_object($langs->trans("ShowTask"),"task"); + $transcode=$langs->trans("Action".$obj->code); + $libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle); + print $libelle; + print ''. dolibarr_print_date($obj->da); + if (date("U",$obj->da) < time()) + { + print img_warning("Late"); + } + print "'.img_object($langs->trans("ShowCustomer"),"company").' '.$obj->sname.'

"; + } + $db->free($resql); +} +else +{ + dolibarr_print_error($db); +} + + /* * Derniers clients enregistrés */ @@ -370,6 +367,7 @@ if ($user->rights->societe->lire) } } + /* * Dernières actions commerciales effectuées */ @@ -421,6 +419,7 @@ else dolibarr_print_error($db); } + /* * Derniers contrat *