コード例 #1
0
ファイル: Municipio.php プロジェクト: stefanoa0/Aptus
 public function update(array $request)
 {
     $dbTableMunicipio = new Application_Model_DbTable_Municipio();
     $dadosMunicipio = array('tc_nome' => $request['nomeMunicipio'], 'tcom_id' => $request['comunidade'], 'tc_especificidade' => $request['especificidade'], 'te_id' => $request['idEndereco']);
     $whereMunicipio = $dbTableMunicipio->getAdapter()->quoteInto('"tc_id" = ?', $request['idMunicipio']);
     $dbTableMunicipio->update($dadosMunicipio, $whereMunicipio);
 }
コード例 #2
0
 public function init()
 {
     // Municipio
     $dbMunicipio = new Application_Model_DbTable_Municipio();
     $municipios = $dbMunicipio->getMunicipiosList();
     $this->addElement('select', 'municipio', array('label' => '', 'required' => false, 'filters' => array('stringTrim')));
     //die('PRUEBA >> 2 - 3 - 4 - 5');
     /* 
       foreach($municipios as $key => $value){
       $this->municipio->addMultiOption($key,$value);
     }
     */
     $this->municipio->addMultiOptions($municipios);
     //$this->municipio->removeDecorator('Errors');
     $this->municipio->setAttrib('class', 'form_select_buscador2');
     $this->municipio->removeDecorator('HtmlTag');
     $this->municipio->removeDecorator('Label');
     $this->addElement('Submit', 'Grabar');
 }
コード例 #3
0
 public function init()
 {
     $this->decoradores = array('ViewHelper', array('Errors', array('tag' => 'div', 'style' => 'color:red;')), 'HtmlTag', 'Label');
     // Categoría
     $dbCategoria = new Application_Model_DbTable_Categoria();
     $categorias = $dbCategoria->getCategoriasList();
     $this->addElement('select', 'categoria', array('label' => ' ', 'required' => false, 'filters' => array('stringTrim')));
     /*   foreach($municipios as $key => $value){
             $this->municipio->addMultiOption($key,$value);
          }*/
     $this->categoria->addMultiOptions($categorias);
     //$this->municipio->removeDecorator('Errors');
     $this->categoria->setAttrib('class', 'form_select_medium');
     $this->categoria->removeDecorator('HtmlTag');
     $this->categoria->removeDecorator('Label');
     //Precio / Mes
     $this->addElement('text', 'precio', array('label' => 'Precio / Mes (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->precio->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar el precio.')));
     $this->precio->addValidator('digits', true, array('messages' => array(Zend_Validate_Digits::NOT_DIGITS => 'Ingresar cantidad entera')));
     $this->precio->setDecorators($this->decoradores);
     $this->precio->setAttrib('class', 'form_input_contact_small');
     //$this->precio->removeDecorator('Errors');
     $this->precio->removeDecorator('HtmlTag');
     $this->precio->removeDecorator('Label');
     // Titulo anuncio
     $this->addElement('text', 'titulo', array('label' => 'Titulo (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->titulo->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar titulo del anuncio.')));
     $this->titulo->setDecorators($this->decoradores);
     $this->titulo->setAttrib('class', 'form_input_contactx');
     //_motor
     //$this->titulo->removeDecorator('Errors');
     $this->titulo->removeDecorator('HtmlTag');
     $this->titulo->removeDecorator('Label');
     // Descripcion completa
     $this->addElement('textarea', 'descripcion', array('label' => 'Descripción completa', 'required' => false, 'filters' => array('stringTrim')));
     //$this->descripcion->setDecorators($this->decoradores);
     $this->descripcion->setAttrib('class', 'textarea');
     $this->descripcion->removeDecorator('Errors');
     $this->descripcion->removeDecorator('HtmlTag');
     $this->descripcion->removeDecorator('Label');
     // Provincia
     $this->addElement('text', 'provincia', array('label' => 'Provincia (*)', 'required' => false, 'filters' => array('stringTrim'), 'value' => 'Barcelona'));
     $this->provincia->setAttrib('disabled', 'disabled');
     $this->provincia->setAttrib('class', 'form_input_contact_small');
     $this->provincia->removeDecorator('Errors');
     $this->provincia->removeDecorator('HtmlTag');
     $this->provincia->removeDecorator('Label');
     // Municipio
     $dbMunicipio = new Application_Model_DbTable_Municipio();
     $municipios = $dbMunicipio->getMunicipiosList();
     $this->addElement('select', 'municipio', array('label' => ' ', 'required' => false, 'filters' => array('stringTrim')));
     /*   foreach($municipios as $key => $value){
             $this->municipio->addMultiOption($key,$value);
          }*/
     $this->municipio->addMultiOptions($municipios);
     //$this->municipio->removeDecorator('Errors');
     $this->municipio->setAttrib('class', 'form_select_medium');
     $this->municipio->removeDecorator('HtmlTag');
     $this->municipio->removeDecorator('Label');
     // Submit "GRABAR"
     $this->addElement('Submit', 'Grabar');
 }
