Merge pull request #10251 from ATM-Marc/FIX_7.0_contact_change

FIX: contact/address tab issue when changing company
This commit is contained in:
Laurent Destailleur 2018-12-19 12:59:32 +01:00 committed by GitHub
commit 2978522006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -1355,7 +1355,7 @@ class Form
$out .= ajax_combobox($htmlid, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT); $out .= ajax_combobox($htmlid, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
} }
if ($htmlname != 'none' || $options_only) $out.= '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlid.'" name="'.$htmlname.'" '.(!empty($moreparam) ? $moreparam : '').'>'; if ($htmlname != 'none' && ! $options_only) $out.= '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlid.'" name="'.$htmlname.'" '.(!empty($moreparam) ? $moreparam : '').'>';
if ($showempty == 1) $out.= '<option value="0"'.($selected=='0'?' selected':'').'>&nbsp;</option>'; if ($showempty == 1) $out.= '<option value="0"'.($selected=='0'?' selected':'').'>&nbsp;</option>';
if ($showempty == 2) $out.= '<option value="0"'.($selected=='0'?' selected':'').'>'.$langs->trans("Internal").'</option>'; if ($showempty == 2) $out.= '<option value="0"'.($selected=='0'?' selected':'').'>'.$langs->trans("Internal").'</option>';
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
@ -1417,7 +1417,7 @@ class Form
{ {
$out.= '<option value="-1"'.($showempty==2?'':' selected').' disabled>'.$langs->trans($socid?"NoContactDefinedForThirdParty":"NoContactDefined").'</option>'; $out.= '<option value="-1"'.($showempty==2?'':' selected').' disabled>'.$langs->trans($socid?"NoContactDefinedForThirdParty":"NoContactDefined").'</option>';
} }
if ($htmlname != 'none' || $options_only) if ($htmlname != 'none' && ! $options_only)
{ {
$out.= '</select>'; $out.= '</select>';
} }

View File

@ -589,8 +589,8 @@ class FormCompany
runJsCodeForEvent'.$htmlname.'(values); runJsCodeForEvent'.$htmlname.'(values);
} }
}); });
/* Clean contact */
$("div#s2id_contactid>a>span").html(\'\'); $(this).trigger("blur");
}); });
// Function used to execute events when search_htmlname change // Function used to execute events when search_htmlname change