extranet/library/Application/Form/RechercheEntreprise.php

204 lines
4.9 KiB
PHP
Raw Normal View History

2011-01-07 17:16:07 +00:00
<?php
2013-05-16 09:06:39 +00:00
class Application_Form_RechercheEntreprise extends Zend_Form
2012-05-20 16:31:28 +00:00
{
2011-01-11 09:17:28 +00:00
public $elementDecorators = array(
'ViewHelper',
'Errors',
2011-04-01 12:14:40 +00:00
array('HtmlTag', array('tag' => 'div', 'class' => 'field')),
array('Label'),
2011-01-11 09:17:28 +00:00
);
public $buttonDecorators = array(
'ViewHelper'
);
2012-05-20 16:31:28 +00:00
2011-01-07 17:16:07 +00:00
public function init()
{
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
$theme = '';
2012-03-26 08:45:23 +00:00
if ( Zend_Registry::isRegistered('theme') ) {
$rtheme = Zend_Registry::get('theme');
2012-05-20 16:31:28 +00:00
if ( !empty($rtheme->name) ) {
$theme = $rtheme->name;
}
}
2012-05-20 16:31:28 +00:00
if ( $theme=='mobile' ) {
$this->elementDecorators = array(
'ViewHelper',
'Errors',
array('Label'),
);
2012-03-26 08:45:23 +00:00
}
2012-05-20 16:31:28 +00:00
2011-01-07 17:16:07 +00:00
$this->setName('recherche');
2011-04-11 14:20:26 +00:00
$this->setAction('/recherche/liste');
2011-01-07 17:16:07 +00:00
$this->setMethod('post');
2012-05-20 16:31:28 +00:00
2012-03-26 08:45:23 +00:00
//type
$this->addElement('hidden', 'type', array(
'value' => 'ent',
'decorators' => array('ViewHelper'),
));
2012-05-20 16:31:28 +00:00
2012-03-26 08:45:23 +00:00
//siret
2011-04-14 13:22:15 +00:00
$this->addElement('text', 'siret', array(
2011-01-07 17:16:07 +00:00
'filters' => array('StringTrim'),
'label' => 'SIREN',
'required' => 'true',
2011-01-11 09:17:28 +00:00
'decorators' => $this->elementDecorators,
2011-04-01 12:14:40 +00:00
'attribs' => array(
'size' => 30,
'maxlength' => 20,
),
2011-01-11 09:17:28 +00:00
));
2012-05-20 16:31:28 +00:00
2012-03-26 08:45:23 +00:00
//raisonSocial
2011-01-07 17:16:07 +00:00
$this->addElement('text', 'raisonSociale', array(
'filters' => array('StringTrim'),
'label' => 'RAISON SOCIALE / ENSEIGNE / SIGLE ',
'required' => 'true',
2011-01-11 09:17:28 +00:00
'decorators' => $this->elementDecorators,
2011-04-01 12:14:40 +00:00
'attribs' => array(
'size' => 30,
'maxlength' => 100,
2011-04-01 12:14:40 +00:00
),
2011-01-11 09:17:28 +00:00
));
2012-05-20 16:31:28 +00:00
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,
),
));
2012-05-20 16:31:28 +00:00
//voie
$this->addElement('text', 'voie', array(
'filters' => array('StringTrim'),
'label' => 'Voie',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
'size' => 20,
'maxlength' => 100,
),
2012-05-20 16:31:28 +00:00
));
} else {
//numero
$this->addElement('text', 'numero', array(
'filters' => array('StringTrim'),
'label' => 'N° & Voie',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
'size' => 2,
'maxlength' => 4,
),
));
2012-05-20 16:31:28 +00:00
//voie
$this->addElement('text', 'voie', array(
'filters' => array('StringTrim'),
'label' => '',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
'size' => 20,
'maxlength' => 100,
),
));
}
2012-05-20 16:31:28 +00:00
2012-03-26 08:45:23 +00:00
//cpVille
2011-01-07 17:16:07 +00:00
$this->addElement('text', 'cpVille', array(
'filters' => array('StringTrim'),
'label' => 'CP OU DÉP. / VILLE',
'required' => 'true',
2011-01-11 09:17:28 +00:00
'decorators' => $this->elementDecorators,
2011-04-01 12:14:40 +00:00
'attribs' => array(
'size' => 30,
'maxlength' => 30,
),
));
2012-05-20 16:31:28 +00:00
2012-03-26 08:45:23 +00:00
//telFax
2011-04-01 12:14:40 +00:00
$this->addElement('text', 'telFax', array(
'filters' => array('StringTrim'),
'label' => 'TÉL / FAX',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
'size' => 30,
'maxlength' => 30,
),
2011-01-11 09:17:28 +00:00
));
2012-05-20 16:31:28 +00:00
2012-03-26 08:45:23 +00:00
//naf
2011-04-01 12:14:40 +00:00
$this->addElement('text', 'naf', array(
2011-01-07 17:16:07 +00:00
'filters' => array('StringTrim'),
2011-04-01 12:14:40 +00:00
'label' => 'NAF',
2013-05-16 15:28:19 +00:00
'title' => 'Saisir ou Rechercher un code NAF',
2011-01-07 17:16:07 +00:00
'required' => 'true',
2011-01-11 09:17:28 +00:00
'decorators' => $this->elementDecorators,
2011-04-01 12:14:40 +00:00
'attribs' => array(
'size' => 30,
'maxlength' => 30,
),
2011-01-11 09:17:28 +00:00
));
2012-05-20 16:31:28 +00:00
//Forme Juridique
$this->addElement('text', 'fj', array(
'filters' => array('StringTrim'),
'label' => 'Forme Juridique',
2013-05-16 15:28:19 +00:00
'title' => 'Saisir ou Rechercher un code Forme Juridique',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
'size' => 30,
'maxlength' => 30,
),
));
2012-03-26 08:45:23 +00:00
//pays
if ($user->checkPerm('INTERNATIONAL')) {
$this->addElement('select', 'pays', array(
2011-04-15 12:27:48 +00:00
'decorators' => $this->elementDecorators,
'label' => 'Pays',
2011-08-12 08:42:32 +00:00
'style' => 'width:175px;',
2011-04-15 12:27:48 +00:00
'required' => true,
'multiOptions' => array(
'' => '',
'FR' => 'France',
'BE' => 'Belgique',
'ES' => 'Espagne',
2011-06-30 15:30:43 +00:00
'GB' => 'United Kingdom',
2011-04-15 12:27:48 +00:00
'NL' => 'Pays-Bas'),
));
}
2012-05-20 16:31:28 +00:00
2012-03-26 08:45:23 +00:00
//submit
2011-01-11 09:17:28 +00:00
$this->addElement('submit', 'submit', array(
2012-03-26 08:45:23 +00:00
'label' => 'Recherche',
'ignore' => true,
'class' => 'button',
'decorators' => $this->buttonDecorators,
2011-01-07 17:16:07 +00:00
));
2012-05-20 16:31:28 +00:00
2012-03-26 08:45:23 +00:00
//reset
2011-01-11 09:17:28 +00:00
$this->addElement('reset', 'reset', array(
2012-03-26 08:45:23 +00:00
'label' => 'Effacer',
'ignore' => true,
'class' => 'button',
'decorators' => $this->buttonDecorators,
2011-01-07 17:16:07 +00:00
));
}
}