<?php

/**
 * Company form.
 *
 * @package    okey
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class CompanyForm extends BaseCompanyForm
{
  public function configure()
    {
    
     unset($this['created_at'],$this['sub_type']);
	
	
	$option = Doctrine::getTable('Category')->getCategoryOptions(-1,5);
	
	$years = range(date('Y'), date('Y') -50);
	$years_list = array_combine($years, $years);
	
	
	$this->widgetSchema['is_active'] = new sfWidgetFormInputCheckbox(array(), array('value'=>1)); 
	 
	$this->widgetSchema['name'] = new sfWidgetFormInput(array(),array('class'=>'news_form')); 
	$this->widgetSchema['issued'] = new sfWidgetFormDateTime(array(
																'date' =>array(
																'format'=>' %year% - %month% - %day%',
																'can_be_empty' =>false,
																'years' =>$years_list
																)
																)); 
	 
	$this->widgetSchema['type'] = new sfWidgetFormChoice(array('choices' => $option));

    $this->widgetSchema->setLabels(array('name'       => 'Байгууллагын нэр'));

    $this->widgetSchema->setLabels(array('type'        => 'Ангилал'));

    $this->widgetSchema->setLabels(array('issued'      => 'Байглагдсан огноо'));
	
	$this->widgetSchema->setLabels(array('address'      => 'Хаяг'));
	
	  $this->widgetSchema->setLabels(array('about'       => 'Байгууллагын тухай'));
	
	$this->widgetSchema->setLabels(array('introduction'       => 'Бүтээгдэхүүн'));

    $this->widgetSchema->setLabels(array('wrkr' => 'Боловсон хүчин'));
	
    $this->widgetSchema->setLabels(array('branch' => 'Салбар'));
	
	
	$this->widgetSchema->setLabels(array('is_active'      => 'Нийтлэх'));

	 
	 
	 
	 
	   $this->validatorSchema['is_active'] = new sfValidatorPass();
	   $this->validatorSchema['type'] = new sfValidatorPass();
	   $this->validatorSchema['address'] = new sfValidatorPass();
        
    }

    
  }
