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);
 }
Ejemplo n.º 2
0
 public function h_getDescomptes()
 {
     return DescomptesPeer::getDescomptesCursArray($this->getIdcursos(), true);
 }
Ejemplo n.º 3
0
        
        <!-- Si el curs no es ple, o bé es ple amb llista d'espera... -->
        <?php 
    $PAGAMENTS = $OC->getSelectPagaments(true);
    $ACCEPTA_LLISTA_ESPERA = array_key_exists(TipusPeer::PAGAMENT_LLISTA_ESPERA, $PAGAMENTS);
    ?>
        <?php 
    if ($ACCEPTA_LLISTA_ESPERA && $OC->isPle() || !$OC->isPle()) {
        ?>
        
        
            <!-- Preu i descomptes -->
            <div style="float: left; ">
                <div style="float: left; width:150px;"><b>Preu i descomptes: </b></div>
                <div style="float: left;"><?php 
        echo select_tag('matricules[descompte]', options_for_select(DescomptesPeer::getDescomptesCursArray($OC->getIdcursos(), true)), array('style' => 'width:300px', 'id' => 'DESCOMPTES'));
        ?>
</div>
            </div>
                                            
            <div id="compra" style="float: left; clear:both; margin-top:5px;">
                <div style="float: left; width:150px;"><b>Tipus de pagament? </b></div>
                <?php 
        if ($OC->isPle()) {
            ?>
                    <div style="float: left;"><?php 
            echo select_tag('matricules[mode_pagament]', options_for_select(array(TipusPeer::PAGAMENT_LLISTA_ESPERA => $PAGAMENTS[TipusPeer::PAGAMENT_LLISTA_ESPERA])), array('style' => 'width:300px'));
            ?>
</div>                                            
                <?php 
        } else {