Merge pull request #3363 from sesom42/develop
displays the correct profile for contacts that have set the default profile
This commit is contained in:
commit
5432af3414
|
@ -9,12 +9,12 @@ function contact_profile_assign($current,$foreign_net) {
|
||||||
|
|
||||||
$o .= "<select id=\"contact-profile-selector\" class=\"form-control\" $disabled name=\"profile-assign\" />\r\n";
|
$o .= "<select id=\"contact-profile-selector\" class=\"form-control\" $disabled name=\"profile-assign\" />\r\n";
|
||||||
|
|
||||||
$r = q("SELECT `id`, `profile-name` FROM `profile` WHERE `uid` = %d",
|
$r = q("SELECT `id`, `profile-name`, `is-default` FROM `profile` WHERE `uid` = %d",
|
||||||
intval($_SESSION['uid']));
|
intval($_SESSION['uid']));
|
||||||
|
|
||||||
if (dbm::is_result($r)) {
|
if (dbm::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$selected = (($rr['id'] == $current) ? " selected=\"selected\" " : "");
|
$selected = (($rr['id'] == $current || ($current == 0 && $rr['is-default'] == 1)) ? " selected=\"selected\" " : "");
|
||||||
$o .= "<option value=\"{$rr['id']}\" $selected >{$rr['profile-name']}</option>\r\n";
|
$o .= "<option value=\"{$rr['id']}\" $selected >{$rr['profile-name']}</option>\r\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue