diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index e9341ed4bb7..fc053e3cff3 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -423,93 +423,108 @@ if ($_socid > 0) * * */ - if ($action == 'changevalue') { - print "
"; - print "
id\" method=\"post\">"; - print ""; - print "Cette société est un cabinet de recrutement : "; - print ""; - print "trans("Valid")."\">"; - print "
\n"; - } else { - /* - * - * Liste des contacts - * - */ - if (defined("MAIN_MODULE_CLICKTODIAL") && MAIN_MODULE_CLICKTODIAL==1) - { - $user->fetch_clicktodial(); // lecture des infos de clicktodial - } - print ''; + if ($action == 'changevalue') + { + print "
"; + print "id\" method=\"post\">"; + print ""; + print "Cette société est un cabinet de recrutement : "; + print ""; + print "trans("Valid")."\">"; + print "\n"; + } + else + { + /* + * + * Liste des contacts + * + */ + if (defined("MAIN_MODULE_CLICKTODIAL") && MAIN_MODULE_CLICKTODIAL==1) + { + $user->fetch_clicktodial(); // lecture des infos de clicktodial + } + print '
'; + + print ''; + print ''; + print ''; + print ""; + print ''; + print ""; + + $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note FROM ".MAIN_DB_PREFIX."socpeople as p WHERE p.fk_soc = $objsoc->id ORDER by p.datec"; + $result = $db->query($sql); + $i = 0 ; $num = $db->num_rows(); $tag = True; + while ($i < $num) + { + $obj = $db->fetch_object(); + $var = !$var; + print ""; + + print '"; + print ""; + print ''; - print ''; - print ''; - print ""; - print ''; - print ""; - - $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note FROM ".MAIN_DB_PREFIX."socpeople as p WHERE p.fk_soc = $objsoc->id ORDER by p.datec"; - $result = $db->query($sql); - $i = 0 ; $num = $db->num_rows(); $tag = True; - while ($i < $num) - { - $obj = $db->fetch_object(); - $var = !$var; - print ""; - - print '"; - print ""; - print ''; - print ''; - print ''; - - print ''; - - print ''; - - print "\n"; - $i++; - $tag = !$tag; - } - print "
'.$langs->trans("Firstname").' '.$langs->trans("Lastname").''.$langs->trans("Poste").''.$langs->trans("Tel").''.$langs->trans("Fax").''.$langs->trans("EMail").'id."&action=create\">".$langs->trans("AddContact")." 
'; + print ''; + print img_file(); + print ' '.$obj->firstname.' '. $obj->name.' '; + + if ($obj->note) + { + print "
".nl2br($obj->note); + } + print "
$obj->poste '; - print '
'.$langs->trans("Firstname").' '.$langs->trans("Lastname").''.$langs->trans("Poste").''.$langs->trans("Tel").''.$langs->trans("Fax").''.$langs->trans("EMail").'id."&action=create\">".$langs->trans("AddContact")." 
'; - print ''; - print img_file(); - print ' '.$obj->firstname.' '. $obj->name.' '; - - if ($obj->note) - { - print "
".nl2br($obj->note); - } - print "
$obj->poste '.dolibarr_print_phone($obj->phone).' '.dolibarr_print_phone($obj->fax).' '.$obj->email.' '; - print "idp\">"; - print img_edit(); - print ''; - print img_actions(); - print '
"; - - print "
"; - - /* - * Listes des actions a faire - * - */ - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + + print ''; + + print ''; + + print "\n"; + $i++; + $tag = !$tag; + } + print "
'.$langs->trans("ActionsToDo").' '.$langs->trans("AddActionToDo").'
'; - - $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; - $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; - $sql .= " WHERE a.fk_soc = $objsoc->id "; - $sql .= " AND u.rowid = a.fk_user_author"; - $sql .= " AND c.id=a.fk_action AND a.percent < 100"; - $sql .= " ORDER BY a.datea DESC, a.id DESC"; + /* + * Lien click to dial + */ + + if (strlen($obj->phone) && $user->clicktodial_enabled == 1) + { + print ''; + print img_phone_out("Appel émis") ; + } + print ''; + print ''.dolibarr_print_phone($obj->phone).' '.dolibarr_print_phone($obj->fax).' '.$obj->email.' '; + print "idp\">"; + print img_edit(); + print ''; + print img_actions(); + print '
"; + + print "
"; + + /* + * Listes des actions a faire + * + */ + print ''; + print ''; + print ''; + print '
'.$langs->trans("ActionsToDo").' '.$langs->trans("AddActionToDo").'
'; + + $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; + $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; + $sql .= " WHERE a.fk_soc = $objsoc->id "; + $sql .= " AND u.rowid = a.fk_user_author"; + $sql .= " AND c.id=a.fk_action AND a.percent < 100"; + $sql .= " ORDER BY a.datea DESC, a.id DESC"; if ( $db->query($sql) ) { print "\n";