Fixed empty default department description in prechat survey

This commit is contained in:
Dmitriy Simushev 2012-02-08 13:20:53 +00:00
parent 87676a5cee
commit 4e69fc957d

View File

@ -339,12 +339,14 @@ function setup_survey($name, $email, $groupid, $info, $referrer)
if ($k['ilastseen'] !== NULL && $k['ilastseen'] < $settings['online_timeout']) { if ($k['ilastseen'] !== NULL && $k['ilastseen'] < $settings['online_timeout']) {
if (!$groupid) { if (!$groupid) {
$groupid = $k['groupid']; // select first online group $groupid = $k['groupid']; // select first online group
$defaultdescription = $k['vclocaldescription'];
} }
} else { } else {
$groupname .= " (offline)"; $groupname .= " (offline)";
} }
$isselected = $k['groupid'] == $groupid; $isselected = $k['groupid'] == $groupid;
if ($isselected) {
$defaultdescription = $k['vclocaldescription'];
}
$val .= "<option value=\"" . $k['groupid'] . "\"" . ($isselected ? " selected=\"selected\"" : "") . ">$groupname</option>"; $val .= "<option value=\"" . $k['groupid'] . "\"" . ($isselected ? " selected=\"selected\"" : "") . ">$groupname</option>";
$groupdescriptions[] = $k['vclocaldescription']; $groupdescriptions[] = $k['vclocaldescription'];
} }