1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
<?php
class PaymentForm extends BasePaymentForm
{
// Définition d'un tableau privé pour créer un liste déroulante !
private static $typePaiement = array (
'Mode de Paiement' => 'Mode de Paiement',
'Cheque' => 'Cheque',
'Carte bancaire' => 'Carte bancaire',
'Prelevement bancaire' => 'Prelevement bancaire',
'Numeraire' => 'Numeraire',
'Perception' => 'Perception'
);
private static $nomBanque = array (
'BNP' => 'BNP',
'Caisse depargne' => 'Caisse d epargne',
'CMB' => 'CMB',
'Autres' => 'Autres...'
);
public function configure()
{
$this->widgetSchema['invoice_id'] = new sfWidgetFormInputHidden();
$this->widgetSchema['customer_id'] = new sfWidgetFormInputHidden();
$this->widgetSchema['amount'] = new sfWidgetFormInputText(array(), array('class' => 'amount'));
$this->widgetSchema['notes'] = new sfWidgetFormInputText(array(), array('class' => 'notes', 'style' => 'display:none'));
$this->widgetSchema['mode'] = new sfWidgetFormSelect(array('choices' => self::$typePaiement), array('onchange' => "javascript:selectMode(this.value, this.form);"));
// $this->widgetSchema['banque'] = new sfWidgetFormSelect(array('choises' => self::$nomBanque), array('class' => 'banque', 'id' => 'banque', 'style' => 'display:none'));
$this->widgetSchema['num_cheque'] = new sfWidgetFormInput(array(), array('class' => 'cheque', 'id' => 'num_cheque', 'style' => 'display:none'));
$this->widgetSchema['rib1'] = new sfWidgetFormInput(array(), array('class' => 'rib1', 'id' => 'rib1', 'style' => 'display:none'));
$this->widgetSchema['rib2'] = new sfWidgetFormInput(array(), array('class' => 'rib2', 'id' => 'rib2', 'style' => 'display:none'));
$this->widgetSchema['rib3'] = new sfWidgetFormInput(array(), array('class' => 'rib3', 'id' => 'rib3', 'style' => 'display:none'));
$this->widgetSchema['rib4'] = new sfWidgetFormInput(array(), array('class' => 'rib4', 'id' => 'rib5', 'style' => 'display:none'));
$this->widgetSchema['date'] = new sfWidgetFormI18nJQueryDate($this->JQueryDateOptions);
$this->widgetSchema->setLabels(array(
'date' => 'Date',
'banque' => 'Banque',
'amount' => 'Amount',
'notes' => 'Notes'
));
$this->setDefaults(array(
'date' => time(),
));
$this->widgetSchema->setFormFormatterName('xit');
}
}
?> |
Partager