merge develop

This commit is contained in:
benoitpotier 2017-03-31 15:10:13 +02:00
commit eac4ac48e4
7 changed files with 688 additions and 664 deletions

View File

@ -208,7 +208,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
if (APPLICATION_ENV == 'development') {
$level = Logger::DEBUG;
} else {
$level = Logger::INFO;
$level = Logger::NOTICE;
}
$log->pushHandler(new StreamHandler($logFile), $level);
$log->pushProcessor(new IntrospectionProcessor());

View File

@ -78,6 +78,7 @@ class ServiceController extends Zend_Controller_Action
} else {
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl';
}
$pathServiceUri = 'clients/'.$client.'/v'.$version;
// --- On redéfini le nom du service
$serviceClassName = 'Entreprise';
$fichierWsdl = $clientClassName.'-'.$serviceClassName.'-'.$version.'.wsdl';
@ -92,6 +93,7 @@ class ServiceController extends Zend_Controller_Action
} else {
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl';
}
$pathServiceUri = $serviceName.'/v'.$version;
$fichierWsdl = $serviceClassName.'-'.$version.'.wsdl';
}
@ -104,6 +106,11 @@ class ServiceController extends Zend_Controller_Action
// --- Get hostname - add compatibility with Reverse Proxy
$hostName = $request->getHttpHost();
$hostScheme = $request->getScheme();
$http = new Zend_Controller_Request_Http();
$proxyScheme = $http->getHeader('X-Forwarded-Proto');
if ($proxyScheme == 'https') {
$hostScheme = 'https';
}
$fichierWsdl = $hostName . '-' . $hostScheme . '-' . $fichierWsdl;
$c = Zend_registry::get('config');
$wsdlPath = $c->profil->path->shared . '/wsdl';
@ -124,6 +131,10 @@ class ServiceController extends Zend_Controller_Action
$wsdl->setBindingStyle(array('style' => 'document'));
$wsdl->setClass($serviceClassName);
if ($hostScheme == 'https') {
$wsdl->setUri($hostScheme.'://'.$hostName.'/'.$pathServiceUri);
}
// --- Enregistrement du WSDL dans un fichier
if (isset($_GET['wsdl-generate'])) {
if (file_exists($wsdlPath . '/' . $fichierWsdl)) {
@ -131,7 +142,6 @@ class ServiceController extends Zend_Controller_Action
}
$wsdl->dump($wsdlPath . '/' . $fichierWsdl);
echo "Le fichier $fichierWsdl a été généré";
// --- Génération/Fourniture du wsdl
} elseif (isset($_GET['wsdl']) && !file_exists($wsdlPath . '/' . $fichierWsdl)) {
$wsdl->dump($wsdlPath . '/' . $fichierWsdl);

View File

@ -591,11 +591,11 @@ class Entreprise extends Scores_Ws_Server
$tabAct = array();
foreach ($tabA as $i=>$lien) {
$liens = new Actionnaire();
$liens->Pmin = $lien['PDetention'];
$liens->MajMin = $lien['MajMin'];
$liens->RaisonSociale = $lien['RS'];
$liens->Pays = $lien['adresse_pays'];
$liens->Siren = $lien['siren'];
$liens->Pmin = $lien->PDetention;
$liens->MajMin = $lien->MajMin;
$liens->RaisonSociale = $lien->RS;
$liens->Pays = $lien->adresse_pays;
$liens->Siren = $lien->siren;
$liens->Actif = 1;
$tabAct[] = $liens;
}
@ -631,6 +631,7 @@ class Entreprise extends Scores_Ws_Server
/** Y a t il eu des informations relatives à une cession ? **/
$iGreffes = new Metier_Partenaires_MGreffes();
$tabCes = $iGreffes->getInfosCessions($siren);
if ($tabCes) {
$identiteProcol->CessionJugeLib = $tabCes['cessJuge'];
$identiteProcol->CessionJugeDate = $tabCes['cessDateJuge'];
@ -911,14 +912,15 @@ class Entreprise extends Scores_Ws_Server
$annsB=$iInsee->getAnnoncesBalo($siren);
$annsA=$iInsee->getAnnoncesAsso($siren);
$annsM=$iInsee->getAnnoncesBoamp($siren, $idAnn);
} elseif ($filtre==1)
$anns=$iInsee->getAnnoncesLegales($siren, $idAnn);
elseif ($filtre==2)
$annsB=$iInsee->getAnnoncesBalo($siren, $idAnn);
elseif ($filtre==3)
$annsA=$iInsee->getAnnoncesAsso($siren, $idAnn);
elseif ($filtre==4)
$annsM=$iInsee->getAnnoncesBoamp($siren, $idAnn);
} elseif ($filtre==1) {
$anns=$iInsee->getAnnoncesLegales($siren, $idAnn);
} elseif ($filtre==2) {
$annsB=$iInsee->getAnnoncesBalo($siren, $idAnn);
} elseif ($filtre==3) {
$annsA=$iInsee->getAnnoncesAsso($siren, $idAnn);
} elseif ($filtre==4) {
$annsM=$iInsee->getAnnoncesBoamp($siren, $idAnn);
}
if (empty($anns) && empty($annsB) && empty($annsA) && empty($annsM))
{
@ -3335,7 +3337,7 @@ class Entreprise extends Scores_Ws_Server
if(!in_array($key, array('SIREN', 'DATE_FRAICHE_BILAN',
'DATE_CLOTURE', 'DATE_CLOTURE_PRE', 'DUREE_MOIS',
'DUREE_MOIS_PRE', 'MONNAIE', 'CONSOLIDE', 'MONNAIE_ORI',
'MONNAIE_LIV_UNITE', 'SOURCE', 'devise'))){
'MONNAIE_LIV_UNITE', 'SOURCE', 'devise', 'TOP_CONFIDENTIEL'))){
$resultPoste = new BilanPoste();
$resultPoste->id = $key;
$resultPoste->val = $value;

File diff suppressed because it is too large Load Diff

View File

@ -269,10 +269,10 @@ class Identite
*/
public $NbEtab;
/**
* Numéro isin
* @var string
*/
/**
* Numéro isin
* @var string
*/
public $Isin;
/**
@ -2366,6 +2366,11 @@ class ListeBilans
* @var int
*/
public $source;
/** Confidentialité du bilan (1 si confidentiel, 0 sinon)
* @var int
*/
public $confidentiel;
}
class SetSurveillanceReturn
@ -2550,6 +2555,11 @@ class Bilan
*/
public $SOURCE;
/** Bilan confidentiel ou non
* @var string
*/
public $TOP_CONFIDENTIEL;
/** Tableau de postes du bilan dans le formalisme associé au Type de bilan
* @var BilanPoste[]
*/

