<?

class Safra17_Form_Lp001 extends Sinistro2_Form_LaudoPreliminar {

    public function init($idLaudoPreliminar = null) {

        parent::init($idLaudoPreliminar);

        $dados = $this->getDados();

        $this->addElement('checkbox', 'fl_danos_folhas', array(
            'disableLoadDefaultDecorators' => true,
            'decorators'=>$this->simpleFieldDecorator,
            'label' => 'Folhas',
            'ignore' => $this->getReadOnlyAll(),
            'readonly' => $this->getReadOnlyAll()
        ));

        $this->addElement('checkbox', 'fl_danos_flores', array(
            'disableLoadDefaultDecorators' => true,
            'decorators'=>$this->simpleFieldDecorator,
            'label' => 'Flores',
            'ignore' => $this->getReadOnlyAll(),
            'readonly' => $this->getReadOnlyAll()
        ));

        $this->addElement('checkbox', 'fl_danos_vegetacao_adjacente', array(
            'disableLoadDefaultDecorators' => true,
            'decorators'=>$this->simpleFieldDecorator,
            'label' => 'Vegetação adjacente',
            'ignore' => $this->getReadOnlyAll(),
            'readonly' => $this->getReadOnlyAll()
        ));

        $this->addElement('checkbox', 'fl_danos_ramos', array(
            'disableLoadDefaultDecorators' => true,
            'decorators'=>$this->simpleFieldDecorator,
            'label' => 'Ramos',
            'ignore' => $this->getReadOnlyAll(),
            'readonly' => $this->getReadOnlyAll()
        ));

        $this->addElement('checkbox', 'fl_danos_frutos', array(
            'disableLoadDefaultDecorators' => true,
            'decorators'=>$this->simpleFieldDecorator,
            'label' => 'Frutos',
            'ignore' => $this->getReadOnlyAll(),
            'readonly' => $this->getReadOnlyAll()
        ));

        $this->addElement('checkbox', 'fl_danos_benfeitoris', array(
            'disableLoadDefaultDecorators' => true,
            'decorators'=>$this->simpleFieldDecorator,
            'label' => 'Benfeitorias',
            'ignore' => $this->getReadOnlyAll(),
            'readonly' => $this->getReadOnlyAll()
        ));

        $this->addElement('checkbox', 'fl_sem_danos', array(
            'disableLoadDefaultDecorators' => true,
            'decorators'=>$this->simpleFieldDecorator,
            'label' => 'Sem danos',
            'ignore' => $this->getReadOnlyAll(),
            'readonly' => $this->getReadOnlyAll()
        ));

        $this->addDisplayGroup(
            array(
                'fl_danos_folhas',
                'fl_danos_flores',
                'fl_danos_vegetacao_adjacente',
                'fl_danos_ramos',
                'fl_danos_frutos',
                'fl_danos_benfeitoris',
                'fl_sem_danos'
            ),
            'houve_danos',
            array(
                'description'=>'Houve danos em:',
                'class'=>'hide',
                'disableLoadDefaultDecorators' => true,
                'decorators'=>$this->fieldGroupDecorator
            )
        );
        $this->addElement('radio', 'fl_produtividade_menor_contratada', array(
            'MultiOptions' => array(0=>'Não', 1=>'Sim. Justifique nas observações.'),
            'disableLoadDefaultDecorators' => true,
            'decorators' => $this->fieldDecorator,
            'separator'=>' ',
            'label' => 'A produtividade do pomar é menor do que a contratada na proposta?',
            'required' => true,
            'ignore' => $this->getReadOnly(),
            'readonly' => $this->getReadOnly()
        ));

        $this->addElement('radio', 'fl_areas_declaradas_conferem', array(
            'MultiOptions' => array(1=>'Sim',0=>'Não. Justifique nas observações'),
            'decorators' => $this->fieldDecorator,
            'disableLoadDefaultDecorators' => true,
            'separator'=>' ',
            'label' => 'As áreas declaradas nos Itens Segurados da proposta representam toda a área cultivada desta cultura na propriedade?',
            'required' => true,
            'ignore' => $this->getReadOnly(),
            'readonly' => $this->getReadOnly()
        ));

        $this->addElement('radio', 'fl_pomar_condiz_proposta', array(
            'MultiOptions' => array(1=>'Sim',0=>'Não. Justifique nas observações'),
            'decorators' => $this->fieldDecorator,
            'disableLoadDefaultDecorators' => true,
            'separator'=>' ',
            'label' => 'O pomar/parreiral condiz com a proposta?',
            'required' => true,
            'ignore' => $this->getReadOnly(),
            'readonly' => $this->getReadOnly()
        ));

        $this->addElement('textarea', 'ds_aspectos_gerais_cultura', array(
            'decorators' => $this->fieldDecorator,
            'disableLoadDefaultDecorators' => true,
            'label' => 'Aspectos gerais da cultura (nutrição, sanidade e outros)',
            'maxlength' => 3000,
            'rows' => 7,
            'cols' => 100,
            'ignore' => $this->getReadOnly(),
            'readonly' => $this->getReadOnly()
        ));
    }

    public $elementDiametroDecorator = array (
        'ViewHelper',
        array(
            array(
                'unidadeMM'=>'Description'
            ),
            array(
                'tag'=>'span'
            )
        ),
        'Errors',
        'Label'
    );

    public function populate($values){
    	parent::populate($values);
    }
}