Beispiel #1
0
 public function setup()
 {
     $this->setWidgets(array('idMatricules' => new sfWidgetFormInputHidden(), 'Usuaris_UsuariID' => new sfWidgetFormInputHidden(), 'Cursos_idCursos' => new sfWidgetFormChoice(array('choices' => CursosPeer::getSelectCursos())), 'Estat' => new sfWidgetFormChoice(array('choices' => MatriculesPeer::getEstatsSelect())), 'DataInscripcio' => new sfWidgetFormDateTime(array('date' => array('format' => '%day%/%month%/%year%'))), 'Pagat' => new sfWidgetFormInputText(), 'tReduccio' => new sfWidgetFormChoice(array('choices' => MatriculesPeer::selectDescomptes())), 'tPagament' => new sfWidgetFormChoice(array('choices' => MatriculesPeer::selectPagament())), 'Comentari' => new sfWidgetFormTextarea()));
     $this->setValidators(array('idMatricules' => new sfValidatorPropelChoice(array('model' => 'Matricules', 'column' => 'idMatricules', 'required' => false)), 'Usuaris_UsuariID' => new sfValidatorPropelChoice(array('model' => 'Usuaris', 'column' => 'UsuariID')), 'Cursos_idCursos' => new sfValidatorPropelChoice(array('model' => 'Cursos', 'column' => 'idCursos')), 'Estat' => new sfValidatorInteger(array('required' => false)), 'Comentari' => new sfValidatorString(array('required' => false)), 'DataInscripcio' => new sfValidatorDateTime(array('required' => false)), 'Pagat' => new sfValidatorNumber(array('required' => false)), 'tReduccio' => new sfValidatorInteger(), 'tPagament' => new sfValidatorInteger()));
     $this->widgetSchema->setLabels(array('Cursos_idCursos' => 'Curs: ', 'Estat' => 'Estat: ', 'Comentari' => 'Comentari: ', 'DataInscripcio' => 'Data d\'inscripció: ', 'Descompte' => 'Te descompte? ', 'tReduccio' => 'Te reducció? ', 'tPagament' => 'Com ha pagat? '));
     $this->widgetSchema->setNameFormat('matricules[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
 }
 public function setup()
 {
     $A_Years = array();
     $avui = date('Y', time());
     for ($year = $avui - 10; $year < $avui + 10; $year++) {
         $A_Years[$year] = $year;
     }
     $IDU = $this->getObject()->getUsuarisUsuariid();
     $this->setWidgets(array('idMatricules' => new sfWidgetFormInputHidden(), 'Usuaris_UsuariID' => new sfWidgetFormInputHidden(), 'Cursos_idCursos' => new sfWidgetFormChoice(array('choices' => CursosPeer::getSelectCursosMatriculaInterna($this->getOption('IDS'), $this->getObject()->getCursosidcursos()))), 'Estat' => new sfWidgetFormChoice(array('choices' => MatriculesPeer::getEstatsSelect())), 'DataInscripcio' => new sfWidgetFormDateTime(array('date' => array('format' => '%day%/%month%/%year%'))), 'Data_pagament' => new sfWidgetFormJQueryDate(array('format' => '%day%/%month%/%year%', 'years' => $A_Years), array()), 'data_baixa' => new sfWidgetFormDate(array('format' => '%day%/%month%/%year%')), 'Pagat' => new sfWidgetFormInputText(), 'tReduccio' => new sfWidgetFormChoice(array('choices' => DescomptesPeer::getDescomptesCursArray($this->getOption('IDC'), true))), 'tPagament' => new sfWidgetFormChoice(array('choices' => TipusPeer::getTipusPagamentInternArray())), 'idDadesBancaries' => new sfWidgetFormChoice(array('choices' => DadesBancariesPeer::getSelectBySelect(DadesBancariesPeer::getDadesUsuari($IDU), false, true))), 'Comentari' => new sfWidgetFormTextarea()));
     $this->setValidators(array('idMatricules' => new sfValidatorPropelChoice(array('model' => 'Matricules', 'column' => 'idMatricules', 'required' => false)), 'Usuaris_UsuariID' => new sfValidatorPropelChoice(array('model' => 'Usuaris', 'column' => 'UsuariID')), 'Cursos_idCursos' => new sfValidatorPropelChoice(array('model' => 'Cursos', 'column' => 'idCursos')), 'Estat' => new sfValidatorInteger(array('required' => false)), 'Comentari' => new sfValidatorString(array('required' => false)), 'DataInscripcio' => new sfValidatorDateTime(array('required' => false)), 'data_baixa' => new sfValidatorDateTime(array('required' => false)), 'Data_pagament' => new sfValidatorDateTime(array('required' => false)), 'Pagat' => new sfValidatorNumber(array('required' => false)), 'tReduccio' => new sfValidatorInteger(), 'tPagament' => new sfValidatorInteger(), 'idDadesBancaries' => new sfValidatorInteger(array('required' => false))));
     $this->widgetSchema->setLabels(array('Cursos_idCursos' => 'Curs: ', 'Estat' => 'Estat: ', 'Comentari' => 'Comentari: ', 'DataInscripcio' => 'Data d\'inscripció: ', 'data_baixa' => 'Data de baixa: ', 'Data_pagament' => 'Data de pagament: ', 'Descompte' => 'Te descompte? ', 'tReduccio' => 'Te reducció? ', 'tPagament' => 'Com ha pagat? ', 'idDadesBancaries' => 'CCC'));
     $this->widgetSchema->setNameFormat('matricules[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
 }