diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 1665e0cfdaf..6f7109a3ef0 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -126,7 +126,6 @@ if ($mode == 'search') { llxHeader('',$langs->trans('CustomerCard')); -$contactstatic = new Contact($db); $userstatic=new User($db); $form = new Form($db); @@ -633,98 +632,10 @@ if ($socid > 0) print ''; print '
'; - /* - * + /* * Liste des contacts - * */ - if ($conf->clicktodial->enabled) - { - $user->fetch_clicktodial(); // lecture des infos de clicktodial - } - - print_titre($langs->trans("ContactsForCompany")); - print ''; - - print ''; - print ''; - print ''; - print ""; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - { - print ''; - } - print ""; - - $sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note "; - $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; - $sql .= " WHERE p.fk_soc = ".$objsoc->id; - $sql .= " ORDER by p.datec"; - - $result = $db->query($sql); - $i = 0; - $num = $db->num_rows($result); - $var=true; - - while ($i < $num) - { - $obj = $db->fetch_object($result); - $var = !$var; - - print ""; - - print ''; - - print ''; - - // Lien click to dial - print ''; - print ''; - print ''; - - print ''; - - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - { - print ''; - } - - print "\n"; - $i++; - } - print "
'.$langs->trans("Name").''.$langs->trans("Poste").''.$langs->trans("Tel").''.$langs->trans("Fax").''.$langs->trans("EMail").'  
'; - $contactstatic->id = $obj->rowid; - $contactstatic->name = $obj->name; - $contactstatic->firstname = $obj->firstname; - print $contactstatic->getNomUrl(1); - print ''.$obj->poste.''; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print dolibarr_print_phone($obj->phone); - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - if ($obj->phone) print dol_phone_link($obj->phone); - print ''; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print dolibarr_print_phone($obj->fax); - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print ' '; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print $obj->email; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print ' '; - print "rowid."\">"; - print img_edit(); - print ''; - print img_object($langs->trans("Rendez-Vous"),"action"); - print '
"; - - print "
"; - + show_contacts($conf,$langs,$db,$objsoc); /* * Listes des actions a faire diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php index 36414fcc5c5..14afd2b57bc 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -247,118 +247,20 @@ if ($socid > 0) print '
'; - - if ($conf->clicktodial->enabled) - { - $user->fetch_clicktodial(); // lecture des infos de clicktodial - } - - - /* - * - * Liste des contacts - * - */ - print ''; - - print ''; - print ''; - print ''; - print ""; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - { - print ''; - } - print ""; - - $sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; - $sql.= " WHERE p.fk_soc = ".$societe->id; - $sql.= " ORDER by p.datec"; - - $result = $db->query($sql); - $i = 0 ; $num = $db->num_rows($result); - $var=1; - while ($i < $num) - { - $obj = $db->fetch_object($result); - $var = !$var; - - print ""; - - print ''; - print ''; - - // Phone - print ''; - - // Fax - print ''; - print ''; - - print ''; - - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - { - 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").'  
'; - print ''.img_object($langs->trans("ShowContact"),"contact").' '.$obj->firstname.' '. $obj->name.' '; - - if (trim($obj->note)) - { - print '
'.nl2br(trim($obj->note)); - } - print '
'.$obj->poste.' '; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print dolibarr_print_phone($obj->phone,''); - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - if ($obj->phone) print dol_phone_link($obj->phone); - print ''; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print dolibarr_print_phone($obj->fax); - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print ' '; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print $obj->email; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print ' '; - - if ($user->rights->societe->contact->creer) - { - print "rowid."\">"; - print img_edit(); - print ''; - } - else print ' '; - - print ''; - print ''; - print img_object($langs->trans("Rendez-Vous"),"action"); - print '
"; - - print "
"; - - /* - * Listes des actions a faire - */ - show_actions_todo($conf,$langs,$db,$societe); - - /* - * Listes des actions effectuees - */ - show_actions_done($conf,$langs,$db,$societe); + /* + * Liste des contacts + */ + show_contacts($conf,$langs,$db,$societe); + + /* + * Listes des actions a faire + */ + show_actions_todo($conf,$langs,$db,$societe); + + /* + * Listes des actions effectuees + */ + show_actions_done($conf,$langs,$db,$societe); } $db->close(); diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php index 255d8495c67..d411136b57a 100644 --- a/htdocs/compta/fiche.php +++ b/htdocs/compta/fiche.php @@ -358,96 +358,11 @@ if ($socid > 0) print ''; print "
\n"; - /* - * + + /* * Liste des contacts - * */ - print_titre($langs->trans("ContactsForCompany")); - print ''; - - print ''; - print ''; - print ''; - print ""; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - { - print ''; - } - print ""; - - $sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; - $sql.= " WHERE p.fk_soc = ".$societe->id; - $sql.= " ORDER by p.datec"; - - $result = $db->query($sql); - $i = 0 ; $num = $db->num_rows($result); - $var=1; - while ($i < $num) - { - $obj = $db->fetch_object($result); - $var = !$var; - - print ""; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - { - print ''; - } - print "\n"; - $i++; - $tag = !$tag; - } - print "
'.$langs->trans("Name").''.$langs->trans("Poste").''.$langs->trans("Tel").''.$langs->trans("Fax").''.$langs->trans("EMail").'  
'; - print ''.img_object($langs->trans("ShowContact"),"contact").' '.$obj->firstname.' '. $obj->name.' '; - - if (trim($obj->note)) - { - print '
'.nl2br(trim($obj->note)); - } - print '
'.$obj->poste.' '; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print $obj->phone; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - if ($obj->phone) print dol_phone_link($obj->phone); - print ''; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print $obj->fax; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print ''; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print $obj->email; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) - print ''; - print ' '; - - if ($user->rights->societe->contact->creer) - { - print "rowid."\">"; - print img_edit(); - print ''; - } - else print ' '; - - print ''; - print img_object($langs->trans("Rendez-Vous"),"action"); - print '
"; - - print "
"; - + show_contacts($conf,$langs,$db,$societe); /* * Listes des actions a faire diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 2a4f4e0a0ed..96a3bf2a124 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -277,76 +277,12 @@ if ( $societe->fetch($socid) ) } print ''; - + print '
'; /* - * - * Liste des contacts - * - */ - $langs->load("companies"); - - print '
'; - - print_titre($langs->trans("ContactsForCompany")); - print ''; - - print ''; - print ''; - print ""; - print ""; - print ''; - print ""; - - $sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; - $sql.= " WHERE p.fk_soc = ".$societe->id; - $sql.= " ORDER by p.datec"; - - $result = $db->query($sql); - - $i = 0 ; - $num = $db->num_rows($result); - $var=true; - - while ($i < $num) - { - $obj = $db->fetch_object($result); - $var = !$var; - - print ""; - - print '"; - print ""; - print ''; - print ''; - print ''; - - if ($user->rights->societe->contact->creer) - { - print ""; - } - - print ''; - - print "\n"; - $i++; - } - print '
'.$langs->trans("Name").''.$langs->trans("Poste").''.$langs->trans("Tel").'".$langs->trans("Fax")."".$langs->trans("EMail")."  
'; - print ''; - print img_object($langs->trans("ShowContact"),"contact"); - print ' '.$obj->firstname.' '. $obj->name.' '; - - if ($obj->note) - { - print "
".nl2br($obj->note); - } - print "
$obj->poste '.$obj->phone.''; - if ($obj->phone) print dol_phone_link($obj->phone); - print ''.$obj->fax.''.$obj->email.'rowid."\">".img_edit()."'; - print img_object($langs->trans("Rendez-Vous"),"action"); - print '
'; - print '
'; + * Liste des contacts + */ + show_contacts($conf,$langs,$db,$societe); /* * Listes des actions a faire diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index cf1dc3b7528..c422f9e32db 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -251,8 +251,8 @@ ActionsDone=Actions done ActionsToDoShort=To do ActionsDoneShort=Done CompanyFundation=Company/Fundation -ContactsForCompany=Contacts for company -ActionsOnCompany=Actions about company +ContactsForCompany=Contacts for this third party +ActionsOnCompany=Actions about this third party NActions=%s actions NActionsLate=%s late Filter=Filter diff --git a/htdocs/langs/fr_BE/main.lang b/htdocs/langs/fr_BE/main.lang index da156fe3fc1..ee4715968e0 100644 --- a/htdocs/langs/fr_BE/main.lang +++ b/htdocs/langs/fr_BE/main.lang @@ -208,8 +208,8 @@ ActionsDone=Actions effectu ActionsToDoShort=À faire ActionsDoneShort=Effectué CompanyFundation=Entreprise/Fondation -ContactsForCompany=Contacts pour l'entreprise -ActionsOnCompany=Actions à propos de l'entreprise +ContactsForCompany=Contacts de ce tiers +ActionsOnCompany=Actions vis à vis de ce tiers NActions=%s actions NActionsLate=%s en retard Filter=Filtre diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 15a4344ffd8..de62a39d84a 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -252,8 +252,8 @@ ActionsDone=Actions effectu ActionsToDoShort=À faire ActionsDoneShort=Effectuées CompanyFundation=Société ou institution -ContactsForCompany=Contacts de cette société -ActionsOnCompany=Actions vis à vis de cette société +ContactsForCompany=Contacts de ce tiers +ActionsOnCompany=Actions vis à vis de ce tiers NActions=%s actions NActionsLate=%s en retard Filter=Filtre diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index 031df2beae1..3d4450e6020 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -225,6 +225,116 @@ function getFormeJuridiqueLabel($code) } +/** + * \brief Show html area for list of contacts + */ +function show_contacts($conf,$langs,$db,$objsoc) +{ + global $user; + global $bc; + + $contactstatic = new Contact($db); + + if ($conf->clicktodial->enabled) + { + $user->fetch_clicktodial(); // lecture des infos de clicktodial + } + + print_titre($langs->trans("ContactsForCompany")); + print ''; + + print ''; + print ''; + print ''; + print ""; + if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) + { + print ''; + } + print ""; + + $sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note "; + $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; + $sql .= " WHERE p.fk_soc = ".$objsoc->id; + $sql .= " ORDER by p.datec"; + + $result = $db->query($sql); + $i = 0; + $num = $db->num_rows($result); + $var=true; + + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + $var = !$var; + + print ""; + + print ''; + + print ''; + + // Lien click to dial + print ''; + print ''; + print ''; + + print ''; + + if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) + { + print ''; + } + + print "\n"; + $i++; + } + } + else + { + //print ""; + //print ''; + //print "\n"; + } + print "
'.$langs->trans("Name").''.$langs->trans("Poste").''.$langs->trans("Tel").''.$langs->trans("Fax").''.$langs->trans("EMail").'  
'; + $contactstatic->id = $obj->rowid; + $contactstatic->name = $obj->name; + $contactstatic->firstname = $obj->firstname; + print $contactstatic->getNomUrl(1); + print ''.$obj->poste.''; + if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) + print ''; + print dolibarr_print_phone($obj->phone); + if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) + print ''; + if ($obj->phone) print dol_phone_link($obj->phone); + print ''; + if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) + print ''; + print dolibarr_print_phone($obj->fax); + if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) + print ''; + print ' '; + if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) + print ''; + print $obj->email; + if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) + print ''; + // \TODO + //if ($obj->email) print dol_email_link($obj->email); + print ' '; + print "rowid."\">"; + print img_edit(); + print ''; + print img_object($langs->trans("Rendez-Vous"),"action"); + print '
'.$langs->trans("NoContactsYetDefined").'
\n"; + + print "
\n"; +} + + /** * \brief Show html area with actions to do */ @@ -349,9 +459,9 @@ function show_actions_todo($conf,$langs,$db,$objsoc) { dolibarr_print_error($db); } - print ""; + print "\n"; - print "
"; + print "
\n"; } } @@ -449,7 +559,7 @@ function show_actions_done($conf,$langs,$db,$objsoc) print ''; // Libelle - print ''.$obj->label.''; + print ''.$obj->label.''; // Contact pour cette action if ($obj->fk_contact > 0) @@ -472,7 +582,7 @@ function show_actions_done($conf,$langs,$db,$objsoc) print ''; // Statut - print ''.$actionstatic->LibStatut($obj->percent,3).''; + print ''.$actionstatic->LibStatut($obj->percent,3).''; print "\n"; $i++; @@ -485,7 +595,8 @@ function show_actions_done($conf,$langs,$db,$objsoc) dolibarr_print_error($db); } - print "
"; + print "\n"; + print "
\n"; } } ?> diff --git a/htdocs/soc.php b/htdocs/soc.php index b9955cd5713..ef6aa7130b7 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -1201,8 +1201,9 @@ else print ''; print ''; print "\n"; + /* - * + * Actions */ if ($_GET["action"] == '') { @@ -1240,12 +1241,16 @@ else } print ''; + print '
'; } + /* + * Liste des contacts + */ + show_contacts($conf,$langs,$db,$soc); } $db->close(); - llxFooter('$Date$ - $Revision$'); ?>