Master get update on libraries

This commit is contained in:
Michael RICOIS 2015-06-22 14:07:57 +00:00
commit 66496bb872
35 changed files with 3933 additions and 60 deletions

View File

@ -4741,7 +4741,7 @@ class MInsee
$idAnnonce = abs($idAnnonce);
$sqlHistoWhere = "e.ANBASE=$idAnnonce ";
$sqlHistoWhere.= " AND e.ANBASE=x.annonceNum AND e.DATE BETWEEN 19890101 AND 20041231";
$sqlHistoWhere.= " AND e.E1GSIR=e.SIREN";
/*$sqlHistoWhere.= " AND e.E1GSIR=e.SIREN";*/
$sqlHistoWhere.= " GROUP BY e.ANBASE ORDER BY e.DATE DESC";
$sql = $this->getAnnoncesLegalesHisto()." WHERE ".$sqlHistoWhere;
}
@ -4768,7 +4768,7 @@ class MInsee
$sqlHistoWhere = "e.E1GSIR=$siren";
$sqlHistoWhere.= $this->getAnnoncesLegalesRubrique('histo', $rubrique);
$sqlHistoWhere.= " AND e.ANBASE=x.annonceNum AND e.DATE BETWEEN 19890101 AND 20041231";
$sqlHistoWhere.= " AND e.E1GSIR=e.SIREN";
/*$sqlHistoWhere.= " AND e.E1GSIR=e.SIREN";*/
$sqlHistoWhere.= " GROUP BY e.ANBASE ORDER BY e.DATE DESC";
$sqlHisto = $this->getAnnoncesLegalesHisto()." WHERE ".$sqlHistoWhere;

View File