コード例 #4
0
 public function init()
 {
     //$this->setAction('user/process');
     /*
             $decoradores = array(
                                   'ViewHelper',
                                   array('Errors', array('tag' => 'div', 'style' => 'color:red;')),
                                   array('HtmlTag', array('tag' => 'div', 'class' => 'formElement')),
                                   array('Label', array('tag' => 'div'))
                                 );
     
     
             
             // Case 1
             $nombre = new Zend_Form_Element_Text('nombre');
             
             $nombre->setLabel('Nombre :')
                     ->setDecorators($decoradores)
                     ->setRequired(true)
                     ->addFilter('StripTags')
                     ->addFilter('StringTrim')
                     ->addValidator('NotEmpty'); 
     
             $submit = new Zend_Form_Element_Submit( 'Enviar' );
             $submit->setAttrib('id', 'enviar');
     
             
     
             // Case 2
             //StripTags delete las etiquetas HTML
             //StringTrim quita todos los caracteres de espacio en blanco iniciales y finales
             $name = new Zend_Form_Element_Text('name');  
     	
             $name->setLabel('* Your Name:')
                  ->setRequired(true)
                  ->addFilter('StripTags')
                  ->addFilter('StringTrim')
                  ->setAttrib('size',50)
                  ->addValidator('stringLength', false, array(0, 300))
                  ->addValidator('NotEmpty',
                                  true,
                                  array('messages' => array(
                                                             Zend_Validate_NotEmpty::IS_EMPTY => 'Introducir su nombre es obligatorio.'
                                                            )
                                         
                                                         
                                       )
                                 )
                  ->setDecorators($decoradores);
             
             
             // Case 3
             
                 $this->addElement(
                                     'text', 
                                     'userBusinessName', 
                                     array(
                                             'label' => 'Nombre comercial (*)', 
                                             'required' => true, 
                                             'filters' => array('stringTrim'),
                                             'value' => '',
                                             
                                       )
                              );
             
                 $this->userBusinessName->setDecorators($decoradores);
                 //$this->userBusinessName->removeDecorator('Errors');
                 $this->userBusinessName->removeDecorator('HtmlTag');
                 $this->userBusinessName->removeDecorator('Label');
     
             
             
             $this->addElements (array( $nombre, $name, $submit ) );
     */
     // Formulario alta de usuario
     $decoradores = array('ViewHelper', array('Errors', array('tag' => 'div', 'style' => 'color:red;')), 'HtmlTag', 'Label');
     $validatorLenghtClave = new Zend_Validate_StringLength(6, 10);
     $validatorLenghtClave->setMessages(array(Zend_Validate_StringLength::TOO_SHORT => 'La clave es muy corta (min. %min%).', Zend_Validate_StringLength::TOO_LONG => 'La clave es muy large (max. %max%).'));
     $validatorLenghtCP = new Zend_Validate_StringLength(5, 5);
     $validatorLenghtCP->setMessages(array(Zend_Validate_StringLength::TOO_SHORT => 'El CP es de %min% digitos.', Zend_Validate_StringLength::TOO_LONG => 'El CP es de %max% digitos.'));
     // Tipo usuario
     /*
              $this->addElement(  'radio', 
                       'tipo', 
                       array(
                               'value' => '1',
                               'multiOptions' => array(
                                                           
                                                           0 => 'Particular',
                                                           1 => 'Profesional',
                                                      ),
                                           ));
     * 
     */
     // Correo electrónico
     $this->addElement('text', 'correoElectronico', array('label' => '', 'required' => true, 'filters' => array('stringTrim')));
     $this->correoElectronico->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Introducir su correo electrónico.')));
     $this->correoElectronico->addValidator('EmailAddress', true, array('messages' => array(Zend_Validate_EmailAddress::INVALID => "El tipo especificado no es válido, el valor debe ser una cadena de texto", Zend_Validate_EmailAddress::INVALID_FORMAT => "'%value%' no es una dirección de correo electrónico válida en el formato local-part@hostname", Zend_Validate_EmailAddress::INVALID_HOSTNAME => "'%hostname%' no es un nombre de host válido para la dirección de correo electrónico '%value%'", Zend_Validate_EmailAddress::INVALID_MX_RECORD => "'%hostname%' no parece tener un registro MX válido para la dirección de correo electrónico '%value%'", Zend_Validate_EmailAddress::INVALID_SEGMENT => "'%hostname%' no esta en un segmento de red ruteable. La dirección de correo electrónico '%value%' no se debe poder resolver desde una red pública.", Zend_Validate_EmailAddress::DOT_ATOM => "'%localPart%' no es igual al formato dot-atom", Zend_Validate_EmailAddress::QUOTED_STRING => "'%localPart%' no es igual al formato quoted-string", Zend_Validate_EmailAddress::INVALID_LOCAL_PART => "'%localPart%' no es una parte local válida para la dirección de correo electrónico '%value%'", Zend_Validate_EmailAddress::LENGTH_EXCEEDED => "'%value%' excede la longitud permitida")));
     $this->correoElectronico->setDecorators($decoradores);
     $this->correoElectronico->setAttrib('class', 'form_input_contact');
     //$this->correoElectronico->removeDecorator('Errors');
     $this->correoElectronico->removeDecorator('HtmlTag');
     $this->correoElectronico->removeDecorator('Label');
     // Contraseña
     $this->addElement('password', 'contrasenya', array('label' => 'Contraseña (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->contrasenya->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar su clave.')));
     //$this->contrasenya->addValidator('stringLength', false, array(6, 10));
     $this->contrasenya->addValidator($validatorLenghtClave);
     $this->contrasenya->setDecorators($decoradores);
     $this->contrasenya->setAttrib('class', 'form_input_contact_small');
     //$this->contrasenya->removeDecorator('Errors');
     $this->contrasenya->removeDecorator('HtmlTag');
     $this->contrasenya->removeDecorator('Label');
     // Repetir contraseña
     $this->addElement('password', 'repetirContrasenya', array('label' => 'Repetir contraseña (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->repetirContrasenya->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Re-ingresar su clave.')));
     $this->repetirContrasenya->addValidator($validatorLenghtClave);
     $this->repetirContrasenya->setDecorators($decoradores);
     $this->repetirContrasenya->setAttrib('class', 'form_input_contact_small');
     //$this->repetirContrasenya->removeDecorator('Errors');
     $this->repetirContrasenya->removeDecorator('HtmlTag');
     $this->repetirContrasenya->removeDecorator('Label');
     // Nombre comercial
     $this->addElement('text', 'nombreComercial', array('label' => 'Nombre de la agencia (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->nombreComercial->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar el nombre comercial.')));
     $this->nombreComercial->setDecorators($decoradores);
     $this->nombreComercial->setAttrib('class', 'form_input_contact');
     //$this->nombreComercial->removeDecorator('Errors');
     $this->nombreComercial->removeDecorator('HtmlTag');
     $this->nombreComercial->removeDecorator('Label');
     // Código postal
     $this->addElement('text', 'codigoPostal', array('label' => 'Código Postal (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->codigoPostal->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar el CP.')));
     //$this->codigoPostal->addValidator('stringLength', false, array(5, 5));
     $this->codigoPostal->addValidator($validatorLenghtCP);
     $this->codigoPostal->addValidator('digits', true, array('messages' => array(Zend_Validate_Digits::NOT_DIGITS => 'Sólo digitos')));
     $this->codigoPostal->setDecorators($decoradores);
     $this->codigoPostal->setAttrib('class', 'form_input_contact_small');
     //$this->codigoPostal->removeDecorator('Errors');
     $this->codigoPostal->removeDecorator('HtmlTag');
     $this->codigoPostal->removeDecorator('Label');
     // Provincia
     $this->addElement('text', 'provincia', array('label' => 'Provincia (*)', 'required' => false, 'filters' => array('stringTrim'), 'value' => 'Barcelona'));
     $this->provincia->setAttrib('disabled', 'disabled');
     $this->provincia->setAttrib('class', 'form_input_contact_small');
     $this->provincia->removeDecorator('Errors');
     $this->provincia->removeDecorator('HtmlTag');
     $this->provincia->removeDecorator('Label');
     $modelo = new Application_Model_DbTable_Municipio();
     $municipios = $modelo->getMunicipiosList();
     // Municipio
     $this->addElement('select', 'municipio', array('label' => ' ', 'required' => false, 'filters' => array('stringTrim')));
     $this->municipio->addMultiOptions($municipios);
     //$this->municipio->removeDecorator('Errors');
     $this->municipio->setAttrib('class', 'form_select');
     $this->municipio->removeDecorator('HtmlTag');
     $this->municipio->removeDecorator('Label');
     // Dirección
     $this->addElement('text', 'direccion', array('label' => 'Dirección (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->direccion->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar la dirección.')));
     $this->direccion->setDecorators($decoradores);
     $this->direccion->setAttrib('class', 'form_input_contact');
     //$this->direccion->removeDecorator('Errors');
     $this->direccion->removeDecorator('HtmlTag');
     $this->direccion->removeDecorator('Label');
     //Nombre contacto
     $this->addElement('text', 'nombreContacto', array('label' => 'Nombre contacto (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->nombreContacto->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar nombre.')));
     $this->nombreContacto->setDecorators($decoradores);
     $this->nombreContacto->setAttrib('class', 'form_input_contact');
     //$this->nombreContacto->removeDecorator('Errors');
     $this->nombreContacto->removeDecorator('HtmlTag');
     $this->nombreContacto->removeDecorator('Label');
     // Apellido contacto
     $this->addElement('text', 'apellidoContacto', array('label' => 'Apellido contacto  (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->apellidoContacto->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar apellido.')));
     $this->apellidoContacto->setDecorators($decoradores);
     $this->apellidoContacto->setAttrib('class', 'form_input_contact');
     //$this->apellidoContacto->removeDecorator('Errors');
     $this->apellidoContacto->removeDecorator('HtmlTag');
     $this->apellidoContacto->removeDecorator('Label');
     // Teléfono
     $this->addElement('text', 'telefono', array('label' => 'Teléfono (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->telefono->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar el teléfono.')));
     $this->telefono->addValidator('digits', true, array('messages' => array(Zend_Validate_Digits::NOT_DIGITS => 'Sólo digitos')));
     $this->telefono->setDecorators($decoradores);
     $this->telefono->setAttrib('class', 'form_input_contact_small');
     //$this->telefono->removeDecorator('Errors');
     $this->telefono->removeDecorator('HtmlTag');
     $this->telefono->removeDecorator('Label');
     // Móvil
     $this->addElement('text', 'movil', array('label' => 'Móvil', 'required' => false, 'filters' => array('stringTrim')));
     $this->movil->addValidator('digits', true, array('messages' => array(Zend_Validate_Digits::NOT_DIGITS => 'Sólo digitos')));
     $this->movil->setDecorators($decoradores);
     $this->movil->setAttrib('class', 'form_input_contact_small');
     //$this->movil->removeDecorator('Errors');
     $this->movil->removeDecorator('HtmlTag');
     $this->movil->removeDecorator('Label');
     // Web
     $this->addElement('text', 'web', array('label' => 'Web (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->web->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar web.')));
     $this->web->setDecorators($decoradores);
     $this->web->setAttrib('class', 'form_input_contact_small');
     //$this->web->removeDecorator('Errors');
     $this->web->removeDecorator('HtmlTag');
     $this->web->removeDecorator('Label');
     // CIF
     $this->addElement('text', 'cif', array('label' => 'CIF (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->cif->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar el CIF.')));
     $this->cif->addValidator('alnum', true, array('messages' => array(Zend_Validate_Alnum::NOT_ALNUM => 'Sólo alfanúmerico')));
     $this->cif->setDecorators($decoradores);
     $this->cif->setAttrib('class', 'form_input_contact_small');
     //$this->cif->removeDecorator('Errors');
     $this->cif->removeDecorator('HtmlTag');
     $this->cif->removeDecorator('Label');
     /*        
             
             $this->addElement(
                                 'CheckBox',
                                 'contract',
                                 array(
                                 'label' => 'I accept the terms of service',
                                 'style' =>'margin-left:100px;',
                                 'required' => true,
                                 'checkedValue' => '1',
                                 'uncheckedValue'  => '0',
                                 'checked' => true,    
                                 'validators' => array(array('NotEmpty', true)),
                                 )
                               );
     
             $a=new Application_Model_Class_Categories();
             $this->addElement(
                                 'Select', 
                                 'municipio',
                                 array(
                                         'label'       => 'Category:',
                                         'AutoComplete'=> true, 
                                         'MultiOptions'=> $a->GetCategories(),
                                         'required' => true 
                                       )
                               ); 
     */
     $this->addElement('Submit', 'Grabar');
 }
