<span class="inline_label"><label for="props">Характеристики</label></span>
<i class="br10"></i>
<table cellpadding="0" cellspacing="0" class="adminTable">
    <tr>
        <td>Название</td>
        <td>Значение</td>
    </tr>
    <?php
    $values = array();
    if(!$form->isNew()){
        $obj = $form->getObject();
        $values = Doctrine_Query::create()
            ->select("v.*")
            ->from("ProductPropValue v INDEXBY v.prop_id")
            ->where("v.product_id = ?", $obj->getId())
            ->fetchArray();
    }
    $props = Doctrine_Query::create()
        ->select("p.*, l.*, pt.*, lt.*")
        ->from("ProductProp p")
        ->leftJoin("p.ProductPropList l")
        ->leftJoin("p.Translation pt WITH pt.lang = 'ru'")
        ->leftJoin("l.Translation lt WITH lt.lang = 'ru'")
        ->fetchArray();
    if(count($props) > 0){
        foreach ($props as $prop){
            echo '<tr>';
            echo '<td width="150">' . $prop['Translation']['ru']['title'] . '</td>';
            echo '<td>';
            if($prop['isList']){
                echo '<select style="width:100%;" name="props[' . $prop['id'] . ']">';
                echo '<option value="">—</option>';
                foreach ($prop['ProductPropList'] as $list){
                    echo '<option ' . (isset($values[$prop['id']]) && (int)$values[$prop['id']]['value'] == $list['id'] ? 'selected="selected"' : '') . ' value="' . $list['id'] . '">' . $list['Translation']['ru']['variant'] . '</option>';
                }
                echo '</select>';
            }else{
                echo '<input autocomplete="off" size="8" maxlength="8" name="props['. $prop["id"] .']" value="' . (isset($values[$prop['id']]) ? $values[$prop['id']]['value'] : '') . '" id="props" type="text">';
            }
            echo '</td>';
            echo '</tr>';
        }
    }
    ?>
</table>