Merge from branch 2.7
This commit is contained in:
commit
7e7794f58b
@ -510,12 +510,12 @@ function changePass(&$pass, &$mode, &$index, &$quorumActif, &$formR)
|
||||
switch ($pass) {
|
||||
case 1: // Pass 2 : Phonex
|
||||
$pass = 2;
|
||||
$mode = SPH_MATCH_EXTENDED2;
|
||||
$mode = SPH_MATCH_EXTENDED;
|
||||
$index = 'ent_phx';
|
||||
return true;
|
||||
case 2: // Pass 3 : Ispell
|
||||
$pass = 3;
|
||||
$mode = SPH_MATCH_ISPELL;
|
||||
$mode = SPH_MATCH_EXTENDED;
|
||||
$index = 'ent_mns';
|
||||
if (SPHINX_ENT_VERSION == 2) {
|
||||
$index = 'ent';
|
||||
@ -523,7 +523,7 @@ function changePass(&$pass, &$mode, &$index, &$quorumActif, &$formR)
|
||||
return true;
|
||||
case 3: // Pass 4 : Quorum n-1
|
||||
$pass = 4;
|
||||
$mode = SPH_MATCH_EXTENDED2;
|
||||
$mode = SPH_MATCH_EXTENDED;
|
||||
$index = 'ent_mns';
|
||||
if (SPHINX_ENT_VERSION == 2) {
|
||||
$index = 'ent';
|
||||
|
@ -446,30 +446,29 @@ class Scores_Ws_Server
|
||||
|
||||
try {
|
||||
$result = $db->fetchRow($sql, null, Zend_Db::FETCH_OBJ);
|
||||
if ( $result !== null ) {
|
||||
//file_put_contents('lecture.log', print_r($result,1));
|
||||
$dataInsert['raisonSociale'] = $result->raisonSociale;
|
||||
$dataInsert['cp'] = $result->adr_cp;
|
||||
$dataInsert['ville'] = $result->adr_ville;
|
||||
$dataInsert['source'] = $result->source;
|
||||
if ( $result->actif == 0 ) {
|
||||
$dataInsert['actifInsee'] = 0;
|
||||
} elseif ( intval($siren)>1000 ) {
|
||||
$dataInsert['actifInsee'] = 1;
|
||||
$sql = $db->select()->from('jo.rncs_entrep', 'count(*) AS nb')->where('siren=?', $siren);
|
||||
$result = $db->fetchRow($sql, null, Zend_Db::FETCH_OBJ);
|
||||
if ( $result !== null ) {
|
||||
if ($result->nb>0 ) {
|
||||
$dataInsert['source'] = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(Zend_Db_Exception $e) {
|
||||
//@todo : log exception
|
||||
//file_put_contents('test.log', $e->getMessage());
|
||||
}
|
||||
|
||||
if ( $result !== null ) {
|
||||
//file_put_contents('lecture.log', print_r($result,1));
|
||||
$dataInsert['raisonSociale'] = $result->raisonSociale;
|
||||
$dataInsert['cp'] = $result->adr_cp;
|
||||
$dataInsert['ville'] = $result->adr_ville;
|
||||
$dataInsert['source'] = $result->source;
|
||||
if ( $result->actif == 0 ) {
|
||||
$dataInsert['actifInsee'] = 0;
|
||||
} elseif ( intval($siren)>1000 ) {
|
||||
$dataInsert['actifInsee'] = 1;
|
||||
$sql = $db->select()->from('jo.rncs_entrep', 'count(*) AS nb')->where('siren=?', $siren);
|
||||
$result = $db->fetchRow($sql, null, Zend_Db::FETCH_OBJ);
|
||||
if ( $result !== null ) {
|
||||
if ($result->nb>0 ) {
|
||||
$dataInsert['source'] = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
@ -670,7 +669,6 @@ class Scores_Ws_Server
|
||||
} else {
|
||||
return $this->authV1($result, $password, $ip);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -688,7 +686,7 @@ class Scores_Ws_Server
|
||||
if ($userInfos->accesWS == 1 && $userInfos->idClient != 1)
|
||||
{
|
||||
// Webservice user don't need access to others apps
|
||||
if ( in_array($ip, $this->listApplicationIp) && $userInfos->idClient != 1 ) {
|
||||
if ( in_array($ip, $this->listApplicationIp) ) {
|
||||
|
||||
return '0901';
|
||||
|
||||
@ -716,7 +714,7 @@ class Scores_Ws_Server
|
||||
* - Not in production
|
||||
* - Not idClient 1 or 147
|
||||
*/
|
||||
if ( $userInfos->accesWS==0 && APPLICATION_ENV=='staging' && !in_array($userInfos->idClient, array(1,147)) )
|
||||
if ( APPLICATION_ENV=='staging' && !in_array($userInfos->idClient, array(1,147) && $userInfos->accesWS==0 ) )
|
||||
{
|
||||
return '0905';
|
||||
}
|
||||
|
@ -37,4 +37,11 @@ return array(
|
||||
),
|
||||
'idClient' => array(1,190),
|
||||
),
|
||||
'rrg' => array(
|
||||
'actif' => true,
|
||||
'versions' => array(
|
||||
'0.1' => array( 'actif' => true, 'defaut' => true ),
|
||||
),
|
||||
'idClient' => array(1,192),
|
||||
),
|
||||
);
|
4
library/WsScore/Clients/Rrg/v0.1/Config.php
Normal file
4
library/WsScore/Clients/Rrg/v0.1/Config.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return array(
|
||||
'Infos' => 'Infos',
|
||||
);
|
125
library/WsScore/Clients/Rrg/v0.1/Entreprise.php
Normal file
125
library/WsScore/Clients/Rrg/v0.1/Entreprise.php
Normal file
@ -0,0 +1,125 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/Types.php';
|
||||
|
||||
require_once 'framework/fwk.php';
|
||||
require_once 'Metier/insee/classMinsee.php';
|
||||
require_once 'Metier/scores/classMScores.php';
|
||||
|
||||
class Entreprise extends Scores_Ws_Server
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->serviceClient = true;
|
||||
$this->serviceClientName = 'Rrg';
|
||||
$this->serviceName = 'Entreprise';
|
||||
}
|
||||
|
||||
/**
|
||||
* blablabla
|
||||
* @param string $siren
|
||||
* @return Infos
|
||||
*/
|
||||
public function getData($siren)
|
||||
{
|
||||
$this->authenticate();
|
||||
|
||||
//Vérification du siren
|
||||
if ( strlen($siren) != 9 ) {
|
||||
$this->sendError('1010');
|
||||
}
|
||||
|
||||
$classInsee = new MInsee();
|
||||
|
||||
//Vérifier SIREN valide
|
||||
if( !$classInsee->valideSiren($siren) ) {
|
||||
$this->sendError('1010');
|
||||
}
|
||||
|
||||
//Vérifier SIREN existe
|
||||
if ( !$classInsee->sirenExiste($siren) ) {
|
||||
$this->sendError('1020');
|
||||
}
|
||||
|
||||
//Evaluation
|
||||
$evaluation = calculIndiScore($siren);
|
||||
|
||||
$db = Zend_Db_Table::getDefaultAdapter();
|
||||
$sql = $db->select()
|
||||
->from('etablissements', array('LPAD(source_id,10,0) AS source_id'), 'jo')
|
||||
->where('siren=?', $evaluation['Siren'])->where('nic=?', $evaluation['Nic']);
|
||||
$etablissement = $db->fetchRow($sql, null, Zend_Db::FETCH_OBJ);
|
||||
|
||||
$Infos = new Infos();
|
||||
$Infos->SourceId = $etablissement->source_id;
|
||||
$Infos->Siren = $evaluation['Siren'];
|
||||
$Infos->Nic = $evaluation['Nic'];
|
||||
$Infos->Nom = $evaluation['Nom'];
|
||||
$Infos->Sigle = $evaluation['Sigle'];
|
||||
$Infos->Enseigne = $evaluation['Enseigne'];
|
||||
$Infos->FJ = $evaluation['FJ'];
|
||||
$Infos->DateCreaEn = $evaluation['DateCreaEn'];
|
||||
|
||||
$Infos->AdresseNum = str_pad($evaluation['AdresseNum'], 5, 0);
|
||||
$Infos->AdresseBtq = $evaluation['AdresseBtq'];
|
||||
$Infos->AdresseVoie = $evaluation['AdresseVoie'];
|
||||
if ($evaluation['AdresseRue'] != '') {
|
||||
$Infos->AdresseVoie.= ' '.$evaluation['AdresseRue'];
|
||||
}
|
||||
$Infos->CP = $evaluation['CP'];
|
||||
$Infos->AdresseVille = $evaluation['Ville'];
|
||||
|
||||
try {
|
||||
$sql = $db->select()->from('identite', array(
|
||||
'insL1_NOMEN',
|
||||
'insL2_COMP',
|
||||
'insL3_CADR',
|
||||
'insL4_VOIE',
|
||||
'insL5_DISP',
|
||||
'insL6_POST',
|
||||
), 'insee')->where('SIREN=?', $Infos->Siren)->where('NIC=?', $Infos->Nic);
|
||||
$inseeLResult = $db->fetchRow($sql, null, Zend_Db::FETCH_OBJ);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
if ($inseeLResult !== null) {
|
||||
$amabis = new MAmabis();
|
||||
$amabisResult = $amabis->normaliseAdresse(
|
||||
$inseeLResult->insL1_NOMEN,
|
||||
$inseeLResult->insL2_COMP,
|
||||
$inseeLResult->insL3_CADR,
|
||||
$inseeLResult->insL4_VOIE,
|
||||
$inseeLResult->insL5_DISP,
|
||||
$inseeLResult->insL6_POST
|
||||
);
|
||||
}
|
||||
|
||||
if (is_array($amabisResult) && count($amabisResult) > 0) {
|
||||
$Infos->AdresseComplement = $amabisResult['L3'];
|
||||
$Infos->AdresseDistributionSpecial = $amabisResult['L5'];
|
||||
$Infos->AdresseComplementPostal = $amabisResult['L6'];
|
||||
$Infos->AdresseHexaviaMatricule = $amabisResult['HexaViaMat'];
|
||||
}
|
||||
|
||||
$Infos->PaiementCS = $evaluation['cs'];
|
||||
$Infos->PaiementInfo = $evaluation['infoPaiement'];
|
||||
|
||||
if ($evaluation['NbBilansScore'] > 0)
|
||||
{
|
||||
$bilan = $evaluation['tabBilan'][0];
|
||||
$Infos->BilanCA = $bilan['FL'];
|
||||
$Infos->BilanDateCloture = $bilan['DATE_CLOTURE'];
|
||||
$Infos->BilanDuree = $bilan['DUREE_MOIS'];
|
||||
$Infos->BilanUnite = $bilan['MONNAIE_LIV_UNITE'];
|
||||
$Infos->BilanDevise = $bilan['MONNAIE'];
|
||||
}
|
||||
|
||||
$Infos->Indiscore = $evaluation['Indiscore20'];
|
||||
$Infos->Encours = round($evaluation['encours']/1000) * 1000;
|
||||
|
||||
$this->wsLog('identite', $siren);
|
||||
|
||||
return $Infos;
|
||||
}
|
||||
}
|
159
library/WsScore/Clients/Rrg/v0.1/Types.php
Normal file
159
library/WsScore/Clients/Rrg/v0.1/Types.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?php
|
||||
class Infos
|
||||
{
|
||||
/**
|
||||
* Identifiant SD de l'établissement siege
|
||||
* @var string
|
||||
*/
|
||||
public $SourceId;
|
||||
|
||||
/**
|
||||
* Siren
|
||||
* @var string
|
||||
*/
|
||||
public $Siren;
|
||||
|
||||
/**
|
||||
* Nic
|
||||
* @var string
|
||||
*/
|
||||
public $Nic;
|
||||
|
||||
/**
|
||||
* Raison Sociale
|
||||
* @var string
|
||||
*/
|
||||
public $Nom;
|
||||
|
||||
/**
|
||||
* Sigle
|
||||
* @var string
|
||||
*/
|
||||
public $Sigle;
|
||||
|
||||
/**
|
||||
* Enseigne
|
||||
* @var string
|
||||
*/
|
||||
public $Enseigne;
|
||||
|
||||
/**
|
||||
* Forme Juridique
|
||||
* @var string
|
||||
*/
|
||||
public $FJ;
|
||||
|
||||
/**
|
||||
* Date de création de l'entreprise au format AAAAMMJJ
|
||||
* @var string
|
||||
*/
|
||||
public $DateCreaEn;
|
||||
|
||||
/**
|
||||
* Adresse - Numéro dans la voie
|
||||
* @var string
|
||||
*/
|
||||
public $AdresseNum;
|
||||
|
||||
/**
|
||||
* Adresse - BTQ
|
||||
* @var string
|
||||
*/
|
||||
public $AdresseBtq;
|
||||
|
||||
/**
|
||||
* Adresse - Type de voie
|
||||
* @var string
|
||||
*/
|
||||
public $AdresseVoie;
|
||||
|
||||
/**
|
||||
* Adresse - Complément
|
||||
* @var string
|
||||
*/
|
||||
public $AdresseComplement;
|
||||
|
||||
/**
|
||||
* Adresse - Distribution Spécial
|
||||
* @var string
|
||||
*/
|
||||
public $AdresseDistributionSpecial;
|
||||
|
||||
/**
|
||||
* Adresse - Complément postal
|
||||
* @var string
|
||||
*/
|
||||
public $AdresseComplementPostal;
|
||||
|
||||
/**
|
||||
* Adresse - Code Postal
|
||||
* @var string
|
||||
*/
|
||||
public $CP;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $AdresseVille;
|
||||
|
||||
/**
|
||||
* Matricule Hexavia
|
||||
* @var string
|
||||
*/
|
||||
public $AdresseHexaviaMatricule;
|
||||
|
||||
/**
|
||||
* Comportement de paiement
|
||||
* @var string
|
||||
*/
|
||||
public $PaiementCS;
|
||||
|
||||
/**
|
||||
* Libellé du comportement de paiement
|
||||
* @var string
|
||||
*/
|
||||
public $PaiementInfo;
|
||||
|
||||
/**
|
||||
* Chiffre d'affaire du bilan
|
||||
* @var string
|
||||
*/
|
||||
public $BilanCA;
|
||||
|
||||
/**
|
||||
* Date de cloture du bilan au format (AAAAMMJJ)
|
||||
* @var string
|
||||
*/
|
||||
public $BilanDateCloture;
|
||||
|
||||
/**
|
||||
* Durée du bilan en mois
|
||||
* @var string
|
||||
*/
|
||||
public $BilanDuree;
|
||||
|
||||
/**
|
||||
* Unité du bilan (U|K|M)
|
||||
* @var string
|
||||
*/
|
||||
public $BilanUnite;
|
||||
|
||||
/**
|
||||
* Devise du bilan
|
||||
* @var string
|
||||
*/
|
||||
public $BilanDevise;
|
||||
|
||||
/**
|
||||
* indiScore - note sur 20
|
||||
* @var int
|
||||
*/
|
||||
public $Indiscore;
|
||||
|
||||
/**
|
||||
* Encours en euros
|
||||
* @var int
|
||||
*/
|
||||
public $Encours;
|
||||
}
|
@ -15,6 +15,7 @@ class Configure
|
||||
$this->_definePath();
|
||||
$this->_defineSphinx();
|
||||
$this->_defineMail();
|
||||
$this->_defineInfogreffe();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -98,4 +99,13 @@ class Configure
|
||||
define('SMTP_PASS', '');
|
||||
}
|
||||
|
||||
protected function _defineInfogreffe()
|
||||
{
|
||||
define('INFOGREFFE_DISPO_WEB', false);
|
||||
define('INFOGREFFE_DISPO_WS', false);
|
||||
define('INFOGREFFE_WS_URL', 'https://webservices.infogreffe.fr/WSContextInfogreffe/INFOGREFFE');
|
||||
define('INFOGREFFE_WS_USER', '85000109');
|
||||
define('INFOGREFFE_WS_PASS', '166');
|
||||
}
|
||||
|
||||
}
|
@ -4301,85 +4301,92 @@ class Entreprise extends Scores_Ws_Server
|
||||
//Check SIREN
|
||||
|
||||
//Lecture de la base de données
|
||||
$bilansM = new Application_Model_JoGreffesBilans();
|
||||
$sql = $bilansM->select()
|
||||
->where('siren=?', $siren)
|
||||
->where('actif=1')
|
||||
->order('date_cloture DESC')
|
||||
->order('num_depot DESC')
|
||||
->order('dateInsert DESC')
|
||||
->limit(1);
|
||||
$row = $bilansM->fetchRow($sql);
|
||||
try {
|
||||
$bilansM = new Application_Model_JoGreffesBilans();
|
||||
$sql = $bilansM->select()
|
||||
->where('siren=?', $siren)
|
||||
->where('actif=1')
|
||||
->order('date_cloture DESC')
|
||||
->order('num_depot DESC')
|
||||
->order('dateInsert DESC')
|
||||
->limit(1);
|
||||
$row = $bilansM->fetchRow($sql);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient==1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
|
||||
if ( $row!==null ) {
|
||||
$liasseInfos = new LiasseInfos();
|
||||
$liasseInfos->Id = $row->id;
|
||||
$liasseInfos->BilanDateCloture = $row->date_cloture;
|
||||
if ( $row === null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch ( $row->type_comptes ) {
|
||||
case '':
|
||||
case 'sociaux':
|
||||
$liasseInfos->BilanType = 'N';
|
||||
break;
|
||||
case 'consolides':
|
||||
$liasseInfos->BilanType = 'C';
|
||||
break;
|
||||
}
|
||||
$liasseInfos = new LiasseInfos();
|
||||
$liasseInfos->Id = $row->id;
|
||||
$liasseInfos->BilanDateCloture = $row->date_cloture;
|
||||
|
||||
|
||||
$liasseInfos->SaisieDate = $row->saisie_date;
|
||||
$liasseInfos->SaisieCode = $row->saisie_code;
|
||||
switch ( $row->saisie_code ) {
|
||||
case '00': $liasseInfos->SaisieLabel = "Bilan saisi sans anomalie"; break;
|
||||
case '01': $liasseInfos->SaisieLabel = "Bilan saisi avec des incohérences comptables à la source du document (issues du remettant)"; break;
|
||||
case '02': $liasseInfos->SaisieLabel = "Bilan avec Actif, Passif ou Compte de Résultat nul"; break;
|
||||
case '03': $liasseInfos->SaisieLabel = "Bilan incomplet (des pages manquent)"; break;
|
||||
case '04': $liasseInfos->SaisieLabel = "Bilan complet non détaillé (seuls les totaux et sous totaux sont renseignés)"; break;
|
||||
case '05': $liasseInfos->SaisieLabel = "Bilan reçu en double exemplaire"; break;
|
||||
case '06': $liasseInfos->SaisieLabel = "Bilan intermédiaire - Situation provisoire"; break;
|
||||
case '07': $liasseInfos->SaisieLabel = "Bilan illisible"; break;
|
||||
case 'A7': $liasseInfos->SaisieLabel = "Bilan illisible, présentant un cadre gris très foncés (dans lesquels sont inscrits en général les totaux)"; break;
|
||||
case 'B7': $liasseInfos->SaisieLabel = "Bilan manuscrits"; break;
|
||||
case 'C7': $liasseInfos->SaisieLabel = "Bilan illisible, présentant des caractères trop gras"; break;
|
||||
case 'D7': $liasseInfos->SaisieLabel = "Bilan scanné en biais ou qui présentent des pages rognées"; break;
|
||||
case 'E7': $liasseInfos->SaisieLabel = "Bilan numérisés trop clairement (comme une imprimante dont la cartouche est presque vide)"; break;
|
||||
case 'F7': $liasseInfos->SaisieLabel = "Bilan illisible"; break;
|
||||
case '08': $liasseInfos->SaisieLabel = "Bilan consolidé"; break;
|
||||
case '09': $liasseInfos->SaisieLabel = "Déclaration d'impôts"; break;
|
||||
case '10': $liasseInfos->SaisieLabel = "Document autre que bilan"; break;
|
||||
case '11': $liasseInfos->SaisieLabel = "Bilan de clôture de liquidation"; break;
|
||||
case '12': $liasseInfos->SaisieLabel = "Bilan de Société financière"; break;
|
||||
case '13': $liasseInfos->SaisieLabel = "Bilan de Société d'assurance"; break;
|
||||
case '14': $liasseInfos->SaisieLabel = "Bilan de Société immobilière"; break;
|
||||
case '15': $liasseInfos->SaisieLabel = "Bilan de Société étrangère"; break;
|
||||
default: $liasseInfos->SaisieLabel = ""; break;
|
||||
}
|
||||
|
||||
if ( $row->saisie_code != '00' ) {
|
||||
//Surcharge des codes de saisie
|
||||
$date = new Zend_Date($row->date_cloture, 'yyyy-MM-dd');
|
||||
try {
|
||||
$liasseM = new Application_Model_JoBilans();
|
||||
$sql = $liasseM->select()
|
||||
->where('siren=?', $siren)
|
||||
->where('typeBilan=?', $liasseInfos->BilanType)
|
||||
->where('dateExercice=?', $date->toString('yyyyMMdd'));
|
||||
$row = $liasseM->fetchRow($sql);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
//file_put_contents('debug.log', $e->getMessage()."\n", FILE_APPEND);
|
||||
}
|
||||
if ( $row !== null ) {
|
||||
$liasseInfos->SaisieDate = substr($row->dateProvPartenaire,0,4) .
|
||||
'-' . substr($row->dateProvPartenaire,4,2) .
|
||||
'-' . substr($row->dateProvPartenaire,6,2);
|
||||
$liasseInfos->SaisieCode = '00';
|
||||
}
|
||||
}
|
||||
|
||||
return $liasseInfos;
|
||||
switch ( $row->type_comptes ) {
|
||||
case '':
|
||||
case 'sociaux':
|
||||
$liasseInfos->BilanType = 'N';
|
||||
break;
|
||||
case 'consolides':
|
||||
$liasseInfos->BilanType = 'C';
|
||||
break;
|
||||
}
|
||||
|
||||
return null;
|
||||
$liasseInfos->SaisieDate = $row->saisie_date;
|
||||
$liasseInfos->SaisieCode = $row->saisie_code;
|
||||
switch ( $row->saisie_code ) {
|
||||
case '00': $liasseInfos->SaisieLabel = "Bilan saisi sans anomalie"; break;
|
||||
case '01': $liasseInfos->SaisieLabel = "Bilan saisi avec des incohérences comptables à la source du document (issues du remettant)"; break;
|
||||
case '02': $liasseInfos->SaisieLabel = "Bilan avec Actif, Passif ou Compte de Résultat nul"; break;
|
||||
case '03': $liasseInfos->SaisieLabel = "Bilan incomplet (des pages manquent)"; break;
|
||||
case '04': $liasseInfos->SaisieLabel = "Bilan complet non détaillé (seuls les totaux et sous totaux sont renseignés)"; break;
|
||||
case '05': $liasseInfos->SaisieLabel = "Bilan reçu en double exemplaire"; break;
|
||||
case '06': $liasseInfos->SaisieLabel = "Bilan intermédiaire - Situation provisoire"; break;
|
||||
case '07': $liasseInfos->SaisieLabel = "Bilan illisible"; break;
|
||||
case 'A7': $liasseInfos->SaisieLabel = "Bilan illisible, présentant un cadre gris très foncés (dans lesquels sont inscrits en général les totaux)"; break;
|
||||
case 'B7': $liasseInfos->SaisieLabel = "Bilan manuscrits"; break;
|
||||
case 'C7': $liasseInfos->SaisieLabel = "Bilan illisible, présentant des caractères trop gras"; break;
|
||||
case 'D7': $liasseInfos->SaisieLabel = "Bilan scanné en biais ou qui présentent des pages rognées"; break;
|
||||
case 'E7': $liasseInfos->SaisieLabel = "Bilan numérisés trop clairement (comme une imprimante dont la cartouche est presque vide)"; break;
|
||||
case 'F7': $liasseInfos->SaisieLabel = "Bilan illisible"; break;
|
||||
case '08': $liasseInfos->SaisieLabel = "Bilan consolidé"; break;
|
||||
case '09': $liasseInfos->SaisieLabel = "Déclaration d'impôts"; break;
|
||||
case '10': $liasseInfos->SaisieLabel = "Document autre que bilan"; break;
|
||||
case '11': $liasseInfos->SaisieLabel = "Bilan de clôture de liquidation"; break;
|
||||
case '12': $liasseInfos->SaisieLabel = "Bilan de Société financière"; break;
|
||||
case '13': $liasseInfos->SaisieLabel = "Bilan de Société d'assurance"; break;
|
||||
case '14': $liasseInfos->SaisieLabel = "Bilan de Société immobilière"; break;
|
||||
case '15': $liasseInfos->SaisieLabel = "Bilan de Société étrangère"; break;
|
||||
default: $liasseInfos->SaisieLabel = ""; break;
|
||||
}
|
||||
|
||||
if ( $row->saisie_code != '00' ) {
|
||||
//Surcharge des codes de saisie
|
||||
$date = new Zend_Date($row->date_cloture, 'yyyy-MM-dd');
|
||||
try {
|
||||
$liasseM = new Application_Model_JoBilans();
|
||||
$sql = $liasseM->select()
|
||||
->where('siren=?', $siren)
|
||||
->where('typeBilan=?', $liasseInfos->BilanType)
|
||||
->where('dateExercice=?', $date->toString('yyyyMMdd'));
|
||||
$row = $liasseM->fetchRow($sql);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
//file_put_contents('debug.log', $e->getMessage()."\n", FILE_APPEND);
|
||||
}
|
||||
if ( $row !== null ) {
|
||||
$liasseInfos->SaisieDate = substr($row->dateProvPartenaire,0,4) .
|
||||
'-' . substr($row->dateProvPartenaire,4,2) .
|
||||
'-' . substr($row->dateProvPartenaire,6,2);
|
||||
$liasseInfos->SaisieCode = '00';
|
||||
}
|
||||
}
|
||||
|
||||
return $liasseInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -587,14 +587,24 @@ class Gestion extends Scores_Ws_Server
|
||||
}
|
||||
|
||||
// Get Data
|
||||
$userM = new Application_Model_Sdv1Utilisateurs();
|
||||
$sql = $userM->select()
|
||||
->joinLeft(array('s'=>'sdv1.utilisateurs_service'), 'u.login=s.login', array('Service'))
|
||||
->joinLeft(array('sd'=>'sdv1.clients_services'), 'sd.Code=s.Service', array('Label AS ServiceLabel'))
|
||||
->where('id=?', $id);
|
||||
try {
|
||||
$userM = new Application_Model_Sdv1Utilisateurs();
|
||||
$sql = $userM->select()->from(array('u'=>'utilisateurs'))
|
||||
->setIntegrityCheck(false)
|
||||
->joinLeft(array('s'=>'sdv1.utilisateurs_service'), 'u.login=s.login', array('Service'))
|
||||
->joinLeft(array('sd'=>'sdv1.clients_services'), 'sd.Code=s.Service', array('Label AS ServiceLabel'))
|
||||
->where('u.id=?', $id);
|
||||
|
||||
$user = $userM->fetchRow($sql);
|
||||
if ( $result === null ) {
|
||||
$user = $userM->fetchRow($sql);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient == 1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
|
||||
if ( $user === null ) {
|
||||
throw new SoapFault('ERR', 'Utilisateur inexistant !');
|
||||
}
|
||||
|
||||
@ -613,34 +623,58 @@ class Gestion extends Scores_Ws_Server
|
||||
$output->Civilite = $user->civilite;
|
||||
$output->Nom = $user->nom;
|
||||
$output->Prenom = $user->prenom;
|
||||
$user->Enable = $item->actif;
|
||||
$user->Delete = $item->deleted;
|
||||
$output->Enable = $user->actif;
|
||||
$output->Delete = $user->deleted;
|
||||
|
||||
// Service - Droits
|
||||
$acces = array();
|
||||
$droitsM = new Application_Model_Sdv1ClientsServicesDroits();
|
||||
$sql = $droitsM->select()->where('IdClient=?', $idClient)->where('Service=?', $service);
|
||||
$droits = $droitsM->fetchAll($sql);
|
||||
// Si l'utilisateur a pour Service = DEFAULT et pas de service DEFAULT alors droits de l'utilisateur
|
||||
if ( count($droits) == 0 ) {
|
||||
$droits = explode(' ', $user->droits);
|
||||
try {
|
||||
$droitsM = new Application_Model_Sdv1ClientsServicesDroits();
|
||||
$sql = $droitsM->select()->where('IdClient=?', $idClient)->where('Service=?', $service);
|
||||
$droits = $droitsM->fetchAll($sql);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient == 1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
if ( count($droits) >0 ) {
|
||||
if ( count($droits) > 0 ) {
|
||||
foreach ($droits as $item) {
|
||||
$acces = new AccesDetails();
|
||||
$acces = new Acces();
|
||||
$acces->Code = $item->Acces;
|
||||
$acces->Label = $this->listeDroits[$item->Acces];
|
||||
$output->Acces[] = $acces;
|
||||
}
|
||||
}
|
||||
|
||||
// Si l'utilisateur a pour Service = DEFAULT et pas de service DEFAULT alors droits de l'utilisateur
|
||||
if ( count($droits) == 0 ) {
|
||||
$droits = explode(' ', $user->droits);
|
||||
foreach ($droits as $item) {
|
||||
$acces = new Acces();
|
||||
$acces->Code = $item;
|
||||
$acces->Label = $this->listeDroits[strtoupper($item)];
|
||||
$output->Acces[] = $acces;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Service - IP
|
||||
$ipM = new Application_Model_Sdv1ClientsServicesIP();
|
||||
$sql = $ipM->select()->where('IdClient=?', $idClient)->where('Service=?', $service);
|
||||
$ips = $ipM->fetchAll($sql);
|
||||
try {
|
||||
$ipM = new Application_Model_Sdv1ClientsServicesIP();
|
||||
$sql = $ipM->select()->where('IdClient=?', $idClient)->where('Service=?', $service);
|
||||
$ips = $ipM->fetchAll($sql);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient == 1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
if ( count($ips) > 0 ) {
|
||||
foreach ($ips as $item) {
|
||||
$output->IP = $item;
|
||||
$output->IP[] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,36 +1,28 @@
|
||||
<?
|
||||
|
||||
include_once('chiffres.php');
|
||||
|
||||
<?php
|
||||
require_once 'framework/common/chiffres.php';
|
||||
define ('TODAY', date('Ymd'));
|
||||
|
||||
/**
|
||||
* Classe de gestion des méthodes relatives à la date et à l'heure
|
||||
*
|
||||
* <p>détail de la classe</p>
|
||||
*
|
||||
* @name nom de la classe
|
||||
* @author Nom de l'auteur <adresse@Email.dom>
|
||||
* @link
|
||||
* @copyright Prénom Nom Année
|
||||
* @version 1.0.0
|
||||
* @package Nom du package
|
||||
*/
|
||||
|
||||
class WDate {
|
||||
|
||||
private static $tabMoisEnLettres = array( 1=>'Janvier',
|
||||
2=>'Février',
|
||||
3=>'Mars',
|
||||
4=>'Avril',
|
||||
5=>'Mai',
|
||||
6=>'Juin',
|
||||
7=>'Juillet',
|
||||
8=>'Août',
|
||||
9=>'Septembre',
|
||||
10=>'Octobre',
|
||||
11=>'Novembre',
|
||||
12=>'Décembre');
|
||||
|
||||
class WDate
|
||||
{
|
||||
private static $tabMoisEnLettres = array(
|
||||
1=>'Janvier',
|
||||
2=>'Février',
|
||||
3=>'Mars',
|
||||
4=>'Avril',
|
||||
5=>'Mai',
|
||||
6=>'Juin',
|
||||
7=>'Juillet',
|
||||
8=>'Août',
|
||||
9=>'Septembre',
|
||||
10=>'Octobre',
|
||||
11=>'Novembre',
|
||||
12=>'Décembre'
|
||||
);
|
||||
|
||||
/** Retourne le numéro du mois donné au format texte (janvier, mars, etc...)
|
||||
* @param string Mois en toute lettres (janvier, mars, etc...)
|
||||
* @return string Mois en Chiffe (1, 3, 12) / false en cas d'erreur
|
||||
@ -40,7 +32,7 @@ include_once('chiffres.php');
|
||||
$tabMoisSansAccents[$num]=strtr($mois, 'ééûÉÉÛ','eeueeu');
|
||||
return array_search(ucfirst(strtolower(strtr($moisEnLettres, 'ééûÉÉÛ','eeuEEU'))), $tabMoisSansAccents);
|
||||
}
|
||||
|
||||
|
||||
/** Retourne le libellé nu numéro du mois passé en paramètre
|
||||
* @param int $moisEnChiffre
|
||||
* @return string Libellé du mois / false si le mois passé en paramètre est invalide
|
||||
@ -51,7 +43,7 @@ include_once('chiffres.php');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/** Retourne le nombre de mois entre 2 dates au format Ymd
|
||||
**
|
||||
** @param int $dateDeb Date de début au format Ymd
|
||||
@ -117,89 +109,87 @@ include_once('chiffres.php');
|
||||
default: return $date;
|
||||
}
|
||||
}
|
||||
|
||||
/** Calcul de la date après application de la période textuelle (deux ans, six mois, quinze jours, etc...)
|
||||
* @todo Fonction ne fonctionnant qu'avec un chiffre en un seul mot du genre dix mais pas quatre vingt dix !!!
|
||||
* @param date $dateIN au format Ymd
|
||||
* @param string $period (ex : cinq mois, six ans, un jour, 3 mois)
|
||||
* @return date
|
||||
*/
|
||||
function period2Days($dateIN, $period, $inThePast=false) {
|
||||
$dateV=self::dateT('Ymd', 'Ymd', $dateIN);
|
||||
if ($dateV<>$dateIN) return NULL;
|
||||
$d=substr($dateIN,6,2);
|
||||
$m=substr($dateIN,4,2);
|
||||
$Y=substr($dateIN,0,4);
|
||||
$period=strtolower(trim(strtr($period, "-.,", ' ')));
|
||||
if ($period=='') return NULL;
|
||||
$tabP=explode(' ', $period);
|
||||
if ($tabP[0]*1>0) $chiffre=$tabP[0]*1*1;
|
||||
else $chiffre=WChiffes::ChiffresEnLettres($tabP[0]);
|
||||
if ($inThePast) $chiffre=-1*$chiffre;
|
||||
switch (end($tabP)) {
|
||||
case 'mois': $dateOUT=date('Ymd', mktime(0, 0, 0, $m+$chiffre, $d, $Y)); break;
|
||||
case 'an':
|
||||
case 'ans': $dateOUT=date('Ymd', mktime(0, 0, 0, $m, $d, $Y+$chiffre)); break;
|
||||
case 'jour':
|
||||
case 'jours': $dateOUT=date('Ymd', mktime(0, 0, 0, $m, $d+$chiffre, $Y)); break;
|
||||
default: $dateOUT=NULL;
|
||||
}
|
||||
return $dateOUT;
|
||||
}
|
||||
|
||||
|
||||
/** le jour est il ferié
|
||||
* @param date $date Date au format SSAA-MM-JJ ou SSAAMMJJ
|
||||
* @param bool $weekend Considérer les WeekEnd comme feriés ? 1=Oui
|
||||
* @return bool
|
||||
**/
|
||||
function jourFerie($date, $weekend=false) {
|
||||
$date =str_replace('-','',strtr($date, '/.:','---'));
|
||||
$jour =self::dateT('Ymd', 'd', $date);
|
||||
$mois =self::dateT('Ymd', 'm', $date);
|
||||
$annee=self::dateT('Ymd', 'Y', $date);
|
||||
$ferie=false;
|
||||
|
||||
// Jours feriées fixes
|
||||
if($jour == 1 && $mois == 1) $ferie = true; // 1er janvier
|
||||
if($jour == 1 && $mois == 5) $ferie = true; // 1er mai
|
||||
if($jour == 8 && $mois == 5) $ferie = true; // 8 mai
|
||||
if($jour == 14 && $mois == 7) $ferie = true; // 14 juillet
|
||||
if($jour == 15 && $mois == 8) $ferie = true; // 15 aout
|
||||
if($jour == 1 && $mois == 11) $ferie = true; // 1 novembre
|
||||
if($jour == 11 && $mois == 11) $ferie = true; // 11 novembre
|
||||
if($jour == 25 && $mois == 12) $ferie = true; // 25 décembre
|
||||
/** Calcul de la date après application de la période textuelle (deux ans, six mois, quinze jours, etc...)
|
||||
* @todo Fonction ne fonctionnant qu'avec un chiffre en un seul mot du genre dix mais pas quatre vingt dix !!!
|
||||
* @param date $dateIN au format Ymd
|
||||
* @param string $period (ex : cinq mois, six ans, un jour, 3 mois)
|
||||
* @return date
|
||||
*/
|
||||
function period2Days($dateIN, $period, $inThePast=false) {
|
||||
$dateV=self::dateT('Ymd', 'Ymd', $dateIN);
|
||||
if ($dateV<>$dateIN) return NULL;
|
||||
$d=substr($dateIN,6,2);
|
||||
$m=substr($dateIN,4,2);
|
||||
$Y=substr($dateIN,0,4);
|
||||
$period=strtolower(trim(strtr($period, "-.,", ' ')));
|
||||
if ($period=='') return NULL;
|
||||
$tabP=explode(' ', $period);
|
||||
if ($tabP[0]*1>0) $chiffre=$tabP[0]*1*1;
|
||||
else $chiffre=WChiffes::ChiffresEnLettres($tabP[0]);
|
||||
if ($inThePast) $chiffre=-1*$chiffre;
|
||||
switch (end($tabP)) {
|
||||
case 'mois': $dateOUT=date('Ymd', mktime(0, 0, 0, $m+$chiffre, $d, $Y)); break;
|
||||
case 'an':
|
||||
case 'ans': $dateOUT=date('Ymd', mktime(0, 0, 0, $m, $d, $Y+$chiffre)); break;
|
||||
case 'jour':
|
||||
case 'jours': $dateOUT=date('Ymd', mktime(0, 0, 0, $m, $d+$chiffre, $Y)); break;
|
||||
default: $dateOUT=NULL;
|
||||
}
|
||||
return $dateOUT;
|
||||
}
|
||||
|
||||
// fêtes religieuses mobiles
|
||||
$pak = @easter_date($annee);
|
||||
$jp = date("d", $pak);
|
||||
$mp = date("m", $pak);
|
||||
if($jp == $jour && $mp == $mois){ $ferie = true;} // Pâques
|
||||
$lpk = mktime(date("H", $pak), date("i", $pak), date("s", $pak), date("m", $pak), date("d", $pak) +1, date("Y", $pak) );
|
||||
$jp = date("d", $lpk);
|
||||
$mp = date("m", $lpk);
|
||||
if($jp == $jour && $mp == $mois){ $ferie = true; }// Lundi de Pâques
|
||||
$asc = mktime(date("H", $pak), date("i", $pak), date("s", $pak), date("m", $pak), date("d", $pak) + 39, date("Y", $pak) );
|
||||
$jp = date("d", $asc);
|
||||
$mp = date("m", $asc);
|
||||
if($jp == $jour && $mp == $mois){ $ferie = true;}//ascension
|
||||
$pe = mktime(date("H", $pak), date("i", $pak), date("s", $pak), date("m", $pak), date("d", $pak) + 49, date("Y", $pak) );
|
||||
$jp = date("d", $pe);
|
||||
$mp = date("m", $pe);
|
||||
if($jp == $jour && $mp == $mois) {$ferie = true;}// Pentecôte
|
||||
$lp = mktime(date("H", $asc), date("i", $pak), date("s", $pak), date("m", $pak), date("d", $pak) + 50, date("Y", $pak) );
|
||||
$jp = date("d", $lp);
|
||||
$mp = date("m", $lp);
|
||||
if($jp == $jour && $mp == $mois) {$ferie = true;}// lundi Pentecôte
|
||||
|
||||
// Samedis et Dimanches
|
||||
if ($weekend) {
|
||||
$jour_sem = date('N',mktime(0,0,0, $mois, $jour, $annee));
|
||||
if($jour_sem>5) $ferie = true;
|
||||
}
|
||||
|
||||
return $ferie;
|
||||
|
||||
/** le jour est il ferié
|
||||
* @param date $date Date au format SSAA-MM-JJ ou SSAAMMJJ
|
||||
* @param bool $weekend Considérer les WeekEnd comme feriés ? 1=Oui
|
||||
* @return bool
|
||||
**/
|
||||
function jourFerie($date, $weekend=false) {
|
||||
$date =str_replace('-','',strtr($date, '/.:','---'));
|
||||
$jour =self::dateT('Ymd', 'd', $date);
|
||||
$mois =self::dateT('Ymd', 'm', $date);
|
||||
$annee=self::dateT('Ymd', 'Y', $date);
|
||||
$ferie=false;
|
||||
|
||||
// Jours feriées fixes
|
||||
if($jour == 1 && $mois == 1) $ferie = true; // 1er janvier
|
||||
if($jour == 1 && $mois == 5) $ferie = true; // 1er mai
|
||||
if($jour == 8 && $mois == 5) $ferie = true; // 8 mai
|
||||
if($jour == 14 && $mois == 7) $ferie = true; // 14 juillet
|
||||
if($jour == 15 && $mois == 8) $ferie = true; // 15 aout
|
||||
if($jour == 1 && $mois == 11) $ferie = true; // 1 novembre
|
||||
if($jour == 11 && $mois == 11) $ferie = true; // 11 novembre
|
||||
if($jour == 25 && $mois == 12) $ferie = true; // 25 décembre
|
||||
|
||||
// fêtes religieuses mobiles
|
||||
$pak = @easter_date($annee);
|
||||
$jp = date("d", $pak);
|
||||
$mp = date("m", $pak);
|
||||
if($jp == $jour && $mp == $mois){ $ferie = true;} // Pâques
|
||||
$lpk = mktime(date("H", $pak), date("i", $pak), date("s", $pak), date("m", $pak), date("d", $pak) +1, date("Y", $pak) );
|
||||
$jp = date("d", $lpk);
|
||||
$mp = date("m", $lpk);
|
||||
if($jp == $jour && $mp == $mois){ $ferie = true; }// Lundi de Pâques
|
||||
$asc = mktime(date("H", $pak), date("i", $pak), date("s", $pak), date("m", $pak), date("d", $pak) + 39, date("Y", $pak) );
|
||||
$jp = date("d", $asc);
|
||||
$mp = date("m", $asc);
|
||||
if($jp == $jour && $mp == $mois){ $ferie = true;}//ascension
|
||||
$pe = mktime(date("H", $pak), date("i", $pak), date("s", $pak), date("m", $pak), date("d", $pak) + 49, date("Y", $pak) );
|
||||
$jp = date("d", $pe);
|
||||
$mp = date("m", $pe);
|
||||
if($jp == $jour && $mp == $mois) {$ferie = true;}// Pentecôte
|
||||
$lp = mktime(date("H", $asc), date("i", $pak), date("s", $pak), date("m", $pak), date("d", $pak) + 50, date("Y", $pak) );
|
||||
$jp = date("d", $lp);
|
||||
$mp = date("m", $lp);
|
||||
if($jp == $jour && $mp == $mois) {$ferie = true;}// lundi Pentecôte
|
||||
|
||||
// Samedis et Dimanches
|
||||
if ($weekend) {
|
||||
$jour_sem = date('N',mktime(0,0,0, $mois, $jour, $annee));
|
||||
if($jour_sem>5) $ferie = true;
|
||||
}
|
||||
|
||||
return $ferie;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -15,19 +15,6 @@ set_include_path(implode(PATH_SEPARATOR, array(
|
||||
get_include_path(),
|
||||
)));
|
||||
|
||||
//Copy configuration
|
||||
$configDir = realpath(dirname(__FILE__)).'/config';
|
||||
$appconfigDir = APPLICATION_PATH.'/configs';
|
||||
$hostname = exec('echo $(hostname)');
|
||||
|
||||
if ( !file_exists( $appconfigDir.'/application.ini') ) {
|
||||
$result = copy($configDir.'/'.$hostname.'/application.ini', $appconfigDir.'/application.ini');
|
||||
if ($result !== true) {
|
||||
echo date('Y-m-d H:i:s')." - Erreur lors de la configuration\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
//Use classmap autoloader - useful with opcode and realpath cache
|
||||
require_once 'Zend/Loader/AutoloaderFactory.php';
|
||||
require_once 'Zend/Loader/ClassMapAutoloader.php';
|
||||
@ -54,18 +41,12 @@ Zend_Loader_AutoloaderFactory::factory(array(
|
||||
// Zend_Application - Use it if you don't have autoloaders
|
||||
//require_once 'Zend/Application.php';
|
||||
|
||||
// Create application, bootstrap, and run
|
||||
$application = new Zend_Application(
|
||||
APPLICATION_ENV,
|
||||
APPLICATION_PATH . '/configs/application.ini'
|
||||
);
|
||||
|
||||
try {
|
||||
$opts = new Zend_Console_Getopt(
|
||||
//Options
|
||||
array(
|
||||
'help|?' => "Affiche les informations d'utilisation",
|
||||
'install' => "Installe et configure",
|
||||
'install=s' => "Installe et configure",
|
||||
)
|
||||
);
|
||||
$opts->parse();
|
||||
@ -75,59 +56,71 @@ try {
|
||||
}
|
||||
|
||||
//Usage
|
||||
if(isset($opts->help))
|
||||
if (isset($opts->help))
|
||||
{
|
||||
echo $opts->getUsageMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
if(isset($opts->install))
|
||||
|
||||
if ($opts->install)
|
||||
{
|
||||
echo date('Y-m-d H:i:s')." - Démarrage de la configuration.\n";
|
||||
|
||||
//Copy configuration
|
||||
$configDir = realpath(dirname(__FILE__)).'/profil';
|
||||
$appconfigDir = APPLICATION_PATH.'/configs';
|
||||
$profil = $opts->install;
|
||||
|
||||
if ( !file_exists( $appconfigDir.'/application.ini') ) {
|
||||
$result = copy($configDir.'/'.$profil.'/application.ini', $appconfigDir.'/application.ini');
|
||||
if ($result !== true) {
|
||||
echo date('Y-m-d H:i:s')." - Impossible de copier la configuration.\n";
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
echo date('Y-m-d H:i:s')." - Le profil de configuration existe déja.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Create application, bootstrap, and run
|
||||
$application = new Zend_Application(
|
||||
APPLICATION_ENV,
|
||||
APPLICATION_PATH . '/configs/application.ini'
|
||||
);
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
|
||||
//Create data directory and all his children
|
||||
if ( !file_exists(APPLICATION_PATH.'/../data') )
|
||||
{
|
||||
mkdir(APPLICATION_PATH.'/../data');
|
||||
}
|
||||
|
||||
if ( !file_exists(APPLICATION_PATH.'/../data/cache') )
|
||||
{
|
||||
mkdir(APPLICATION_PATH.'/../data/cache');
|
||||
}
|
||||
|
||||
if ( !file_exists(APPLICATION_PATH.'/../data/files') )
|
||||
{
|
||||
mkdir(APPLICATION_PATH.'/../data/files');
|
||||
}
|
||||
|
||||
if ( !file_exists(APPLICATION_PATH.'/../data/sessions') )
|
||||
{
|
||||
mkdir(APPLICATION_PATH.'/../data/sessions');
|
||||
}
|
||||
|
||||
if ( !file_exists(APPLICATION_PATH.'/../data/wdsl') )
|
||||
{
|
||||
mkdir(APPLICATION_PATH.'/../data/wsdl');
|
||||
$dirToCreate = array(
|
||||
APPLICATION_PATH.'/../data',
|
||||
APPLICATION_PATH.'/../data/cache',
|
||||
APPLICATION_PATH.'/../data/log',
|
||||
APPLICATION_PATH.'/../data/files',
|
||||
APPLICATION_PATH.'/../data/sessions',
|
||||
APPLICATION_PATH.'/../data/wsdl',
|
||||
);
|
||||
foreach ($dirToCreate as $dir) {
|
||||
if ( !file_exists($dir) ) {
|
||||
mkdir($dir);
|
||||
}
|
||||
}
|
||||
|
||||
// Generate cache file
|
||||
// genCache.php
|
||||
// genCodeRatios.php
|
||||
|
||||
|
||||
if ( substr(strtoupper(PHP_OS),0,3) == 'WIN' ) {
|
||||
|
||||
} else {
|
||||
|
||||
if ( substr(strtoupper(PHP_OS),0,3) != 'WIN' ) {
|
||||
//Copy files
|
||||
passthru('cp -rv '.realpath(dirname(__FILE__)).'/config/_files/* '.$c->profil->path->files.'/');
|
||||
passthru('cp -rv '.realpath(dirname(__FILE__)).'/files/* '.$c->profil->path->files.'/');
|
||||
|
||||
//Modification des permissions
|
||||
passthru('chown -R www-data: '.APPLICATION_PATH.'/../');
|
||||
|
||||
//Check WKHTMLTOPDF
|
||||
$wkhtml = exec('echo $(which wkhtmltopdf)');
|
||||
if ( empty(trim($wkhtml)) ) {
|
||||
echo date('Y-m-d H:i:s')." - Warning : WKHTMLTOPDF non installé.\n";
|
||||
}
|
||||
}
|
||||
|
||||
//Check persistent data directories
|
||||
|
18
scripts/build/etc/README
Normal file
18
scripts/build/etc/README
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
Server Configuration
|
||||
====================
|
||||
|
||||
Copier tout les fichiers de configuration du serveur.
|
||||
cp -vRi scripts/build/config/etc/* /etc/
|
||||
|
||||
PHP5
|
||||
----
|
||||
/etc/php5
|
||||
|
||||
crontab
|
||||
-------
|
||||
/etc/cron.d
|
||||
|
||||
incron
|
||||
------
|
||||
/etc/incron.d
|
1
scripts/build/etc/cron.d/webservice_cache
Normal file
1
scripts/build/etc/cron.d/webservice_cache
Normal file
@ -0,0 +1 @@
|
||||
01 19 01-05 * * root php /home/vhosts/webservice/scripts/build/genCache.php --generate Evenements
|
6
scripts/build/etc/logrotate.d/webservice
Normal file
6
scripts/build/etc/logrotate.d/webservice
Normal file
@ -0,0 +1,6 @@
|
||||
/home/vhosts/data/webservice/*.log {
|
||||
weekly
|
||||
missingok
|
||||
compress
|
||||
notifempty
|
||||
}
|
@ -69,24 +69,23 @@ if( count($opts->getOptions())==0 || isset($opts->help))
|
||||
|
||||
if ( $opts->list ) {
|
||||
$tabItems = array(
|
||||
'Tribunaux' => "Tribunaux",
|
||||
'FctDir' => "Fonctions de direction",
|
||||
'Evenements' => "Table des evenements bodacc",
|
||||
'Devises' => "Table des devises bodacc",
|
||||
'RncsTribunaux' => "Table des tribunaux",
|
||||
'DevisesInpi' => "Devises Inpi",
|
||||
'Jugements' => "Jugements",
|
||||
'PaysInpi' => "PaysInpi",
|
||||
'CodesNaf' => "Codes Naf",
|
||||
'CodesNace' => "Codes Nace",
|
||||
'CodesNafa' => "Codes Nafa",
|
||||
'CodesFJ' => "Codes Formes Juridiques",
|
||||
'Tribunaux' => "Tribunaux",
|
||||
'FctDir' => "Fonctions de direction",
|
||||
'Evenements' => "Table des evenements bodacc",
|
||||
'Devises' => "Table des devises bodacc",
|
||||
'RncsTribunaux' => "Table des tribunaux",
|
||||
'DevisesInpi' => "Devises Inpi",
|
||||
'Jugements' => "Jugements",
|
||||
'PaysInpi' => "PaysInpi",
|
||||
'CodesNaf' => "Codes Naf",
|
||||
'CodesNace' => "Codes Nace",
|
||||
'CodesNafa' => "Codes Nafa",
|
||||
'CodesFJ' => "Codes Formes Juridiques",
|
||||
);
|
||||
echo "\n";
|
||||
foreach ( $tabItems as $code => $label ) {
|
||||
echo "\t" . $code . " => ". $label . PHP_EOL;
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,6 @@ profil.wkhtmltopdf.path = "/home/vhosts/dataws/wkhtml/linux/wkhtmltopdf-amd64"
|
||||
profil.path.batch = APPLICATION_PATH "/../scripts/jobs"
|
||||
profil.path.cache = APPLICATION_PATH "/../data/cache"
|
||||
profil.path.files = APPLICATION_PATH "/../data/files" ; DOC_WEB_LOCAL
|
||||
profil.path.log = APPLICATION_PATH "/../data/log"
|
||||
profil.path.data = "/mnt/data/vhosts/data/webservice"
|
||||
profil.path.secure = "/mnt/datafile/" ; SECURE_STORAGE
|
||||
|
@ -24,12 +24,11 @@ profil.mail.email.support = supportdev@scores-decisions.com
|
||||
profil.mail.email.supportdev = supportdev@scores-decisions.com
|
||||
profil.mail.email.contact = supportdev@scores-decisions.com
|
||||
profil.mail.email.production = supportdev@scores-decisions.com
|
||||
profil.wkhtmltopdf.path = "/home/vhosts/data/wkhtml/wkhtmltopdf-amd64"
|
||||
profil.wkhtmltopdf.path = "/home/vhosts/data/webservice/wkhtml/wkhtmltopdf"
|
||||
profil.path.batch = APPLICATION_PATH "/../scripts/jobs"
|
||||
profil.path.cache = APPLICATION_PATH "/../data/cache"
|
||||
profil.path.files = APPLICATION_PATH "/../data/files" ; DOC_WEB_LOCAL
|
||||
profil.path.log = APPLICATION_PATH "/../data/log"
|
||||
profil.path.data = "/home/vhosts/data"
|
||||
profil.path.data = "/home/vhosts/data/webservice"
|
||||
profil.path.secure = "/mnt/datafile" ; SECURE_STORAGE
|
||||
|
||||
; Metier - Infogreffe
|
76
scripts/build/profil/prod-online/application.ini
Normal file
76
scripts/build/profil/prod-online/application.ini
Normal file
@ -0,0 +1,76 @@
|
||||
[production]
|
||||
phpSettings.date.timezone = "Europe/Paris"
|
||||
phpSettings.display_startup_errors = 0
|
||||
phpSettings.display_errors = 0
|
||||
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
|
||||
bootstrap.class = "Bootstrap"
|
||||
appnamespace = "Application"
|
||||
resources.session.save_path = APPLICATION_PATH "/../data/sessions"
|
||||
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
|
||||
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth"
|
||||
resources.frontController.plugins.Services = "Application_Controller_Plugin_Services"
|
||||
resources.frontController.plugins.Menu = "Application_Controller_Plugin_Menu"
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
resources.layout.layout = "layout"
|
||||
resources.layout.layoutPath = APPLICATION_PATH "/views"
|
||||
resources.view.basePath = APPLICATION_PATH "/views"
|
||||
|
||||
; Scores configuration
|
||||
profil.server.name = WebRecette
|
||||
profil.mail.method = smtp
|
||||
profil.mail.smtp_host = smtp.celeste.fr
|
||||
profil.mail.smtp_port = 25
|
||||
profil.mail.email.support = supportdev@scores-decisions.com
|
||||
profil.mail.email.supportdev = supportdev@scores-decisions.com
|
||||
profil.mail.email.contact = supportdev@scores-decisions.com
|
||||
profil.mail.email.production = supportdev@scores-decisions.com
|
||||
profil.wkhtmltopdf.path = "/home/vhosts/data/webservice/wkhtml/wkhtmltopdf"
|
||||
profil.path.batch = APPLICATION_PATH "/../scripts/jobs"
|
||||
profil.path.cache = APPLICATION_PATH "/../data/cache"
|
||||
profil.path.files = APPLICATION_PATH "/../data/files" ; DOC_WEB_LOCAL
|
||||
profil.path.data = "/home/vhosts/data/webservice"
|
||||
profil.path.secure = "/mnt/datafile" ; SECURE_STORAGE
|
||||
|
||||
; Metier - Infogreffe
|
||||
profil.infogreffe.wsdl = "infogreffe.wsdl"
|
||||
profil.infogreffe.url = "https://webservices.infogreffe.fr/WSContextInfogreffe/INFOGREFFE"
|
||||
profil.infogreffe.uri = "https://webservices.infogreffe.fr/"
|
||||
profil.infogreffe.user = 85000109
|
||||
profil.infogreffe.password = 166
|
||||
profil.infogreffe.cache.path = APPLICATION_PATH "/../data/cache"
|
||||
profil.infogreffe.cache.time = 8
|
||||
profil.infogreffe.storage.path = "/mnt/datafile/greffes"
|
||||
|
||||
; Sphinx configuration
|
||||
profil.sphinx.ent.host = "192.168.122.32"
|
||||
profil.sphinx.ent.port = 9312
|
||||
profil.sphinx.ent.version = 2
|
||||
profil.sphinx.dir.host = "192.168.122.32"
|
||||
profil.sphinx.dir.port = 9312
|
||||
profil.sphinx.dir.version = 2
|
||||
profil.sphinx.act.host = "192.168.122.32"
|
||||
profil.sphinx.act.port = 9312
|
||||
profil.sphinx.act.version = 2
|
||||
profil.sphinx.histo.host = "192.168.122.32"
|
||||
profil.sphinx.histo.port = 9312
|
||||
profil.sphinx.histo.version = 2
|
||||
|
||||
; For old configuration - see Configure.php
|
||||
profil.db.metier.adapter=mysqli
|
||||
profil.db.metier.params.host=195.154.170.169:53336
|
||||
profil.db.metier.params.username=wsuser
|
||||
profil.db.metier.params.password=wspass2012
|
||||
profil.db.metier.params.dbname=sdv1
|
||||
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"
|
||||
|
||||
[staging : production]
|
||||
resources.frontController.params.displayExceptions = 1
|
||||
|
||||
[development : production]
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 1
|
||||
resources.frontController.params.displayExceptions = 1
|
||||
|
||||
[testing : production]
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 1
|
Loading…
Reference in New Issue
Block a user