2012-05-11 12:26:16 +00:00
|
|
|
<?php
|
|
|
|
class Scores_Fields
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Fields options to display
|
|
|
|
* [name] => array(
|
|
|
|
* label =>
|
|
|
|
* fields => array(
|
|
|
|
* type => array()
|
|
|
|
* ...
|
|
|
|
* )
|
|
|
|
* famille =>
|
|
|
|
* activated =>
|
2012-05-17 19:44:16 +00:00
|
|
|
* title =>
|
2012-05-11 12:26:16 +00:00
|
|
|
* )
|
|
|
|
* )
|
|
|
|
*
|
2012-05-11 20:25:55 +00:00
|
|
|
* name : the key to retrieve field parameters
|
2012-05-11 12:26:16 +00:00
|
|
|
* label : the string to display as title
|
2012-05-11 20:25:55 +00:00
|
|
|
* famille : the key to identify where familly the field belongs to
|
2012-05-11 12:26:16 +00:00
|
|
|
* activated : true or false
|
2012-05-17 19:44:16 +00:00
|
|
|
* title : Text to display as info or help
|
2012-05-11 12:26:16 +00:00
|
|
|
*
|
|
|
|
* fields : define all different fields for the same element
|
|
|
|
* => type : which type of element (select, text, tree, ...), it's the key for array
|
2012-05-11 20:25:55 +00:00
|
|
|
* => value :
|
2012-05-11 12:26:16 +00:00
|
|
|
* => label (optional) :
|
|
|
|
* => class :
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $fields = array
|
|
|
|
(
|
2012-05-11 20:25:55 +00:00
|
|
|
'siege' => array (
|
2012-05-11 12:26:16 +00:00
|
|
|
'label' => "Type d'établissement",
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Sièges', '0' => 'Secondaires')),
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
2012-05-17 19:44:16 +00:00
|
|
|
'title' => 'Aide',
|
2012-05-11 12:26:16 +00:00
|
|
|
),
|
2012-05-11 20:25:55 +00:00
|
|
|
'groupe' => array(
|
|
|
|
'label' => "Appartient à un groupe",
|
2012-05-11 12:26:16 +00:00
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'tel' => array(
|
|
|
|
'label' => 'Téléphone renseigné',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'fax' => array(
|
|
|
|
'label' => 'Télécopie renseignée',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'web' => array(
|
|
|
|
'label' => 'Site Web renseigné',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'mail' => array(
|
|
|
|
'label' => 'Email de contact renseigné',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'presentRcs' => array(
|
|
|
|
'label' => 'Etablissement présent au RNCS',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'adrDom' => array(
|
|
|
|
'label' => 'Adresse de domiciliation',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'dirNom' => array(
|
|
|
|
'label' => 'Nom du principal dirigeant présent',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
|
|
|
|
/* What is this ? */
|
|
|
|
'lieuAct' => array(
|
|
|
|
'label' => "Lieu d\'activté",
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '1000')),
|
|
|
|
'textarea' => array('value' => null)
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'nbMPubli' => array(
|
|
|
|
'label' => 'Marchés publiques remportés',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'dateCrea_ent' => array(
|
2012-05-11 20:25:55 +00:00
|
|
|
'label' => "Date de création de l'entreprise",
|
2012-05-11 12:26:16 +00:00
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '1000'))
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'dateCrea_etab' => array(
|
|
|
|
'label' => "Date de création de l'établissement",
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '1000'))
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'action' => array(
|
|
|
|
'label' => 'Présence d\'actionnaires',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'nbActio' => array(
|
|
|
|
'label' => 'Nombre d\'actionnaires connus',
|
|
|
|
'fields' => array(
|
2012-05-11 20:25:55 +00:00
|
|
|
//@todo : getMinMax
|
|
|
|
'interval' => array('value' => null)
|
2012-05-11 12:26:16 +00:00
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
2012-05-11 20:25:55 +00:00
|
|
|
'participation' => array(
|
2012-05-11 12:26:16 +00:00
|
|
|
'label' => "Présence de participations",
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'nbPart' => array(
|
|
|
|
'label' => 'Nombre de participations connues',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '1000'))
|
|
|
|
),
|
|
|
|
'famille' => 'entreprise',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'ape_etab' => array(
|
|
|
|
'label' => "Activité de l'établissement (Code NAF)",
|
|
|
|
'fields' => array(
|
|
|
|
'tree' => array('value' => null, 'action' => 'naf', 'title' => "Arborescence de code NAF etablissement"),
|
|
|
|
'text' => array('value' => null, 'label' => "Recherche de code NAF", 'title'=>"Selection de code NAF etablissement"),
|
|
|
|
),
|
|
|
|
'famille' => 'economique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'ape_entrep' => array(
|
2012-05-14 13:16:14 +00:00
|
|
|
'label' => "Activité de l'entreprise (Code NAF)",
|
2012-05-11 12:26:16 +00:00
|
|
|
'fields' => array(
|
2012-05-14 13:16:14 +00:00
|
|
|
'tree' => array('value' => null, 'action' => 'naf', 'title' => "Arborescence de code NAF entreprise"),
|
|
|
|
'text' => array('value' => null, 'label' => "Recherche de code NAF", 'title'=>"Selection de code NAF entreprise"),
|
2012-05-11 12:26:16 +00:00
|
|
|
),
|
|
|
|
'famille' => 'economique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'NaceEtab' => array(
|
|
|
|
'label' => 'Code NACE de l\'établissement',
|
|
|
|
'fields' => array(
|
|
|
|
'text' => array('value' => null),
|
|
|
|
'textarea' => array('value' => null)
|
|
|
|
),
|
|
|
|
'famille' => 'economique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'NaceEntrep' => array(
|
|
|
|
'label' => 'Code NACE de l\'entreprise',
|
|
|
|
'fields' => array(
|
|
|
|
'text' => array('value' => null),
|
|
|
|
'textarea' => array('value' => null)
|
|
|
|
),
|
|
|
|
'famille' => 'economique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'age_etab' => array(
|
|
|
|
'label' => 'Age de l\'entreprise',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => null)
|
|
|
|
),
|
|
|
|
'famille' => 'economique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'age_entrep' => array(
|
|
|
|
'label' => 'Age de l\'établissement',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => null)
|
|
|
|
),
|
|
|
|
'famille' => 'economique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'teff_entrep' => array(
|
2012-05-11 20:25:55 +00:00
|
|
|
'label' => "Tranche d'effectif de l'Entreprise",
|
2012-05-11 12:26:16 +00:00
|
|
|
'fields' => array(
|
2012-05-11 20:25:55 +00:00
|
|
|
'selectMultiple' => array(
|
|
|
|
'value' => array(
|
|
|
|
'NN' => "Unités non employeuses",
|
|
|
|
'0' => "0 salarié",
|
|
|
|
'1' => "1 ou 2 salariés",
|
|
|
|
'2' => "3 à 5 salariés",
|
|
|
|
'3' => "6 à 9 salariés",
|
|
|
|
'11' => "10 à 19 salariés",
|
|
|
|
'12' => "20 à 49 salariés",
|
|
|
|
'21' => "50 à 99 salariés",
|
|
|
|
'22' => "100 à 199 salariés",
|
|
|
|
'31' => "200 à 249 salariés",
|
|
|
|
'32' => "250 à 499 salariés",
|
|
|
|
'41' => "500 à 999 salariés",
|
|
|
|
'42' => "1 000 à 1 999 salariés",
|
|
|
|
'51' => "2 000 à 4 999 salariés",
|
|
|
|
'52' => "5 000 à 9 999 salariés",
|
|
|
|
'53' => "10 000 salariés et plus",
|
|
|
|
),
|
|
|
|
),
|
2012-05-11 12:26:16 +00:00
|
|
|
),
|
|
|
|
'famille' => 'economique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'teff_etab' => array(
|
|
|
|
'label' => 'Tranche d\'effectif de l\'établissement',
|
|
|
|
'fields' => array(
|
2012-05-11 20:25:55 +00:00
|
|
|
'selectMultiple' => array(
|
2012-05-11 12:26:16 +00:00
|
|
|
'value' => array(
|
2012-05-11 20:25:55 +00:00
|
|
|
'NN' => "Unités non employeuses",
|
|
|
|
'0' => "0 salarié",
|
|
|
|
'1' => "1 ou 2 salariés",
|
|
|
|
'2' => "3 à 5 salariés",
|
|
|
|
'3' => "6 à 9 salariés",
|
|
|
|
'11' => "10 à 19 salariés",
|
|
|
|
'12' => "20 à 49 salariés",
|
|
|
|
'21' => "50 à 99 salariés",
|
|
|
|
'22' => "100 à 199 salariés",
|
|
|
|
'31' => "200 à 249 salariés",
|
|
|
|
'32' => "250 à 499 salariés",
|
|
|
|
'41' => "500 à 999 salariés",
|
|
|
|
'42' => "1 000 à 1 999 salariés",
|
|
|
|
'51' => "2 000 à 4 999 salariés",
|
|
|
|
'52' => "5 000 à 9 999 salariés",
|
|
|
|
'53' => "10 000 salariés et plus",
|
2012-05-11 12:26:16 +00:00
|
|
|
)
|
2012-05-11 20:25:55 +00:00
|
|
|
),
|
2012-05-11 12:26:16 +00:00
|
|
|
),
|
|
|
|
'famille' => 'economique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'nbEtab' => array(
|
|
|
|
'label' => 'Nombre d\'établissements',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'economique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'eff_entrep' => array(
|
|
|
|
'label' => 'Effectif réel de l\'entreprise',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'economique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'eff_etab' => array(
|
|
|
|
'label' => 'Effectif réel de l\'établissement',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'economique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'capital' => array(
|
|
|
|
'label' => 'Capital de l\'entreprise',
|
|
|
|
'fields' => array(
|
|
|
|
'intervalSelect' => array(
|
|
|
|
'value' => array(
|
|
|
|
array(0, 15000),
|
|
|
|
array(15000, 30000),
|
|
|
|
array(30000, 75000),
|
|
|
|
array(75000, 150000),
|
|
|
|
array(150000, 750000),
|
|
|
|
array(750000, 0),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
|
|
|
'famille' => 'economique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
//geographique
|
2012-05-15 11:38:51 +00:00
|
|
|
'geo' => array(
|
2012-05-11 12:26:16 +00:00
|
|
|
'label' => 'Localisation géographique',
|
|
|
|
'fields' => array(
|
|
|
|
'tree' => array('value' => null, 'action' => 'geographique', 'title' => "Arborescence géographique"),
|
|
|
|
'text' => array('value' => null, 'label' => "Recherche", 'title'=>"Recherche géographique"),
|
|
|
|
),
|
|
|
|
'famille' => 'geographique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
2012-05-11 20:25:55 +00:00
|
|
|
|
|
|
|
'geo_domtom' => array(
|
|
|
|
'label' => 'Exlcure les DOM-TOM',
|
2012-05-11 12:26:16 +00:00
|
|
|
'fields' => array(
|
2012-05-11 20:25:55 +00:00
|
|
|
'checkbox' => array('value' => '1'),
|
2012-05-11 12:26:16 +00:00
|
|
|
),
|
|
|
|
'famille' => 'geographique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
2012-05-11 20:25:55 +00:00
|
|
|
'geo_etranger' => array(
|
|
|
|
'label' => 'Exclure les départements étrangers',
|
2012-05-11 12:26:16 +00:00
|
|
|
'fields' => array(
|
2012-05-11 20:25:55 +00:00
|
|
|
'checkbox' => array('value' => '1'),
|
2012-05-11 12:26:16 +00:00
|
|
|
),
|
|
|
|
'famille' => 'geographique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
2012-05-11 20:25:55 +00:00
|
|
|
'geo_corse' => array(
|
|
|
|
'label' => 'Exclure la corse',
|
2012-05-11 12:26:16 +00:00
|
|
|
'fields' => array(
|
2012-05-11 20:25:55 +00:00
|
|
|
'checkbox' => array('value' => '1'),
|
2012-05-11 12:26:16 +00:00
|
|
|
),
|
|
|
|
'famille' => 'geographique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'adr_reg' => array(
|
|
|
|
'label' => 'Liste code région',
|
|
|
|
'fields' => array(
|
|
|
|
'text' => array('value' => null),
|
|
|
|
'textarea' => array('value' => null)
|
|
|
|
),
|
|
|
|
'famille' => 'geographique',
|
|
|
|
'activated' => true,
|
|
|
|
'type' => 'textarea',
|
|
|
|
'class' => null,
|
|
|
|
'action' => 'geographique',
|
|
|
|
'title' => 'Localisation'
|
|
|
|
),
|
|
|
|
'zus' => array(
|
|
|
|
'label' => 'Zones urbaines sensibles',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
|
|
|
),
|
|
|
|
'famille' => 'geographique',
|
|
|
|
'activated' => true,
|
|
|
|
'type' => 'select',
|
|
|
|
),
|
|
|
|
'zru' => array(
|
|
|
|
'label' => 'Zones de redynamisation urbaine',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
|
|
|
),
|
|
|
|
'famille' => 'geographique',
|
|
|
|
'activated' => true,
|
|
|
|
'type' => 'select',
|
|
|
|
),
|
|
|
|
'zfu' => array(
|
|
|
|
'label' => 'zones franches urbaines',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
|
|
|
),
|
|
|
|
'famille' => 'geographique',
|
|
|
|
'activated' => true,
|
|
|
|
'type' => 'select',
|
|
|
|
),
|
|
|
|
'cucs' => array(
|
|
|
|
'label' => 'Contrats urbains de cohésion sociale',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
|
|
|
),
|
|
|
|
'famille' => 'geographique',
|
|
|
|
'activated' => true,
|
|
|
|
'type' => 'select',
|
|
|
|
),
|
|
|
|
'zrr' => array(
|
|
|
|
'label' => 'Zone de revitalisation rurale',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
|
|
|
),
|
|
|
|
'famille' => 'geographique',
|
|
|
|
'activated' => true,
|
|
|
|
'type' => 'select',
|
|
|
|
),
|
|
|
|
'zafr' => array(
|
|
|
|
'label' => 'Zones Aide à finalité régionale',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
|
|
|
),
|
|
|
|
'famille' => 'geographique',
|
|
|
|
'activated' => true,
|
|
|
|
'type' => 'select',
|
|
|
|
),
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Forme Juridique
|
|
|
|
*/
|
|
|
|
'cj' => array(
|
|
|
|
'label' => 'Forme Juridique',
|
|
|
|
'fields' => array(
|
|
|
|
'tree' => array('value' => null, 'action' => 'juridique', 'title' => "Arborescence Forme Juridique"),
|
|
|
|
'text' => array('value' => null, 'label' => "Recherche", 'title'=>"Recherche Forme Juridique"),
|
|
|
|
),
|
|
|
|
'famille' => 'juridique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
|
|
|
|
'actifEco' => array(
|
|
|
|
'label' => 'Établissement économiquement actif',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
|
|
|
),
|
|
|
|
'famille' => 'juridique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'procolHisto' => array(
|
|
|
|
'label' => 'Présence procédure collective dans histo',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
|
|
|
),
|
|
|
|
'famille' => 'juridique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'tvaIntraValide' => array(
|
|
|
|
'label' => 'Numéro de TVA intracommunautaire valide',
|
|
|
|
'fields' => array(
|
|
|
|
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
|
|
|
),
|
|
|
|
'famille' => 'juridique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'dateImmat' => array(
|
|
|
|
'label' => 'Date d\'immatriculation',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '1000'))
|
|
|
|
),
|
|
|
|
'famille' => 'juridique',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
//financier
|
|
|
|
'bilType' => array(
|
|
|
|
'label' => 'Type du dernier bilan',
|
|
|
|
'fields' => array(
|
|
|
|
'selectMultiple' => array('value' => array(
|
|
|
|
'I' => 'Inconnue',
|
|
|
|
'R' => 'Réel',
|
|
|
|
'E' => 'Estimé')
|
|
|
|
),
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'avisCs' => array(
|
|
|
|
'label' => 'Informations de paiements',
|
|
|
|
'fields' => array(
|
|
|
|
'selectMultiple' => array('value' => array(
|
|
|
|
'' => 'Risque indéterminé',
|
|
|
|
'00' => 'Aucun risque resencé',
|
|
|
|
'10' => 'Présence d\'impayé(s)',
|
|
|
|
'15' => 'Présence de privilèges',
|
|
|
|
'23-29-39-43' => 'Risque moyen',
|
|
|
|
'21-26-28' => 'Risque important',
|
|
|
|
'31-50' => 'Risque très important',
|
|
|
|
'24' => 'Risque dans le groupe')
|
|
|
|
),
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilDuree' => array(
|
|
|
|
'label' => 'Durée du dernier bilan en mois',
|
|
|
|
'fields' => array(
|
|
|
|
'intervalSelect' => array(
|
|
|
|
'value' => array(
|
|
|
|
array(0, 5),
|
|
|
|
array(5, 10),
|
|
|
|
array(10, 15),
|
|
|
|
array(20, 23),
|
|
|
|
array(23, 0)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilTca' => array(
|
|
|
|
'label' => 'Tranche de CA issue du bilan',
|
|
|
|
'fields' => array(
|
|
|
|
'selectMultiple' => array('value' => array(
|
|
|
|
'0' => 'Non déterminée',
|
|
|
|
'1' => 'de 500K€ à1M€',
|
|
|
|
'2' => 'de 1 à 2 ME',
|
|
|
|
'3' => 'de 2 à 5 ME',
|
|
|
|
'4' => 'de 5 à 10 ME',
|
|
|
|
'5' => 'de 10 à 20 ME',
|
|
|
|
'6' => 'de 20 à 50 ME',
|
|
|
|
'7' => '50 à 100 ME',
|
|
|
|
'8' => 'de 100 à 200 ME',
|
|
|
|
'9' => '+ de 200 ME'
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilAnnee' => array(
|
|
|
|
'label' => 'Dernière année de bilan',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '1000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilCloture' => array(
|
|
|
|
'label' => 'Dernière date de clôture du bilan',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '1000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilEE' => array(
|
|
|
|
'label' => 'Total bilan (EE)',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilFL' => array(
|
|
|
|
'label' => 'CA total (FL)',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilFK' => array(
|
|
|
|
'label' => 'Chiffre d\'affaires Export (FK)',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilFR' => array(
|
|
|
|
'label' => 'Produits d\'Exploitation (FR)',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
'type' => 'interval',
|
|
|
|
'class' => null
|
|
|
|
),
|
|
|
|
'bilGF' => array(
|
|
|
|
'label' => 'Charges d\'Exploitation (GF)',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilGP' => array(
|
|
|
|
'label' => 'Charges Financières (GP)',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilGW' => array(
|
|
|
|
'label' => 'R.C.A.I - Résultat courant av. impôt (GW)',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilHD' => array(
|
|
|
|
'label' => 'Produits Exceptionnels (HD)',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilHH' => array(
|
|
|
|
'label' => 'Charges Exceptionnels (HH)',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilHL' => array(
|
|
|
|
'label' => 'Total des Produits (HL)',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilHM' => array(
|
|
|
|
'label' => 'Total des Charges (HM)',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilHN' => array(
|
|
|
|
'label' => 'Résultat (HN)',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
),
|
|
|
|
'bilYP' => array(
|
|
|
|
'label' => 'Effectif salarié (YP)',
|
|
|
|
'fields' => array(
|
|
|
|
'interval' => array('value' => array('0', '10000000'))
|
|
|
|
),
|
|
|
|
'famille' => 'financier',
|
|
|
|
'activated' => true,
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Save all information in this array
|
|
|
|
* The key NB is mandatory as this
|
|
|
|
* ['NB']['total'] => store the number of elements matches
|
|
|
|
* ['NB']['insee'] => store the number of elements matches which type is INSEE
|
2012-05-11 20:25:55 +00:00
|
|
|
* Other keys
|
|
|
|
* [key][in] => inclusion
|
|
|
|
* [key][ex] => exclusion
|
2012-05-11 12:26:16 +00:00
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $ciblage;
|
|
|
|
protected $total = null;
|
|
|
|
protected $insee = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param boolean $batch
|
|
|
|
*/
|
|
|
|
public function __construct($batch = false)
|
|
|
|
{
|
|
|
|
$session = new Zend_Session_Namespace('ciblage');
|
|
|
|
$this->ciblage = empty($session->ciblage) ? array() : $session->ciblage;
|
|
|
|
if (isset($this->ciblage['NB']['total'])) { $this->total = $this->ciblage['NB']['total']; }
|
|
|
|
if (isset($this->ciblage['NB']['insee'])) { $this->insee = $this->ciblage['NB']['insee']; }
|
|
|
|
if (isset($this->ciblage['NB'])) { unset($this->ciblage['NB']); }
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Save data to session
|
|
|
|
*/
|
|
|
|
protected function setSession()
|
|
|
|
{
|
|
|
|
$session = new Zend_Session_Namespace('ciblage');
|
|
|
|
$this->ciblage['NB']['total'] = $this->total;
|
|
|
|
$this->ciblage['NB']['insee'] = $this->insee;
|
|
|
|
$session->ciblage = $this->ciblage;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enregistre un critère et sa valeur
|
|
|
|
* @param string $key
|
|
|
|
* @param mixed $value
|
2012-05-11 20:25:55 +00:00
|
|
|
* @param boolean $ex
|
2012-05-11 12:26:16 +00:00
|
|
|
*/
|
2012-05-11 20:25:55 +00:00
|
|
|
public function setCritere($key, $value, $ex = false)
|
2012-05-11 12:26:16 +00:00
|
|
|
{
|
2012-05-11 20:25:55 +00:00
|
|
|
//Remove critere for these values on all type of fields
|
|
|
|
if ( in_array($value, array('', '-', null)) ) {
|
|
|
|
unset($this->ciblage[$key]);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-05-15 11:38:51 +00:00
|
|
|
$types = array_keys($this->fields[$key]['fields']);
|
|
|
|
|
|
|
|
if ( !is_array($value) && !in_array($types[0], array('select', 'checkbox')) ) {
|
2012-05-14 13:16:14 +00:00
|
|
|
//Remove all space in string value
|
|
|
|
$value = str_replace(' ', '', $value);
|
2012-05-15 11:38:51 +00:00
|
|
|
//Try to detect separator and transform as array
|
2012-05-16 14:16:26 +00:00
|
|
|
//@todo : Schema a detecter
|
|
|
|
if ( preg_match_all('/([0-9A-Z]+)(?:,|;)?/', $value, $matches) ){
|
2012-05-14 15:32:50 +00:00
|
|
|
Zend_Registry::get('firebug')->info($matches);
|
2012-05-14 13:16:14 +00:00
|
|
|
$value = $matches[1];
|
|
|
|
}
|
2012-05-15 11:38:51 +00:00
|
|
|
//Add value to the existing
|
2012-05-15 15:20:09 +00:00
|
|
|
if (array_key_exists($key, $this->ciblage)) {
|
|
|
|
if ($ex) {
|
|
|
|
$value = array_merge($this->ciblage[$key]['ex'], $value);
|
|
|
|
} else {
|
|
|
|
$value = array_merge($this->ciblage[$key]['in'], $value);
|
|
|
|
}
|
2012-05-15 11:38:51 +00:00
|
|
|
}
|
2012-05-14 13:16:14 +00:00
|
|
|
}
|
|
|
|
|
2012-05-15 15:42:18 +00:00
|
|
|
//Remove duplicate values
|
|
|
|
if (is_array($value) ) {
|
|
|
|
$value = array_unique($value);
|
|
|
|
}
|
|
|
|
|
2012-05-11 20:25:55 +00:00
|
|
|
//Before to save the value
|
|
|
|
switch ( $types[0] ) {
|
|
|
|
case 'interval':
|
|
|
|
//@todo : Check Min Max
|
|
|
|
|
|
|
|
break;
|
|
|
|
case 'checkbox':
|
|
|
|
if ( $value==0 ) {
|
|
|
|
unset($this->ciblage[$key]);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Save the value
|
|
|
|
if ($ex) {
|
|
|
|
$this->ciblage[$key]['ex'] = $value;
|
|
|
|
} else {
|
|
|
|
$this->ciblage[$key]['in'] = $value;
|
|
|
|
}
|
2012-05-11 12:26:16 +00:00
|
|
|
$this->setSession();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Définir les critères en une fois
|
|
|
|
* @param array $criteres Criteres as array with key => val
|
2012-05-15 11:38:51 +00:00
|
|
|
* @param boolean $inSession pour désactiver l'enregistrement en session
|
2012-05-11 12:26:16 +00:00
|
|
|
*/
|
2012-05-15 11:38:51 +00:00
|
|
|
public function setCriteres($criteres, $inSession = true)
|
2012-05-11 12:26:16 +00:00
|
|
|
{
|
|
|
|
$this->ciblage = $criteres;
|
2012-05-15 11:38:51 +00:00
|
|
|
if ( $inSession ) {
|
|
|
|
$this->setSession();
|
|
|
|
}
|
2012-05-11 12:26:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Désactivation d'un critère
|
|
|
|
* @param string $key
|
|
|
|
*/
|
|
|
|
public function unsetCritere($key)
|
|
|
|
{
|
2012-05-11 20:25:55 +00:00
|
|
|
if( key_exists($key, $this->ciblage) ) {
|
2012-05-11 12:26:16 +00:00
|
|
|
unset($this->ciblage[$key]);
|
|
|
|
$this->setSession();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Permet de supprimer une valeur dans une clef de session
|
|
|
|
* @param string $key
|
|
|
|
* @param mixed $valeur
|
|
|
|
*/
|
|
|
|
public function unsetCritereValue($key, $valeur) {
|
|
|
|
|
|
|
|
//@todo provisoir trouver une autre technique plus adapté.
|
|
|
|
if(key_exists($key, $this->ciblage)) {
|
|
|
|
$don = explode(',', $this->ciblage[$key]);
|
|
|
|
foreach ($don as $val) {
|
|
|
|
if($val == $valeur)
|
|
|
|
$don[key($don)] = '';
|
|
|
|
else
|
|
|
|
$new[] = $val;
|
|
|
|
}
|
|
|
|
if(count($new) > 0) {
|
|
|
|
$don = implode(',', $new);
|
|
|
|
if(!empty($don))
|
|
|
|
$this->ciblage[$key] = $don;
|
|
|
|
} else {
|
|
|
|
unset($this->ciblage[$key]);
|
|
|
|
}
|
|
|
|
$this->setSession();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Récupération de la valeur d'un critère
|
|
|
|
* @param string $key
|
|
|
|
*/
|
|
|
|
public function getCritere($key)
|
|
|
|
{
|
|
|
|
if(array_key_exists($key, $this->ciblage)) {
|
|
|
|
return $this->ciblage[$key];
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Récupération des critères et de leurs valeurs
|
|
|
|
*/
|
|
|
|
public function getCriteres()
|
|
|
|
{
|
|
|
|
return $this->ciblage;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Définit un élément de comptage
|
|
|
|
* @param string $element
|
|
|
|
* @param integer $nb
|
|
|
|
*/
|
|
|
|
public function setNb($element, $nb)
|
|
|
|
{
|
|
|
|
$this->{$element} = $nb;
|
|
|
|
$this->setSession();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Récupére la valeur d'un élément de comptage
|
|
|
|
* @param string $element
|
|
|
|
*/
|
|
|
|
public function getNb($element)
|
|
|
|
{
|
|
|
|
return $this->{$element};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Suppression des critères de toutes une famille
|
|
|
|
* @param string $famille
|
|
|
|
*/
|
|
|
|
public function resetFamille($famille)
|
|
|
|
{
|
|
|
|
$reference = $this->getByFamille($famille);
|
|
|
|
foreach($this->ciblage as $name => $valeur) {
|
|
|
|
if($name != 'null') {
|
|
|
|
if(array_key_exists($name, $reference)) {
|
|
|
|
unset($this->ciblage[$name]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->setSession();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Suppression de toutes les valeurs en session
|
|
|
|
*/
|
|
|
|
public function clearCiblage()
|
|
|
|
{
|
|
|
|
Zend_Session::namespaceUnset('ciblage');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getValues($val = null)
|
|
|
|
{
|
|
|
|
if ( $val === null ) {
|
2012-05-11 20:25:55 +00:00
|
|
|
$val = $this->getCriteres();
|
2012-05-11 12:26:16 +00:00
|
|
|
}
|
2012-05-11 20:25:55 +00:00
|
|
|
return $val;
|
2012-05-11 12:26:16 +00:00
|
|
|
}
|
|
|
|
|
2012-05-15 11:38:51 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param unknown_type $name
|
|
|
|
*/
|
2012-05-11 20:25:55 +00:00
|
|
|
protected function getMinMax($name)
|
2012-05-11 12:26:16 +00:00
|
|
|
{
|
2012-05-11 20:25:55 +00:00
|
|
|
$MinMaxM = new Application_Model_MinMax();
|
2012-05-15 15:20:09 +00:00
|
|
|
$minmax = $MinMaxM->fetchAll($MinMaxM->select()->where('cle = ?', $name))->toArray();
|
2012-05-11 20:25:55 +00:00
|
|
|
return $minmax;
|
2012-05-11 12:26:16 +00:00
|
|
|
}
|
|
|
|
|
2012-05-15 11:38:51 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2012-05-11 12:26:16 +00:00
|
|
|
public function getFields() {
|
|
|
|
return $this->fields;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get($name)
|
|
|
|
{
|
|
|
|
if ($this->fields[$name]['activated'] == true)
|
|
|
|
return $this->fields[$name];
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getByFamille($famille)
|
|
|
|
{
|
|
|
|
$section = array();
|
|
|
|
|
|
|
|
foreach($this->fields as $name => $item) {
|
|
|
|
if($item['famille'] == $famille) {
|
|
|
|
$section[$name] = $item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ($section);
|
|
|
|
}
|
|
|
|
|
2012-05-15 11:38:51 +00:00
|
|
|
public function getLabel($name)
|
2012-05-11 12:26:16 +00:00
|
|
|
{
|
2012-05-15 11:38:51 +00:00
|
|
|
return $this->fields[$name]['label'];
|
2012-05-11 12:26:16 +00:00
|
|
|
}
|
|
|
|
|
2012-05-15 11:38:51 +00:00
|
|
|
public function getInfoCritere()
|
2012-05-11 12:26:16 +00:00
|
|
|
{
|
2012-05-15 11:38:51 +00:00
|
|
|
|
2012-05-11 12:26:16 +00:00
|
|
|
}
|
2012-05-15 11:38:51 +00:00
|
|
|
|
2012-05-11 12:26:16 +00:00
|
|
|
}
|