2011-01-06 08:37:20 +00:00
|
|
|
<?php
|
2011-04-28 10:26:36 +00:00
|
|
|
require_once realpath(dirname(__FILE__)).'/Cache.php';
|
|
|
|
|
2011-01-06 08:37:20 +00:00
|
|
|
class WsScores
|
|
|
|
{
|
2013-05-23 13:42:00 +00:00
|
|
|
/**
|
|
|
|
* WebService configuration
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $webservices = array();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* User login
|
|
|
|
* @var string
|
|
|
|
*/
|
2011-01-07 17:16:07 +00:00
|
|
|
protected $login = '';
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* User password
|
|
|
|
* @var string
|
|
|
|
*/
|
2011-01-07 17:16:07 +00:00
|
|
|
protected $password = '';
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Standard nbReponse use
|
|
|
|
* @var int
|
|
|
|
*/
|
2011-04-11 14:20:26 +00:00
|
|
|
protected $nbReponses = 20;
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2013-05-23 13:42:00 +00:00
|
|
|
/**
|
|
|
|
* Enable/Disable using of cache
|
|
|
|
* @var unknown
|
|
|
|
*/
|
|
|
|
protected $cacheEnable = true;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enbale/Disable cache writing
|
|
|
|
* @var boolean
|
|
|
|
*/
|
|
|
|
protected $cacheWrite = true;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Load WebService config
|
|
|
|
* @param string $login
|
|
|
|
* @param string $password
|
|
|
|
*/
|
2011-04-11 14:20:26 +00:00
|
|
|
public function __construct($login = '', $password = '')
|
|
|
|
{
|
2012-11-05 15:33:01 +00:00
|
|
|
$c = Zend_Registry::get('config');
|
2012-11-16 14:12:03 +00:00
|
|
|
$location = $c->profil->webservice->location;
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-11-16 09:31:47 +00:00
|
|
|
$cWS = new Zend_Config_Ini(realpath(dirname(__FILE__)) . '/webservices.ini');
|
2012-11-05 15:33:01 +00:00
|
|
|
$config = $cWS->toArray();
|
2012-07-30 09:35:19 +00:00
|
|
|
if (APPLICATION_ENV == 'staging' && array_key_exists($location.'-staging', $config)) {
|
|
|
|
$location.= '-staging';
|
|
|
|
}
|
|
|
|
$this->webservices = $config[$location]['webservices'];
|
2011-01-07 17:16:07 +00:00
|
|
|
if ( !empty($login) && !empty($password) ){
|
|
|
|
$this->login = $login;
|
|
|
|
$this->password = $password;
|
|
|
|
} else {
|
2012-05-20 16:31:28 +00:00
|
|
|
$user = new Scores_Utilisateur();
|
2011-04-28 10:26:36 +00:00
|
|
|
$this->login = $user->getLogin();
|
2011-09-07 12:54:43 +00:00
|
|
|
$this->password = $user->getPassword();
|
2011-04-28 10:26:36 +00:00
|
|
|
$this->nbReponses = $user->getNbRep();
|
|
|
|
if ( $user->checkModeEdition() ) {
|
2013-05-23 13:42:00 +00:00
|
|
|
//Don't use the cache
|
|
|
|
$this->cacheEnable = false;
|
|
|
|
//Don't write cache
|
|
|
|
if ( APPLICATION_ENV == 'staging' ) {
|
|
|
|
$this->cacheWrite = false;
|
|
|
|
}
|
2011-04-28 10:26:36 +00:00
|
|
|
}
|
2011-01-07 17:16:07 +00:00
|
|
|
}
|
2011-01-06 08:37:20 +00:00
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2013-05-23 13:42:00 +00:00
|
|
|
/**
|
|
|
|
* loadClient
|
|
|
|
* @param unknown_type $webservice
|
|
|
|
*/
|
|
|
|
protected function loadClient($webservice)
|
|
|
|
{
|
|
|
|
$wsdl = $this->webservices[$webservice]['wsdl'];
|
|
|
|
$options = $this->webservices[$webservice]['options'];
|
|
|
|
$options['features'] = SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS;
|
|
|
|
$options['compression'] = SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE;
|
|
|
|
$options['login'] = $this->login;
|
|
|
|
$options['password'] = $this->password;
|
|
|
|
if (APPLICATION_ENV == 'development'){
|
2013-11-29 13:54:52 +00:00
|
|
|
$options['cache_wsdl'] = WSDL_CACHE_NONE;
|
2013-05-23 13:42:00 +00:00
|
|
|
}
|
|
|
|
$options['trace'] = true;
|
|
|
|
$options['encoding'] = 'utf-8';
|
|
|
|
$client = false;
|
|
|
|
try {
|
|
|
|
$client = new SoapClient($wsdl, $options);
|
|
|
|
} catch (Exception $e) {
|
|
|
|
Zend_Registry::get('firebug')->info($e->getMessage());
|
|
|
|
throw new Exception('Application Error');
|
|
|
|
}
|
|
|
|
return $client;
|
|
|
|
}
|
|
|
|
|
2013-12-26 14:42:44 +00:00
|
|
|
public function delSaisieContactEt($id)
|
2013-11-21 16:31:49 +00:00
|
|
|
{
|
2013-12-26 14:42:44 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->delContactEt($params);
|
|
|
|
return $reponse->delContactEtResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
return $fault->faultstring;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setSaisieContactEt($siret, $type, $value, $info, $id=null)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getContactEt($params);
|
|
|
|
return $reponse->getContactEtResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
return $fault->faultstring;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getSaisieContactEt($id)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getContactEt($params);
|
|
|
|
return $reponse->getContactEtResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
return $fault->faultstring;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function getContactEt($siret, $filter = null)
|
|
|
|
{
|
|
|
|
$filename = 'getcontactet-'.$siret;
|
|
|
|
|
|
|
|
if ( $filter !== null ) {
|
|
|
|
$filename.= '-'.$filter;
|
|
|
|
}
|
2013-11-21 16:31:49 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->siret = $siret;
|
2013-12-26 14:42:44 +00:00
|
|
|
$params->filtre = $filter;
|
2013-11-21 16:31:49 +00:00
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getContactEt($params);
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getContactEtResult);
|
|
|
|
}
|
|
|
|
return $reponse->getContactEtResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param unknown $siren
|
|
|
|
* @param number $offset
|
|
|
|
* @param number $nbItems
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2013-11-13 14:10:30 +00:00
|
|
|
public function getSubventionList($siren, $offset = 0, $nbItems = 100)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->companyId = $siren;
|
|
|
|
$params->offset = $offset;
|
|
|
|
$params->nbItems = $nbItems;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getSubventionList($params);
|
|
|
|
return $reponse->getSubventionListResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Subvention Detail
|
|
|
|
* @param int $id
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public function getSubventionDetail($id)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getSubventionDetail($params);
|
|
|
|
return $reponse->getSubventionDetailResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param unknown $siren
|
|
|
|
* @param number $nic
|
|
|
|
* @param number $niveau
|
|
|
|
* @return Ambigous <boolean, mixed>|boolean
|
|
|
|
*/
|
2013-03-15 15:47:36 +00:00
|
|
|
public function getEntrepriseValo($siren, $nic=0, $niveau=2)
|
|
|
|
{
|
|
|
|
$filename = 'getvalo-'.$siren.'-'.$nic.'-'.$niveau;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2013-03-15 15:47:36 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2013-03-15 15:47:36 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->nic = $nic;
|
|
|
|
$params->niveau = $niveau;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getValo($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getValoResult);
|
|
|
|
}
|
2013-03-15 15:47:36 +00:00
|
|
|
return $reponse->getValoResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-14 09:32:08 +00:00
|
|
|
public function setSurveillancesMail($login, $email)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->login = $login;
|
|
|
|
$params->email = $email;
|
|
|
|
$client = $this->loadClient('gestion');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setSurveillancesMail($params);
|
|
|
|
return $reponse->setSurveillancesMailResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-06 10:04:28 +00:00
|
|
|
public function setUserService($login, $code)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->login = $login;
|
|
|
|
$params->code = $code;
|
2013-05-14 09:32:08 +00:00
|
|
|
$client = $this->loadClient('gestion');
|
2013-03-06 10:04:28 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->setUserService($params);
|
|
|
|
return $reponse->setUserServiceResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-01-23 20:25:25 +00:00
|
|
|
public function getCatalogEvent($id, $columns)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$params->columns = $columns;
|
|
|
|
$client = $this->loadClient('catalog');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getEvent($params);
|
|
|
|
return $reponse->getEventResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
echo $client->__getLastResponse();
|
|
|
|
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-03-15 15:47:36 +00:00
|
|
|
|
2013-03-12 09:02:47 +00:00
|
|
|
public function getCatalogNaf5($id, $columns)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$params->columns =$columns;
|
|
|
|
$client = $this->loadClient('catalog');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getNaf5($params);
|
|
|
|
return $reponse->getNaf5Result;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
echo $client->__getLastResponse();
|
|
|
|
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-03-20 14:09:48 +00:00
|
|
|
|
2013-03-20 06:19:46 +00:00
|
|
|
public function getCatalogFctDir($id, $columns)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$params->columns =$columns;
|
|
|
|
$client = $this->loadClient('catalog');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getDirFonction($params);
|
|
|
|
return $reponse->getDirFonctionResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
echo $client->__getLastResponse();
|
|
|
|
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-23 20:25:25 +00:00
|
|
|
|
2013-11-21 16:31:49 +00:00
|
|
|
public function getCatalogCity($id, $columns)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$params->columns = $columns;
|
|
|
|
$client = $this->loadClient('catalog');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getCity($params);
|
|
|
|
return $reponse->getCityResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
echo $client->__getLastResponse();
|
|
|
|
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-14 09:32:08 +00:00
|
|
|
public function getCatalogLegalForm($id, $columns)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$params->columns =$columns;
|
|
|
|
$client = $this->loadClient('catalog');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getLegalForm($params);
|
|
|
|
return $reponse->getLegalFormResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
echo $client->__getLastResponse();
|
|
|
|
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-01-18 16:23:31 +00:00
|
|
|
public function setLienChange($action, $idLien, $id)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->action = $action;
|
|
|
|
$params->idLien = $idLien;
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setLienChange($params);
|
|
|
|
return $reponse->setLienChangeResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-01-15 17:14:31 +00:00
|
|
|
/**
|
2013-06-06 12:01:45 +00:00
|
|
|
* Set Score Cut Off
|
2013-01-15 17:14:31 +00:00
|
|
|
* @param string $siren
|
|
|
|
* @param int $encours
|
|
|
|
* @param int $scoreSolv
|
|
|
|
* @param int $scoreDir
|
|
|
|
* @param int $scoreConf
|
|
|
|
* @param string $remarque
|
2013-08-12 12:08:03 +00:00
|
|
|
* @param boolean delete
|
2013-01-15 17:14:31 +00:00
|
|
|
* @return boolean
|
|
|
|
*/
|
2013-08-12 12:08:03 +00:00
|
|
|
public function setScoreCutoff($siren, $encours, $scoreSolv, $scoreDir, $scoreConf, $remarque, $delete)
|
2013-01-15 17:14:31 +00:00
|
|
|
{
|
|
|
|
$infos = array(
|
|
|
|
'siren' => $siren,
|
|
|
|
'encours' => $encours,
|
|
|
|
'scoreSolv' => $scoreSolv,
|
|
|
|
'scoreDir' => $scoreDir,
|
|
|
|
'scoreConf' => $scoreConf,
|
|
|
|
'remarque' => $remarque,
|
|
|
|
);
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->infos = json_encode($infos);
|
2013-08-12 12:08:03 +00:00
|
|
|
$params->delete = $delete;
|
2013-03-20 14:09:48 +00:00
|
|
|
$client = $this->loadClient('saisie');
|
2013-01-15 17:14:31 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->setScoreCutoff($params);
|
|
|
|
return $reponse->setScoreCutoffResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
2013-03-20 14:31:36 +00:00
|
|
|
return $fault->faultstring;
|
2013-01-15 17:14:31 +00:00
|
|
|
}
|
|
|
|
}
|
2013-09-23 08:47:30 +00:00
|
|
|
|
2013-06-06 12:01:45 +00:00
|
|
|
/**
|
|
|
|
* Get Score Cut Off
|
|
|
|
* @param string $siren
|
|
|
|
* @return Cutoff values or False
|
|
|
|
*/
|
|
|
|
public function getScoreCutoff($siren)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getScoreCutoff($params);
|
|
|
|
return $reponse->getScoreCutoffResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
return $fault->faultstring;
|
|
|
|
}
|
|
|
|
}
|
2013-09-23 08:47:30 +00:00
|
|
|
|
2013-07-30 08:42:29 +00:00
|
|
|
/**
|
|
|
|
* Delete Score Cut Off
|
|
|
|
* @param string $siren
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public function delScoreCutoff($siren)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->delScoreCutoff($params); //change name when webservice is ready
|
|
|
|
return $reponse->delScoreCutoffResult; //change name when webservice is ready
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
return $fault->faultstring;
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
|
|
|
public function searchLogin($idClient, $query)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->idClient = $idClient;
|
|
|
|
$params->query = $query;
|
|
|
|
$client = $this->loadClient('gestion');
|
|
|
|
try {
|
|
|
|
$reponse = $client->searchLogin($params);
|
|
|
|
return $reponse->searchLoginResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-12 21:19:42 +00:00
|
|
|
public function getCatalogCurrency()
|
|
|
|
{
|
|
|
|
$filename = 'catalog-currency';
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ( $cache->exist() ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-12-12 21:19:42 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = null;
|
|
|
|
$client = $this->loadClient('catalog');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getCurrency($params);
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getCurrencyResult);
|
|
|
|
return $reponse->getCurrencyResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2013-03-15 15:47:36 +00:00
|
|
|
|
2012-12-12 15:31:16 +00:00
|
|
|
public function getCatalogCountry()
|
|
|
|
{
|
|
|
|
$filename = 'catalog-country';
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ( $cache->exist() ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-12-12 15:31:16 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = null;
|
|
|
|
$params->columns = array(
|
|
|
|
'codPays3',
|
|
|
|
'libPays',
|
|
|
|
'devise',
|
|
|
|
'indTel',
|
|
|
|
);
|
|
|
|
$client = $this->loadClient('catalog');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getCountry($params);
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getCountryResult);
|
|
|
|
return $reponse->getCountryResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-11-03 09:22:32 +00:00
|
|
|
public function setBourse($isin, $infos)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->isin = $isin;
|
|
|
|
$params->infos = $infos;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setBourse($params);
|
|
|
|
return $reponse->setBourseResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-11-03 09:22:32 +00:00
|
|
|
public function getSaisieBourse($isin)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->isin = $isin;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getBourse($params);
|
|
|
|
return $reponse->getBourseResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-11-03 09:22:32 +00:00
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2013-03-06 10:04:28 +00:00
|
|
|
public function setClientTarif($idClient, $log, $service, $type, $priceUnit, $limit, $date, $duree, $doublon)
|
2012-10-17 07:52:44 +00:00
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->idClient = $idClient;
|
|
|
|
$params->tarif->log = $log;
|
|
|
|
$params->tarif->service = $service;
|
|
|
|
$params->tarif->type = $type;
|
|
|
|
$params->tarif->priceUnit = $priceUnit;
|
|
|
|
$params->tarif->limit = $limit;
|
|
|
|
$params->tarif->date = $date;
|
|
|
|
$params->tarif->duree = $duree;
|
|
|
|
$params->tarif->doublon = $doublon;
|
|
|
|
$client = $this->loadClient('gestion');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setClientTarif($params);
|
|
|
|
return $reponse->setClientTarifResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-10-17 07:52:44 +00:00
|
|
|
public function getClientTarifs($idClient, $service = null)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->idClient = $idClient;
|
|
|
|
$params->service = $service;
|
|
|
|
$client = $this->loadClient('gestion');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getClientTarifs($params);
|
2013-03-06 10:04:28 +00:00
|
|
|
return $reponse->getClientTarifsResult;
|
2012-10-17 07:52:44 +00:00
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
|
|
|
public function setService($idClient, $infos)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->idClient = $idClient;
|
|
|
|
$params->infos = $infos;
|
|
|
|
$client = $this->loadClient('gestion');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setService($params);
|
|
|
|
return $reponse->setServiceResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getServiceUsers($idClient, $service)
|
2012-10-17 07:52:44 +00:00
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->idClient = $idClient;
|
2013-03-06 10:04:28 +00:00
|
|
|
$params->serviceCode = $service;
|
2012-10-17 07:52:44 +00:00
|
|
|
$client = $this->loadClient('gestion');
|
|
|
|
try {
|
2013-01-15 17:14:31 +00:00
|
|
|
$reponse = $client->getServiceUsers($params);
|
2013-03-06 10:04:28 +00:00
|
|
|
Zend_Registry::get('firebug')->info($reponse);
|
2013-01-15 17:14:31 +00:00
|
|
|
return $reponse->getServiceUsersResult;
|
2012-10-17 07:52:44 +00:00
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-10-17 07:52:44 +00:00
|
|
|
public function getServices($idClient)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->idClient = $idClient;
|
|
|
|
$client = $this->loadClient('gestion');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getServices($params);
|
|
|
|
return $reponse->getServicesResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-10-16 13:54:14 +00:00
|
|
|
public function getCountryId($code)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->codeCountry = $code;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getCountryId($params);
|
|
|
|
return $reponse->getCountryIdResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-10-23 15:28:17 +00:00
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-10-23 15:28:17 +00:00
|
|
|
public function getSaisieLien($id)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getLien($params);
|
|
|
|
return $reponse->getLienResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-10-16 13:54:14 +00:00
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-11-22 07:44:55 +00:00
|
|
|
public function getLienDoc($id, $type = null, $groupe = false)
|
2012-11-09 16:24:11 +00:00
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$params->type = $type;
|
|
|
|
$params->groupe = $groupes;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getLienDoc($params);
|
|
|
|
return $reponse->getLienDocResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-11-07 17:21:39 +00:00
|
|
|
public function setLienDoc($infos, $id = null)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->infos = $infos;
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setLienDoc($params);
|
|
|
|
return $reponse->setLienDocResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-10-15 09:12:59 +00:00
|
|
|
public function setLien($infos, $id = null)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->infos = $infos;
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setLien($params);
|
|
|
|
return $reponse->setLienResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-11-12 17:55:37 +00:00
|
|
|
public function getSaisieLienRef($id)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getLienRef($params);
|
|
|
|
return $reponse->getLienRefResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-10-24 07:57:39 +00:00
|
|
|
public function getLienRef($id)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getLienRef($params);
|
|
|
|
return $reponse->getLienRefResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-10-15 09:12:59 +00:00
|
|
|
public function setLienRef($infos, $id = null)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->infos = $infos;
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setLienRef($params);
|
|
|
|
return $reponse->setLienRefResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-11-22 07:44:55 +00:00
|
|
|
public function searchLienRef($query, $type = null)
|
2012-10-15 09:12:59 +00:00
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->query = $query;
|
2012-11-22 07:44:55 +00:00
|
|
|
$params->type = $type;
|
2012-10-15 09:12:59 +00:00
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->searchLienRef($params);
|
|
|
|
return $reponse->searchLienRefResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-10-03 10:21:18 +00:00
|
|
|
public function setActeAsso($siren, $waldec, $type, $libelle, $date)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->waldec = $waldec;
|
|
|
|
$params->type = $type;
|
|
|
|
$params->libelle = $libelle;
|
|
|
|
$params->date = $date;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setActeAsso($params);
|
|
|
|
return $reponse->setActeAssoResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-09-21 19:40:45 +00:00
|
|
|
public function setBilan($siren, $unite, $dateCloture, $dureeMois, $dateCloturePre, $dureeMoisPre, $typeBilan, $postes, $step = 'normal')
|
2012-09-05 12:37:30 +00:00
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->data->unite = $unite;
|
|
|
|
$params->data->dateCloture = $dateCloture;
|
|
|
|
$params->data->dureeMois = $dureeMois;
|
|
|
|
$params->data->dateCloturePre = $dateCloturePre;
|
|
|
|
$params->data->dureeMoisPre = $dureeMoisPre;
|
|
|
|
$params->data->typeBilan = $typeBilan;
|
2012-09-21 19:40:45 +00:00
|
|
|
$params->data->postes = $postes;
|
|
|
|
$params->step = $step;
|
2012-09-05 12:37:30 +00:00
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setBilan($params);
|
|
|
|
return $reponse->setBilanResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-08-17 13:02:12 +00:00
|
|
|
/**
|
|
|
|
* Liste des bilans
|
2014-02-13 14:41:39 +00:00
|
|
|
* @param string $identifiant
|
|
|
|
* Siren
|
|
|
|
* @param int $position
|
|
|
|
* @param int $nbRep
|
|
|
|
*
|
2012-08-17 13:02:12 +00:00
|
|
|
*/
|
2014-02-13 14:41:39 +00:00
|
|
|
public function getPiecesBilans($identifiant, $position = 0, $nbRep = 200)
|
2012-08-17 13:02:12 +00:00
|
|
|
{
|
2014-02-13 14:41:39 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->identifiant = $identifiant;
|
|
|
|
$params->position = $position;
|
|
|
|
$params->nbRep = $nbRep;
|
2012-08-17 13:02:12 +00:00
|
|
|
$client = $this->loadClient('pieces');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getBilans($params);
|
|
|
|
return $reponse->getBilansResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-08-17 13:02:12 +00:00
|
|
|
/**
|
|
|
|
* Bilan URL
|
|
|
|
* @param string $siren
|
2014-02-13 14:41:39 +00:00
|
|
|
* @param string $type
|
2012-08-17 13:02:12 +00:00
|
|
|
* @param string $diffusion
|
|
|
|
* @param string $dateCloture
|
|
|
|
* @param string $reference
|
|
|
|
*/
|
2014-02-13 14:41:39 +00:00
|
|
|
public function getPiecesBilan($siren, $type, $diffusion, $dateCloture, $reference = '')
|
2012-08-17 13:02:12 +00:00
|
|
|
{
|
|
|
|
$params = new stdClass();
|
2013-11-05 14:45:25 +00:00
|
|
|
$params->identifiant = $siren;
|
2012-08-17 13:02:12 +00:00
|
|
|
$params->dateCloture = $dateCloture;
|
2014-02-13 14:41:39 +00:00
|
|
|
$params->type = $type;
|
2013-11-05 14:45:25 +00:00
|
|
|
$params->diffusion = $diffusion;
|
2012-08-17 13:02:12 +00:00
|
|
|
$params->reference = $reference;
|
|
|
|
$client = $this->loadClient('pieces');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getBilan($params);
|
|
|
|
Zend_Registry::get('firebug')->info($reponse);
|
|
|
|
return $reponse->getBilanResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2014-02-13 14:41:39 +00:00
|
|
|
public function getPiecesActe($siren, $diffusion, $depotNum, $depotDate, $acteType, $acteNum, $acteDate, $reference = '')
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->identifiant = $siren;
|
|
|
|
$params->diffusion = $diffusion;
|
|
|
|
$params->depotNum = $depotNum;
|
|
|
|
$params->depotDate = $depotDate;
|
|
|
|
$params->acteType = $acteType;
|
|
|
|
$params->acteNum = $acteNum;
|
|
|
|
$params->acteDate = $acteDate;
|
|
|
|
$params->reference = $reference;
|
|
|
|
$client = $this->loadClient('pieces');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getActe($params);
|
|
|
|
Zend_Registry::get('firebug')->info($reponse);
|
|
|
|
return $reponse->getActeResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPiecesActes($identifiant, $position = 0, $nbRep = 200)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->identifiant = $identifiant;
|
|
|
|
$params->position = $position;
|
|
|
|
$params->nbRep = $nbRep;
|
|
|
|
$client = $this->loadClient('pieces');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getActes($params);
|
|
|
|
return $reponse->getActesResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-06-20 20:23:01 +00:00
|
|
|
public function setCGU()
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->application ='';
|
|
|
|
$client = $this->loadClient('gestion');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setCGU($params);
|
|
|
|
Zend_Registry::get('firebug')->info($reponse);
|
|
|
|
return $reponse->setCGUResult;
|
|
|
|
} catch(SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-06-14 12:18:02 +00:00
|
|
|
/**
|
|
|
|
* Get all infos for a user (Admin)
|
|
|
|
* @param string $login
|
|
|
|
*/
|
|
|
|
public function getUser($login)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->login = $login;
|
|
|
|
$client = $this->loadClient('gestion');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getUser($params);
|
|
|
|
return $reponse->getUserResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-29 13:29:45 +00:00
|
|
|
/**
|
|
|
|
* Retourne les infos du groupe
|
|
|
|
* @param string $siren
|
|
|
|
*/
|
|
|
|
public function getGroupeInfos($siren)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getGroupeInfos($params);
|
|
|
|
return $reponse->getGroupeInfosResult;
|
2012-05-20 16:31:28 +00:00
|
|
|
} catch (SoapFault $fault) {
|
2012-04-11 09:43:03 +00:00
|
|
|
if ( in_array($fault->faultcode, array('Error')) ){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
2012-03-29 13:29:45 +00:00
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2012-03-28 15:54:49 +00:00
|
|
|
/**
|
|
|
|
* Retourne l'arborescence d'un groupe
|
|
|
|
* @param string $siren
|
2012-12-03 15:02:44 +00:00
|
|
|
* @param int pctMin
|
2012-03-28 15:54:49 +00:00
|
|
|
* @param int $nbNiveaux
|
|
|
|
*/
|
2013-11-18 14:49:04 +00:00
|
|
|
public function getGroupesArbo($siren, $pctMin=33, $nbNiveaux=10, $stopAtIsin = false)
|
2012-03-28 15:54:49 +00:00
|
|
|
{
|
2013-11-18 14:49:04 +00:00
|
|
|
$filename = 'groupesarbo-'.$siren.'-'.$pctMin;
|
|
|
|
$filename.= '-0';
|
|
|
|
if ($stopAtIsin === true) {
|
|
|
|
$filename.= '-1';
|
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2012-03-28 15:54:49 +00:00
|
|
|
$params = new StdClass;
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->pctMin = $pctMin;
|
2013-11-18 14:49:04 +00:00
|
|
|
$params->stopAtIsin = $stopAtIsin;
|
2012-03-28 15:54:49 +00:00
|
|
|
$params->nbNiveaux = $nbNiveaux;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getGroupesArbo($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getGroupesArboResult);
|
|
|
|
}
|
2012-03-28 15:54:49 +00:00
|
|
|
return $reponse->getGroupesArboResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
2012-05-20 16:31:28 +00:00
|
|
|
}
|
2012-03-28 15:54:49 +00:00
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2012-03-08 14:36:24 +00:00
|
|
|
/**
|
|
|
|
* Récupération des kbis
|
|
|
|
*/
|
2012-05-20 16:31:28 +00:00
|
|
|
public function getKbis($siren)
|
2012-03-08 14:36:24 +00:00
|
|
|
{
|
|
|
|
$params = new StdClass;
|
|
|
|
$params->siren = $siren;
|
|
|
|
$client = $this->loadClient('pieces');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getKbis($params);
|
2012-03-09 16:00:42 +00:00
|
|
|
return $reponse->getKbisResult;
|
2012-03-08 14:36:24 +00:00
|
|
|
} catch (SoapFault $fault) {
|
2012-07-30 09:35:19 +00:00
|
|
|
if ( in_array($fault->faultcode, array('0000', 'MSG')) ){
|
2012-08-16 11:37:59 +00:00
|
|
|
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
2012-03-08 14:36:24 +00:00
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
}
|
|
|
|
|
2011-12-11 11:50:51 +00:00
|
|
|
/**
|
|
|
|
* Enter description here ...
|
|
|
|
* @param unknown_type $siren
|
|
|
|
* @param unknown_type $id
|
|
|
|
* @param unknown_type $codeEven
|
|
|
|
*/
|
|
|
|
public function setAnnonceEven($siren, $id, $codeEven)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->id = $id;
|
|
|
|
$params->codeEven = $codeEven;
|
|
|
|
$client = $this->loadClient('saisie');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setAnnonceEven($params);
|
|
|
|
return $reponse->setAnnonceEvenResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-12-09 15:27:22 +00:00
|
|
|
/**
|
|
|
|
* Recherche par référence client
|
|
|
|
* @param string $search
|
|
|
|
* @param integer $position
|
|
|
|
* @param integer $nbRep
|
|
|
|
*/
|
|
|
|
public function searchRefClient($search, $position=0, $nbRep=20)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->search = $search;
|
2012-05-20 16:31:28 +00:00
|
|
|
$params->position = $position;
|
2011-12-09 15:27:22 +00:00
|
|
|
$params->nbRep = $nbRep;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->searchRefClient($params);
|
|
|
|
return $reponse->searchRefClientResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
2012-05-20 16:31:28 +00:00
|
|
|
}
|
2011-12-09 15:27:22 +00:00
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-12-05 13:03:55 +00:00
|
|
|
/**
|
|
|
|
* Enter description here ...
|
|
|
|
* @param unknown_type $siren
|
|
|
|
* @return Ambigous <boolean, mixed>|boolean
|
|
|
|
*/
|
|
|
|
public function getListeDepots($siren)
|
|
|
|
{
|
|
|
|
$filename = 'listedepots-'.$siren;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-05 13:03:55 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getListeDepots($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getListeDepotsResult);
|
|
|
|
}
|
2011-12-05 13:03:55 +00:00
|
|
|
return $reponse->getListeDepotsResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-09-06 12:08:21 +00:00
|
|
|
/**
|
|
|
|
* Commande d'une enquete intersud
|
|
|
|
* @param string $siren
|
|
|
|
* @param array $infoEnq
|
|
|
|
* @param array $infoUser
|
|
|
|
*/
|
|
|
|
public function commandeEnquete($siren, $infoEnq, $infoUser)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->infoEnq = json_encode($infoEnq);
|
|
|
|
$params->infoDemande = json_encode($infoUser);
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->commandeEnquete($params);
|
|
|
|
return $reponse->commandeEnqueteResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-12-05 13:03:55 +00:00
|
|
|
/**
|
|
|
|
* Enter description here ...
|
2012-02-29 16:53:00 +00:00
|
|
|
* @param string $siret
|
|
|
|
* @param integer $id
|
|
|
|
* @param array $infos
|
2011-12-05 13:03:55 +00:00
|
|
|
* @return boolean
|
|
|
|
*/
|
2012-02-29 16:53:00 +00:00
|
|
|
public function setInfosEntrep($siret, $id, $infos)
|
2011-07-06 15:31:24 +00:00
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->siret = $siret;
|
|
|
|
$params->idEntreprise = $siret;
|
2012-02-29 16:53:00 +00:00
|
|
|
$params->infos = json_encode($infos);
|
|
|
|
$client = $this->loadClient('saisie');
|
2011-07-06 15:31:24 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->setInfosEntrep($params);
|
|
|
|
return $reponse->setInfosEntrepResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-07-06 15:31:24 +00:00
|
|
|
return false;
|
2012-05-20 16:31:28 +00:00
|
|
|
}
|
2011-07-06 15:31:24 +00:00
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
|
|
|
|
2011-07-06 15:31:24 +00:00
|
|
|
/**
|
|
|
|
* Enter description here ...
|
|
|
|
* @param unknown_type $idAnn
|
|
|
|
* @param unknown_type $siret
|
|
|
|
*/
|
2011-07-01 12:44:12 +00:00
|
|
|
public function supprAnnonceCollecte($idAnn, $siret = '')
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->idAnn= $idAnn;
|
|
|
|
$params->siret= $siret;
|
2011-12-29 15:12:59 +00:00
|
|
|
$client = $this->loadClient('saisie');
|
2011-07-01 12:44:12 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->supprAnnonceCollecte($params);
|
|
|
|
return $reponse->supprAnnonceCollecteResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-07-01 12:44:12 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-07-01 10:23:18 +00:00
|
|
|
/**
|
|
|
|
* supprAnnonce
|
|
|
|
* @param integer $source
|
|
|
|
* @param string $idAnn
|
|
|
|
* @param string $siret
|
|
|
|
*/
|
|
|
|
public function supprAnnonce($source, $idAnn, $siret = '')
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->source= $source;
|
|
|
|
$params->idAnn= $idAnn;
|
|
|
|
$params->siret = $siret;
|
2011-12-29 15:12:59 +00:00
|
|
|
$client = $this->loadClient('saisie');
|
2011-07-01 10:23:18 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->supprAnnonce($params);
|
|
|
|
return $reponse->supprAnnonceResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-07-01 10:23:18 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-07-01 10:23:18 +00:00
|
|
|
/**
|
|
|
|
* dupliqueAnnonce
|
|
|
|
* @param integer $source
|
|
|
|
* @param string $idAnn
|
|
|
|
* @param string $siretIn
|
|
|
|
* @param string $siretOut
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public function dupliqueAnnonce($source, $idAnn, $siretIn = '', $siretOut = '')
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->source= $source;
|
|
|
|
$params->idAnn= $idAnn;
|
|
|
|
$params->siretIn = $siretIn;
|
|
|
|
$params->siretOut = $siretOut;
|
2011-12-29 15:12:59 +00:00
|
|
|
$client = $this->loadClient('saisie');
|
2011-07-01 10:23:18 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->dupliqueAnnonce($params);
|
|
|
|
return $reponse->dupliqueAnnonceResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-07-01 10:23:18 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-08-10 12:06:28 +00:00
|
|
|
/**
|
|
|
|
* Enter description here ...
|
|
|
|
* @param string $idAnn
|
|
|
|
* @param string $siret
|
|
|
|
*/
|
|
|
|
public function getAnnonceCollecte($idAnn, $siret)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->idAnn= $idAnn;
|
|
|
|
$params->siret = $siret;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getAnnonceCollecte($params);
|
|
|
|
return $reponse->getAnnonceCollecteResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-08-10 12:06:28 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-24 09:12:40 +00:00
|
|
|
/**
|
|
|
|
* getRapport
|
2011-08-03 09:21:51 +00:00
|
|
|
* @param string $siren
|
|
|
|
* @param integer $niveau
|
|
|
|
* @param integer $id
|
|
|
|
* @param boolean $plus
|
2011-10-18 08:21:26 +00:00
|
|
|
* @param string $ref
|
|
|
|
* @param integer $encours
|
|
|
|
* @param string $email
|
2011-05-24 09:12:40 +00:00
|
|
|
*/
|
2011-10-18 08:21:26 +00:00
|
|
|
public function getRapport($siren, $niveau=3, $id=0, $plus=false, $ref='', $encours=0, $email='')
|
2011-05-24 09:12:40 +00:00
|
|
|
{
|
|
|
|
$filename = 'getrapport-'.$siren.'-'.$niveau.'-'.$id;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-24 09:12:40 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-05-24 09:12:40 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->niveau = $niveau;
|
|
|
|
$params->id = $id;
|
2011-08-03 09:21:51 +00:00
|
|
|
$params->plus = $plus;
|
2011-10-18 08:21:26 +00:00
|
|
|
$params->ref = $ref;
|
|
|
|
$params->encours = $encours;
|
|
|
|
$params->email = $email;
|
2011-05-24 09:12:40 +00:00
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
2011-06-22 14:47:00 +00:00
|
|
|
ini_set('default_socket_timeout', 600);
|
|
|
|
set_time_limit(300);
|
|
|
|
$reponse = $client->getRapport($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getRapportResult);
|
|
|
|
}
|
2011-05-24 09:12:40 +00:00
|
|
|
return $reponse->getRapportResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-24 09:12:40 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-20 15:56:34 +00:00
|
|
|
/**
|
|
|
|
* getPortefeuilleCsv
|
|
|
|
* @param unknown_type $login
|
|
|
|
* @param unknown_type $idClient
|
|
|
|
*/
|
|
|
|
public function getPortefeuilleCsv($login='', $idClient=0)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->login = $login;
|
|
|
|
$params->idClient = $idClient;
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-08-02 16:19:47 +00:00
|
|
|
//@todo : Seulement pour aider Altysis
|
2012-11-05 15:33:01 +00:00
|
|
|
$c = Zend_Registry::get('config');
|
2012-11-16 14:12:03 +00:00
|
|
|
$location = $c->profil->webservice->location;
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-12-03 07:27:06 +00:00
|
|
|
$cWS = new Zend_Config_Ini(realpath(dirname(__FILE__)) . '/webservices.ini');
|
2012-11-05 15:33:01 +00:00
|
|
|
$config = $cWS->toArray();
|
2012-08-02 16:19:47 +00:00
|
|
|
$this->webservices = $config[$location]['webservices'];
|
|
|
|
//@todo
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2011-05-20 15:56:34 +00:00
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getPortefeuilleCsv($params);
|
|
|
|
return $reponse->getPortefeuilleCsvResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-20 15:56:34 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-20 15:56:34 +00:00
|
|
|
/**
|
|
|
|
* getListeSurveillanceCsv
|
|
|
|
* @param unknown_type $source
|
|
|
|
* @param unknown_type $login
|
|
|
|
* @param unknown_type $idClient
|
|
|
|
*/
|
|
|
|
public function getListeSurveillancesCsv($source='', $login='', $idClient=0)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->source = $source;
|
|
|
|
$params->login = $login;
|
|
|
|
$params->idClient = $idClient;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getListeSurveillancesCsv($params);
|
|
|
|
return $reponse->getListeSurveillancesCsvResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-20 15:56:34 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-20 14:38:31 +00:00
|
|
|
/**
|
|
|
|
* getLogsClients
|
|
|
|
* @param unknown_type $mois
|
|
|
|
* @param unknown_type $detail
|
|
|
|
* @param unknown_type $idClient
|
|
|
|
* @param unknown_type $login
|
|
|
|
* @param unknown_type $all
|
|
|
|
*/
|
|
|
|
public function getLogsClients($mois, $detail=0, $idClient=0, $login='', $all=0)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->mois = $mois;
|
|
|
|
$params->detail = $detail;
|
|
|
|
$params->idClient = $idClient;
|
|
|
|
$params->login = $login;
|
|
|
|
$params->all = $all;
|
2011-10-17 07:15:09 +00:00
|
|
|
$client = $this->loadClient('gestion');
|
2011-05-20 14:38:31 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->getLogsClients($params);
|
|
|
|
return $reponse->getLogsClientsResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-20 14:38:31 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
|
|
|
|
2011-05-19 14:21:08 +00:00
|
|
|
/**
|
|
|
|
* getIndiScore
|
|
|
|
* @param string $siren
|
|
|
|
* @param string $nic
|
|
|
|
* @param integer $niveau
|
|
|
|
* @param boolean $plus
|
2011-10-18 08:21:26 +00:00
|
|
|
* @param string $ref
|
|
|
|
* @param integer $encours
|
|
|
|
* @param string $email
|
2011-05-19 14:21:08 +00:00
|
|
|
*/
|
2011-10-18 08:21:26 +00:00
|
|
|
public function getIndiScore($siren, $nic=0, $niveau=2, $plus=false, $ref='', $encours=0, $email='')
|
2011-05-19 14:21:08 +00:00
|
|
|
{
|
2011-05-23 15:12:54 +00:00
|
|
|
$filename = 'getindiscore-'.$siren.'-'.$nic.'-'.$niveau;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-19 14:21:08 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-05-24 09:45:49 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->nic = $nic;
|
|
|
|
$params->niveau = $niveau;
|
|
|
|
$params->plus = $plus;
|
2011-10-18 08:21:26 +00:00
|
|
|
$params->ref = $ref;
|
|
|
|
$params->encours = $encours;
|
|
|
|
$params->email = $email;
|
2011-05-19 14:21:08 +00:00
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getIndiScore($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getIndiScoreResult);
|
|
|
|
}
|
2011-05-19 14:21:08 +00:00
|
|
|
return $reponse->getIndiScoreResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-23 15:12:54 +00:00
|
|
|
return false;
|
2011-05-19 14:21:08 +00:00
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-19 06:32:08 +00:00
|
|
|
/**
|
|
|
|
* setLog
|
|
|
|
* @param string $page
|
|
|
|
* @param string $siret
|
|
|
|
* @param string $id
|
|
|
|
* @param string $ref
|
|
|
|
*/
|
|
|
|
public function setLog ($page, $siret, $id=0, $ref = '')
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
2012-01-24 14:40:53 +00:00
|
|
|
$params->page = $page;
|
2011-05-19 06:32:08 +00:00
|
|
|
$params->siret = $siret;
|
2011-06-30 07:29:54 +00:00
|
|
|
$params->id = $id;
|
2011-05-19 06:32:08 +00:00
|
|
|
$params->ref = $ref;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setLog($params);
|
|
|
|
return true;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-19 06:32:08 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-10 09:53:39 +00:00
|
|
|
/**
|
|
|
|
* getListeClients
|
|
|
|
* @param unknown_type $idClient
|
|
|
|
*/
|
2011-06-08 12:31:52 +00:00
|
|
|
public function getListeClients($idClient=false)
|
2011-05-10 09:53:39 +00:00
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->idClient = $idClient;
|
2011-10-17 07:15:09 +00:00
|
|
|
$client = $this->loadClient('gestion');
|
2011-05-10 09:53:39 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->getListeClients($params);
|
|
|
|
return $reponse->getListeClientsResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-10 09:53:39 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-09 10:15:20 +00:00
|
|
|
/**
|
|
|
|
* setMandataire
|
|
|
|
* Enter description here ...
|
|
|
|
* @param unknown_type $infos
|
|
|
|
*/
|
|
|
|
public function setMandataire($infos)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
2011-11-07 15:23:08 +00:00
|
|
|
$params->infos->id = $infos['id'];
|
|
|
|
$params->infos->sirenGrp = $infos['sirenGrp'];
|
|
|
|
$params->infos->sirenMand = $infos['sirenMand'];
|
|
|
|
$params->infos->Nom = $infos['Nom'];
|
|
|
|
$params->infos->Prenom = $infos['Prenom'];
|
|
|
|
$params->infos->type = $infos['type'];
|
|
|
|
$params->infos->stagiaire = $infos['stagiaire'];
|
|
|
|
$params->infos->coursAppel = $infos['coursAppel'];
|
|
|
|
$params->infos->coursAppel2 = $infos['coursAppel2'];
|
|
|
|
$params->infos->tribunal = $infos['tribunal'];
|
|
|
|
$params->infos->Statut = $infos['Statut'];
|
|
|
|
$params->infos->adresse = $infos['adresse'];
|
|
|
|
$params->infos->adresseComp = $infos['adresseComp'];
|
|
|
|
$params->infos->cp = $infos['cp'];
|
|
|
|
$params->infos->ville = $infos['ville'];
|
|
|
|
$params->infos->tel = $infos['tel'];
|
|
|
|
$params->infos->fax = $infos['fax'];
|
|
|
|
$params->infos->email = $infos['email'];
|
|
|
|
$params->infos->web = $infos['web'];
|
|
|
|
$params->infos->contact = $infos['contact'];
|
2011-05-09 10:15:20 +00:00
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setMandataire($params);
|
|
|
|
return $reponse->setMandataireResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-09 10:15:20 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* getIdCourAppel
|
|
|
|
* @param string $codeTribunal
|
|
|
|
*/
|
|
|
|
public function getIdCoursAppel($codeTribunal)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->codeTribunal = $codeTribunal;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getIdCoursAppel($params);
|
|
|
|
return $reponse->getIdCoursAppelResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-09 10:06:06 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* searchMandataires
|
|
|
|
* @param unknown_type $nom
|
|
|
|
* @param unknown_type $type
|
|
|
|
* @param unknown_type $cpDep
|
|
|
|
*/
|
2011-05-09 09:43:38 +00:00
|
|
|
public function searchMandataires($nom, $type=array(), $cpDep=0)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->nom = $nom;
|
|
|
|
$params->type = $type;
|
|
|
|
$params->cpDep = $cpDep;
|
2011-05-20 14:40:08 +00:00
|
|
|
$client = $this->loadClient('interne');
|
2011-05-09 09:43:38 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->searchMandataires($params);
|
|
|
|
return $reponse->searchMandatairesResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-09 09:43:38 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-07-01 06:57:17 +00:00
|
|
|
/**
|
|
|
|
* getMandataire
|
|
|
|
* @param string $idMand
|
|
|
|
*/
|
|
|
|
public function getMandataire($idMand)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
2012-12-04 14:21:08 +00:00
|
|
|
$params->id = $idMand;
|
|
|
|
$client = $this->loadClient('saisie');
|
2011-07-01 06:57:17 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->getMandataire($params);
|
|
|
|
return $reponse->getMandataireResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-07-01 06:57:17 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2011-09-13 20:14:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Recherche Annonce
|
|
|
|
* @param string $source
|
|
|
|
* @param string $dateAnnee
|
|
|
|
* @param integer $numParution
|
|
|
|
* @param integer $numAnnonce
|
|
|
|
*/
|
|
|
|
public function rechercheAnnonce($source, $dateAnnee, $numParution, $numAnnonce)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->source = $source;
|
|
|
|
$params->dateAnnee = $dateAnnee;
|
|
|
|
$params->numParution = $numParution;
|
|
|
|
$params->numAnnonce = $numAnnonce;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->rechercheAnnonce($params);
|
|
|
|
return $reponse->rechercheAnnonceResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-09-13 20:14:10 +00:00
|
|
|
/**
|
|
|
|
* Recherche Historique
|
|
|
|
* @param string $recherche
|
|
|
|
* @param string $annee
|
|
|
|
* @param string $typeBod
|
|
|
|
* @param integer $deb
|
|
|
|
*/
|
|
|
|
public function rechercheHisto($recherche, $annee, $typeBod, $deb = 0)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->recherche = $recherche;
|
|
|
|
$params->annee = $annee;
|
|
|
|
$params->typeBod = $typeBod;
|
|
|
|
$params->deb = $deb;
|
|
|
|
$params->nbRep = $this->nbReponses;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->rechercheHisto($params);
|
|
|
|
return $reponse->rechercheHistoResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
2012-05-20 16:31:28 +00:00
|
|
|
}
|
2011-09-13 20:14:10 +00:00
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-30 14:19:17 +00:00
|
|
|
/**
|
|
|
|
* Recherche par dirigeants
|
2011-07-01 07:29:22 +00:00
|
|
|
* @param array $criteres
|
2011-06-30 14:19:17 +00:00
|
|
|
* @param integer $deb
|
|
|
|
* @param integer $nbRep
|
|
|
|
* @param integer $maxRep
|
|
|
|
*/
|
2011-07-01 07:29:22 +00:00
|
|
|
public function searchDir($criteres, $deb=0, $nbRep=20, $maxRep=200)
|
2011-06-30 14:19:17 +00:00
|
|
|
{
|
|
|
|
$params = new stdClass();
|
2011-07-01 07:29:22 +00:00
|
|
|
$params->criteres->nom = $criteres['dirNom'];
|
|
|
|
$params->criteres->prenom = $criteres['dirPrenom'];
|
|
|
|
$params->criteres->dateNaiss = $criteres['dirDateNaiss'];
|
|
|
|
$params->criteres->lieuNaiss = $criteres['lieuNaiss'];
|
|
|
|
$params->criteres->pertinence = ($criteres['pertinence']===true) ? true : false ;
|
2011-06-30 14:19:17 +00:00
|
|
|
$params->deb = $deb;
|
|
|
|
$params->nbRep = $nbRep;
|
|
|
|
$params->maxRep = $maxRep;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->searchDir($params);
|
|
|
|
return $reponse->searchDirResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-06-30 14:19:17 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-08-16 13:49:22 +00:00
|
|
|
/**
|
|
|
|
* Recherche Actionnaire
|
|
|
|
* @param unknown_type $nom
|
|
|
|
* @param unknown_type $cpVille
|
|
|
|
* @param unknown_type $siren
|
|
|
|
* @param unknown_type $pays
|
|
|
|
* @param unknown_type $pctMin
|
|
|
|
* @param unknown_type $pctMax
|
|
|
|
* @param unknown_type $deb
|
|
|
|
* @param unknown_type $nbRep
|
|
|
|
* @param unknown_type $maxRep
|
|
|
|
* @param unknown_type $pertinence
|
|
|
|
*/
|
2011-08-19 13:27:44 +00:00
|
|
|
public function searchAct($nom, $cpVille='', $siren='', $pays='', $pctMin=0, $pctMax=100, $deb=0)
|
2011-08-16 13:49:22 +00:00
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->nom = $nom;
|
|
|
|
$params->cpVille = $cpVille;
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->pays = $pays;
|
|
|
|
$params->pctMin = $pctMin;
|
|
|
|
$params->pctMax= $pctMax;
|
|
|
|
$params->pertinence = false;
|
|
|
|
$params->deb = $deb;
|
|
|
|
$params->nbRep = $this->nbReponses;
|
|
|
|
//$params->maxRep = $maxRep;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->searchAct($params);
|
|
|
|
return $reponse->searchActResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* getTribunaux
|
|
|
|
* Enter description here ...
|
|
|
|
* @param unknown_type $tabTypes
|
|
|
|
*/
|
2011-05-06 09:51:50 +00:00
|
|
|
public function getTribunaux($tabTypes = array())
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->tabTypes = $tabTypes;
|
2011-05-20 14:40:08 +00:00
|
|
|
$client = $this->loadClient('interne');
|
2011-05-06 09:51:50 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->getTribunaux($params);
|
|
|
|
return $reponse->getTribunauxResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-06 09:51:50 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* getListeJalCollecte
|
|
|
|
* Enter description here ...
|
|
|
|
*/
|
2011-05-06 09:51:50 +00:00
|
|
|
public function getListeJalCollecte()
|
|
|
|
{
|
2011-05-18 09:11:34 +00:00
|
|
|
$filename = 'listejalcollecte';
|
|
|
|
$cache = new Cache($filename);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
2011-05-26 15:41:36 +00:00
|
|
|
return $cache->getBlock();
|
2011-05-18 09:11:34 +00:00
|
|
|
}
|
2011-05-24 09:45:49 +00:00
|
|
|
$params = new stdClass();
|
2011-05-06 09:51:50 +00:00
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getListeJalCollecte();
|
2011-05-18 09:11:34 +00:00
|
|
|
$cache->deletefile();
|
2011-05-26 15:41:36 +00:00
|
|
|
$cache->setBlock($reponse->getListeJalCollecteResult);
|
2011-05-06 09:51:50 +00:00
|
|
|
return $reponse->getListeJalCollecteResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-06 09:51:50 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* getDevises
|
|
|
|
* Enter description here ...
|
|
|
|
* @param unknown_type $codeIsoDevise
|
|
|
|
*/
|
2011-05-06 09:51:50 +00:00
|
|
|
public function getDevises($codeIsoDevise = '')
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->codeIsoDevise = $codeIsoDevise;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getDevises($params);
|
|
|
|
return $reponse->getDevisesResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-06 09:51:50 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* getPrivilegesCumul
|
|
|
|
* Enter description here ...
|
|
|
|
* @param unknown_type $siren
|
|
|
|
* @param unknown_type $tabTypes
|
|
|
|
*/
|
2011-05-06 09:51:50 +00:00
|
|
|
public function getPrivilegesCumul($siren, $tabTypes = array() )
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->tabTypes = $tabTypes;
|
2011-05-20 14:40:08 +00:00
|
|
|
$client = $this->loadClient('interne');
|
2011-05-06 09:51:50 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->getPrivilegesCumul($params);
|
|
|
|
return $reponse->getPrivilegesCumulResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-06 09:51:50 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* getPrivilegesDetail
|
|
|
|
* Enter description here ...
|
|
|
|
* @param unknown_type $siren
|
|
|
|
* @param unknown_type $tabTypes
|
|
|
|
*/
|
2011-05-06 09:51:50 +00:00
|
|
|
public function getPrivilegesDetail($siren, $tabTypes = array() )
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->tabTypes = $tabTypes;
|
2011-05-20 14:40:08 +00:00
|
|
|
$client = $this->loadClient('interne');
|
2011-05-06 09:51:50 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->getPrivilegesDetail($params);
|
|
|
|
return $reponse->getPrivilegesDetailResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-06 09:51:50 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* setSurveillance
|
|
|
|
* Enter description here ...
|
|
|
|
* @param string $siret
|
|
|
|
* @param string $email
|
|
|
|
* @param string $ref
|
|
|
|
* @param string $source
|
|
|
|
* @param boolean $delete
|
|
|
|
* @param integer $encoursClient
|
|
|
|
*/
|
|
|
|
public function setSurveillance($siret, $email, $ref = '', $source='annonces', $delete=false, $encoursClient=0)
|
2011-05-04 13:39:06 +00:00
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->siret = $siret;
|
|
|
|
$params->email = $email;
|
|
|
|
$params->ref = $ref;
|
|
|
|
$params->source = $source;
|
|
|
|
$params->delete = $delete;
|
|
|
|
$params->encoursClient = $encoursClient;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->setSurveillance($params);
|
|
|
|
return $reponse->setSurveillanceResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-04 13:39:06 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* getListeUtilisateurs
|
|
|
|
* Enter description here ...
|
|
|
|
* @param string $login
|
|
|
|
* @param integer $idClient
|
|
|
|
*/
|
2011-05-03 15:43:40 +00:00
|
|
|
public function getListeUtilisateurs($login, $idClient = -1)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->login = $login;
|
|
|
|
$params->idClient = $idClient;
|
2011-10-17 07:15:09 +00:00
|
|
|
$client = $this->loadClient('gestion');
|
2011-05-03 15:43:40 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->getListeUtilisateurs($params);
|
|
|
|
return $reponse->getListeUtilisateursResult;
|
2011-05-04 13:39:06 +00:00
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-03 15:43:40 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* getMarques
|
|
|
|
* Enter description here ...
|
|
|
|
* @param string $siren
|
|
|
|
* @param integer $idDepot
|
|
|
|
*/
|
2011-05-02 13:38:52 +00:00
|
|
|
public function getMarques($siren, $idDepot = 0)
|
|
|
|
{
|
2011-05-24 09:45:49 +00:00
|
|
|
$filename = 'marques-'.$siren.'-'.$idDepot;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-24 09:45:49 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->idDepot = $idDepot;
|
2011-05-02 13:38:52 +00:00
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getMarques($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getMarquesResult);
|
|
|
|
}
|
2011-05-02 13:38:52 +00:00
|
|
|
return $reponse->getMarquesResult;
|
2011-08-11 15:12:56 +00:00
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-02 13:38:52 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* getListeConventions
|
|
|
|
* Enter description here ...
|
|
|
|
* @param string $siren
|
|
|
|
*/
|
2011-05-02 12:14:05 +00:00
|
|
|
public function getListeConventions($siren)
|
|
|
|
{
|
|
|
|
$filename = 'conventions-'.$siren;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-02 12:14:05 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-05-24 09:45:49 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
2011-05-02 12:14:05 +00:00
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getListeConventions($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getListeConventionsResult);
|
|
|
|
}
|
2011-05-02 12:14:05 +00:00
|
|
|
return $reponse->getListeConventionsResult;
|
2011-08-11 15:12:56 +00:00
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-02 12:14:05 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* getListeCompetences
|
|
|
|
* Enter description here ...
|
|
|
|
* @param string $siret
|
|
|
|
* @param string $type
|
|
|
|
* @param string $codeInsee
|
|
|
|
*/
|
2011-05-02 06:40:45 +00:00
|
|
|
public function getListeCompetences($siret, $type, $codeInsee)
|
|
|
|
{
|
|
|
|
$filename = 'competences-'.$siret.'-'.$type.'-'.$codeInsee;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-02 06:40:45 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-05-24 09:45:49 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siret = $siret;
|
|
|
|
$params->type = $type;
|
|
|
|
$params->codeInsee = $codeInsee;
|
2011-05-02 06:40:45 +00:00
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getListeCompetences($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getListeCompetencesResult);
|
|
|
|
}
|
2011-05-02 06:40:45 +00:00
|
|
|
return $reponse->getListeCompetencesResult;
|
2011-08-11 15:12:56 +00:00
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-02 06:40:45 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* getInfosReg
|
|
|
|
* @param string $siren
|
|
|
|
* @param mixed $id
|
|
|
|
*/
|
2011-05-02 06:40:45 +00:00
|
|
|
public function getInfosReg($siren, $id = false)
|
|
|
|
{
|
2011-05-24 09:45:49 +00:00
|
|
|
$filename = 'infosreg-'.$siren.'-'.$id;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-24 09:45:49 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-05-02 06:40:45 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getInfosReg($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getInfosRegResult);
|
|
|
|
}
|
2011-05-02 06:40:45 +00:00
|
|
|
return $reponse->getInfosRegResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-31 12:13:19 +00:00
|
|
|
if ($fault->faultcode=='1030'){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
2011-05-02 06:40:45 +00:00
|
|
|
}
|
2012-06-07 13:45:57 +00:00
|
|
|
}
|
2012-04-19 12:37:08 +00:00
|
|
|
|
2012-09-05 12:37:30 +00:00
|
|
|
public function getAnnoncesNum($siren)
|
|
|
|
{
|
|
|
|
$filename = 'annoncesnum-'.$siren;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-05 12:37:30 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getAnnoncesNum($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getAnnoncesNumResult);
|
|
|
|
}
|
2012-09-05 12:37:30 +00:00
|
|
|
return $reponse->getAnnoncesNumResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-06-19 12:12:52 +00:00
|
|
|
public function getAnnoncesBalo($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
2012-04-19 12:37:08 +00:00
|
|
|
{
|
|
|
|
$filename = 'annoncesbalo-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-19 12:37:08 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->idAnn = $idAnn;
|
2012-06-19 12:12:52 +00:00
|
|
|
$params->filtre = $filtre;
|
2012-04-19 12:37:08 +00:00
|
|
|
$params->position = $position;
|
|
|
|
$params->nbRep = $nbRep;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getAnnoncesBalo($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getAnnoncesBaloResult);
|
|
|
|
}
|
2012-04-19 12:37:08 +00:00
|
|
|
return $reponse->getAnnoncesBaloResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-06-07 13:45:57 +00:00
|
|
|
|
2012-06-19 12:12:52 +00:00
|
|
|
public function getAnnoncesBoamp($siren, $idAnn=null, $filtre = null, $position=0, $nbRep=20)
|
2012-04-19 12:37:08 +00:00
|
|
|
{
|
2012-06-19 12:12:52 +00:00
|
|
|
$filename = 'annoncesboamp-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-19 12:37:08 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->idAnn = $idAnn;
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-07-02 19:31:25 +00:00
|
|
|
$params->filtre = null;
|
|
|
|
if (!empty($filtre) && in_array($filtre,array('A','M'))) {
|
|
|
|
$filtreStruct = new stdClass();
|
|
|
|
$filtreStruct->key = 'type';
|
|
|
|
$filtreStruct->value = $filtre;
|
|
|
|
$params->filtre[] = $filtreStruct;
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-04-19 12:37:08 +00:00
|
|
|
$params->position = $position;
|
|
|
|
$params->nbRep = $nbRep;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getAnnoncesBoamp($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getAnnoncesBoampResult);
|
|
|
|
}
|
2012-04-19 12:37:08 +00:00
|
|
|
return $reponse->getAnnoncesBoampResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-06-07 13:45:57 +00:00
|
|
|
|
2012-06-19 12:12:52 +00:00
|
|
|
public function getAnnoncesAsso($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
2012-04-19 12:37:08 +00:00
|
|
|
{
|
|
|
|
$filename = 'annoncesasso-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-19 12:37:08 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
2012-06-19 12:12:52 +00:00
|
|
|
$params->idAnn = $idAnn;
|
|
|
|
$params->filtre = $filtre;
|
2012-04-19 12:37:08 +00:00
|
|
|
$params->position = $position;
|
|
|
|
$params->nbRep = $nbRep;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getAnnoncesAsso($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getAnnoncesAssoResult);
|
|
|
|
}
|
2012-04-19 12:37:08 +00:00
|
|
|
return $reponse->getAnnoncesAssoResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-06-07 13:45:57 +00:00
|
|
|
|
2012-06-19 12:12:52 +00:00
|
|
|
public function getAnnoncesLegales($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
2012-04-19 12:37:08 +00:00
|
|
|
{
|
|
|
|
$filename = 'annonceslegales-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-19 12:37:08 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
2012-06-19 12:12:52 +00:00
|
|
|
$params->idAnn = $idAnn;
|
|
|
|
$params->filtre = $filtre;
|
2012-04-19 12:37:08 +00:00
|
|
|
$params->position = $position;
|
|
|
|
$params->nbRep = $nbRep;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getAnnoncesLegales($params);
|
|
|
|
Zend_Registry::get('firebug')->info($reponse);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getAnnoncesLegalesResult);
|
|
|
|
}
|
2012-04-19 12:37:08 +00:00
|
|
|
return $reponse->getAnnoncesLegalesResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-06-07 13:45:57 +00:00
|
|
|
|
2011-05-09 10:06:06 +00:00
|
|
|
/**
|
|
|
|
* getAnnonces
|
|
|
|
* @param string $siren
|
|
|
|
* @param integer $filtre
|
|
|
|
* @param string $idAnn
|
|
|
|
* @param integer $position
|
|
|
|
* @param integer $nbRep
|
|
|
|
*/
|
2011-05-02 09:05:25 +00:00
|
|
|
public function getAnnonces($siren, $filtre=0, $idAnn='', $position=0, $nbRep=100)
|
2011-05-02 06:40:45 +00:00
|
|
|
{
|
2011-05-24 09:45:49 +00:00
|
|
|
$filename = 'annonces-'.$siren.'-'.$filtre.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-24 09:45:49 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-05-02 06:40:45 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
2011-05-02 09:05:25 +00:00
|
|
|
$params->filtre = $filtre;
|
|
|
|
$params->idAnn = $idAnn;
|
2011-05-02 06:40:45 +00:00
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getAnnonces($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getAnnoncesResult);
|
|
|
|
}
|
2011-05-02 06:40:45 +00:00
|
|
|
return $reponse->getAnnoncesResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-05-02 06:40:45 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-21 12:32:08 +00:00
|
|
|
/**
|
|
|
|
* isSirenExistant
|
|
|
|
* @param string $siren
|
|
|
|
*/
|
|
|
|
public function isSirenExistant($siren)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->isSirenExistant($params);
|
|
|
|
return $reponse->isSirenExistantResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-04-21 12:32:08 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 09:07:57 +00:00
|
|
|
/**
|
|
|
|
* getPortefeuille
|
|
|
|
* @param object $filtre
|
|
|
|
* @param integer $position
|
|
|
|
* @param integer $nbAffichage
|
|
|
|
*/
|
2011-04-28 10:26:36 +00:00
|
|
|
public function getPortefeuille($filtre, $position = 0, $nbAffichage = 100)
|
|
|
|
{
|
2011-04-19 09:07:57 +00:00
|
|
|
$params = new StdClass;
|
|
|
|
$params->filtre = $filtre;
|
|
|
|
$params->deb = $position;
|
|
|
|
$params->nbRep = $nbAffichage;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getPortefeuille($params);
|
|
|
|
return $reponse->getPortefeuilleResult;
|
2011-04-21 12:32:08 +00:00
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-04-19 09:07:57 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 08:51:18 +00:00
|
|
|
/**
|
|
|
|
* getSurveillances
|
2012-02-10 15:54:50 +00:00
|
|
|
* @param object $filtre
|
2011-04-19 08:51:18 +00:00
|
|
|
* @param integer $deb
|
|
|
|
* @param integer $nbRep
|
|
|
|
* @param string $tri
|
|
|
|
*/
|
2012-02-10 15:54:50 +00:00
|
|
|
public function getSurveillances($filtre, $deb=0, $nbRep=100)
|
2011-04-19 08:51:18 +00:00
|
|
|
{
|
|
|
|
$params = new StdClass;
|
2012-02-10 15:54:50 +00:00
|
|
|
$params->filtre = $filtre;
|
2011-04-19 08:51:18 +00:00
|
|
|
$params->position = $deb;
|
|
|
|
$params->nbRep = $nbRep;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getSurveillances($params);
|
|
|
|
return $reponse->getSurveillancesResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-04-19 08:51:18 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 07:44:15 +00:00
|
|
|
/**
|
|
|
|
* getListeBilans
|
|
|
|
* @param string $siren
|
|
|
|
*/
|
2011-05-24 09:45:49 +00:00
|
|
|
public function getListeBilans($siren)
|
|
|
|
{
|
|
|
|
$filename = 'listebilans-'.$siren;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-24 09:45:49 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-05-24 09:45:49 +00:00
|
|
|
$params = new StdClass;
|
2011-04-19 07:44:15 +00:00
|
|
|
$params->siren = $siren;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getListeBilans($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getListeBilansResult);
|
|
|
|
}
|
2011-04-19 07:44:15 +00:00
|
|
|
return $reponse->getListeBilansResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-04-19 07:44:15 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 07:44:15 +00:00
|
|
|
/**
|
|
|
|
* getBilan
|
|
|
|
* @param string $siren
|
|
|
|
* @param unknown_type $millesime
|
|
|
|
* @param unknown_type $typeBilan
|
|
|
|
* @param unknown_type $ref
|
|
|
|
*/
|
2011-05-24 09:45:49 +00:00
|
|
|
public function getBilan($siren, $millesime, $typeBilan, $ref)
|
|
|
|
{
|
2011-05-24 09:57:40 +00:00
|
|
|
$filename = 'bilan-'.$siren.'-'.$millesime.'-'.$typeBilan.'-'.$ref;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-24 09:45:49 +00:00
|
|
|
$params = new StdClass;
|
2011-04-19 07:44:15 +00:00
|
|
|
$params->siren = $siren;
|
|
|
|
$params->millesime = $millesime;
|
|
|
|
$params->typeBilan = $typeBilan;
|
|
|
|
$params->ref = $ref;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getBilan($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getBilanResult);
|
|
|
|
}
|
2011-04-19 07:44:15 +00:00
|
|
|
return $reponse->getBilanResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-04-19 07:44:15 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 07:41:24 +00:00
|
|
|
/**
|
|
|
|
* getBanques
|
|
|
|
* @param string $siren
|
|
|
|
*/
|
2011-05-24 09:45:49 +00:00
|
|
|
public function getBanques($siren)
|
|
|
|
{
|
|
|
|
$filename = 'banques-'.$siren;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-24 09:45:49 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-05-24 09:45:49 +00:00
|
|
|
$params = new StdClass;
|
2011-04-19 07:41:24 +00:00
|
|
|
$params->siren = $siren;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getBanques($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getBanquesResult);
|
|
|
|
}
|
2011-04-19 07:41:24 +00:00
|
|
|
return $reponse->getBanquesResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-04-19 07:41:24 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 07:41:24 +00:00
|
|
|
/**
|
|
|
|
* getInfosBourse
|
|
|
|
* @param string $siren
|
|
|
|
*/
|
2011-05-24 09:45:49 +00:00
|
|
|
public function getInfosBourse($siren)
|
|
|
|
{
|
|
|
|
$filename = 'infosbourse-'.$siren;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-24 09:45:49 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-05-24 09:45:49 +00:00
|
|
|
$params = new StdClass;
|
2011-04-19 07:41:24 +00:00
|
|
|
$params->siren = $siren;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getInfosBourse($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getInfosBourseResult);
|
|
|
|
}
|
2011-04-19 07:41:24 +00:00
|
|
|
return $reponse->getInfosBourseResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-31 12:13:19 +00:00
|
|
|
if ($fault->faultcode=='1030'){
|
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
2011-04-19 07:41:24 +00:00
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 07:14:04 +00:00
|
|
|
/**
|
|
|
|
* getRatios
|
|
|
|
* @param string $siren
|
|
|
|
* @param string $page
|
|
|
|
*/
|
|
|
|
public function getRatios($siren, $page = 'ratios')
|
|
|
|
{
|
2011-05-24 09:45:49 +00:00
|
|
|
$filename = 'ratios-'.$siren.'-'.$page;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-24 09:45:49 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-04-19 07:14:04 +00:00
|
|
|
$params = new StdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->page = $page;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getRatios($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getRatiosResult);
|
|
|
|
}
|
2011-04-19 07:14:04 +00:00
|
|
|
return $reponse->getRatiosResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-04-19 07:14:04 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
|
|
|
|
2011-04-19 06:23:20 +00:00
|
|
|
/**
|
|
|
|
* getDirigeants
|
|
|
|
* @param string $siren
|
|
|
|
* @param boolean $histo
|
|
|
|
*/
|
|
|
|
public function getDirigeants($siren, $histo=false)
|
|
|
|
{
|
2011-08-23 19:27:00 +00:00
|
|
|
$filename = 'dirigeants-'.$siren.'-'.intval($histo);
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-02 06:40:45 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-05-24 09:45:49 +00:00
|
|
|
$params = new StdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$params->histo = $histo;
|
2011-04-19 06:23:20 +00:00
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
2011-05-02 06:40:45 +00:00
|
|
|
$reponse = $client->getDirigeants($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getDirigeantsResult);
|
|
|
|
}
|
2011-04-19 06:23:20 +00:00
|
|
|
return $reponse->getDirigeantsResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-04-19 06:23:20 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-12-05 13:03:55 +00:00
|
|
|
/**
|
|
|
|
* getDirigeantsOp
|
|
|
|
* @param string $siren
|
|
|
|
*/
|
|
|
|
public function getDirigeantsOp($siren)
|
|
|
|
{
|
|
|
|
$filename = 'dirigeantsop-'.$siren;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-12-05 13:03:55 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-12-05 13:03:55 +00:00
|
|
|
$params = new StdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getDirigeantsOp($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getDirigeantsOpResult);
|
|
|
|
}
|
2011-12-05 13:03:55 +00:00
|
|
|
return $reponse->getDirigeantsOpResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2012-02-08 19:34:58 +00:00
|
|
|
/**
|
|
|
|
* getIdentiteLight
|
|
|
|
* @param string $siret
|
|
|
|
* @param int $id
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getIdentiteLight($siret, $id = 0)
|
|
|
|
{
|
|
|
|
$filename = 'identitelight-'.$siret.'-'.$id;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2012-02-08 19:34:58 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2012-02-08 19:34:58 +00:00
|
|
|
$params = new StdClass();
|
|
|
|
$params->siret = $siret;
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getIdentiteLight($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getIdentiteLightResult);
|
|
|
|
}
|
2012-02-08 19:34:58 +00:00
|
|
|
return $reponse->getIdentiteLightResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-14 13:12:50 +00:00
|
|
|
/**
|
|
|
|
* getIdentite
|
|
|
|
* @param string $siret
|
|
|
|
* @param int $id
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getIdentite($siret, $id = 0)
|
|
|
|
{
|
2011-05-02 06:40:45 +00:00
|
|
|
$filename = 'identite-'.$siret.'-'.$id;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-04-28 10:26:36 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-05-24 09:45:49 +00:00
|
|
|
$params = new StdClass();
|
|
|
|
$params->siret = $siret;
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('entreprise');
|
2011-04-14 13:12:50 +00:00
|
|
|
try {
|
|
|
|
$reponse = $client->getIdentite($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getIdentiteResult);
|
|
|
|
}
|
2011-04-14 13:12:50 +00:00
|
|
|
return $reponse->getIdentiteResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2013-05-14 09:32:08 +00:00
|
|
|
if (in_array($fault->getCode(), '1020')) {
|
|
|
|
return $fault->getMessage();
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
2011-04-14 13:12:50 +00:00
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 08:45:19 +00:00
|
|
|
/**
|
|
|
|
* getIdentiteProcol
|
|
|
|
* @param string $siret
|
|
|
|
* @param int $id
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getIdentiteProcol($siret, $id = 0)
|
|
|
|
{
|
|
|
|
$filename = 'identiteprocol-'.$siret.'-'.$id;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-06-14 08:45:19 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-06-14 08:45:19 +00:00
|
|
|
$params = new StdClass();
|
|
|
|
$params->siret = $siret;
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getIdentiteProcol($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getIdentiteProcolResult);
|
|
|
|
}
|
2011-06-14 08:45:19 +00:00
|
|
|
return $reponse->getIdentiteProcolResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-06-14 08:45:19 +00:00
|
|
|
throw new Zend_Soap_Client_Exception($fault);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2012-11-15 13:30:33 +00:00
|
|
|
/**
|
|
|
|
* getLiensById
|
|
|
|
* @param int $id
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getLiensById($id)
|
|
|
|
{
|
|
|
|
$filename = 'liensbyid-'.$id;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2012-11-15 13:30:33 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2012-11-15 13:30:33 +00:00
|
|
|
$params = new StdClass();
|
|
|
|
$params->id = $id;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getLiensById($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getLiensByIdResult);
|
|
|
|
}
|
2012-11-15 15:41:35 +00:00
|
|
|
return $reponse->getLiensByIdResult;
|
2012-11-15 13:30:33 +00:00
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
if ($fault->getCode()=='MSG') {
|
|
|
|
return $fault->getMessage();
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-18 15:25:26 +00:00
|
|
|
/**
|
|
|
|
* getLiens
|
|
|
|
* @param string $siren
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getLiens($siren)
|
|
|
|
{
|
2011-05-24 09:45:49 +00:00
|
|
|
$filename = 'liens-'.$siren;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-24 09:45:49 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-04-18 15:25:26 +00:00
|
|
|
$params = new StdClass();
|
|
|
|
$params->siren = $siren;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getLiens($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getLiensResult);
|
|
|
|
}
|
2011-04-18 15:25:26 +00:00
|
|
|
return $reponse->getLiensResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2012-11-14 13:14:55 +00:00
|
|
|
if ($fault->getCode()=='MSG') {
|
|
|
|
return $fault->getMessage();
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
2011-04-18 15:25:26 +00:00
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-18 15:25:26 +00:00
|
|
|
/**
|
|
|
|
* getListeEvenements
|
|
|
|
* @param string $siren
|
|
|
|
* @param string $nic
|
|
|
|
* @param integer $position
|
|
|
|
* @param integer $nbRep
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getListeEvenements($siren, $nic=0, $position=0, $nbRep=200)
|
|
|
|
{
|
2011-05-24 09:45:49 +00:00
|
|
|
$filename = 'listeevenements-'.$siren.'-'.$nic.'-'.$position.'-'.$nbRep;
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-24 09:45:49 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-05-24 09:45:49 +00:00
|
|
|
$params = new stdClass();
|
2011-04-18 15:25:26 +00:00
|
|
|
$params->siren = $siren;
|
|
|
|
$params->nic = $nic;
|
|
|
|
$params->position = $position;
|
|
|
|
$params->nbRep = $nbRep;
|
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getListeEvenements($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getListeEvenementsResult);
|
|
|
|
}
|
2011-04-18 15:25:26 +00:00
|
|
|
return $reponse->getListeEvenementsResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-04-18 15:25:26 +00:00
|
|
|
return false;
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-18 15:25:26 +00:00
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-18 15:25:26 +00:00
|
|
|
/**
|
|
|
|
* getListeEtablissements
|
|
|
|
* @param string $siren
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2013-03-28 17:18:00 +00:00
|
|
|
public function getListeEtablissements($siren, $actif = -1, $position = 0)
|
2011-04-18 15:25:26 +00:00
|
|
|
{
|
2013-03-28 17:18:00 +00:00
|
|
|
$filename = 'listeetablissements-'.$siren.'-'.$position;
|
2011-10-06 10:09:31 +00:00
|
|
|
if ($actif != -1){
|
|
|
|
$filename.= '-'.$actif;
|
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache = new Cache($filename);
|
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
|
|
|
return $cache->getBlock();
|
|
|
|
}
|
2011-05-24 09:45:49 +00:00
|
|
|
}
|
2013-05-23 13:42:00 +00:00
|
|
|
|
2011-05-24 09:45:49 +00:00
|
|
|
$params = new StdClass();
|
2011-04-18 15:25:26 +00:00
|
|
|
$params->siren = $siren;
|
|
|
|
$params->dep = 0;
|
2011-04-22 13:30:35 +00:00
|
|
|
$params->actif = $actif;
|
2013-03-28 17:18:00 +00:00
|
|
|
$params->position = $position;
|
|
|
|
$params->nbRep = 200;
|
2011-04-18 15:25:26 +00:00
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
|
|
|
$reponse = $client->getListeEtablissements($params);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($this->cacheWrite) {
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getListeEtablissementsResult);
|
|
|
|
}
|
2011-04-18 15:25:26 +00:00
|
|
|
return $reponse->getListeEtablissementsResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-04-18 15:25:26 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-11 14:20:26 +00:00
|
|
|
/**
|
2011-06-30 15:48:07 +00:00
|
|
|
* searchEntreprise
|
2012-04-25 15:33:09 +00:00
|
|
|
* @param array $criteres
|
|
|
|
* @param int $position
|
|
|
|
* @param int $nbRep
|
|
|
|
* @param int $actif
|
2011-04-11 14:20:26 +00:00
|
|
|
*/
|
2012-01-24 16:13:18 +00:00
|
|
|
public function searchEntreprise($criteres, $position = 0, $nbRep = null)
|
2011-04-11 14:20:26 +00:00
|
|
|
{
|
|
|
|
$params = new StdClass;
|
2011-06-30 15:48:07 +00:00
|
|
|
$params->criteres = new StdClass;
|
|
|
|
$params->criteres->identifiant = $criteres['identifiant'];
|
|
|
|
$params->criteres->raisonSociale = $criteres['raisonSociale'];
|
|
|
|
$params->criteres->adresse = $criteres['adresse'];
|
|
|
|
$params->criteres->codePostal = $criteres['codePostal'];
|
|
|
|
$params->criteres->ville = $criteres['ville'];
|
|
|
|
$params->criteres->telFax = $criteres['telFax'];
|
|
|
|
$params->criteres->naf = $criteres['naf'];
|
|
|
|
$params->criteres->siege = false;
|
2012-04-25 15:33:09 +00:00
|
|
|
$params->criteres->actif = in_array($criteres['actif'], array(0,1,2)) ? $criteres['actif'] : 2;
|
2013-05-14 09:32:08 +00:00
|
|
|
$params->criteres->fj = $criteres['fj'];
|
2011-04-11 14:20:26 +00:00
|
|
|
$params->position = $position;
|
2012-01-24 16:13:18 +00:00
|
|
|
$params->nbRep = empty($nbRep) ? $this->nbReponses : $nbRep ;
|
2011-04-11 14:20:26 +00:00
|
|
|
$client = $this->loadClient('entreprise');
|
|
|
|
try {
|
2011-06-30 15:48:07 +00:00
|
|
|
$reponse = $client->searchEntreprise($params);
|
|
|
|
return $reponse->searchEntrepriseResult;
|
2011-04-11 14:20:26 +00:00
|
|
|
} catch (SoapFault $fault) {
|
2011-09-06 06:48:54 +00:00
|
|
|
if (in_array($fault->faultcode, array('1010', '1020'))){
|
2011-09-02 14:46:43 +00:00
|
|
|
return $fault->faultstring;
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
2011-04-11 14:20:26 +00:00
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-30 15:48:07 +00:00
|
|
|
/**
|
|
|
|
* setCmdAsso
|
|
|
|
* @param unknown_type $infosCommande
|
|
|
|
* @param unknown_type $infosDemandeur
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2011-06-29 16:07:23 +00:00
|
|
|
public function setCmdAsso($infosCommande, $infosDemandeur)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->infosCommande = $infosCommande;
|
|
|
|
$params->infosDemandeur = $infosDemandeur;
|
|
|
|
try {
|
|
|
|
$client = $this->loadClient('interne');
|
|
|
|
$reponse = $client->setCmdAsso($params);
|
|
|
|
return $reponse->setCmdAssoResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-06-29 16:07:23 +00:00
|
|
|
Zend_Registry::get('firebug')->info($fault);
|
|
|
|
//Placer exception pour affichage message
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-29 07:14:04 +00:00
|
|
|
/**
|
|
|
|
* Enregistre ou modifie un client
|
|
|
|
* @param unknown_type $infos
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2011-10-06 10:09:31 +00:00
|
|
|
public function setClient($infos)
|
2011-06-29 07:14:04 +00:00
|
|
|
{
|
|
|
|
$params = new stdClass();
|
2011-10-06 10:09:31 +00:00
|
|
|
$params->infos = json_encode($infos);
|
2011-06-29 07:14:04 +00:00
|
|
|
try {
|
2011-10-17 07:15:09 +00:00
|
|
|
$client = $this->loadClient('gestion');
|
2011-06-29 07:14:04 +00:00
|
|
|
$reponse = $client->setClient($params);
|
|
|
|
return $reponse->setClientResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-06-29 07:14:04 +00:00
|
|
|
Zend_Registry::get('firebug')->info($fault);
|
|
|
|
//Placer exception pour affichage message
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2011-04-11 14:20:26 +00:00
|
|
|
|
2011-05-03 12:56:06 +00:00
|
|
|
/**
|
|
|
|
* setInfosLogin
|
|
|
|
* @param string $login
|
|
|
|
* @param string $action
|
2012-07-16 13:25:23 +00:00
|
|
|
* @param array $infos
|
2011-05-03 12:56:06 +00:00
|
|
|
*/
|
|
|
|
public function setInfosLogin($login, $action, $infos = null)
|
|
|
|
{
|
|
|
|
$params = new stdClass();
|
|
|
|
$params->login = $login;
|
|
|
|
$params->action = $action;
|
2012-07-16 13:25:23 +00:00
|
|
|
if ($infos !== null ) {
|
|
|
|
$params->infos = json_encode($infos);
|
|
|
|
}
|
2011-05-03 12:56:06 +00:00
|
|
|
try {
|
2011-10-17 07:15:09 +00:00
|
|
|
$client = $this->loadClient('gestion');
|
2011-05-03 12:56:06 +00:00
|
|
|
$reponse = $client->setInfosLogin($params);
|
|
|
|
return $reponse->setInfosLoginResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2013-02-18 16:41:40 +00:00
|
|
|
if (in_array($fault->getCode(),array('MSG','ERR'))) {
|
|
|
|
return $fault->getMessage();
|
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
Zend_Registry::get('firebug')->info($fault);
|
|
|
|
//Placer exception pour affichage message
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2011-05-03 12:56:06 +00:00
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-11 14:20:26 +00:00
|
|
|
/**
|
|
|
|
* getInfosLogin
|
2011-04-28 10:26:36 +00:00
|
|
|
* @param string $login
|
|
|
|
* @param string $ipUtilisateur
|
2011-04-11 14:20:26 +00:00
|
|
|
*/
|
|
|
|
public function getInfosLogin($login, $ipUtilisateur = '')
|
|
|
|
{
|
2011-01-06 08:37:20 +00:00
|
|
|
$params = new stdClass();
|
|
|
|
$params->login = $login;
|
|
|
|
$params->ipUtilisateur = $ipUtilisateur;
|
2011-01-07 17:16:07 +00:00
|
|
|
try {
|
2011-10-17 07:15:09 +00:00
|
|
|
$client = $this->loadClient('gestion');
|
|
|
|
$reponse = $client->getInfosLogin($params);
|
2011-01-07 17:16:07 +00:00
|
|
|
return $reponse->getInfosLoginResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2012-05-20 16:31:28 +00:00
|
|
|
if (substr($fault->faultcode,0,1)=='0'){
|
2012-02-28 17:09:28 +00:00
|
|
|
return $fault->faultstring;
|
2011-08-30 14:46:40 +00:00
|
|
|
} else {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
return false;
|
|
|
|
}
|
2011-01-07 17:16:07 +00:00
|
|
|
}
|
2011-01-06 08:37:20 +00:00
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-11 14:20:26 +00:00
|
|
|
/**
|
|
|
|
* getNextLogin
|
2012-08-16 11:37:59 +00:00
|
|
|
* @param int $idClient
|
2011-04-11 14:20:26 +00:00
|
|
|
*/
|
2012-08-16 11:37:59 +00:00
|
|
|
public function getNextLogin($idClient)
|
2011-04-11 14:20:26 +00:00
|
|
|
{
|
2011-04-01 12:14:40 +00:00
|
|
|
$params = new stdClass();
|
2012-08-16 11:37:59 +00:00
|
|
|
$params->idClient = $idClient;
|
2011-04-01 12:14:40 +00:00
|
|
|
try {
|
2011-10-17 07:15:09 +00:00
|
|
|
$client = $this->loadClient('gestion');
|
2011-04-01 12:14:40 +00:00
|
|
|
$reponse = $client->getNextLogin($params);
|
2012-08-16 11:37:59 +00:00
|
|
|
Zend_Registry::get('firebug')->info($reponse);
|
2011-04-01 12:14:40 +00:00
|
|
|
return $reponse->getNextLoginResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2012-08-16 11:37:59 +00:00
|
|
|
Zend_Registry::get('firebug')->info($fault);
|
2011-04-01 12:14:40 +00:00
|
|
|
//Placer exception pour affichage message
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2013-03-06 10:04:28 +00:00
|
|
|
/**
|
|
|
|
* getLogs
|
|
|
|
*/
|
|
|
|
public function getLogs()
|
|
|
|
{
|
|
|
|
$filename = 'logs';
|
|
|
|
$cache = new Cache($filename);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
2013-03-06 10:04:28 +00:00
|
|
|
return $cache->getBlock('logs');
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
$client = $this->loadClient('gestion');
|
|
|
|
$reponse = $client->getLogs();
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getLogsResult);
|
|
|
|
return $reponse->getLogsResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
//Placer exception pour affichage message
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-11 14:20:26 +00:00
|
|
|
/**
|
|
|
|
* getListePrefs
|
|
|
|
*/
|
|
|
|
public function getListePrefs()
|
|
|
|
{
|
2011-05-03 15:43:40 +00:00
|
|
|
$filename = 'prefs';
|
|
|
|
$cache = new Cache($filename);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
2011-05-03 15:43:40 +00:00
|
|
|
return $cache->getBlock('prefs');
|
|
|
|
}
|
2011-04-01 12:14:40 +00:00
|
|
|
try {
|
2011-10-17 07:15:09 +00:00
|
|
|
$client = $this->loadClient('gestion');
|
2011-04-01 12:14:40 +00:00
|
|
|
$reponse = $client->getListePrefs();
|
2011-05-03 15:43:40 +00:00
|
|
|
$cache->deletefile();
|
2011-06-08 08:22:13 +00:00
|
|
|
$cache->setBlock($reponse->getListePrefsResult);
|
2011-04-01 12:14:40 +00:00
|
|
|
return $reponse->getListePrefsResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-04-01 12:14:40 +00:00
|
|
|
//Placer exception pour affichage message
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-11 14:20:26 +00:00
|
|
|
/**
|
|
|
|
* getListeDroits
|
|
|
|
*/
|
|
|
|
public function getListeDroits()
|
|
|
|
{
|
2011-05-03 15:43:40 +00:00
|
|
|
$filename = 'droits';
|
|
|
|
$cache = new Cache($filename);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
2011-05-03 15:43:40 +00:00
|
|
|
return $cache->getBlock('droits');
|
|
|
|
}
|
2011-04-01 12:14:40 +00:00
|
|
|
try {
|
2011-10-17 07:15:09 +00:00
|
|
|
$client = $this->loadClient('gestion');
|
2011-04-01 12:14:40 +00:00
|
|
|
$reponse = $client->getListeDroits();
|
2011-05-03 15:43:40 +00:00
|
|
|
$cache->deletefile();
|
2011-06-08 08:22:13 +00:00
|
|
|
$cache->setBlock($reponse->getListeDroitsResult);
|
2011-04-01 12:14:40 +00:00
|
|
|
return $reponse->getListeDroitsResult;
|
|
|
|
} catch (SoapFault $fault) {
|
2011-08-11 15:12:56 +00:00
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
2011-04-01 12:14:40 +00:00
|
|
|
//Placer exception pour affichage message
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2011-04-11 14:20:26 +00:00
|
|
|
|
2012-09-21 15:10:32 +00:00
|
|
|
/**
|
|
|
|
* getCategory
|
|
|
|
*/
|
|
|
|
public function getCategory()
|
|
|
|
{
|
|
|
|
$filename = 'category';
|
|
|
|
$cache = new Cache($filename);
|
2013-05-23 13:42:00 +00:00
|
|
|
if ($cache->exist() && $this->cacheEnable ){
|
2012-09-21 15:10:32 +00:00
|
|
|
return $cache->getBlock('category');
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
$client = $this->loadClient('gestion');
|
|
|
|
$reponse = $client->getCategory();
|
|
|
|
$cache->deletefile();
|
|
|
|
$cache->setBlock($reponse->getCategoryResult);
|
|
|
|
return $reponse->getCategoryResult;
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
|
|
|
//Placer exception pour affichage message
|
|
|
|
return false;
|
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2012-09-21 15:10:32 +00:00
|
|
|
}
|
2013-01-15 17:14:31 +00:00
|
|
|
|
2011-04-11 14:20:26 +00:00
|
|
|
/**
|
|
|
|
* soaperror
|
2011-08-11 14:59:34 +00:00
|
|
|
* @param string $method
|
|
|
|
* @param soapfault $fault
|
2011-06-29 06:33:56 +00:00
|
|
|
* @param string $requete
|
|
|
|
* @param string $reponse
|
2011-04-11 14:20:26 +00:00
|
|
|
*/
|
2011-08-11 14:59:34 +00:00
|
|
|
protected function soaperror($method, $fault, $requete, $reponse)
|
2011-04-11 14:20:26 +00:00
|
|
|
{
|
2011-04-19 07:14:04 +00:00
|
|
|
$message = '';
|
2011-06-29 06:33:56 +00:00
|
|
|
$message.= 'Erreur SOAP - Code : '.$fault->faultcode.' - Message : '.$fault->faultstring;
|
2011-08-12 14:56:57 +00:00
|
|
|
$message.= ' - Utilisateur : '.$this->login;
|
2011-11-17 13:38:58 +00:00
|
|
|
$message.= "\n\n";
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-08-12 14:56:57 +00:00
|
|
|
$message.= "Method : ".$method.", File :".$fault->getFile().", Ligne : ".$fault->getLine();
|
2011-11-17 13:38:58 +00:00
|
|
|
$message.= "\n\n";
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-08-12 14:56:57 +00:00
|
|
|
$message.= "Detail :\n".$fault->getTraceAsString();
|
|
|
|
$message.= "\n\n";
|
2011-11-17 13:38:58 +00:00
|
|
|
|
2013-10-04 12:41:24 +00:00
|
|
|
if ( $controller = Zend_Controller_Front::getInstance() ) {
|
|
|
|
$message.= "Request Parameters :\n ".print_r($controller->getRequest()->getParams(), true);
|
|
|
|
$message.= "\n\n";
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2012-02-08 09:25:32 +00:00
|
|
|
$message.= "Referer : ".$_SERVER['HTTP_REFERER']."\n\n";
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-08-11 14:59:34 +00:00
|
|
|
$message.= "Requete :\n ".$requete."\n";
|
2012-05-20 16:31:28 +00:00
|
|
|
$message.= "Reponse :\n ".$reponse."\n";
|
2012-11-05 15:33:01 +00:00
|
|
|
$c = Zend_Registry::get('config');
|
2013-10-25 14:30:46 +00:00
|
|
|
$mail = new Scores_Mail();
|
2012-11-16 14:12:03 +00:00
|
|
|
$mail->setSubject('[ERREUR SOAP] - '.$c->profil->server->name.' -'.date('Ymd'));
|
2011-08-11 15:12:56 +00:00
|
|
|
$mail->setBodyTexte($message);
|
2011-06-29 06:33:56 +00:00
|
|
|
$mail->setFrom('supportdev');
|
|
|
|
$mail->addToKey('supportdev');
|
2011-04-11 14:20:26 +00:00
|
|
|
$mail->send();
|
|
|
|
}
|
2012-07-30 09:35:19 +00:00
|
|
|
}
|