public function setup()
 {
     $this->setWidgets(array('horari_id' => new sfWidgetFormInputHidden(), 'actiu' => new sfWidgetFormChoice(array('choices' => array(0 => 'No', 1 => 'Sí')), array('style' => 'width:100px')), 'Preu' => new sfWidgetFormInputText(array(), array('style' => 'width:100px')), 'Places' => new sfWidgetFormInputText(array(), array('style' => 'width:100px')), 'PagamentExtern' => new sfWidgetFormChoice(array('choices' => TipusPeer::getTipusPagamentExternArray(), 'multiple' => true), array('style' => 'height:150px')), 'PagamentIntern' => new sfWidgetFormChoice(array('choices' => TipusPeer::getTipusPagamentInternArray(), 'multiple' => true), array('style' => 'height:150px')), 'site_id' => new sfWidgetFormInputHidden(), 'descomptes' => new sfWidgetFormChoice(array('choices' => array()), array())));
     $this->setValidators(array('horari_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->getHorariId()), 'empty_value' => $this->getObject()->getHorariId(), 'required' => false)), 'Preu' => new sfValidatorInteger(array('min' => 0, 'max' => 200, 'required' => false)), 'Places' => new sfValidatorInteger(array('min' => 1, 'max' => 3000, 'required' => false)), 'site_id' => new sfValidatorInteger(array('min' => 0, 'max' => 32767)), 'actiu' => new sfValidatorInteger(array('min' => 0, 'max' => 1)), 'descomptes' => new sfValidatorCallback(array('callback' => array('EntradesPreusForm', 'ComprovaDescomptes'), 'arguments' => array(), 'required' => true)), 'PagamentIntern' => new sfValidatorCallback(array('callback' => array('EntradesPreusForm', 'PagamentIntern'), 'arguments' => array(), 'required' => true)), 'PagamentExtern' => new sfValidatorCallback(array('callback' => array('EntradesPreusForm', 'PagamentExtern'), 'arguments' => array(), 'required' => true))));
     $this->widgetSchema->setNameFormat('entrades_preus[%s]');
     $this->widgetSchema->setLabels(array('Preu' => 'Preu', 'Places' => 'Places', 'Tipus' => 'Tipus', 'descomptes' => 'Descomptes', 'PagamentExtern' => 'P. Extranet', 'PagamentIntern' => 'P. Intranet', 'actiu' => 'Actiu'));
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     $this->widgetSchema->setFormFormatterName('SpanHorizontal');
 }
Exemplo n.º 2
0
 public function getPagamentExternSelect()
 {
     $RET = array();
     $A = $this->getPagamentExtern();
     $A2 = TipusPeer::getTipusPagamentExternArray();
     foreach ($A as $E) {
         $RET[$E] = $A2[$E];
     }
     if ($this->getIsPle() && $this->hasLlistaEspera()) {
         $RET = array();
         $RET[TipusPeer::PAGAMENT_LLISTA_ESPERA] = $A2[TipusPeer::PAGAMENT_LLISTA_ESPERA];
     } elseif (!$this->getIsPle()) {
         unset($RET[TipusPeer::PAGAMENT_LLISTA_ESPERA]);
     }
     return $RET;
 }
 public static function getTipusPagaments($IDH, $intern = false)
 {
     $RET = array();
     $OEP = EntradesPreusPeer::retrieveByPK($IDH);
     if ($intern) {
         $A = $OEP->getPagamentIntern();
         $AP = TipusPeer::getTipusPagamentInternArray();
     } else {
         $A = $OEP->getPagamentExtern();
         $AP = TipusPeer::getTipusPagamentExternArray();
     }
     foreach ($A as $id) {
         $RET[$id] = $AP[$id];
     }
     return $RET;
 }
Exemplo n.º 4
0
                    <div class="clear row fb">
                        <span class="title row_title fb"><label for="cursos_isRestringit">Restringit? </label></span>
                        <span class="row_field fb"><?php 
    echo select_tag('cursos[isRestringit]', options_for_select(array('' => '---', 1 => 'Sí', 0 => 'No'), $FOC['isRestringit']->getValue()));
    ?>
</span>
                    </div>
                    
                    <div class="clear row fb">
                        <span class="title row_title fb"><label for="cursos_VisibleAWeb">Pagament acceptat? </label></span>
                        <span class="row_field fb">
                            <div style="float: left; margin-right:10px;">
                                <b>Extranet</b><br />
                                <?php 
    echo select_tag('cursos[PagamentExtern]', options_for_select(TipusPeer::getTipusPagamentExternArray(), $FOC['PagamentExtern']->getValue()), array('multiple' => 'multiple', 'style' => 'height:140px; width:200px;'));
    ?>
                            </div>                        
                            <div style="float: left; margin-right:10px;">
                                <b>Intranet</b><br />
                                <?php 
    echo select_tag('cursos[PagamentIntern]', options_for_select(TipusPeer::getTipusPagamentInternArray(), $FOC['PagamentIntern']->getValue()), array('multiple' => 'multiple', 'style' => 'height:140px; width:200px;'));
    ?>
                            </div>                                                                                                
                        </span>
                    </div>

                    <div class="clear row fb">
                        <span class="title row_title fb"><label for="cursos_ADescomptes">Descomptes? </label></span>
                        <table>
                            <tr>