202 lines
4.8 KiB
PHP
202 lines
4.8 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()
|
|
{
|
|
$user = new Scores_Utilisateur();
|
|
|
|
$theme = '';
|
|
if ( Zend_Registry::isRegistered('theme') ) {
|
|
$rtheme = Zend_Registry::get('theme');
|
|
if ( !empty($rtheme->name) ) {
|
|
$theme = $rtheme->name;
|
|
}
|
|
}
|
|
|
|
if ( $theme=='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,
|
|
),
|
|
));
|
|
|
|
if ( $theme=='mobile' ) {
|
|
//numero
|
|
$this->addElement('text', 'numero', array(
|
|
'filters' => array('StringTrim'),
|
|
'label' => 'N°',
|
|
'required' => 'true',
|
|
'decorators' => $this->elementDecorators,
|
|
'attribs' => array(
|
|
'size' => 2,
|
|
'maxlength' => 4,
|
|
),
|
|
));
|
|
|
|
//voie
|
|
$this->addElement('text', 'voie', array(
|
|
'filters' => array('StringTrim'),
|
|
'label' => 'Voie',
|
|
'required' => 'true',
|
|
'decorators' => $this->elementDecorators,
|
|
'attribs' => array(
|
|
'size' => 20,
|
|
'maxlength' => 100,
|
|
),
|
|
));
|
|
} else {
|
|
//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,
|
|
),
|
|
));
|
|
|
|
//Forme Juridique
|
|
$this->addElement('text', 'fj', array(
|
|
'filters' => array('StringTrim'),
|
|
'label' => 'Forme Juridique',
|
|
'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,
|
|
));
|
|
}
|
|
|
|
}
|