extranet/library/Form/RechercheEntreprise.php
2012-03-26 08:45:23 +00:00

161 lines
3.9 KiB
PHP

<?php
class Form_RechercheEntreprise extends Zend_Form
{
public $elementDecorators = array(
'ViewHelper',
'Errors',
array('HtmlTag', array('tag' => 'div', 'class' => 'field')),
array('Label'),
);
public $buttonDecorators = array(
'ViewHelper'
);
public function init()
{
require_once 'Scores/Utilisateur.php';
$user = new Utilisateur();
if ( Zend_Registry::isRegistered('theme') ) {
$theme = Zend_Registry::get('theme');
if ( $theme->name=='mobile' ) {
$this->elementDecorators = array(
'ViewHelper',
'Errors',
array('Label'),
);
}
}
$this->setName('recherche');
$this->setAction('/recherche/liste');
$this->setMethod('post');
//type
$this->addElement('hidden', 'type', array(
'value' => 'ent',
'decorators' => array('ViewHelper'),
));
//siret
$this->addElement('text', 'siret', array(
'filters' => array('StringTrim'),
'label' => 'SIREN',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
'size' => 30,
'maxlength' => 20,
),
));
//raisonSocial
$this->addElement('text', 'raisonSociale', array(
'filters' => array('StringTrim'),
'label' => 'RAISON SOCIALE / ENSEIGNE / SIGLE ',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
'size' => 30,
'maxlength' => 100,
),
));
//numero
$this->addElement('text', 'numero', array(
'filters' => array('StringTrim'),
'label' => 'N° & Voie',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
'size' => 2,
'maxlength' => 4,
),
));
//voie
$this->addElement('text', 'voie', array(
'filters' => array('StringTrim'),
'label' => '',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
'size' => 20,
'maxlength' => 100,
),
));
//cpVille
$this->addElement('text', 'cpVille', array(
'filters' => array('StringTrim'),
'label' => 'CP OU DÉP. / VILLE',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
'size' => 30,
'maxlength' => 30,
),
));
//telFax
$this->addElement('text', 'telFax', array(
'filters' => array('StringTrim'),
'label' => 'TÉL / FAX',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
'size' => 30,
'maxlength' => 30,
),
));
//naf
$this->addElement('text', 'naf', array(
'filters' => array('StringTrim'),
'label' => 'NAF',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
'size' => 30,
'maxlength' => 30,
),
));
//pays
if ($user->checkPerm('INTERNATIONAL')) {
$this->addElement('select', 'pays', array(
'decorators' => $this->elementDecorators,
'label' => 'Pays',
'style' => 'width:175px;',
'required' => true,
'multiOptions' => array(
'' => '',
'FR' => 'France',
'BE' => 'Belgique',
'ES' => 'Espagne',
'GB' => 'United Kingdom',
'NL' => 'Pays-Bas'),
));
}
//submit
$this->addElement('submit', 'submit', array(
'label' => 'Recherche',
'ignore' => true,
'class' => 'button',
'decorators' => $this->buttonDecorators,
));
//reset
$this->addElement('reset', 'reset', array(
'label' => 'Effacer',
'ignore' => true,
'class' => 'button',
'decorators' => $this->buttonDecorators,
));
}
}