diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index ab7fd2a510c..8342613208e 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -352,7 +352,7 @@ if ($action == 'update') $actioncomm->array_options[$key]=GETPOST($key); } } - + if (! $error) { $db->begin(); @@ -646,7 +646,7 @@ if ($id) $act = new ActionComm($db); $result=$act->fetch($id); $act->fetch_optionals($id,$extralabels); - + if ($result < 0) { dol_print_error($db,$act->error); @@ -786,16 +786,19 @@ if ($id) print '
| '.$langs->trans("ActionOnCompany").' | '; - print ''; - print $form->select_company($act->societe->id,'socid','',1,1); - print ' | '; + // Thirdparty - Contact + if ($conf->societe->enabled) + { + print '||
| '.$langs->trans("ActionOnCompany").' | '; + print ''; + print $form->select_company($act->societe->id,'socid','',1,1); + print ' | '; - // Contact - print ''.$langs->trans("Contact").' | '; - print $form->selectarray("contactid", (empty($act->societe->id)?array():$act->societe->contact_array()), $act->contact->id, 1); - print ' | '.$langs->trans("Contact").' | '; + print $form->selectarray("contactid", (empty($act->societe->id)?array():$act->societe->contact_array()), $act->contact->id, 1); + print ' | '; + } // Project if (! empty($conf->projet->enabled)) @@ -803,7 +806,7 @@ if ($id) // Projet associe $langs->load("project"); - print '
| '.$langs->trans("Project").' | '; + print ' | ||
| '.$langs->trans("Project").' | '; $numprojet=select_projects($act->societe->id,$act->fk_project,'projectid'); if ($numprojet==0) { @@ -813,7 +816,7 @@ if ($id) } // Priority - print ' | ||
| '.$langs->trans("Priority").' | '; + print ' | ||
| '.$langs->trans("Priority").' | '; print ''; print ' | ||
| '.$langs->trans("ActionOnCompany").' | '.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); - if ($act->societe->id && $act->type_code == 'AC_TEL') - { - if ($act->societe->fetch($act->societe->id)) + if ($conf->societe->enabled) + { + print ' | ||||
| '.$langs->trans("ActionOnCompany").' | '.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
+ if ($act->societe->id && $act->type_code == 'AC_TEL')
{
- print " ".dol_print_phone($act->societe->tel); - } - } - print ' | ';
- print ''.$langs->trans("Contact").' | '; - print '';
- if ($act->contact->id > 0)
- {
- print $act->contact->getNomUrl(1);
- if ($act->contact->id && $act->type_code == 'AC_TEL')
- {
- if ($act->contact->fetch($act->contact->id))
+ if ($act->societe->fetch($act->societe->id))
{
- print " ".dol_print_phone($act->contact->phone_pro); + print " ".dol_print_phone($act->societe->tel); } } + print ' | ';
+ print ''.$langs->trans("Contact").' | '; + print '';
+ if ($act->contact->id > 0)
+ {
+ print $act->contact->getNomUrl(1);
+ if ($act->contact->id && $act->type_code == 'AC_TEL')
+ {
+ if ($act->contact->fetch($act->contact->id))
+ {
+ print " ".dol_print_phone($act->contact->phone_pro); + } + } + } + else + { + print $langs->trans("None"); + } + print ' |
| '.$langs->trans("Project").' | '; + print ' | ||||
| '.$langs->trans("Project").' | '; if ($act->fk_project) { $project=new Project($db); @@ -1001,7 +1006,7 @@ if ($id) } // Priority - print ' | ||||
| '.$langs->trans("Priority").' | '; + print ' | ||||
| '.$langs->trans("Priority").' | '; print ($act->priority?$act->priority:''); print ' | ||||