@ -1,7 +1,10 @@
<?
class MLiens {
<?php
/**
* Replace by v2
*/
class MLiens
{
public $siren=0;
private $iDb;
private $iInsee;

View File

@ -24,7 +24,7 @@ $tabCommentaires = array(
",
),
9996 => array(
1 => "Au répertoire national l'activité est codifiée {APEENT(5)}, {APEENT}
1 => "Au répertoire national l'activité est codifiée {APEENT(5)}, {APEENT}
",
),
199000 => array(
@ -324,9 +324,9 @@ $tabCommentaires = array(
20001000 => array(
10 => "Cette étude a pour but de rechercher la valeur globale de l'entreprise en tenant compte des ses éléments financiers et de ses différentes caractéristiques intrinsèques (forces et faiblesses).",
30 => "Schématiquement, les méthodes d'évaluation de l'entreprise que nous pouvons utiliser se regroupent en trois catégories:",
31 => "<LI> celles qui relèvent dune approche patrimoniale.",
32 => "<LI> celles qui sappuient sur la rentabilité.",
33 => "<LI> celles qui découlent dune comparaison, qui valorise une société à partir de données sur des sociétés présentant un profil comparable.",
31 => "<LI> celles qui relèvent d'une approche patrimoniale.",
32 => "<LI> celles qui s'appuient sur la rentabilité.",
33 => "<LI> celles qui découlent d'une comparaison, qui valorise une société à partir de données sur des sociétés présentant un profil comparable.",
50 => "L'objectif de ce rapport est d'indiquer une fouchette de valeurs, à partir des éléments financiers et statistiques objectifs du système Score & Decision.",
),
20011000 => array(
@ -406,7 +406,7 @@ $tabCommentaires = array(
20020100 => array(
0 => "<H3> Multiple du Chiffre d'affaires",
10 => "Cette méthode, la plus connue et la plus simple, est principalement utilisée pour avaluer les fonds de commerce.",
45 => "En labsence de marché, lévaluation des éléments incorporels de ces fonds se fait selon une méthode forfaitaire, selon les performances et lactivité de lentreprise.",
45 => "En l'absence de marché, l'évaluation des éléments incorporels de ces fonds se fait selon une méthode forfaitaire, selon les performances et l'activité de l'entreprise.",
51 => "Selon la méthode du multiple du Chiffre d'affaires l'estimation se situe entre {VAL970_EU} et {VAL971_EU}.",
),
20020110 => array(
@ -426,7 +426,7 @@ $tabCommentaires = array(
),
20022200 => array(
0 => "<H3> Méthode de la valeur de productivité",
51 => "La méthode de la valeur de la productivité est l'expression de la rentabilité de lentreprise au travers la capitalisation du benéfice corrigé des dotations. Elle débouche sur une valorisation entre {VAL974_EU} et {VAL975_EU}.",
51 => "La méthode de la valeur de la productivité est l'expression de la rentabilité de l'entreprise au travers la capitalisation du benéfice corrigé des dotations. Elle débouche sur une valorisation entre {VAL974_EU} et {VAL975_EU}.",
),
20022210 => array(
1 => "<BR>Ci-dessous l'évolution du Résultat Courant Avant Impôts.",
@ -435,7 +435,7 @@ $tabCommentaires = array(
),
20022500 => array(
0 => "<H3> Méthode de la valeur du rendement",
11 => "Cette méthode se fonde sur le bénéfice distribué, elle ne se conçoit qu’à légard dentreprises sociétaires qui pratiquent une politique régulière de distribution.",
11 => "Cette méthode se fonde sur le bénéfice distribué, elle ne se conçoit qu'à l'égard d'entreprises sociétaires qui pratiquent une politique régulière de distribution.",
51 => "Le résultat de la méthode de la valeur du rendement se situe entre {VAL982_EU} et {VAL983_EU}.",
),
20022510 => array(
@ -445,7 +445,7 @@ $tabCommentaires = array(
),
20023100 => array(
0 => "<H3> Multiple du Bénéfice",
10 => "On peux considérer quune entreprise vaut par sa rentabilité, sur la base dun multiple de ses résultats. Le bénéfice à retenir est établi à partir du résultat net courant (résultat courant avant impôt, minoré de limpôt sur les sociétés), afin déliminer les éléments exceptionnels affectant le résultat net comptable.",
10 => "On peux considérer qu'une entreprise vaut par sa rentabilité, sur la base d'un multiple de ses résultats. Le bénéfice à retenir est établi à partir du résultat net courant (résultat courant avant impôt, minoré de l'impôt sur les sociétés), afin d'éliminer les éléments exceptionnels affectant le résultat net comptable.",
51 => "Par la méthode du multiple du Bénéfice l'entreprise est valorisée entre {VAL984_EU} et {VAL985_EU}.",
),
20023110 => array(
@ -455,7 +455,7 @@ $tabCommentaires = array(
),
20025200 => array(
0 => "<H3> Multiple de l'EBE",
10 => "Cette méthode repose sur une évaluation globale de lentreprise prenant en compte lendettement financier de la société.",
10 => "Cette méthode repose sur une évaluation globale de l'entreprise prenant en compte l'endettement financier de la société.",
20 => "La valorisation par l'EBE conduit à une fourchette de valeurs entre {VAL986_EU} et {VAL987_EU}.",
),
20025210 => array(
@ -485,7 +485,7 @@ $tabCommentaires = array(
20 => "Par l'étude des transactions récentes, la valeur de l'entreprise se situe entre {VAL996_EU} et {VAL997_EU}.",
),
20028100 => array(
0 => "<H3> Méthode dévaluation par la Situation Nette Comptable (SNC)",
0 => "<H3> Méthode d'évaluation par la Situation Nette Comptable (SNC)",
1 => "Un des axes de l'évalutation peut s'appuyer sur la situation nette comptable (SNC) de la société, l'actif net, c'est-à-dire amorti, corrigé des dettes.",
20 => "Valorisation par la Situation Nette Comptable entre {VAL976_EU} et {VAL977_EU}.",
),

View File

@ -24,7 +24,7 @@ $tabCommentaires = array(
",
),
9996 => array(
1 => "Au répertoire national l'activité est codifiée {APEENT(5)}, {APEENT}
1 => "Au répertoire national l'activité est codifiée {APEENT(5)}, {APEENT}
",
),
199000 => array(
@ -324,9 +324,9 @@ $tabCommentaires = array(
20001000 => array(
10 => "Cette étude a pour but de rechercher la valeur globale de l'entreprise en tenant compte des ses éléments financiers et de ses différentes caractéristiques intrinsèques (forces et faiblesses).",
30 => "Schématiquement, les méthodes d'évaluation de l'entreprise que nous pouvons utiliser se regroupent en trois catégories:",
31 => "<LI> celles qui relèvent dune approche patrimoniale.",
32 => "<LI> celles qui sappuient sur la rentabilité.",
33 => "<LI> celles qui découlent dune comparaison, qui valorise une société à partir de données sur des sociétés présentant un profil comparable.",
31 => "<LI> celles qui relèvent d'une approche patrimoniale.",
32 => "<LI> celles qui s'appuient sur la rentabilité.",
33 => "<LI> celles qui découlent d'une comparaison, qui valorise une société à partir de données sur des sociétés présentant un profil comparable.",
50 => "L'objectif de ce rapport est d'indiquer une fouchette de valeurs, à partir des éléments financiers et statistiques objectifs du système Score & Decision.",
),
20011000 => array(
@ -406,7 +406,7 @@ $tabCommentaires = array(
20020100 => array(
0 => "<H3> Multiple du Chiffre d'affaires",
10 => "Cette méthode, la plus connue et la plus simple, est principalement utilisée pour avaluer les fonds de commerce.",
45 => "En labsence de marché, lévaluation des éléments incorporels de ces fonds se fait selon une méthode forfaitaire, selon les performances et lactivité de lentreprise.",
45 => "En l'absence de marché, l'évaluation des éléments incorporels de ces fonds se fait selon une méthode forfaitaire, selon les performances et l'activité de l'entreprise.",
51 => "Selon la méthode du multiple du Chiffre d'affaires l'estimation se situe entre {VAL970_EU} et {VAL971_EU}.",
),
20020110 => array(
@ -426,7 +426,7 @@ $tabCommentaires = array(
),
20022200 => array(
0 => "<H3> Méthode de la valeur de productivité",
51 => "La méthode de la valeur de la productivité est l'expression de la rentabilité de lentreprise au travers la capitalisation du benéfice corrigé des dotations. Elle débouche sur une valorisation entre {VAL974_EU} et {VAL975_EU}.",
51 => "La méthode de la valeur de la productivité est l'expression de la rentabilité de l'entreprise au travers la capitalisation du benéfice corrigé des dotations. Elle débouche sur une valorisation entre {VAL974_EU} et {VAL975_EU}.",
),
20022210 => array(
1 => "<BR>Ci-dessous l'évolution du Résultat Courant Avant Impôts.",
@ -435,7 +435,7 @@ $tabCommentaires = array(
),
20022500 => array(
0 => "<H3> Méthode de la valeur du rendement",
11 => "Cette méthode se fonde sur le bénéfice distribué, elle ne se conçoit qu’à légard dentreprises sociétaires qui pratiquent une politique régulière de distribution.",
11 => "Cette méthode se fonde sur le bénéfice distribué, elle ne se conçoit qu'à l'égard d'entreprises sociétaires qui pratiquent une politique régulière de distribution.",
51 => "Le résultat de la méthode de la valeur du rendement se situe entre {VAL982_EU} et {VAL983_EU}.",
),
20022510 => array(
@ -445,7 +445,7 @@ $tabCommentaires = array(
),
20023100 => array(
0 => "<H3> Multiple du Bénéfice",
10 => "On peux considérer quune entreprise vaut par sa rentabilité, sur la base dun multiple de ses résultats. Le bénéfice à retenir est établi à partir du résultat net courant (résultat courant avant impôt, minoré de limpôt sur les sociétés), afin déliminer les éléments exceptionnels affectant le résultat net comptable.",
10 => "On peux considérer qu'une entreprise vaut par sa rentabilité, sur la base d'un multiple de ses résultats. Le bénéfice à retenir est établi à partir du résultat net courant (résultat courant avant impôt, minoré de l'impôt sur les sociétés), afin d'éliminer les éléments exceptionnels affectant le résultat net comptable.",
51 => "Par la méthode du multiple du Bénéfice l'entreprise est valorisée entre {VAL984_EU} et {VAL985_EU}.",
),
20023110 => array(
@ -455,7 +455,7 @@ $tabCommentaires = array(
),
20025200 => array(
0 => "<H3> Multiple de l'EBE",
10 => "Cette méthode repose sur une évaluation globale de lentreprise prenant en compte lendettement financier de la société.",
10 => "Cette méthode repose sur une évaluation globale de l'entreprise prenant en compte l'endettement financier de la société.",
20 => "La valorisation par l'EBE conduit à une fourchette de valeurs entre {VAL986_EU} et {VAL987_EU}.",
),
20025210 => array(
@ -485,7 +485,7 @@ $tabCommentaires = array(
20 => "Par l'étude des transactions récentes, la valeur de l'entreprise se situe entre {VAL996_EU} et {VAL997_EU}.",
),
20028100 => array(
0 => "<H3> Méthode dévaluation par la Situation Nette Comptable (SNC)",
0 => "<H3> Méthode d'évaluation par la Situation Nette Comptable (SNC)",
1 => "Un des axes de l'évalutation peut s'appuyer sur la situation nette comptable (SNC) de la société, l'actif net, c'est-à-dire amorti, corrigé des dettes.",
20 => "Valorisation par la Situation Nette Comptable entre {VAL976_EU} et {VAL977_EU}.",
),
@ -545,27 +545,27 @@ $tabCommentaires = array(
20 => "<LI> Les immobilisations corporelles doivent être réévaluées à leur valeur de marché et non comptable. ",
),
20090610 => array(
20 => "<LI> L?estimation finale devrait intégrer l?ensemble des dettes à court terme exigibles au moment de la cession.",
20 => "<LI> L'estimation finale devrait intégrer l'ensemble des dettes à court terme exigibles au moment de la cession.",
),
20090611 => array(
20 => "<LI> L?estimation finale devrait intégrer l?ensemble des dettes à court, moyen et long termes exigibles au moment de la cession.",
20 => "<LI> L'estimation finale devrait intégrer l'ensemble des dettes à court, moyen et long termes exigibles au moment de la cession.",
),
20090710 => array(
20 => "<LI> Il conviendra de vérifier l?exactitude des dettes financières portées au bilan.",
20 => "<LI> Il conviendra de vérifier l'exactitude des dettes financières portées au bilan.",
),
20090711 => array(
20 => "<LI> Il conviendra de vérifier l?exactitude des dettes fournisseurs portées au bilan.",
20 => "<LI> Il conviendra de vérifier l'exactitude des dettes fournisseurs portées au bilan.",
),
20090712 => array(
20 => "<LI> Il conviendra de vérifier l?exactitude des dettes financières et fournisseurs portées au bilan.",
20 => "<LI> Il conviendra de vérifier l'exactitude des dettes financières et fournisseurs portées au bilan.",
),
20090810 => array(
20 => "<BR>A noter qu'aucune provision ne figure au bilan.",
30 => "<C.> Or, au vu de l'effectif de l'entreprise pourrait devoir provisionner les congés à payer de l?exercice, d?éventuelles indemnités de fin de carrière ou de départ.",
30 => "<C.> Or, au vu de l'effectif de l'entreprise pourrait devoir provisionner les congés à payer de l'exercice, d'éventuelles indemnités de fin de carrière ou de départ.",
),
20090830 => array(
20 => "<BR> A noter que les provisions semblent anormalement limitées.",
30 => "<C.> Or, au vu de l'effectif de l'entreprise pourrait devoir provisionner les congés à payer de l?exercice, d?éventuelles indemnités de fin de carrière ou de départ.",
30 => "<C.> Or, au vu de l'effectif de l'entreprise pourrait devoir provisionner les congés à payer de l'exercice, d'éventuelles indemnités de fin de carrière ou de départ.",
),
20090840 => array(
20 => "<BR> A noter que les provisions semblent anormalement élevées.",

View File

@ -3481,7 +3481,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
require_once 'Metier/scores/Formule/Score_'.$version.'.php';
break;
case 'valo':
$version = '26';
$version = 'v209';
require_once 'Metier/scores/Comment/Valo_'.$version.'_'.$NIVEAU.'.php';
require_once 'Metier/scores/Formule/Valo_'.$version.'.php';
break;

View File

@ -0,0 +1,102 @@
<?php
class Scores_Auth_Adapter_Db implements Zend_Auth_Adapter_Interface
{
protected $_username;
protected $_password;
protected $_hash;
protected $_timeout = 3600;
protected $checkWs = false;
protected $clients = array();
/**
*
* @param string $username
* @param string $password
* @param boolean $checkWs
*/
public function __construct($username, $password, $checkWs = false)
{
$this->_username = $username;
$this->_password = $password;
$this->_hash = md5($username.'|'.$password);
$this->checkWs = $checkWs;
}
/**
* Limit access to only client IDs
* @param array $id
*/
public function limitClient($id = null)
{
if (is_array($id) && count($id)>0) {
$this->clients = $id;
}
}
/**
* Override the timeout
* @param integer $seconds
*/
public function setTimeout($seconds = null)
{
if ($seconds===null)
return;
$this->_timeout = $seconds;
}
/**
* (non-PHPdoc)
* @see Zend_Auth_Adapter_Interface::authenticate()
*/
public function authenticate()
{
$userM = new Application_Model_Sdv1Utilisateurs();
$sql = $userM->select()
->setIntegrityCheck(false)
->from(array('u'=>'sdv1.utilisateurs'), array('u.idClient', 'u.id', 'u.login', 'u.password'))
->join(array('c'=>'sdv1.clients'), 'u.idClient = c.id', array('c.timeout'))
->where('u.login=?', $this->_username)
->where('u.actif=?', 1)
->where('u.deleted=?', 0)
->where('c.actif=?','Oui');
if ( count($this->clients) > 0 ) {
$sql->where('u.idClient IN('.join(',',$this->clients).')');
}
if ($this->checkWs) {
$sql->where('u.accesWS=?',1);
}
$result = $userM->fetchRow($sql);
$identity = new stdClass();
$identity->username = $this->_username;
$identity->hash = $this->_hash;
if ( null === $result ) {
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, $identity);
} else {
if ( $this->_password == $result->password
|| $this->_password == md5($result->login.'|'.$result->password) ) {
$identity->id = $result->id;
$identity->idClient = $result->idClient;
$timeout = (!empty($result->timeout)) ? $result->timeout : $this->_timeout;
$identity->timeout = $timeout;
$identity->time = time() + $timeout;
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $identity);
} else {
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $identity);
}
}
}
}

View File

@ -0,0 +1,179 @@
<?php
class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
{
/**
*
* @var string
*/
protected $_username;
/**
*
* @var string
*/
protected $_password;
/**
*
* @var unknown
*/
protected $_timeout = 1800;
/**
*
* @var unknown
*/
protected $_checkIp = false;
public function __construct($username, $password, $iponly = false)
{
$this->_username = $username;
$this->_password = $password;
if ($iponly){
$this->_password = 'iponly:'.$_SERVER['REMOTE_ADDR'];
}
$this->_checkIp = $iponly;
}
/**
* (non-PHPdoc)
* @see Zend_Auth_Adapter_Interface::authenticate()
*/
public function authenticate()
{
$adressIp = $_SERVER['REMOTE_ADDR'];
require_once 'Scores/WsScores.php';
$ws = new WsScores($this->_username, $this->_password);
$InfosLogin = $ws->getInfosLogin($this->_username, $adressIp);
$identity = new stdClass();
$identity->username = $this->_username;
$identity->password = $this->_password;
$identity->email = $InfosLogin->result->email;
$identity->profil = $InfosLogin->result->profil;
$identity->pref = $InfosLogin->result->pref;
$identity->droits = $InfosLogin->result->droits;
$identity->droitsClients = $InfosLogin->result->droitsClients;
$identity->nom = $InfosLogin->result->nom;
$identity->prenom = $InfosLogin->result->prenom;
$identity->tel = $InfosLogin->result->tel;
$identity->fax = $InfosLogin->result->fax;
$identity->mobile = $InfosLogin->result->mobile;
$identity->id = $InfosLogin->result->id;
$identity->idClient = $InfosLogin->result->idClient;
$identity->reference = $InfosLogin->result->reference;
$identity->nbReponses = $InfosLogin->result->nbReponses;
$identity->typeScore = $InfosLogin->result->typeScore;
$identity->dateValidation = $InfosLogin->result->dateValidation;
$identity->nombreConnexions = $InfosLogin->result->nombreConnexions;
$identity->dateDerniereConnexion = $InfosLogin->result->dateDerniereConnexion;
$identity->dateDebutCompte = $InfosLogin->result->dateDebutCompte;
$identity->dateFinCompte = $InfosLogin->result->dateFinCompte;
$identity->acceptationCGU = $InfosLogin->result->acceptationCGU;
$identity->ip = $adressIp;
$identity->modeEdition = false;
$timeout = (!empty($InfosLogin->result->timeout)) ? $InfosLogin->result->timeout : $this->_timeout;
$identity->timeout = $timeout;
$identity->time = time() + $timeout;
$lang = in_array($InfosLogin->result->lang, array('fr','en')) ? $InfosLogin->result->lang : 'fr';
$identity->lang = $lang;
$identity->langtmp = $lang;
/*
* Adresse Ip interdites
*/
$ipInterdites =
'81.252.88.0-81.252.88.7' // CTE D AGGLOMERATION DE SOPHIA
. ';' . '195.200.187.163' // PacWan
. ';' . '213.11.81.41' // Verizon France SAS
. ';' . '83.206.171.252' // FR-BASE-D-INFORMATIONS-LEGALES-BI
. ';' . '81.255.32.139'
. ';' . '212.155.191.1*' // Satair A/S
. ';' . '217.70.1*.17' // OJSC "Sibirtelecom"
. ';' . '212.37.196.156' // GENERALE-MULTIMEDIA-SUD
. ';' . '80.245.60.121' // Planete Marseille - Mailclub
. ';' . '213.246.57.101' // IKOULA
. ';' . '193.104.158.0-193.104.158.255' // Altares.fr
. ';' . '195.6.3.0-195.6.3.255' // ORT
. ';' . '217.144.112.0-217.144.116.63' // Coface
;
if ( $this->checkPlagesIp($ipInterdites, $adressIp) ) {
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity);
}
// Renvoi
if ( is_string($InfosLogin) || $InfosLogin->error->errnum!=0){
$message = $InfosLogin;
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $identity, array($message));
} elseif ($this->_username == $InfosLogin->result->login) {
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $identity);
} else {
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity);
}
}
/**
* Controle si une adresse IP est dans une liste des IP communiquées sous la forme
* 192.168.3.5-192.68.3.10;192.168.3.*;192.168.3.10
* @param string $strPlageIP
* La plage d'adresses IP
* @param string $adresseIP
* L'adresse IP à tester
* @return boolean
*/
protected function checkPlagesIp($strPlageIP, $adresseIP)
{
$connected = false;
$tabIpAllowed = explode(';', trim($strPlageIP));
if (count($tabIpAllowed)==1 && $tabIpAllowed[0]=='') $tabIpAllowed = array();
foreach ($tabIpAllowed as $ip) {
$tabPlages = explode('-', $ip);
// C'est une plage d'adresse '-'
if (isset($tabPlages[1]))
$connected = $this->in_plage($tabPlages[0],$tabPlages[1],$adresseIP);
else {
// C'est une adresse avec ou sans masque '*'
if (preg_match('/^'.str_replace('*','.*',str_replace('.','\.',$ip)).'$/', $adresseIP) )
$connected=true;
}
if ($connected) break;
}
if (count($tabIpAllowed)==0) return false;
elseif (!$connected) {
return false;
}
return true;
}
/**
* Enter description here ...
* @param unknown_type $plage_1
* @param unknown_type $plage_2
* @param unknown_type $ip
* @return boolean
*/
protected function in_plage($plage_1,$plage_2,$ip)
{
$ip2 = $this->getIpNumber($ip);
if ($ip2>=$this->getIpNumber($plage_1) && $ip2<=$this->getIpNumber($plage_2))
return true;
else
return false;
}
/**
* Converti une IP en nombre
* @param string $ip Adresse IP
* @return integer
*/
protected function getIpNumber($ip)
{
$tab=explode('.', $ip);
return (($tab[0]*256*256*256) + ($tab[1]*256*256) + ($tab[2]*256) + ($tab[3]));
}
}

View File

@ -0,0 +1,130 @@
<?php
class Scores_Mail_Method extends Zend_Mail
{
protected $config;
protected $transport;
/**
* Gestion de l'envoi des mails en fonction de la configuration
* Fournir un objet de configuration ou utiliser la configuration de l'application
* method => smtp, sendmail, file
* Si method = smtp
* (host => IP, dns)
*
* Activer l'authentification
* (auth => login, plain, ....)
* (username => )
* (password => )
*/
public function __construct( $config = null )
{
if ($config === null) {
$c = Zend_Registry::get('config');
$this->config = $c->profil->mail;
} else {
$this->config = $config;
}
$this->_charset = 'ISO-8859-15';
// --- Configuration du transport SMTP
if ( $this->config->method == 'smtp' ) {
$config = array();
if ( isset($this->config->auth) ) {
$config['auth'] = $this->config->auth;
if ( isset($this->config->username) ) {
$config['username'] = $this->config->username;
}
if ( isset($this->config->password) ) {
$config['password'] = $this->config->password;
}
}
if ( isset($this->config->port) ) {
$config['port'] = $this->config->port;
}
$tr = new Zend_Mail_Transport_Smtp($this->config->host, $config);
}
// --- Configuration transport Sendmail
if ( $this->config->method == 'sendmail' ) {
$tr = new Zend_Mail_Transport_Sendmail();
}
// --- Configuration transport File
if ( $this->config->method == 'file' ) {
$tr = new Zend_Mail_Transport_File(array('callback' => array($this, 'recipientFilename')));
}
$this->transport = $tr;
}
/**
* Champ From en fonction de la clé de configuration
* @param string $configKey
*/
public function setFromKey($configKey)
{
$email = $this->config->email->$configKey;
$this->setFrom($email, ucfirst($configKey));
}
/**
* Champ To en fonction de la clé de configuration
* @param string $configKey
*/
public function addToKey($configKey)
{
$email = $this->config->email->$configKey;
$this->addTo($email, ucfirst($configKey));
}
/**
* Définit le sujet de l'email
* @param string $texte
*/
public function setSubjectC($texte = '')
{
$this->setSubject($this->txtConvert($texte));
}
/**
* Définit le corps de l'email au format texte
* @param string $texte
*/
public function setBodyTextC($texte = '')
{
$this->setBodyText($this->txtConvert($texte));
}
/**
* Définit le corps de l'email au format html
* @param string $html
*/
public function setBodyHtmlC($html = '')
{
$this->setBodyHtml($this->txtConvert($html));
}
/**
* Envoi de l'emai
*/
public function execute()
{
return $this->send($this->transport);
}
//We suppose that character encoding of strings is UTF-8 on PHP script.
protected function txtConvert($string)
{
return mb_convert_encoding($string, 'ISO-8859-1', 'UTF-8');
}
protected function recipientFilename($transport)
{
return $transport->recipients . '_' . mt_rand() . '.tmp';
}
}

View File

@ -0,0 +1,614 @@
<?php
class Scores_Validate_IpInNetwork extends Zend_Validate_Ip
{
const NOT_IN_NETWORK = 'notInNetwork';
const LOW_IN_NETWORK = 'lowInNetwork';
const HIGH_IN_NETWORK = 'highInNetwork';
const INVALID_NETWORK = 'invalidNetwork';
const MISSING_NETWORK = 'missingNetwork';
/**
* A CIDR number (valid values 0-32)
* @var int
*/
protected $_cidr = 0;
/**
* A decimal 32-bit netmask
* @var string
*/
protected $_netmask = '255.255.255.255';
/**
* A 4-octet IPv4 network address
* @var string
*/
protected $_network = null;
/**
* A network/mask notation or network range
* @var string
*/
protected $_notation = null;
/**
* Unsigned decimal "from" IP address
* @var string
*/
protected $_rangeFrom = null;
/**
* Unsigned decimal "to" IP address
* @var string
*/
protected $_rangeTo = 0;
/**
* Will throw Exception instead of trigger_error if true
* @var false
*/
protected $_throw = false;
/**
* Constructor for IpInNetwork class
*
* @desc <p>Accepts an array with options. Also adds the error messages to the parent's message templates.</p>
* @example <p>List of allow options and their use:
* $options argument must be an array and allows two key/value pairs for this class and passes on any remaining
* values to the parent class Zend_Validate_Ip. If key 'network' exists it will pass on the value to method
* setNetworkNotation and for key 'throw' to setThrow4Notation.</p>
* @see Zend_Validate_Ip::__construct()
* @see Scores_Validate_IpInNetwork::setNetworkNotation()
* @see Scores_Validate_IpInNetwork::setThrow4Notation()
* @param array $options
* @return void
*/
public function __construct($options = array()) {
if ( !empty($options) && is_array($options) ) {
if ( array_key_exists('throw',$options) ) {
$this->setThrow4Notation($options['throw']);
unset($options['throw']);
}
if ( array_key_exists('network',$options) ) {
$this->setNetworkNotation($options['network']);
unset($options['network']);
}
}
$this->setMessages(array());
parent::__construct($options);
}
/**
* (non-PHPdoc)
* @see Zend_Validate_Abstract::setMessages()
*/
public function setMessages(array $messages) {
$newMessages = array(
self::MISSING_NETWORK => 'No valid network has been given to validate against',
self::INVALID_NETWORK => 'The network is not an accepted format',
self::NOT_IN_NETWORK => "The ip '%value%' does not match the provided 32 network",
self::LOW_IN_NETWORK => "The ip '%value%' is lower in range than the provided network",
self::HIGH_IN_NETWORK => "The ip '%value%' is higher in range than the provided network",
);
foreach ( $newMessages as $messageKey => $messageString ) {
if ( !isset($this->_messageTemplates[$messageKey]) ) {
$this->_messageTemplates[$messageKey] = $messageString;
} elseif ( !empty($messages) && array_key_exists($messageKey,$messages) ) {
$this->_messageTemplates[$messageKey] = $messages[$messageKey];
unset($messages[$messageKey]);
}
}
empty($messages) || parent::setMessages($messages) ;
return $this;
}
/**
* (non-PHPdoc)
* @see Zend_Validate_Ip::isValid()
*/
public function isValid($value) {
if ( true === parent::isValid($value) ) {
$notation = $this->_getNotation();
if ( !empty($notation) ) {
// a valid notation has been set
$network = $this->_getNetwork();
if ( !empty($network) ) {
if ( true === $this->_validateIpInNetwork($value) ) {
return true;
}
} else {
if ( true === $this->_validateIpInRange($value) ) {
return true;
}
}
// NOTE: Errors are only available in regards to the value (ip address) and not the network/netmask (notation)
$errors = $this->getErrors();
if ( empty($errors) ) {
$this->_error(self::NOT_IN_NETWORK);
}
} else {
$this->_error(self::MISSING_NETWORK);
}
}
return false;
}
/**
* Validates the IP in a given network
*
* @since Version 0.1.36
* @version 0.1.36 2012/01/14 16:34:00 CST
* @author aw
* @desc <p>Takes the CIDR and network (IP) address and validates the given IP address against it. Sets the appropriate
* errors if the IP is not a match for the network.</p>
* @param string $ip
* @return bool
*/
protected function _validateIpInNetwork($ip) {
$netmask = $this->getCidr();
$network = $this->_getNetwork();
// lets get this out of the way first
if ( 32 === $netmask ) {
// this network has to match the IP
if ( $network === $ip ) {
return true;
} else {
$this->_error(self::NOT_IN_NETWORK);
return false;
}
}
// get the unsigned integers for the IP and network address
$ip_addr_uDec = $this->_makeUnsignedAddress($ip);
$lNetwork_uDec = $this->_makeUnsignedAddress($network);
// let verify the IP against the lower end of the range
if ( $ip_addr_uDec < $lNetwork_uDec ) {
// the ip is below the network range
$this->_error(self::LOW_IN_NETWORK);
return false;
}
// well then, finally verify the IP against the uppoer end of the range
// add the decimal representation of the netmask to the network IP
$netmask_uDec1 = $netmask < 31 ? pow(2, (32-$netmask)) - 1 : 1 ;
$netmask_uDec = pow(2, 32-$netmask) - 1 ;
$uNetwork_uDec = $lNetwork_uDec + $netmask_uDec;
if ( $ip_addr_uDec > $uNetwork_uDec ) {
// the ip is above the network range
$this->_error(self::HIGH_IN_NETWORK);
return false;
}
return true;
}
/**
* Validates the IP in a given range
*
* @since Version 0.1.36
* @version 0.1.36 2012/01/16 13:06:00 CST
* @author aw
* @desc <p>Takes the "from" and "to" (IP) address and validates the given IP address against it. Sets the appropriate
* errors if the IP is not within the defined range.</p>
* @param string $ip
* @return bool
*/
protected function _validateIpInRange($ip) {
$uInt_Ip = $this->_makeUnsignedAddress($ip);
if ( is_numeric($this->_rangeFrom) && $uInt_Ip >= $this->_rangeFrom ) {
if ( $uInt_Ip <= $this->_rangeTo ) {
return true;
} elseif ( is_numeric($this->_rangeTo) ) {
$this->_error(self::HIGH_IN_NETWORK);
return false;
}
} elseif ( is_numeric($this->_rangeFrom) ) {
$this->_error(self::LOW_IN_NETWORK);
return false;
}
$this->_error(self::MISSING_NETWORK);
return false;
}
/**
* Set the network (notation) to the properties
*
* @since Version 0.1.36
* @version 0.1.36 2012/01/14 13:43:00 CST
* @author aw
* @desc <p>The network is usually a notation with a network/netmask combination. The method uses two methods to validate
* the netmask and the network address. If the notation is a range fromIPAddress-toIPAddress the netmask and network address
* are ignored. The isValid() will then attempt to validate the value within the range and not the network segment.</p>
* string $notation network/address (128.0.0.0/24) (128.0.0.0/255.255.255.0) or (128.0.0.0-128.0.0.255)
* @return object|false Awd_Validate_IpInNetwork
*/
public function setNetworkNotation($notation) {
$network = false !== strpos($notation, '/') ? $this->_evaluateNetmask($notation) : false ;
if ( false !== $network) {
// a valid CIDR/netmask has been found
if ( true === parent::isValid($network) ) {
if ( $this->_validateNetwork($network) ) {
$this->_network = $network;
$this->_notation = $notation;
return $this;
}
} else {
$this->_invalidNetwork(__LINE__);
}
} elseif ( false !== strpos($notation, '-') ) {
// the notation is looking like a from-to IP range
if ( true === $this->_validateRange($notation) ) {
$this->_notation = $notation;
return $this;
}
}
return false;
}
/**
* Sets the value for _throw property
*
* @since Version 0.1.36
* @version 0.1.35 2012/01/17 08:23:00 CST
* @author aw
* @desc <p>The value determines if the application will throw an exception or trigger an E_USER_WARNING if
* an error was found in the submitted network notation. The default is false.</p>
* @throws E_USER_WARNING if the argument is not of type bool
* bool $throw
* @return object Awd_Validate_IpInNetwork
*/
public function setThrow4Notation($throw = false) {
if ( !is_bool($throw) ) {
$msg = '[AWD] Programming error: The argument is not a boolean value';
trigger_error($msg,E_USER_WARNING);
}
$this->_throw = $throw;
return $this;
}
/**
* Gets the value for _throw property
*
* @since Version 0.1.36
* @version 0.1.35 2012/01/17 08:27:00 CST
* @author aw
* @desc <p>The value determines if the application will throw an exception or trigger an E_USER_WARNING if
* an error was found in the submitted network notation. The default is false.</p>
* @return bool
*/
public function getThrow4Notation() {
return (bool) $this->_throw;
}
/**
* Gets the network (notation) as it has been set if valid
*
* @since Version 0.1.36
* @version 0.1.36 2012/01/14 16:08:00 CST
* @author aw
* @desc <p>If empty the network (notation) was either not set or not valid. Hence, this method can be used to
* verify if setting a network range or notation was successful with the constructor.</p>
* @return string
*/
public function getNetworkNotation() {
return (string) $this->_getNotation();
}
/**
* Protected method to gets the network (notation) as it has been set if valid
*
* @since Version 0.1.36
* @version 0.1.36 2012/01/14 16:08:00 CST
* @author aw
* @desc <p>Note that the notation is only available when it passed the internal validation. Internally (protected)
* the network represents the network (IP) address whereas the notation is the full string as set when is valid.
* The notation is a representation of network range or network/mask. This method essentially returns internally
* (protected) the same result as the public method getNetworkNotation().</p>
* @return string|null
*/
protected function _getNotation() {
return empty($this->_notation) ? null : (string) $this->_notation ;
}
/**
* Gets the network address from the notation if a valid address and mask has been set
*
* @since Version 0.1.36
* @version 0.1.36 2012/01/14 16:18:00 CST
* @author aw
* @desc <p>Note that internally (protected) the network represents the network (IP) address extracted from the
* "network notation", i.e. a representation of network range or network/mask. If the notation was not valid or a
* network range has been set this value will be empty.</p>
* @return string
*/
protected function _getNetwork() {
return (string) $this->_network;
}
/**
* Gets the CIDR from the notation if a valid address and mask has been set
*
* @since Version 0.1.36
* @version 0.1.36 2012/01/14 16:26:00 CST
* @author aw
* @desc <p>The CIDR has been extracted from the "network notation", i.e. a representation of network/mask or
* network/CIDR. If the notation was not valid or a network range has been set this value will be empty.</p>
* @return int
*/
public function getCidr() {
return (int) $this->_cidr;
}
/**
* Evaluates the netmask from a notation
*
* @since Version 0.1.36
* @version 0.1.36 2012/01/15 10:12:00 CST
* @author aw
* @desc <p>The notation is usually set as a {network/CIDR} or {network/netmask} notation. This method examines
* the string following a slash. A CIDR mask will be verified for its number whereas a netmask is passed to
* another method _validateNetmask() for validation and if valid converted into a CIDR representation. In
* either case if the value is valid the remaining network (IP) address is returned or false on failure.</p>
* @throws Calls method _invalidNetwork() when a failure is detected
* @param string $notation
* @return string|bool (false)
*/
protected function _evaluateNetmask($notation) {
// split the notation in network and netmask information
list($network, $netmask) = explode('/', $notation, 2);
if ( is_numeric($netmask) ) {
// does look like a CIDR netmask
$between = new Zend_Validate_Between(array('min'=>1,'max'=>32));
if ( true === $between->isValid($netmask) ) {
$this->_cidr = (int) $netmask;
return $network;
} else {
$error_msgs = $between->getMessages();
if ( !empty($error_msgs) && is_array($error_msgs) ) {
$msg = array_shift($error_msgs);
} else {
// fallback, should not really be an option
$msg = sprintf('The netmask [ %s ] is not a valid option',$netmask);
}
// oops, this CIDR is not a valid range
return $this->_invalidNetwork(__LINE__.' - '.$msg);
}
} elseif ( !empty($netmask) ) {
// looks more like 32-bit (like 255.255.255.0) format
if ( true === ($line = $this->_validateNetmask($netmask)) ) {
return $network;
}
return $this->_invalidNetwork($line);
}
return $this->_invalidNetwork(__LINE__);
}
/**
* Validates a 32-bit netmask
*
* @since Version 0.1.36
* @version 0.1.36 2012/01/16 10:34:00 CST
* @author aw
* @desc <p>A netmask is a decimal representation of 32-bit string where the beginning sequence is a complete
* set of 1 (one) followed by a complete set of 0 (zero). If valid the netmask string will be a CIDR numeric
* value and set to the proected property _cidr. If not valid the returned value is the line plus the index if
* the failure is in one of the segments.</p>
* @param string $netmask
* @return true|string
*/
protected function _validateNetmask($netmask) {
$classes = explode('.', $netmask);
if ( 4 !== count($classes) ) {
return __LINE__;
}
$cidr = 0; $end = false;
foreach ( $classes as $index => $segment ) {
if ( !is_numeric($segment) ) {
return __LINE__;
} elseif ( 0 === (int) $segment ) {
$end = true; // all following segment have to be 0 (zero) as well
continue;
}
$matches = array();
// evaluate the binary representation of the segment
$bin = decbin($segment);
if ( 8 !== strlen($bin) || 0 === preg_match('/^([1]{1,8})([0]*)$/', decbin($segment), $matches) ) {
if ( 8 !== strlen($bin) ) {
// this segment is not a complete byte (8 bits) i.e. a value below 128
return __LINE__.':'.++$index; // NOTE: Index begins at 0 (zero)
}
// this segment is a complete byte (8 bits), i.e. a value above 128, but not a valid binary mask (like 11110000)
return __LINE__.':'.++$index; // NOTE: Index begins at 0 (zero)
} elseif ( true === $end ) {
// a mask was found in the previous segment; therefore, this segment should be 0 (zero)
return __LINE__.':'.++$index; // NOTE: Index begins at 0 (zero)
}
$len = strlen($matches[1]);
if ( $len < 8 ) { $end = true; }
$cidr += $len;
}
$this->_cidr = $cidr;
return true;
}
/**
* Validates the network address in a subnet notation
*
* @since Version 0.1.36
* @version 0.1.36 2012/01/16 10:34:00 CST
* @author aw
* @desc <p>The network address in a CIDR or subnet mask notation is the base of the assigned block.
* Because the size of the block is specified by the CIDR or subnet mask the base of a network address
* has to fit and match into the block size. This method evaluates the block size and then validates
* if the base of network address fits into the assigned block. If not valid the line plus the index
* of the failed segment is sent to method _invalidNetwork() triggering or throwing an error.</p>
* @param string $network
* @return true|string
*/
protected function _validateNetwork($network) {
$cidr = $this->getCidr();
$class = $cidr / 8;
// an integer indicates a classful (unicast) network
if ( is_int($class) ) {
$iClass = $class;
$maskBits = 0;
} else {
$iClass = (int) floor($class);
$maskBits = (int) 8 - ($cidr - ($iClass * 8));
$hosts = (int) pow(2, $maskBits); // number of usable hosts in a subnet
}
$segments = explode('.', $network);
// Note: $segments index begins at 0 (zero) and $iClass is the last complete segment in the netmask (8 bits (255))
// It is irrelevant but just to clarify for $iClass: 1 = Class A, 2 = Class B, 3 = Class C
$complete = false;
// check all segments following the last complete class and because we have to check for
// subnetting in the _follow_ class we do NOT add 1 to $iClass as the index in $segments
for ($index = $iClass; $index < 4; $index++) {
$subNetwork = (int) $segments[$index];
if ( 0 === $maskBits ) {
// this class has no subnets (aka classful network)
// all 0 (zero) are expected as (sub)network numbers
if ( 0 !== $subNetwork ) {
return $this->_invalidNetwork(__LINE__.':'.++$index); // NOTE: Index begins at 0 (zero)
}
continue;
} else {
// this class has subnets (aka a classless (subnetted) network)
if ( true === $complete ) {
// for all following networks 0 (zero) is expected as (sub)network number
if ( 0 !== $subNetwork ) {
return $this->_invalidNetwork(__LINE__.':'.++$index); // NOTE: Index begins at 0 (zero)
}
continue;
}
$complete = true;
// the (sub)network must be a fact or hosts(/subnets)
$block = $subNetwork / $hosts;
if ( is_int($block) ) {
// all clear
// NOTE: We do NOT return yet because we may have to verify any following segments
continue;
} else {
return $this->_invalidNetwork(__LINE__.':'.++$index.':'.$hosts); // NOTE: Index begins at 0 (zero)
}
}
}
return true;
}
/**
* Validates a network range with a "from-to" IP address notation
*
* @since Version 0.1.36
* @version 0.1.35 2012/01/16 12:44:00 CST
* @author aw
* @desc <p>A network range can be any difference (or equal) between two valid IP addresses. The method will even switch the
* values if the "to" is lower than the "from" address.</p>
* @param string $range
* @return bool
*/
protected function _validateRange($range) {
list($from,$to) = explode('-', $range); // Note: we do NOT care if more IP ranges have been set, i.e. the range would be invalid
if ( false === ($uInt_from = $this->_makeUnsignedAddress($from)) || false === ($uInt_to = $this->_makeUnsignedAddress($to)) ) {
return $this->_invalidNetwork(__LINE__); // at least one of the addresses is not a valid IP address
}
if ( $uInt_from <= $uInt_to ) {
$this->_rangeFrom = $uInt_from;
$this->_rangeTo = $uInt_to;
} else {
// the range is not in the correct order
$this->_rangeFrom = $uInt_to;
$this->_rangeTo = $uInt_from;
}
return true;
}
/**
* Converts an IP address into an unsigned decimal number (see ATTENTION note for returned value)
*
* @since Version 0.1.36
* @version 0.1.35 2012/01/16 12:31:00 CST
* @author aw
* @desc <p>Uses php function ip2long() to convert the IP into a signed value first and then returns the value with
* sprintf($u). ATTENTION: Function sprintf returns this value as a string and typecasting will not produce the expected
* result for IP addresses above 128.0.0.0. Do not typecast this value to an integer!</p>
* @param string $ip
* @return string
*/
private function _makeUnsignedAddress($ip) {
if ( false === ($ip_addr_long = ip2long($ip)) ) {
// not a valid IP address
return false;
}
// Note ip2long creates signed integers
// a positive number means the address is in the lower half < 128 (0nnn nnnn.)
// a negative number means the address is in the upper half >= 128 (1nnn nnnn.)
// 127.255.255.255 = 2147483647
// 128.0.0.1 = -2147483647
// 128.0.0.0 = -2147483648
// convert to unsigned decimal number
return sprintf('%u',$ip_addr_long);
}
/**
* Triggers an error warning or throws an exception
*
* @since Version 0.1.36
* @version 0.1.36 2012/01/15 11:54:00 CST
* @author aw
* @desc <p>The error message contains the argument which is usually the line where the error occured. The calling method
* may add additional information to the line number.</p>
* @throws E_USER_WARNING If the _throw property is false (default)
* @throws Exception If the _throw property is true
* @param string|int $line
* @return bool (false)
*/
private function _invalidNetwork($line) {
$error_msg = 'The provided network information is not a recognized format [#'.$line.']';
$this->_error(self::INVALID_NETWORK,$error_msg);
$msg = '[SCORES] Application error: '.$error_msg;
if ( false === $this->_throw ) {
trigger_error($msg,E_USER_WARNING);
return false;
} else {
throw new Exception($msg);
}
}
}

View File

@ -0,0 +1,39 @@
This validator class will test an IP against a provide network notation. The
network notation can be a network range, or network address with CIDR or 32-bit
decimal subnet mask notation. Note that the main validation method always uses
the CIDR notation, i.e a bitmask will be converted into a CIDR.
Examples for network notations
------------------------------
Network Range:
**************
128.0.0.12-128.0.0.19
true for all IP addresses inclusively in this range (i.e. from .12 to .19)
CIDR notation:
**************
128.0.0.8/30
block with 4 hosts
true for IP addresses from .8-.11 (i.e. .8, .9, .10, .11)
Subnet mask notation:
*********************
128.0.0.8/255.255.255.252
same as CIDR notation
Special Notes:
--------------
1) The network notation is validated, i.e. you have to pass a valid network and
CIDR or subnet mask combination. For the network range the two values must be
valid IP addresses.
2) A CIDR notation of /32, subnet mask /255.255.255.255 or a range with two
equal addresses will match for one host, i.e. the result is true if the network
address or the range addresses are identical to the IP address
3) The network notation or a range has to be set prior to calling isValid() as
is custom with all Zend validators. The notation can be set when instantiating
the object as an array and 'network' as the index. The setter method is
setNetworkNotation($notation) and expects a string as the argument.

View File

@ -0,0 +1,53 @@
<?php
class Scores_Wkhtml_Pdf
{
protected $wkhtml;
public function __construct()
{
$c = Zend_Registry::get('config');
$this->wkhtml = $c->profil->wkhtmltopdf->path;
}
/**
* Défini les options supplémentaires à l'execution de wkhtmltopdf
* -n, --disable-javascript Do not allow webpages to run javascript.
* --disable-internal-links Do no make local links
* --disable-external-links Do no make links to remote web pages
* --user-style-sheet <url> Specify a user style sheet, to load with every page.
* --print-media-type Use print media-type instead of screen.
* --header-left|right
* @param string $name
* @param string $value
*/
public function setOptions($name, $value = '')
{
$this->options[$name] = $value;
}
/**
* Imprime un fichier HTML en PDF avec l'utilitaire wkhtmltopdf
* @param string $fileIn
* @param string $fileOut
* @return string Nom du fichier
*/
public function exec($fileIn, $fileOut = '')
{
if (empty($fileOut)) {$fileOut = str_replace('.html', '.pdf', $fileIn); }
if(file_exists($fileOut)){ unlink($fileOut); }
$options = '--disable-internal-links';
if ( count($this->options) )
{
foreach ( $this->options as $name => $value )
{
$options.= ' --'.$name;
if ($value!= '') $options.= ' "'.$value.'"';
}
}
$cmd = $this->wkhtml.' '.$options.' "'.$fileIn.'" "'.$fileOut.'"';
exec( $cmd );
return $fileOut;
}
}

View File

@ -0,0 +1,92 @@
<?php
class Scores_Ws_Discover
{
protected $serviceWsdl = null;
protected $serviceOptions = array();
protected $serviceStructure = array();
protected $serviceStructureTypes = array();
protected $serviceTypes;
protected $serviceFunctions;
public function __construct($wsdl, $options = array())
{
$this->serviceWsdl = $wsdl;
$this->serviceOptions = $options;
$this->setStructure();
}
public function getStructure()
{
return $this->serviceStructure;
}
public function getStructureParam()
{
return $this->serviceStructureTypes;
}
protected function setStructure()
{
$client = new Zend_Soap_Client(
$this->serviceWsdl,
$this->serviceOptions
);
$this->serviceFunctions = $client->getFunctions();
$this->serviceTypes = $client->getTypes();
foreach($this->serviceFunctions as $func)
{
$this->setFunction($func);
}
foreach($this->serviceTypes as $type){
$this->setType($type);
}
}
protected function setFunction($func)
{
if (preg_match('/[^\s]+\s([^\s]+)\((.*)\)/', $func, $matches))
{
$funcName = $matches[1];
$funcParams = $matches[2];
$this->serviceStructure[$funcName] = array();
if (preg_match_all('/([^\s]+)\s([^\s]+),?/', $funcParams, $mParams))
{
$nbParams = count($mParams[0]);
for($i=0;$i<$nbParams;$i++)
{
$type = $mParams[1][$i];
$name = $mParams[2][$i];
$this->serviceStructure[$funcName][$i] = array(
'name' => $name,
'type' => $type
);
}
}
}
}
protected function setType($type)
{
$type = str_replace("\n", '', $type);
if (preg_match('/struct\s([^\s]+)\s\{(.*)\}$/m', $type, $matches))
{
$struct = trim($matches[1]);
$params = trim($matches[2]);
preg_match_all('/([^\s]+)\s([^\s]+);/', $params, $paramsMatches);
$nbParams = count($paramsMatches[0]);
$this->serviceStructureTypes[$struct] = array();
for($i=0; $i<$nbParams;$i++)
{
$this->serviceStructureTypes[$struct][$i] = array(
'name' => $paramsMatches[2][$i],
'type' => $paramsMatches[1][$i],
);
}
}
}
}

187
library/Scores/Ws/Doc.php Normal file
View File

@ -0,0 +1,187 @@
<?php
class Scores_Ws_Doc
{
private $serviceClass;
private $classmap = array();
private $serviceMethods = array();
private $serviceTypes = array();
public function __construct($serviceClass = null, $classmap = null, $path)
{
$this->serviceClass = $serviceClass;
$this->classmap = $classmap;
require_once $path . 'Service.php';
$this->parseService();
$this->parseTypes();
}
/**
* Retourne la liste des services et leurs paramètres
* @return array
*/
public function getServiceMethods()
{
return $this->serviceMethods;
}
/**
* Retourne la liste des types de données et leurs paramètres
* @return array
*/
public function getServiceTypes()
{
return $this->serviceTypes;
}
private function parseService()
{
$class = new Zend_Server_Reflection();
$methods = $class->reflectClass($this->serviceClass)
->getMethods();
$methodsElement = array();
foreach ($methods as $method) {
$prototype = null;
$maxNumArgumentsOfPrototype = -1;
foreach ($method->getPrototypes() as $tmpPrototype) {
$numParams = count($tmpPrototype->getParameters());
if ($numParams > $maxNumArgumentsOfPrototype) {
$maxNumArgumentsOfPrototype = $numParams;
$prototype = $tmpPrototype;
}
}
$paramsElement = array();
foreach ($prototype->getParameters() as $param) {
$paramElement = array(
'type' => $param->getType(),
'name' => $param->getName(),
'description' => $param->getDescription(),
);
if ($param->isOptional()){
$paramElement['optional'] = $param->isOptional();
$paramElement['defaultValue'] = $param->getDefaultValue();
}
$paramsElement[] = $paramElement;
}
$methodElement = array(
'name' => $method->getName(),
'desc' => $method->getDescription(),
'params' => $paramsElement,
'return' => $prototype->getReturnType(),
);
$methodsElement[] = $methodElement;
}
$this->serviceMethods = $methodsElement;
}
private function parseTypes()
{
$typesElement = array();
if (count($this->classmap)>0)
{
foreach ($this->classmap as $className)
{
$class = new ReflectionClass($className);
$paramsElement = array();
foreach ($class->getProperties() as $property) {
if ($property->isPublic() && preg_match_all('/@var\s+([^\s]+)/m', $property->getDocComment(), $matches)) {
$name = $property->getName();
$type = $matches[1][0];
/**
* Traitement éléments de documentation à placer dans le WSDL
* Supprime les retours chariots.
* Récupére les éléments de documentation
*/
$comment = '';
$docBlock = preg_replace('/\n/', '', $property->getDocComment() );
if (preg_match('/\/\*\*(.+) \* @var\s+[^\s]+\s+(?:\*|@)/m', $docBlock, $docBlockMatches)) {
$comment.= preg_replace(
array('/\r/', '/\*/' ),
array('' , ''), $docBlockMatches[1]
);
}
/**
* Traitement des @xsd (Provisoire)
* Définition des longueurs dans la documentation
* @xsd minLength=[\d]+ => (Longueur min = [\d]+)
* @xsd maxLength=[\d]+ => (Longueur max = [\d]+)
* @xsd enumeration=element,element
*/
if (preg_match_all('/@xsd\s+(minLength|maxLength)=([\d]+)\s+(?:\*|@)/m', $property->getDocComment(), $resMatches, PREG_SET_ORDER)){
$comment.= '(';
$parcourCpt = 0;
foreach ($resMatches as $res ) {
switch ($res[1]){
case 'minLength':
$comment.= 'Longueur min = '.$res[2];
break;
case 'maxLength':
$comment.= 'Longueur max = '.$res[2];
break;
}
$parcourCpt++;
if ($parcourCpt>0 && $parcourCpt<count($resMatches)) {
$comment.= ', ';
}
}
$comment.= ')';
}
/**
* Traitement des références
* @ref fichier:titre:nom_du_fichier
* => http://vhost/ref/fichier/
* @ref mysql:titre:requete.sql
* => http://vhost/ref/table/
*/
if (preg_match_all('/@ref\s+(fichier|mysql):(.*):(.*)\.(?:csv|sql)\s+(?:\*|@)/m', $property->getDocComment(), $refMatches, PREG_SET_ORDER)){
$view = new Zend_View();
$comment.= ', Référence(s) : ';
foreach ($refMatches as $ref){
switch ($ref[1]){
case 'fichier':
$urlFichier = $view->url(array(
'controller' => 'ref',
'action' => 'fichier',
'q' => $ref[3],
), null, true);
$comment.= '<a href="'.$urlFichier.'">'.$ref[2].'</a>';
break;
case 'mysql':
$urlMysql = $view->url(array(
'controller' => 'ref',
'action' => 'table',
'q' => $ref[3],
), null, true);
$comment.= '<a href="'.$urlMysql.'">'.$ref[2].'</a>';
break;
}
$comment.= ', ';
}
}
$paramElement = array(
'name' => $name,
'type' => $type,
'description' => trim($comment)
);
}
$paramsElement[] = $paramElement;
}
$typesElement[$className] = $paramsElement;
}
$this->serviceTypes = $typesElement;
}
}
}

View File

@ -0,0 +1,2 @@
<?php
class Scores_Ws_Exception extends Zend_Exception {}

View File

@ -0,0 +1,24 @@
<?php
class Scores_Ws_Form_GetIdentite extends Zend_Form
{
public function init()
{
$this->setName('soapform');
$this->setAction('/demo/requete');
$this->setMethod('post');
$this->addElement('text', 'siret', array(
'filters' => array('StringTrim'),
'validators' => array(
array('stringLength',false,array(9,14)),
array('NotEmpty', true),
),
'label' => 'Siret : ',
'required' => 'true',
)
);
$this->addElement('submit', 'submit', array(
'label' => 'Envoyez',
));
}
}

1158
library/Scores/Ws/Server.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,112 @@
<?php
class Scores_Ws_Trigger
{
protected $userInfos;
protected $event;
protected $events = null;
public function __construct($event, $userInfos)
{
$this->event = $event;
$this->userInfos = $userInfos;
}
/**
* Check if we have a trigger to execute
* @return number
*/
protected function hasTrigger()
{
if ( $this->userInfos['Service'] === null ) {
$service = 'default';
}
$model = new Application_Model_Sdv1ClientsServicesTrigger();
$sql = $model->select()
->where('event=?', $this->event)
->where('idClient=?', $this->userInfos['idClient'])
->where('service=?', $service)
->where('login=? OR login=""', $login);
$result = $model->fetchAll($sql);
if ( count($result)>0 ) {
foreach ( $result as $item ) {
$tmp->action = $item->action;
$tmp->params = json_decode($item->actionParams, true);
}
}
return count($result);
}
/**
* Execute all triggers after hasTrigger
* @param array $args
* @return boolean
*/
protected function executeAllTrigger($args)
{
if ( count($this->events)>0 ) {
foreach ( $this->events as $action ) {
$args = array_merge($args, $action->params);
switch ( $action->action ) {
case 'surveillance':
return $this->surveillance($args);
break;
}
}
}
}
/**
* Mise en surveillance automatique
* @param array $args
* source, siren, ...
* @return boolean
*/
protected function surveillance($args)
{
if ( !array_key_exists('source', $args) ) {
return false;
}
if ( !array_key_exists('siren', $args) ) {
return false;
}
if ( !array_key_exists('nic', $args) ) {
return false;
}
if ( empty(trim($this->userInfos['email'])) ) {
return false;
}
if ( array_key_exists('ref', $args)) {
$ref = $args['ref'];
}
try {
$model = new Application_Model_JoSurveillancesSite();
$data = array(
'source' => $args['source'],
'login' => $this->userInfos['login'],
'email' => $this->userInfos['email'],
'siren' => $args['siren'],
'nic' => $args['nic'],
'ref' => $ref,
'encoursClient' => 0,
'rs' => $args['Nom'],
'cp' => $args['CP'],
'ville' => $args['Ville'],
'dateAjout' => date('Y-m-d'),
'dateSuppr' => 0,
);
$model->insert($data);
return true;
} catch (Zend_Db_Exception $e) {
}
return false;
}
}

View File

@ -0,0 +1,15 @@
<?php
// Generated by ZF's ./bin/classmap_generator.php
return array(
'Scores_Auth_Adapter_Db' => dirname(__FILE__) . '//Auth/Adapter/Db.php',
'Scores_Auth_Adapter_Ws' => dirname(__FILE__) . '//Auth/Adapter/Ws.php',
'Scores_Locale_String' => dirname(__FILE__) . '//Locale/String.php',
'Scores_Mail_Method' => dirname(__FILE__) . '//Mail/Method.php',
'Scores_Validate_IpInNetwork' => dirname(__FILE__) . '//Validate/IpInNetwork.php',
'Scores_Wkhtml_Pdf' => dirname(__FILE__) . '//Wkhtml/Pdf.php',
'Scores_Ws_Doc' => dirname(__FILE__) . '//Ws/Doc.php',
'Scores_Ws_Exception' => dirname(__FILE__) . '//Ws/Exception.php',
'Scores_Ws_Form_GetIdentite' => dirname(__FILE__) . '//Ws/Form/GetIdentite.php',
'Scores_Ws_Server' => dirname(__FILE__) . '//Ws/Server.php',
'Scores_Ws_Trigger' => dirname(__FILE__) . '//Ws/Trigger.php',
);

View File

@ -0,0 +1,154 @@
<?php
class SdMetier_Intersud_Service
{
/**
* Stockage du cookie
* @var string
*/
protected $ckfile;
protected $login = 'YLENA';
protected $pass = 'WYLFE';
/**
* Gestion des demandes d'enquêtes au service Infogreffe
*/
public function __construct(){}
public function setDemandeur()
{
}
public function setEnquete()
{
}
public function call()
{
$this->ckfile = __DIR__.'/'.uniqid('cookie-');
if (file_exists($ckfile)) unlink($ckfile);
// --- Authentification
$url = 'http://www.intersud.fr/espace_client/';
$data = array(
'login' => $this->login,
'pwd' => $this->pass,
);
$result = $this->page($url, $data);
// --- Post de la demande
$url = 'http://intersud.fr/espace_client/demande_enquete.php';
$data = array(
//Expediteur - Email
'email_exp' => 'support@scores-decisions.com',
//Type enquete - Prestation Nationales
'type_enk' => $enqType, // 0=Premier, 1=Gold, 2=Distrimat, 3=Star, 4=Avis bancaire, 5=Autre
'delai_enk' => $enqDelai, // 6=24h, 7=72h, 8=+de5jours
//Type enquete - Prestation Internationales
//Société
'soc' => $tabIdentite['Nom'],
'cible_enk' => 9, // 9
'siret' => $siren,
'acti' => '',
'soc_exp' => $tabInterSud['soc_exp'],
'nom_diri' => '',
'adr' => $tabIdentite['Adresse'],
'ref_exp' => $tabInterSud['ref_exp'],
'autre_type_enk' => '', // Texte libre
'adr2' => $tabIdentite['Adresse2'],
'ville' => $tabIdentite['Ville'],
'cp' => $tabIdentite['CP'],
'pays' => '', // International ?
'nom_exp' => $tabInterSud['nom_exp'],
'tel' => $tabIdentite['Tel'],
'port' => $infoEnq['Entrep']['AutreTel'],
'tel_exp' => $tabInterSud['tel_exp'],
'bank' => trim(implode(' ', $infoEnq['Entrep']['Rib'])),
'int_enk' => $tabInterSud['int_enk'], // International ?
'encours' => $infoEnq['Encours'],
'nb_ech' => $infoEnq['NbEcheances'],
'delai2_enk' => $tabInterSud['delai2_enk'], // International ?
'cred' => '',
'comment' => urlencode($comment),
'val_ret' => $tabInterSud['val_ret'],
);
$result = $this->page($url, $data);
}
protected function page($url, $curl_data = '', $override = null)
{
//$user_agent = 'Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1';
//$user_agent = 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)';
$user_agent = 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)';
$verbose = false;
$post = false;
$fields = '';
if (is_array($curl_data) && count($curl_data)>0) {
foreach($curl_data as $key=>$value) {
$fields .= $key.'='.$value.'&';
}
rtrim($fields,'&');
$post = true;
}
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => false, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => $user_agent, // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
CURLOPT_TIMEOUT => 120, // timeout on response
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
CURLOPT_POST => $post, // i am sending post data
CURLOPT_POSTFIELDS => $fields, // this are my post vars
CURLOPT_SSL_VERIFYHOST => 0, // don't verify ssl
CURLOPT_SSL_VERIFYPEER => false, //
CURLOPT_VERBOSE => $verbose , //
//CURLOPT_COOKIESESSION => true,
CURLOPT_COOKIEFILE => $ckfile,
CURLOPT_COOKIEJAR => $ckfile, // Stockage du cookie de session
);
//Override define CURL option
if (is_array($override) && count($override)>0 ) {
$options = $override + $options;
}
$ch = curl_init($url);
curl_setopt_array($ch,$options);
$content = curl_exec($ch);
$err = curl_errno($ch);
$errmsg = curl_error($ch) ;
$header = curl_getinfo($ch);
curl_close($ch);
//Rewrite encoding to UTF-8
//text/html; charset=ISO-8859-1
//$encoding = getPageHeader('text\/html; charset=', '', $header['content_type']);
//$encoding = 'ISO-8859-1';
//$content = iconv($encoding, 'UTF-8//TRANSLIT', $content);
// $header['errno'] = $err;
// $header['errmsg'] = $errmsg;
// $header['content'] = $content;
return array('header'=>$header, 'content'=>$content);
}
}

View File

@ -0,0 +1,6 @@
<?php
class SdMetier_Rnvp_Detail
{
}

View File

@ -0,0 +1,111 @@
<?php
require_once 'Metier/partenaires/classMPrivileges.php';
require_once 'Metier/partenaires/classMMarques.php';
require_once 'Metier/partenaires/classMLiens2.php';
require_once 'Metier/scores/classMRegression.php';
require_once 'Metier/scores/classMSolvabilite.php';
require_once 'Metier/scores/classMRatios.php';
/**
* Injection SdMetier_Scoring_Vars
*
* $this->getVars(name)
* $this->setVars(name)
* $this->operation(name)
*
* Les variables doivents être déclarées public pour un accès direct $this->Vars->{var name}
*
*/
/**
* Injection SdMetier_Scoring_Formule_{version}
* Auto-generated class avec
* - appel à vars
* - appel à operation
*
* function calc => effectue les opérations de calcul
*
*/
/**
* Injection SdMetier_Scoring_Comment_{version}
* Doit récupérer le contexte de toutes les variables pour générer les commentaires
* - Récupération des données d'initialisation
* - Récupération du contexte de calcul
* - Récupération de Vars
* - Formattage
*/
class SdMetier_Scoring_Calcul
{
protected $Vars = null;
protected $Formule = null;
protected $Comment = null;
protected $version = '414';
protected $niveau = '2';
protected $debug = false;
protected $db = null;
public function __construct($siren, $type = 'score', $sourceModif = 'jour')
{
// --- Commence par une initialisation des variables dans le dictionnaire
$this->Vars = new SdMetier_Scoring_Vars();
}
public function setDebug($debug = false)
{
$this->debug = $debug;
}
public function setDb($db)
{
$this->db = $db;
}
public function getVars()
{
return $this->Vars;
}
public function setFormule(SdMetier_Scoring_Formule_Interface $formule)
{
$this->Formule = $formule;
}
public function setComment(SdMetier_Scoring_Comment_Interface $comment)
{
$this->Comment = $comment;
}
public function exec($comment = false)
{
// --- Execution des calculs du score
// --- Commentaires activés
if ( $comment === true ) {
// --- Chargement si nécessaires des commentaires
if ( $this->Comment === null ) {
}
// --- Chargement si nécessaire des formules
if ( $this->Formule === null ) {
}
}
}
}

View File

@ -0,0 +1,6 @@
<?php
abstract class SdMetier_Scoring_Comment_Abstract implements SdMetier_Scoring_Comment_Interface
{
}

View File

@ -0,0 +1,2 @@
<?php
interface SdMetier_Scoring_Comment_Interface {}

View File

@ -0,0 +1 @@
<?php

View File

@ -0,0 +1 @@
<?php

View File

@ -0,0 +1,6 @@
<?php
abstract class SdMetier_Scoring_Formule_Abstract implements SdMetier_Scoring_Formule_Interface
{
}

View File

@ -0,0 +1,2 @@
<?php
interface SdMetier_Scoring_Formule_Interface {}

View File

@ -67,8 +67,8 @@ class SdMetier_Sfr_Compile
$this->compileTxt.= "\t".$i." => array(\n";
$this->compileTxt.= "\t\t'name' => '".$rule->label."',\n";
$this->compileTxt.= "\t\t'value' => '".$rule->value."',\n";
$this->compileTxt.= "\t\t'po' => ".$rule->po.",\n";
$this->compileTxt.= "\t\t'comment' => \"".$rule->comment."\",\n";
$this->compileTxt.= "\t\t'po' => ".$rule->po.",\n";
$this->compileTxt.= "\t\t'params' => array(\n";
$this->addParams($rule->type, $rule->codif);
$this->compileTxt.= "\t\t),\n";

View File

@ -0,0 +1,542 @@
<?php
return array(
0 => array(
'name' => 'PO-NAF-GE',
'value' => '6000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabNafSFR'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '6'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
1 => array(
'name' => 'PO-NAF-GE',
'value' => '12000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabNafSFR'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '7'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
2 => array(
'name' => 'PO-NAF-GE',
'value' => '25000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabNafSFR'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '8'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
3 => array(
'name' => 'PO-NAF-GE',
'value' => '45000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabNafSFR'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '9'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
4 => array(
'name' => 'PO-NAF-PME',
'value' => '4600',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabNafSFR'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '6'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
5 => array(
'name' => 'PO-NAF-PME',
'value' => '5700',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabNafSFR'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '7'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
6 => array(
'name' => 'PO-NAF-PME',
'value' => '14000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabNafSFR'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '8'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
7 => array(
'name' => 'PO-NAF-PME',
'value' => '19000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabNafSFR'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '9'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
8 => array(
'name' => 'PO-NAF-PME',
'value' => '700',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabNafSFR'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '6'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
9 => array(
'name' => 'PO-NAF-PME',
'value' => '1000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabNafSFR'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '7'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
10 => array(
'name' => 'PO-NAF-PME',
'value' => '1100',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabNafSFR'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '8'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
11 => array(
'name' => 'PO-NAF-PME',
'value' => '2800',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabNafSFR'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '9'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
12 => array(
'name' => 'PO-Date-GE',
'value' => '3000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '6'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
13 => array(
'name' => 'PO-Date-GE',
'value' => '3000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '4'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '7'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
14 => array(
'name' => 'PO-Date-GE',
'value' => '3000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '8'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
15 => array(
'name' => 'PO-Date-GE',
'value' => '5000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '9'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
16 => array(
'name' => 'PO-Date-GE',
'value' => '5000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '10'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
17 => array(
'name' => 'PO-Date-GE',
'value' => '5000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '11'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
18 => array(
'name' => 'PO-Date-GE',
'value' => '10000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '12'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
19 => array(
'name' => 'PO-Date-GE',
'value' => '10000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '13'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
20 => array(
'name' => 'PO-Date-GE',
'value' => '10000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '14'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
21 => array(
'name' => 'PO-Date-PME',
'value' => '3000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '6'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
22 => array(
'name' => 'PO-Date-PME',
'value' => '3000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '7'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
23 => array(
'name' => 'PO-Date-PME',
'value' => '3000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '8'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
24 => array(
'name' => 'PO-Date-PME',
'value' => '6000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '9'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
25 => array(
'name' => 'PO-Date-PME',
'value' => '6000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '4'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '10'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
26 => array(
'name' => 'PO-Date-PME',
'value' => '6000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '11'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
27 => array(
'name' => 'PO-Date-PME',
'value' => '9000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '12'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
28 => array(
'name' => 'PO-Date-PME',
'value' => '9000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '13'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
29 => array(
'name' => 'PO-Date-PME',
'value' => '9000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '14'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
30 => array(
'name' => 'PO-Date-TPE',
'value' => '1000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '6'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
31 => array(
'name' => 'PO-Date-TPE',
'value' => '1000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '7'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
32 => array(
'name' => 'PO-Date-TPE',
'value' => '1000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '8'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
33 => array(
'name' => 'PO-Date-TPE',
'value' => '1500',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '9'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
34 => array(
'name' => 'PO-Date-TPE',
'value' => '1500',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '4'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '10'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
35 => array(
'name' => 'PO-Date-TPE',
'value' => '2000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '11'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
36 => array(
'name' => 'PO-Date-TPE',
'value' => '2000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '12'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
37 => array(
'name' => 'PO-Date-TPE',
'value' => '2000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '13'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
38 => array(
'name' => 'PO-Date-TPE',
'value' => '2000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '14'),
2 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
39 => array(
'name' => 'PO-STD-GE',
'value' => '6000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '6'),
1 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
40 => array(
'name' => 'PO-STD-GE',
'value' => '10000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '7'),
1 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
41 => array(
'name' => 'PO-STD-GE',
'value' => '20000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '8'),
1 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
),
),
42 => array(
'name' => 'PO-STD-PME',
'value' => '3000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '6'),
1 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
43 => array(
'name' => 'PO-STD-PME',
'value' => '3700',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '7'),
1 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
44 => array(
'name' => 'PO-STD-PME',
'value' => '5000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '8'),
1 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
45 => array(
'name' => 'PO-STD-PME',
'value' => '9000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '9'),
1 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'PME'),
),
),
46 => array(
'name' => 'PO-STD-TPE',
'value' => '1000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '6'),
1 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
47 => array(
'name' => 'PO-STD-TPE',
'value' => '1000',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '7'),
1 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
48 => array(
'name' => 'PO-STD-TPE',
'value' => '1500',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '8'),
1 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
49 => array(
'name' => 'PO-STD-TPE',
'value' => '1500',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '9'),
1 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'TPE'),
),
),
);

View File

@ -0,0 +1,168 @@
<?php
return array(
0 => array(
'name' => 'VORd-11.1',
'value' => 'STOP',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'ContratAge', 'type' => 'EGAL', 'value' => 'UNDEFINE'),
1 => array( 'var' => 'IR', 'type' => 'EGAL', 'value' => 'UNDEFINE'),
),
),
1 => array(
'name' => 'VORd-11.2',
'value' => 'CONTINUE',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'ContratAge', 'type' => 'EGAL', 'value' => 'UNDEFINE'),
1 => array( 'var' => 'IR', 'type' => 'MIN', 'value' => '-1', 'define' => array( 'var' => 'ContratAge', 'value' => '24')),
),
),
2 => array(
'name' => 'VORd-11.3',
'value' => 'CONTINUE',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'ContratAge', 'type' => 'MIN', 'value' => '-1'),
1 => array( 'var' => 'IR', 'type' => 'EGAL', 'value' => 'UNDEFINE', 'define' => array( 'var' => 'IR', 'value' => '8')),
),
),
3 => array(
'name' => 'VORd-10.1',
'value' => 'ROUGE',
'comment' => "Société dont la solvabilité est limitée et qui rencontre des difficultés de paiement : Faire une DEC pour tout acte éligible",
'po' => 0,
'params' => array(
0 => array( 'var' => 'FEU', 'type' => 'EGAL', 'value' => 'VERT'),
1 => array( 'var' => 'IR', 'type' => 'MIN', 'value' => '4.9'),
2 => array( 'var' => 'IR', 'type' => 'MAX', 'value' => '7.1'),
3 => array( 'var' => 'ContratAge', 'type' => 'MAX', 'value' => '25'),
4 => array( 'var' => 'Indiscore', 'type' => 'MIN', 'value' => '9'),
5 => array( 'var' => 'Indiscore', 'type' => 'MAX', 'value' => '12'),
),
),
4 => array(
'name' => 'VORd-10.2',
'value' => 'ORANGE',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'FEU', 'type' => 'EGAL', 'value' => 'VERT'),
1 => array( 'var' => 'IR', 'type' => 'MIN', 'value' => '4.9'),
2 => array( 'var' => 'IR', 'type' => 'MAX', 'value' => '7.1'),
3 => array( 'var' => 'ContratAge', 'type' => 'MIN', 'value' => '24'),
4 => array( 'var' => 'ContratAge', 'type' => 'MAX', 'value' => '36'),
5 => array( 'var' => 'Indiscore', 'type' => 'MIN', 'value' => '9'),
6 => array( 'var' => 'Indiscore', 'type' => 'MAX', 'value' => '12'),
),
),
5 => array(
'name' => 'VORd-10.3',
'value' => 'ORANGE',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'FEU', 'type' => 'EGAL', 'value' => 'VERT'),
1 => array( 'var' => 'IR', 'type' => 'MIN', 'value' => '4.9'),
2 => array( 'var' => 'IR', 'type' => 'MAX', 'value' => '7.1'),
3 => array( 'var' => 'ContratAge', 'type' => 'MAX', 'value' => '25'),
4 => array( 'var' => 'Indiscore', 'type' => 'MIN', 'value' => '11'),
5 => array( 'var' => 'Indiscore', 'type' => 'MAX', 'value' => '14'),
),
),
6 => array(
'name' => 'VORd-10.4',
'value' => 'ROUGE',
'comment' => "Société dont la solvabilité est limitée et qui rencontre des difficultés de paiement : Faire une DEC pour tout acte éligible",
'po' => 0,
'params' => array(
0 => array( 'var' => 'FEU', 'type' => 'EGAL', 'value' => 'ORANGE'),
1 => array( 'var' => 'IR', 'type' => 'MAX', 'value' => '2.1'),
2 => array( 'var' => 'ContratAge', 'type' => 'MIN', 'value' => '35'),
),
),
7 => array(
'name' => 'VORd-10.5',
'value' => 'VERT',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'FEU', 'type' => 'EGAL', 'value' => 'ORANGE'),
1 => array( 'var' => 'IR', 'type' => 'MIN', 'value' => '2'),
2 => array( 'var' => 'IR', 'type' => 'MAX', 'value' => '5'),
3 => array( 'var' => 'ContratAge', 'type' => 'MIN', 'value' => '36'),
4 => array( 'var' => 'Indiscore', 'type' => 'MIN', 'value' => '7'),
),
),
8 => array(
'name' => 'VORd-10.6',
'value' => 'ROUGE',
'comment' => "Société dont la solvabilité est limitée et qui rencontre des difficultés de paiement : Faire une DEC pour tout acte éligible",
'po' => 0,
'params' => array(
0 => array( 'var' => 'FEU', 'type' => 'EGAL', 'value' => 'ORANGE'),
1 => array( 'var' => 'EntrepRecente', 'type' => 'EGAL', 'value' => '1'),
2 => array( 'var' => 'IR', 'type' => 'MAX', 'value' => '2.1'),
3 => array( 'var' => 'ContratAge', 'type' => 'MAX', 'value' => '36'),
),
),
9 => array(
'name' => 'VORd-10.7',
'value' => 'ROUGE',
'comment' => "Société dont la solvabilité est limitée et qui rencontre des difficultés de paiement : Faire une DEC pour tout acte éligible",
'po' => 0,
'params' => array(
0 => array( 'var' => 'FEU', 'type' => 'EGAL', 'value' => 'ORANGE'),
1 => array( 'var' => 'EntrepRecente', 'type' => 'EGAL', 'value' => '1'),
2 => array( 'var' => 'ContratAge', 'type' => 'MAX', 'value' => '25'),
3 => array( 'var' => 'IR', 'type' => 'MIN', 'value' => '4.9'),
4 => array( 'var' => 'IR', 'type' => 'MAX', 'value' => '7.1'),
5 => array( 'var' => 'Indiscore', 'type' => 'MIN', 'value' => '9'),
6 => array( 'var' => 'Indiscore', 'type' => 'MAX', 'value' => '12'),
),
),
10 => array(
'name' => 'VORd-10.8',
'value' => 'VERT',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'FEU', 'type' => 'EGAL', 'value' => 'ORANGE'),
1 => array( 'var' => 'EntrepRecente', 'type' => 'EGAL', 'value' => '1'),
2 => array( 'var' => 'IR', 'type' => 'MIN', 'value' => '4.9'),
3 => array( 'var' => 'IR', 'type' => 'MAX', 'value' => '7.1'),
4 => array( 'var' => 'ContratAge', 'type' => 'MIN', 'value' => '36'),
5 => array( 'var' => 'Indiscore', 'type' => 'MIN', 'value' => '11'),
),
),
11 => array(
'name' => 'VORd-10.8-2',
'value' => 'VERT',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'FEU', 'type' => 'EGAL', 'value' => 'ORANGE'),
1 => array( 'var' => 'EntrepRecente', 'type' => 'EGAL', 'value' => '1'),
2 => array( 'var' => 'IR', 'type' => 'MIN', 'value' => '4.9'),
3 => array( 'var' => 'IR', 'type' => 'MAX', 'value' => '7.1'),
4 => array( 'var' => 'ContratAge', 'type' => 'MIN', 'value' => '24'),
5 => array( 'var' => 'Indiscore', 'type' => 'MIN', 'value' => '13'),
),
),
12 => array(
'name' => 'VORd-10.9',
'value' => 'ORANGE',
'comment' => "Faire une DEC si dépassement de la PO proposée",
'po' => 0,
'params' => array(
0 => array( 'var' => 'FEU', 'type' => 'EGAL', 'value' => 'ROUGE'),
1 => array( 'var' => 'IR', 'type' => 'MIN', 'value' => '2'),
2 => array( 'var' => 'IR', 'type' => 'MAX', 'value' => '5'),
3 => array( 'var' => 'ContratAge', 'type' => 'MIN', 'value' => '36'),
4 => array( 'var' => 'Indiscore', 'type' => 'MIN', 'value' => '3'),
),
),
);

View File

@ -0,0 +1,164 @@
<?php
return array(
0 => array(
'name' => 'VORp-1.0',
'value' => 'DEFINE',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'IsCAC', 'type' => 'EGAL', 'value' => '1', 'define' => array( 'var' => 'TypeEntrep', 'value' => 'CAC')),
1 => array( 'var' => 'Effectif', 'type' => 'MIN', 'value' => '499', 'define' => array( 'var' => 'TypeEntrep', 'value' => 'GE')),
2 => array( 'var' => 'Effectif', 'type' => 'MIN', 'value' => '3', 'define' => array( 'var' => 'TypeEntrep', 'value' => 'PME')),
3 => array( 'var' => 'Effectif', 'type' => 'MIN', 'value' => '-1', 'define' => array( 'var' => 'TypeEntrep', 'value' => 'TPE')),
4 => array( 'var' => 'Effectif', 'type' => 'EGAL', 'value' => 'UNDEFINE', 'define' => array( 'var' => 'TypeEntrep', 'value' => 'TPE')),
),
),
1 => array(
'name' => 'VORp-2.1',
'value' => 'VERT',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabAdminNaf', 'define' => array( 'var' => 'IsAdmin', 'value' => '1')),
),
),
2 => array(
'name' => 'VORp-2.2',
'value' => 'VERT',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'FJ', 'type' => 'LIST', 'value' => 'TabAdminFj', 'define' => array( 'var' => 'IsAdmin', 'value' => '1')),
),
),
3 => array(
'name' => 'VORp-3.1',
'value' => 'ROUGE',
'comment' => "Société de droit étranger : faire une DEC si volonté de poursuivre l'affaire",
'po' => 0,
'params' => array(
0 => array( 'var' => 'NAF', 'type' => 'LIST', 'value' => 'TabEtrangerNaf', 'define' => array( 'var' => 'IsEtranger', 'value' => '1')),
),
),
4 => array(
'name' => 'VORp-3.2',
'value' => 'ROUGE',
'comment' => "Société de droit étranger : faire une DEC si volonté de poursuivre l'affaire",
'po' => 0,
'params' => array(
0 => array( 'var' => 'FJ', 'type' => 'LIST', 'value' => 'TabEtrangerFj', 'define' => array( 'var' => 'IsEtranger', 'value' => '1')),
),
),
5 => array(
'name' => 'VORp-4.1',
'value' => 'ROUGE',
'comment' => "Cette société fait l'objet d'un Redressement Judiciaire : faire une DEC si volonté de poursuivre l'affaire",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'MAX', 'value' => '6'),
1 => array( 'var' => 'RJ', 'type' => 'EGAL', 'value' => '1'),
),
),
6 => array(
'name' => 'VORp-4.2',
'value' => 'ROUGE',
'comment' => "Cette société fait l'objet d'une liquidation judiciaire : pas d'entrée en relation possible",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'MAX', 'value' => '6'),
1 => array( 'var' => 'LJ', 'type' => 'EGAL', 'value' => '1'),
),
),
7 => array(
'name' => 'VORp-4.3',
'value' => 'ROUGE',
'comment' => "Cette société fait l'objet d'une Sauvegarde Judiciaire : faire une DEC si volonté de poursuivre l'affaire",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'MAX', 'value' => '6'),
1 => array( 'var' => 'SV', 'type' => 'EGAL', 'value' => '1'),
),
),
8 => array(
'name' => 'VORp-4.4',
'value' => 'ROUGE',
'comment' => "Cette entreprise n'est pas active à l'INSEE : pas d'entrée en relation possible",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'MAX', 'value' => '6'),
1 => array( 'var' => 'InseeActif', 'type' => 'EGAL', 'value' => '0'),
),
),
9 => array(
'name' => 'VORp-5.0',
'value' => 'ORANGE',
'comment' => "Faire une DEC si dépassement de la PO proposée",
'po' => 1,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'MAX', 'value' => '16'),
1 => array( 'var' => 'Indiscore', 'type' => 'MIN', 'value' => '9'),
2 => array( 'var' => 'InseeAge', 'type' => 'MAX', 'value' => '37', 'define' => array( 'var' => 'EntrepRecente', 'value' => '1')),
3 => array( 'var' => 'TypeEntrep', 'type' => 'MIN', 'value' => 'PME'),
),
),
10 => array(
'name' => 'VORp-7.0',
'value' => 'ORANGE',
'comment' => "Cette entreprise fait l'objet d'une sauvegarde : faire une DEC si dépassement de la PO",
'po' => 1,
'params' => array(
0 => array( 'var' => 'FEU', 'type' => 'EGAL', 'value' => 'ROUGE'),
1 => array( 'var' => 'SV', 'type' => 'EGAL', 'value' => '1'),
2 => array( 'var' => 'Indiscore', 'type' => 'MIN', 'value' => '4'),
),
),
11 => array(
'name' => 'VORp-8.0',
'value' => 'VERT',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'GE'),
1 => array( 'var' => 'Indiscore', 'type' => 'EGAL', 'value' => '9'),
),
),
12 => array(
'name' => 'VORp-9.0',
'value' => 'VERT',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'TypeEntrep', 'type' => 'EGAL', 'value' => 'CAC'),
1 => array( 'var' => 'Indiscore', 'type' => 'MIN', 'value' => '5'),
),
),
13 => array(
'name' => 'VORp-6.1',
'value' => 'ROUGE',
'comment' => "Solvabilité et pérennité compromise : faire une DEC si volonté de poursuivre l'affaire",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'MAX', 'value' => '5'),
),
),
14 => array(
'name' => 'VORp-6.2',
'value' => 'ORANGE',
'comment' => "Faire une DEC si dépassement de la PO proposée",
'po' => 1,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'MAX', 'value' => '9'),
1 => array( 'var' => 'Indiscore', 'type' => 'MIN', 'value' => '4'),
),
),
15 => array(
'name' => 'VORp-6.3',
'value' => 'VERT',
'comment' => "",
'po' => 0,
'params' => array(
0 => array( 'var' => 'Indiscore', 'type' => 'MAX', 'value' => '21'),
1 => array( 'var' => 'Indiscore', 'type' => 'MIN', 'value' => '8'),
),
),
);

View File

@ -13,7 +13,7 @@ class SdMetier_Sfr_Scoring
* Version of rules (for loading static files)
* @var double
*/
protected $version = '1.0';
protected $version = '1.1';
/**
* Put in error when not calculated
@ -634,6 +634,7 @@ class SdMetier_Sfr_Scoring
if ( $this->ValInseeActif==1 && !empty($this->ValSituationJuridique) ) {
$this->ValRJ = 0; //Liste des codes - 1200
$classInsee->AnnoncesLegalesVisu = true;
$retRJ = $classInsee->getAnnoncesLegales($siren, 0, array('1200','1201','1202','1203','1204','1205','1206','1207','1208','1209','1210','1211','1212','1214','1215','1216'));
if (count($retRJ)>0) {
$this->ValRJ = 1;
@ -641,6 +642,7 @@ class SdMetier_Sfr_Scoring
if ($this->debug) file_put_contents('sfr.log', "RJ = ".$this->ValRJ."\n", FILE_APPEND);
$this->ValSV = 0; //Liste des codes - 1100
$classInsee->AnnoncesLegalesVisu = true;
$retSV = $classInsee->getAnnoncesLegales($siren, 0, array('1100','1101','1102','1110','1119'));
if (count($retSV)>0) {
$this->ValSV = 1;
@ -648,6 +650,7 @@ class SdMetier_Sfr_Scoring
if ($this->debug) file_put_contents('sfr.log', "SV = ".$this->ValSV."\n", FILE_APPEND);
$this->ValLJ = 0; //Liste des codes - 1300
$classInsee->AnnoncesLegalesVisu = true;
$retLJ = $classInsee->getAnnoncesLegales($siren, 0, array('1300','1301','1302', '1303', '1304', '1305', '1306', '1307', '1308', '1309', '13010', '1311', '1312', '1313', '1346'));
if (count($retLJ)>0) {
$this->ValLJ = 1;

View File

@ -1,13 +1,14 @@
<?php
// Generated by ZF's ./bin/classmap_generator.php
return array(
'SdMetier_Graydon_Service' => dirname(__FILE__) . '//Graydon/Service.php',
'SdMetier_Infogreffe_DocAC' => dirname(__FILE__) . '//Infogreffe/DocAC.php',
'SdMetier_Infogreffe_DocBI' => dirname(__FILE__) . '//Infogreffe/DocBI.php',
'SdMetier_Infogreffe_DocST' => dirname(__FILE__) . '//Infogreffe/DocST.php',
'SdMetier_Infogreffe_Service' => dirname(__FILE__) . '//Infogreffe/Service.php',
'SdMetier_Scoring_Vars' => dirname(__FILE__) . '//Scoring/Vars.php',
'SdMetier_Search_Engine' => dirname(__FILE__) . '//Search/Engine.php',
'SdMetier_Sfr_Compile' => dirname(__FILE__) . '//Sfr/Compile.php',
'SdMetier_Sfr_Scoring' => dirname(__FILE__) . '//Sfr/Scoring.php',
'SdMetier_Graydon_Service' => dirname(__FILE__) . '//Graydon/Service.php',
'SdMetier_Infogreffe_DocAC' => dirname(__FILE__) . '//Infogreffe/DocAC.php',
'SdMetier_Infogreffe_DocBI' => dirname(__FILE__) . '//Infogreffe/DocBI.php',
'SdMetier_Infogreffe_DocST' => dirname(__FILE__) . '//Infogreffe/DocST.php',
'SdMetier_Infogreffe_Service' => dirname(__FILE__) . '//Infogreffe/Service.php',
'SdMetier_Intersud_Service' => dirname(__FILE__) . '//Intersud/Service.php',
'SdMetier_Rnvp_Detail' => dirname(__FILE__) . '//Rnvp/Detail.php',
'SdMetier_Search_Engine' => dirname(__FILE__) . '//Search/Engine.php',
'SdMetier_Sfr_Compile' => dirname(__FILE__) . '//Sfr/Compile.php',
'SdMetier_Sfr_Scoring' => dirname(__FILE__) . '//Sfr/Scoring.php',
);

View File

@ -11,26 +11,22 @@
*/
function sendMail($from, $to, $subject, $text='', $html='', $tabAttachedFiles=array())
{
$to = preg_split("/[\s,;]+/", $to);
$mail = new Zend_Mail('ISO-8859-15');
$tr = new Zend_Mail_Transport_Smtp(SMTP_HOST, array('port'=>SMTP_PORT));
$mail->setDefaultTransport($tr);
$mail->setFrom($from);
if ( count($to) > 0 ) {
$mail = new Scores_Mail_Method();
$mail->setFrom($from);
if ( count($to) > 0 ) {
foreach ( $to as $item ) {
$mail->addTo($item);
}
}
$mail->setSubject($subject);
if ($text!='') {
$mail->setBodyText(mb_convert_encoding($text, 'ISO-8859-15', 'UTF-8'));
}
$mail->setSubject($subject);
if ($text!='') {
$mail->setBodyText($text);
}
if ($html!='') {
$mail->setBodyHtml(mb_convert_encoding($html, 'ISO-8859-15', 'UTF-8'));
$mail->setBodyHtml($html);
}
if ( count($tabAttachedFiles) > 0 ) {
@ -41,11 +37,11 @@ function sendMail($from, $to, $subject, $text='', $html='', $tabAttachedFiles=ar
}
try {
$mail->send();
$mail->execute();
} catch (Zend_Mail_Transport_Exception $e) {
file_put_contents(LOG_PATH.'/sendMailError.log',date('Y-m-d H:i:s')." - ".$e->getMessage().PHP_EOL, FILE_APPEND);
file_put_contents(LOG_PATH.'/sendMailError.log', date('Y-m-d H:i:s')." - ".$e->getMessage()."\n", FILE_APPEND);
} catch (Zend_Mail_Protocol_Exception $e) {
file_put_contents(LOG_PATH.'/sendMailError.log',date('Y-m-d H:i:s')." - ".$e->getMessage().PHP_EOL, FILE_APPEND);
file_put_contents(LOG_PATH.'/sendMailError.log', date('Y-m-d H:i:s')." - ".$e->getMessage()."\n", FILE_APPEND);
}
}
?>

View File

@ -23,7 +23,7 @@ resources.db.isDefaultTableAdapter = true
profil.server.name = sdsrvdev01
profil.webservice.location = local
profil.mail.method = smtp
profil.mail.smtp_host = smtp.free.fr
profil.mail.host = smtp.free.fr
profil.mail.email.support = support@scores-decisions.com
profil.mail.email.supportdev = supportdev@scores-decisions.com
profil.path.data = "/home/vhosts/data/enrichissement"