Fix: If thirdparty module not enabled, company and contact fields must
not be visibles
This commit is contained in:
parent
fe469b83ab
commit
3aa9c75b0d
@ -786,16 +786,19 @@ if ($id)
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Company
|
// Thirdparty - Contact
|
||||||
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td>';
|
if ($conf->societe->enabled)
|
||||||
print '<td>';
|
{
|
||||||
print $form->select_company($act->societe->id,'socid','',1,1);
|
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td>';
|
||||||
print '</td>';
|
print '<td>';
|
||||||
|
print $form->select_company($act->societe->id,'socid','',1,1);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
// Contact
|
// Contact
|
||||||
print '<td>'.$langs->trans("Contact").'</td><td width="30%">';
|
print '<td>'.$langs->trans("Contact").'</td><td width="30%">';
|
||||||
print $form->selectarray("contactid", (empty($act->societe->id)?array():$act->societe->contact_array()), $act->contact->id, 1);
|
print $form->selectarray("contactid", (empty($act->societe->id)?array():$act->societe->contact_array()), $act->contact->id, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
@ -803,7 +806,7 @@ if ($id)
|
|||||||
// Projet associe
|
// Projet associe
|
||||||
$langs->load("project");
|
$langs->load("project");
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
|
print '<tr><td width="30%" valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
|
||||||
$numprojet=select_projects($act->societe->id,$act->fk_project,'projectid');
|
$numprojet=select_projects($act->societe->id,$act->fk_project,'projectid');
|
||||||
if ($numprojet==0)
|
if ($numprojet==0)
|
||||||
{
|
{
|
||||||
@ -813,7 +816,7 @@ if ($id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Priority
|
// Priority
|
||||||
print '<tr><td nowrap>'.$langs->trans("Priority").'</td><td colspan="3">';
|
print '<tr><td nowrap width="30%">'.$langs->trans("Priority").'</td><td colspan="3">';
|
||||||
print '<input type="text" name="priority" value="'.($act->priority?$act->priority:'').'" size="5">';
|
print '<input type="text" name="priority" value="'.($act->priority?$act->priority:'').'" size="5">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -958,39 +961,41 @@ if ($id)
|
|||||||
print '</table><br><br><table class="border" width="100%">';
|
print '</table><br><br><table class="border" width="100%">';
|
||||||
|
|
||||||
// Third party - Contact
|
// Third party - Contact
|
||||||
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
|
if ($conf->societe->enabled)
|
||||||
if ($act->societe->id && $act->type_code == 'AC_TEL')
|
|
||||||
{
|
{
|
||||||
if ($act->societe->fetch($act->societe->id))
|
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
|
||||||
|
if ($act->societe->id && $act->type_code == 'AC_TEL')
|
||||||
{
|
{
|
||||||
print "<br>".dol_print_phone($act->societe->tel);
|
if ($act->societe->fetch($act->societe->id))
|
||||||
}
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td>'.$langs->trans("Contact").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
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 "<br>".dol_print_phone($act->contact->phone_pro);
|
print "<br>".dol_print_phone($act->societe->tel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '<td>'.$langs->trans("Contact").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
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 "<br>".dol_print_phone($act->contact->phone_pro);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("None");
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
print $langs->trans("None");
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
|
print '<tr><td width="30%" valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
|
||||||
if ($act->fk_project)
|
if ($act->fk_project)
|
||||||
{
|
{
|
||||||
$project=new Project($db);
|
$project=new Project($db);
|
||||||
@ -1001,7 +1006,7 @@ if ($id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Priority
|
// Priority
|
||||||
print '<tr><td nowrap>'.$langs->trans("Priority").'</td><td colspan="3">';
|
print '<tr><td nowrap width="30%">'.$langs->trans("Priority").'</td><td colspan="3">';
|
||||||
print ($act->priority?$act->priority:'');
|
print ($act->priority?$act->priority:'');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user