コード例 #5
0
 public function init()
 {
     $this->decoradores = array('ViewHelper', array('Errors', array('tag' => 'div', 'style' => 'color:red;')), 'HtmlTag', 'Label');
     $this->validatorLenghtCP = new Zend_Validate_StringLength(5, 5);
     $this->validatorLenghtCP->setMessages(array(Zend_Validate_StringLength::TOO_SHORT => 'El CP es de %min% digitos.', Zend_Validate_StringLength::TOO_LONG => 'El CP es de %max% digitos.'));
     // Operacion OLD
     /*
     $this->addElement(
                             'select', 
                             'operacion', 
                             array(
                                     'label' => ' ', 
                                     'required' => false, 
                                     'filters' => array('stringTrim')
                                  )
                       );
     
     $operacion = array('0' => 'Alquiler', '1' => 'Venta');
     
     $this->operacion->addMultiOptions($operacion);  
     //$this->municipio->removeDecorator('Errors');
     $this->operacion->setAttrib('class','form_select_medium');
     $this->operacion->removeDecorator('HtmlTag');
     $this->operacion->removeDecorator('Label');
     */
     $this->addElement('select', 'operacion', array('label' => ' ', 'required' => false, 'filters' => array('stringTrim')));
     $operacion = array('0' => 'Apartamentos en alquiler', '1' => 'Habitación individual en alquiler', '2' => 'Habitación doble en alquiler');
     $this->operacion->addMultiOptions($operacion);
     //$this->municipio->removeDecorator('Errors');
     $this->operacion->setAttrib('class', 'form_select_medium');
     $this->operacion->removeDecorator('HtmlTag');
     $this->operacion->removeDecorator('Label');
     // Tipo vivienda
     /*
     $this->addElement(  'radio', 
                         'tipoVivienda', 
                         array(  'label' => 'Tipo de vivienda (*)',
                                 'multiOptions' => array(
                                                             
                                                             0 => 'Piso',
                                                             1 => 'Dúplex',
                                                             2 => 'Estudio',
                                                             3 => 'Ático',
                                                             4 => 'Loft',
                                                             5 => 'Casa/Chalet'
                                                        )
                                             ));        
     
     $this->tipoVivienda->setValue('Piso');
     $this->tipoVivienda->setAttrib('class','form_input_contact');
     $this->tipoVivienda->removeDecorator('Errors');
     $this->tipoVivienda->removeDecorator('HtmlTag');
     $this->tipoVivienda->removeDecorator('Label');
     */
     //Precio / Mes
     $this->addElement('text', 'precio', array('label' => 'Precio / Mes (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->precio->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar el precio.')));
     $this->precio->addValidator('digits', true, array('messages' => array(Zend_Validate_Digits::NOT_DIGITS => 'Ingresar cantidad entera')));
     $this->precio->setDecorators($this->decoradores);
     $this->precio->setAttrib('class', 'form_input_contact_small');
     //$this->precio->removeDecorator('Errors');
     $this->precio->removeDecorator('HtmlTag');
     $this->precio->removeDecorator('Label');
     // Deposito
     $this->addElement('text', 'deposito', array('label' => 'Deposito', 'required' => false, 'filters' => array('stringTrim')));
     $this->deposito->setAttrib('class', 'form_input_contact_small');
     $this->deposito->removeDecorator('Errors');
     $this->deposito->removeDecorator('HtmlTag');
     $this->deposito->removeDecorator('Label');
     // Superficie
     /*
     $this->addElement(
                         'text', 
                         'superficie', 
                         array(
                                 'label' => 'Superficie (m2) (*)', 
                                 'required' => true, 
                                 'filters' => array('stringTrim')
                           )
                  );
     
     $this->superficie->addValidator('NotEmpty',
                      true,
                      array('messages' => array(
                                                 Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar la superficie m2.'
                                               )
                           ));
     
     $this->superficie->addValidator('digits', true, array('messages' => array(Zend_Validate_Digits::NOT_DIGITS => 'Ingresar cantidad entera')));
     $this->superficie->setDecorators($this->decoradores);
     $this->superficie->setAttrib('class','form_input_contact_small');
     //$this->superficie->removeDecorator('Errors');
     $this->superficie->removeDecorator('HtmlTag');
     $this->superficie->removeDecorator('Label');
     */
     // Número de dormitorios
     $dbDormitorio = new Application_Model_DbTable_TipoDormitorio();
     $dormitorios = $dbDormitorio->getDormitoriosList();
     $this->addElement('select', 'numeroDormitorios', array('label' => ' ', 'required' => false, 'filters' => array('stringTrim')));
     /*   foreach($dormitorios as $key => $value){
             $this->numeroDormitorios->addMultiOption($key,$value);
          }*/
     $this->numeroDormitorios->addMultiOptions($dormitorios);
     //$this->numeroDormitorios->removeDecorator('Errors');
     $this->numeroDormitorios->setAttrib('class', 'form_select_bit');
     $this->numeroDormitorios->removeDecorator('HtmlTag');
     $this->numeroDormitorios->removeDecorator('Label');
     // Número de baños
     $dbBanyo = new Application_Model_DbTable_TipoBanyo();
     $banyos = $dbBanyo->getBanyosList();
     $this->addElement('select', 'numeroBanyos', array('label' => ' ', 'required' => false, 'filters' => array('stringTrim')));
     /*   foreach($banyos as $key => $value){
             $this->numeroBanyos->addMultiOption($key,$value);
          }*/
     $this->numeroBanyos->addMultiOptions($banyos);
     //$this->numeroBanyos->removeDecorator('Errors');
     $this->numeroBanyos->setAttrib('class', 'form_select_bit');
     $this->numeroBanyos->removeDecorator('HtmlTag');
     $this->numeroBanyos->removeDecorator('Label');
     // Titulo anuncio
     $this->addElement('text', 'titulo', array('label' => 'Titulo (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->titulo->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar titulo del anuncio.')));
     $this->titulo->setDecorators($this->decoradores);
     $this->titulo->setAttrib('class', 'form_input_contact');
     //$this->titulo->removeDecorator('Errors');
     $this->titulo->removeDecorator('HtmlTag');
     $this->titulo->removeDecorator('Label');
     // Descripcion completa
     $this->addElement('textarea', 'descripcion', array('label' => 'Descripción completa', 'required' => false, 'filters' => array('stringTrim')));
     //$this->descripcion->setDecorators($this->decoradores);
     $this->descripcion->setAttrib('class', 'form_input_contact');
     $this->descripcion->removeDecorator('Errors');
     $this->descripcion->removeDecorator('HtmlTag');
     $this->descripcion->removeDecorator('Label');
     // Alta de suministros
     /* Versión para la web*/
     $altaSuministros = new Zend_Form_Element_Checkbox('altaSuministros');
     $altaSuministros->setLabel('Alta de suministros')->setRequired(FALSE);
     $altaSuministros->setUncheckedValue(0);
     $altaSuministros->setCheckedValue(1);
     $altaSuministros->setAttrib('class', 'form_input_contact_very_small');
     $altaSuministros->removeDecorator('Errors');
     $altaSuministros->removeDecorator('HtmlTag');
     $altaSuministros->removeDecorator('Label');
     $this->addElement($altaSuministros);
     /*
     $this->addElement(
                         'checkBox',
                         'altaSuministros',
                         array   (
                                     'label' => 'Alta de suministros',
                                     'required' => false,
                                     'checkedValue' => '1',
                                     'uncheckedValue'  => '0',
                                 )
                       ); 
     
     $this->altaSuministros->setAttrib('class','form_input_contact_very_small');
     $this->altaSuministros->removeDecorator('Errors');
     $this->altaSuministros->removeDecorator('HtmlTag');
     $this->altaSuministros->removeDecorator('Label');
     */
     // Ascensor
     /*
     $ascensor = new Zend_Form_Element_Checkbox('ascensor');
     $ascensor->setLabel('Ascensor')
              ->setRequired(FALSE);
     
     $ascensor->setUncheckedValue(0);
     $ascensor->setCheckedValue(1);
     $ascensor->setAttrib('class','form_input_contact_very_small');
     $ascensor->removeDecorator('Errors');
     $ascensor->removeDecorator('HtmlTag');
     $ascensor->removeDecorator('Label');
     $this->addElement($ascensor);
     */
     $this->addElement('checkBox', 'ascensor', array('label' => 'Ascensor', 'required' => false, 'checkedValue' => '1', 'uncheckedValue' => '0'));
     $this->ascensor->setAttrib('class', 'form_input_contact_very_small');
     $this->ascensor->removeDecorator('Errors');
     $this->ascensor->removeDecorator('HtmlTag');
     $this->ascensor->removeDecorator('Label');
     // Piso exterior
     $this->addElement('checkBox', 'pisoExterior', array('label' => 'Piso exterior', 'required' => false, 'checkedValue' => '1', 'uncheckedValue' => '0'));
     $this->pisoExterior->setAttrib('class', 'form_input_contact_very_small');
     $this->pisoExterior->removeDecorator('Errors');
     $this->pisoExterior->removeDecorator('HtmlTag');
     $this->pisoExterior->removeDecorator('Label');
     // Balcon
     $this->addElement('checkBox', 'balcon', array('label' => 'Balcón', 'required' => false, 'checkedValue' => '1', 'uncheckedValue' => '0'));
     $this->balcon->setAttrib('class', 'form_input_contact_very_small');
     $this->balcon->removeDecorator('Errors');
     $this->balcon->removeDecorator('HtmlTag');
     $this->balcon->removeDecorator('Label');
     // Amueblado
     /*
     $this->addElement(  'radio', 
                         'amueblado', 
                         array(  'label' => '¿Amueblado?',
                                 'multiOptions' => array(
                                                             
                                                             1 => 'Si',
                                                             0 => 'No',
                                                        ),
                                             ));        
     
     //$this->amueblado->setAttrib('class','radio-amueblado');
     $this->amueblado->removeDecorator('Errors');
     $this->amueblado->removeDecorator('HtmlTag');
     $this->amueblado->removeDecorator('Label');
     */
     // Código postal
     $this->addElement('text', 'codigoPostal', array('label' => 'Código Postal (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->codigoPostal->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar el CP.')));
     //$this->codigoPostal->addValidator('stringLength', false, array(5, 5));
     $this->codigoPostal->addValidator($this->validatorLenghtCP);
     $this->codigoPostal->addValidator('digits', true, array('messages' => array(Zend_Validate_Digits::NOT_DIGITS => 'Sólo digitos')));
     $this->codigoPostal->setDecorators($this->decoradores);
     $this->codigoPostal->setAttrib('class', 'form_input_contact_small');
     //$this->codigoPostal->removeDecorator('Errors');
     $this->codigoPostal->removeDecorator('HtmlTag');
     $this->codigoPostal->removeDecorator('Label');
     // Provincia
     $this->addElement('text', 'provincia', array('label' => 'Provincia (*)', 'required' => false, 'filters' => array('stringTrim'), 'value' => 'Barcelona'));
     $this->provincia->setAttrib('disabled', 'disabled');
     $this->provincia->setAttrib('class', 'form_input_contact_small');
     $this->provincia->removeDecorator('Errors');
     $this->provincia->removeDecorator('HtmlTag');
     $this->provincia->removeDecorator('Label');
     // Municipio
     $dbMunicipio = new Application_Model_DbTable_Municipio();
     $municipios = $dbMunicipio->getMunicipiosList();
     $this->addElement('select', 'municipio', array('label' => ' ', 'required' => false, 'filters' => array('stringTrim')));
     /*   foreach($municipios as $key => $value){
             $this->municipio->addMultiOption($key,$value);
          }*/
     $this->municipio->addMultiOptions($municipios);
     //$this->municipio->removeDecorator('Errors');
     $this->municipio->setAttrib('class', 'form_select_medium');
     $this->municipio->removeDecorator('HtmlTag');
     $this->municipio->removeDecorator('Label');
     // Tipo de via
     $dbVias = new Application_Model_DbTable_TipoVias();
     $vias = $dbVias->getViasList();
     $this->addElement('select', 'tipoVia', array('label' => ' ', 'required' => false, 'filters' => array('stringTrim')));
     /*   foreach($vias as $key => $value){
             $this->tipoVia->addMultiOption($key,$value);
          }*/
     $this->tipoVia->addMultiOptions($vias);
     //$this->tipoVia->removeDecorator('Errors');
     $this->tipoVia->setAttrib('class', 'form_select_medium');
     $this->tipoVia->removeDecorator('HtmlTag');
     $this->tipoVia->removeDecorator('Label');
     //Nombre de la calle
     $this->addElement('text', 'direccion', array('label' => 'Nombre de la calle (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->direccion->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar la dirección.')));
     $this->direccion->setDecorators($this->decoradores);
     $this->direccion->setAttrib('class', 'form_input_contact');
     //$this->direccion->removeDecorator('Errors');
     $this->direccion->removeDecorator('HtmlTag');
     $this->direccion->removeDecorator('Label');
     // Nº
     $this->addElement('text', 'numero', array('label' => 'Nº (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->numero->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar el Nº.')));
     //$this->numero->addValidator('stringLength', false, array(5, 5));
     //$this->numero->addValidator( $this->validatorLenghtCP );
     $this->numero->addValidator('digits', true, array('messages' => array(Zend_Validate_Digits::NOT_DIGITS => 'Sólo digitos')));
     $this->numero->setDecorators($this->decoradores);
     $this->numero->setAttrib('class', 'form_input_contact_small');
     //$this->numero->removeDecorator('Errors');
     $this->numero->removeDecorator('HtmlTag');
     $this->numero->removeDecorator('Label');
     // Bis
     $this->addElement('checkBox', 'bis', array('label' => 'Bis', 'required' => false, 'checkedValue' => '1', 'uncheckedValue' => '0'));
     $this->bis->setAttrib('class', 'form_input_contact_very_small');
     $this->bis->removeDecorator('Errors');
     $this->bis->removeDecorator('HtmlTag');
     $this->bis->removeDecorator('Label');
     // S/N
     $this->addElement('checkBox', 'sinNumero', array('label' => 'S/N', 'required' => false, 'checkedValue' => '1', 'uncheckedValue' => '0'));
     $this->sinNumero->setAttrib('class', 'form_input_contact_very_small');
     $this->sinNumero->removeDecorator('Errors');
     $this->sinNumero->removeDecorator('HtmlTag');
     $this->sinNumero->removeDecorator('Label');
     // Escalera
     $this->addElement('text', 'escalera', array('label' => 'Escalera (*)', 'required' => false, 'filters' => array('stringTrim')));
     $this->escalera->setAttrib('class', 'form_input_contact_small');
     $this->escalera->removeDecorator('Errors');
     $this->escalera->removeDecorator('HtmlTag');
     $this->escalera->removeDecorator('Label');
     // Piso / Planta
     $dbPlantas = new Application_Model_DbTable_TipoPlanta();
     $plantas = $dbPlantas->getPlantasList();
     $this->addElement('select', 'tipoPlanta', array('label' => ' ', 'required' => false, 'filters' => array('stringTrim')));
     /*   foreach($plantas as $key => $value){
             $this->tipoPlanta->addMultiOption($key,$value);
          }*/
     $this->tipoPlanta->addMultiOptions($plantas);
     //$this->tipoPlanta->removeDecorator('Errors');
     $this->tipoPlanta->setAttrib('class', 'form_select_medium');
     $this->tipoPlanta->removeDecorator('HtmlTag');
     $this->tipoPlanta->removeDecorator('Label');
     // Puerta
     $this->addElement('text', 'puerta', array('label' => 'Puerta', 'required' => false, 'filters' => array('stringTrim')));
     $this->puerta->setAttrib('class', 'form_input_contact_small');
     $this->puerta->removeDecorator('Errors');
     $this->puerta->removeDecorator('HtmlTag');
     $this->puerta->removeDecorator('Label');
     // Otra información
     $this->addElement('textarea', 'informacion', array('label' => 'Otra información', 'required' => false, 'filters' => array('stringTrim')));
     $this->informacion->setAttrib('class', 'form_input_contact');
     $this->informacion->removeDecorator('Errors');
     $this->informacion->removeDecorator('HtmlTag');
     $this->informacion->removeDecorator('Label');
     $this->addElement('Submit', 'Grabar');
 }