static function getInputField(CCModel $form, $field, $needEmpty = true)
 {
     $listType = $form->fieldType();
     $tableClass = SiteHelper::getCamelCase($form->tableName());
     $value = !empty($_POST[$tableClass]) && !empty($_POST[$tableClass][$field]) ? $_POST[$tableClass][$field] : "";
     $HTMLOption = "";
     $fieldType = $form->fieldType();
     if (!empty($listType[$field])) {
         $fieldName = $tableClass . "[" . $field . "]";
         switch ($listType[$field]) {
             case "checkbox":
                 $input = CHtml::checkBox($fieldName, $value);
                 break;
             case "visual_textarea":
                 $input = CHtml::textArea($fieldName, $value);
                 break;
             case "url":
                 $input = CHtml::activeUrlField($form, $field);
                 break;
             case "date":
                 $input = "от: " . CHtml::textField($fieldName, $value, array("class" => "yearField"));
                 $input .= "  до: " . CHtml::textField($tableClass . "[" . $field . "_2]", $value, array("class" => "yearField"));
                 break;
         }
     }
     // Выводим списк связей
     if (empty($input)) {
         if ($relation = $form->getRelationByField($field)) {
             $input = '<select name="' . $tableClass . '[' . $field . ']" class="field_' . $field . '">';
             if (!empty($needEmpty)) {
                 $input .= '<option value=""> --- --- --- </option>';
             }
             $input .= CCModelHelper::getRelationListOptions($form, $field, CCModelHelper::getRelationItems($relation, $form), $value);
             $input .= '</select>';
         }
     }
     if (empty($input)) {
         if (!empty($fieldType[$field]) && $fieldType[$field] == "integer") {
             $value_2 = !empty($_POST[$tableClass]) && !empty($_POST[$tableClass][$field . "_2"]) ? $_POST[$tableClass][$field . "_2"] : "";
             $input = "от: " . CHtml::textField($fieldName, $value, array("class" => "yearField"));
             $input .= "&nbsp;&nbsp;до: " . CHtml::textField($tableClass . "[" . $field . "_2]", $value_2, array("class" => "yearField"));
         } else {
             $input = CHtml::activeTextField($form, $field);
         }
     }
     return $input;
     // Определяем это поле релайшин или нет
     // Если не релайшин то вывести <input type="text" иначе
 }