View File

@ -73,16 +73,16 @@ class Saisie extends Scores_Ws_Server
$tabScores = $tabInfos['score'];
//Valider le code Isin
if (strlen(trim($tabIdentite['isin']))) {
$iBourse = new Metier_Partenaires_MBourse();
if (!$iBourse->isIsin($tabIdentite['isin'])) {
$error->errnum = 1;
if (strlen(trim($tabIdentite['isin']))) {
$iBourse = new Metier_Partenaires_MBourse();
if (!$iBourse->isIsin($tabIdentite['isin'])) {
$error->errnum = 1;
$error->errmsg = 'Code Isin incorrect.';
$output = new SetInfosEntrepReturn();
$output->error = $error;
$output->result = $result;
return $output;
}
return $output;
}
}
// Mise à jour de l'identité
@ -1257,21 +1257,21 @@ class Saisie extends Scores_Ws_Server
break;
}
$iInsee = new Metier_Insee_MInsee();
$iInsee = new Metier_Insee_MInsee();
$entrep = $iInsee->getIdentiteLight($siren, $nic);
if ( empty($entrep['id']) || intval($entrep['id'])==0 ) {
$this->sendError('1020');
}
$data = array(
'siren' => $siren,
'nic' => $nic,
'dateProvPartenaire'=> date('Y').date('m').date('d'),
'typeTel' => $type,
'infoTel' => $info,
'telephone' => $value,
'actif' => 1,
'partenaire' => 175,
$data = array(
'siren' => $siren,
'nic' => $nic,
'dateProvPartenaire'=> date('Y').date('m').date('d'),
'typeTel' => $type,
'infoTel' => $info,
'telephone' => $value,
'actif' => 1,
'partenaire' => 175,
);
if ( $id === null ) {
@ -1393,9 +1393,9 @@ class Saisie extends Scores_Ws_Server
{
$this->authenticate();
// --- Control input value
if ( strlen($siren)!=9 ) {
$this->sendError('1010');
// --- Control input value
if ( strlen($siren)!=9 ) {
$this->sendError('1010');
}
$tabPostes = array();
@ -1407,8 +1407,8 @@ class Saisie extends Scores_Ws_Server
if (!preg_match('/[0-9]{8}/', $data->dateCloture)) {
throw new SoapFault('MSG', "Erreur Date de cloture");
}
if ($data->dateCloturePre != 'AAAAMMJJ' && !preg_match('/[0-9]{8}/', $data->dateCloturePre)) {
throw new SoapFault('MSG', "Erreur Date de cloture précédente");
if ($data->dateCloturePre != 'AAAAMMJJ' && !preg_match('/[0-9]{8}/', $data->dateCloturePre)) {
throw new SoapFault('MSG', "Erreur Date de cloture précédente");
}
if ($data->dateCloturePre == 'AAAAMMJJ') {
$data->dateCloturePre = 0;
@ -1450,21 +1450,21 @@ class Saisie extends Scores_Ws_Server
}
// --- Insertion dans la bdd
else {
try {
$bilansM = new Application_Model_JoBilans();
$sql = $bilansM->select()
->where('siren=?', $siren)
->where('dateExercice=?', $cloture)
->where('typeBilan=?', $type);
->where('typeBilan=?', $type);
$row = $bilansM->fetchRow($sql);
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient!=1) {
throw new SoapFault('ERR', "Application error");
} else {
throw new SoapFault('ERR', $e->getMessage());
}
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient == 1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
$postesDiff = array();
@ -1485,7 +1485,7 @@ class Saisie extends Scores_Ws_Server
'unite' => $data->unite,
'postes' => $data->postes,
'partenaire' => 1,
'confidentiel' => 0,
'confidentiel' => 0,
'dateInsert' => date('YmdHis'),
);
@ -1493,10 +1493,10 @@ class Saisie extends Scores_Ws_Server
try {
$id = $bilansM->insert($dataToInsert);
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient!=1) {
throw new SoapFault('ERR', "Application error");
} else {
if ($this->User->idClient == 1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
}
@ -1512,10 +1512,10 @@ class Saisie extends Scores_Ws_Server
try {
$historiquesM->insert($backupData);
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient!=1) {
throw new SoapFault('ERR', "Application error");
} else {
if ($this->User->idClient == 1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
@ -1532,7 +1532,7 @@ class Saisie extends Scores_Ws_Server
'unite' => $data->unite,
'postes' => $data->postes,
'partenaire' => 1,
'confidentiel' => 0,
'confidentiel' => 0,
'dateInsert' => date('YmdHis'),
);
@ -1540,10 +1540,10 @@ class Saisie extends Scores_Ws_Server
try {
$id = $bilansM->update($dataToUpdate, 'id = '.$row->id);
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient!=1) {
throw new SoapFault('ERR', "Application error");
} else {
if ($this->User->idClient == 1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
@ -1555,7 +1555,7 @@ class Saisie extends Scores_Ws_Server
// --- Save user
$userM = new Application_Model_JoBilansUser();
try {
try {
$userM->insert(array(
'idUtilisateur' => $this->User->id,
'login' => $this->User->login,
@ -1564,13 +1564,13 @@ class Saisie extends Scores_Ws_Server
'typeBilan' => $data->typeBilan,
'dateAction' => date('YmdHis'),
'postesDiff' => implode(';', $postesDiff),
));
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient!=1) {
throw new SoapFault('ERR', "Application error");
} else {
throw new SoapFault('ERR', $e->getMessage());
}
));
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient == 1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
return $id;
@ -1749,8 +1749,8 @@ class Saisie extends Scores_Ws_Server
if (strlen(trim($dataRef['isin']))) {
$iBourse = new Metier_Partenaires_MBourse();
if (!$iBourse->isIsin($dataRef['isin'])) {
throw new SoapFault('ERR', 'Code Isin incorrect.');
if (!$iBourse->isIsin($dataRef['isin'])) {
throw new SoapFault('ERR', 'Code Isin incorrect.');
}
}
@ -2345,20 +2345,20 @@ class Saisie extends Scores_Ws_Server
}
if ($result) return true;
}
//Move active participations if TUP and Fusion selected
elseif ($action=='tupfusion')
{
try {
$result = $lienM->update(array('idAct'=>$id, 'idUpdate'=>$this->User->id),
"idAct=$idLien AND actif=1 AND dateSuppr='0000-00-00 00:00:00'");
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient==1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
if ($result) return true;
//Move active participations if TUP and Fusion selected
elseif ($action=='tupfusion')
{
try {
$result = $lienM->update(array('idAct'=>$id, 'idUpdate'=>$this->User->id),
"idAct=$idLien AND actif=1 AND dateSuppr='0000-00-00 00:00:00'");
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient==1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
if ($result) return true;
}
return false;
@ -2593,7 +2593,7 @@ class Saisie extends Scores_Ws_Server
}
return $result;
case 'edit':
case 'edit':
$tabRet['idUpdate'] = $userId;
try {
$result = $dirOp->update($tabRet, $where);

View File

@ -42,7 +42,7 @@ callInfo.inparams
callInfo.inparams[0].name
u'parameters'
callInfo.inparams[0].type
(u'http://wse.scores-decisions.com:8081/service', u'status')
(u'http://hostname/service', u'status')