if (isset($lead->field_defs[$colsSecondField]) && $lead->field_defs[$colsSecondField] != null) { if ($field1_type == 'multienum' || $field1_type == 'enum' || $field1_type == 'radioenum') { $lead1_options = ''; if (!empty($lead->{$field1_name})) { $lead1_options = get_select_options_with_id($app_list_strings[$field1_options], unencodeMultienum($lead->{$field1_name})); } else { $lead1_options = get_select_options_with_id($app_list_strings[$field1_options], ''); } if ($field1_required) { $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>{$field1_label}</span sugar='slot'><span class='required' style='color: rgb(255, 0, 0);'>{$web_required_symbol}</span></td>"; } else { $Web_To_Lead_Form_html .= "<td width='15%' style='text-align: left; font-size: 12px; font-weight: normal;'><span sugar='slot'>{$field1_label}</span sugar='slot'></td>"; } if (isset($lead->field_defs[$colsSecondField]['isMultiSelect']) && $lead->field_defs[$colsSecondField]['isMultiSelect'] == 1) { $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><select id='{$field1_name}' name='{$field1_name}[]' multiple='true' tabindex='1'>{$lead1_options}</select></span sugar='slot'></td>"; } elseif (ifRadioButton($lead->field_defs[$colsSecondField]['name'])) { $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'>"; foreach ($app_list_strings[$field1_options] as $field_option_key => $field_option) { if ($field_option != null) { if (!empty($lead->{$field1_name}) && in_array($field_option_key, unencodeMultienum($lead->{$field1_name}))) { $Web_To_Lead_Form_html .= "<input id='{$colsSecondField}" . "_{$field_option_key}' checked name='{$colsSecondField}' value='{$field_option_key}' type='radio'>"; } else { $Web_To_Lead_Form_html .= "<input id='{$colsSecondField}" . "_{$field_option_key}' name='{$colsSecondField}' value='{$field_option_key}' type='radio'>"; } $Web_To_Lead_Form_html .= "<span ='document.getElementById('" . $lead->field_defs[$colsSecondField] . "_{$field_option_key}').checked =true style='cursor:default'; onmousedown='return false;'>{$field_option}</span><br>"; } } $Web_To_Lead_Form_html .= "</span sugar='slot'></td>"; } else { $Web_To_Lead_Form_html .= "<td width='35%' style='font-size: 12px; font-weight: normal;'><span sugar='slot'><select id={$field1_name} name={$field1_name} tabindex='1'>{$lead1_options}</select></span sugar='slot'></td>"; }
private static function getFieldEnumHTML($lead, $fieldName, $appListStringsFieldOptions, $fieldRequired, $fieldLabel, $webRequiredSymbol, $colsField) { $html = ''; $leadOptions = get_select_options_with_id($appListStringsFieldOptions, !empty($lead->{$fieldName}) ? unencodeMultienum($lead->{$fieldName}) : ''); $html .= self::getFieldLabelHTML($fieldLabel, $fieldRequired, $webRequiredSymbol); if (isset($lead->field_defs[$colsField]['isMultiSelect']) && $lead->field_defs[$colsField]['isMultiSelect'] == 1) { $html .= self::getFieldEnumMultiSelectHTML($fieldName, $leadOptions, $fieldRequired); } elseif (ifRadioButton($lead->field_defs[$colsField]['name'])) { $html .= self::getFieldEnumRadioGroupHTML($appListStringsFieldOptions, $lead, $fieldName, $colsField, $fieldRequired); } else { $html .= self::getFieldEnumSelectHTML($fieldName, $leadOptions, $fieldRequired); } return $html; }