Skip to content

Commit

Permalink
FIX: contact/adress tab: when changing company ajax combo, the first …
Browse files Browse the repository at this point in the history
…contact change is not taken into account
  • Loading branch information
ATM-Marc committed Dec 18, 2018
1 parent 051853f commit 7e2eca6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions htdocs/core/class/html.form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ function selectcontacts($socid, $selected='', $htmlname='contactid', $showempty=
$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 == 2) $out.= '<option value="0"'.($selected=='0'?' selected':'').'>'.$langs->trans("Internal").'</option>';
$num = $this->db->num_rows($resql);
Expand Down Expand Up @@ -1417,7 +1417,7 @@ function selectcontacts($socid, $selected='', $htmlname='contactid', $showempty=
{
$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>';
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/class/html.formcompany.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ function selectCompaniesForNewContact($object, $var_id, $selected='', $htmlname=
runJsCodeForEvent'.$htmlname.'(values);
}
});
/* Clean contact */
$("div#s2id_contactid>a>span").html(\'\');
$(this).trigger("blur");
});
// Function used to execute events when search_htmlname change
Expand Down

0 comments on commit 7e2eca6

Please sign in to comment.