Fix: [ bug #367 ] "Multi-tiers" fonctionality inverted in project

contacts.
This commit is contained in:
Laurent Destailleur 2012-04-21 19:44:05 +02:00
parent 80de63d5a3
commit afb79d5d2c
3 changed files with 10 additions and 8 deletions

View File

@ -506,7 +506,7 @@ class FormCompany
* @param string $var_id Name of id field
* @param string $selected Pre-selected third party
* @param string $htmlname Name of HTML form
* @param string $limitto Disable answers that are not id in this array list
* @param array $limitto Disable answers that are not id in this array list
* @param int $forceid This is to force antoher object id than object->id
* @return void
* TODO obsolete ?

View File

@ -248,8 +248,8 @@ if ($id > 0 || ! empty($ref))
print '</form>';
// Line to add external contact. Only if project is linked to a third party.
if ($project->societe->id)
{
//if ($project->societe->id)
//{
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addcontact">';
@ -265,12 +265,12 @@ if ($id > 0 || ! empty($ref))
print '<td colspan="1">';
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$project->societe->id;
$selectedCompany = $formcompany->selectCompaniesForNewContact($project, 'id', $selectedCompany, 'newcompany');
$selectedCompany = $formcompany->selectCompaniesForNewContact($project, 'id', $selectedCompany, 'newcompany', (empty($project->societe->id)?array():array($project->societe->id)));
print '</td>';
print '<td colspan="1">';
$nbofcontacts=$form->select_contacts($selectedCompany, '', 'contactid');
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
//if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
print '</td>';
print '<td>';
$formcompany->selectTypeContact($project, '', 'type','external','rowid');
@ -287,7 +287,7 @@ if ($id > 0 || ! empty($ref))
print '</tr>';
print "</form>";
}
//}
print '<tr><td colspan="6">&nbsp;</td></tr>';
}

View File

@ -416,7 +416,9 @@ else
// Customer
print '<tr><td>'.$langs->trans("Company").'</td><td>';
print $form->select_company($project->societe->id,'socid','',1,1);
$text=$form->select_company($project->societe->id,'socid','',1,1);
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");
print $form->textwithtooltip($text.' '.img_help(),$texthelp,1);
print '</td></tr>';
// Visibility
@ -449,7 +451,7 @@ else
print '<div align="center"><br>';
print '<input name="update" class="button" type="submit" value="'.$langs->trans("Modify").'"> &nbsp; ';
print '<input type="submit" class="button" name="cancel" Value="'.$langs->trans("Cancel").'"></div>';
print '</form>';
}
else