extranet/library/Scores/Ws/Saisie.php
2014-04-24 10:46:36 +00:00

511 lines
14 KiB
PHP

<?php
class Scores_Ws_Saisie extends Scores_Ws_Abstract
{
/**
* getMandataire
* @param string $idMand
*/
public function getMandataire($idMand)
{
$params = new stdClass();
$params->id = $idMand;
$client = $this->loadClient('saisie');
try {
$reponse = $client->getMandataire($params);
return $reponse->getMandataireResult;
} catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}
/**
* 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;
$client = $this->loadClient('saisie');
try {
$reponse = $client->dupliqueAnnonce($params);
return $reponse->dupliqueAnnonceResult;
} catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}
/**
* Enter description here ...
* @param string $siret
* @param integer $id
* @param array $infos
* @return boolean
*/
public function setInfosEntrep($siret, $id, $infos)
{
$params = new stdClass();
$params->siret = $siret;
$params->idEntreprise = $siret;
$params->infos = json_encode($infos);
$client = $this->loadClient('saisie');
try {
$reponse = $client->setInfosEntrep($params);
return $reponse->setInfosEntrepResult;
} catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}
/**
* Enter description here ...
* @param unknown_type $idAnn
* @param unknown_type $siret
*/
public function supprAnnonceCollecte($idAnn, $siret = '')
{
$params = new stdClass();
$params->idAnn= $idAnn;
$params->siret= $siret;
$client = $this->loadClient('saisie');
try {
$reponse = $client->supprAnnonceCollecte($params);
return $reponse->supprAnnonceCollecteResult;
} catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}
/**
* 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;
$client = $this->loadClient('saisie');
try {
$reponse = $client->supprAnnonce($params);
return $reponse->supprAnnonceResult;
} catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}
/**
* 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;
}
}
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;
}
}
}
public function setBilan($siren, $unite, $dateCloture, $dureeMois, $dateCloturePre, $dureeMoisPre, $typeBilan, $postes, $step = 'normal')
{
$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;
$params->data->postes = $postes;
$params->step = $step;
$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;
}
}
}
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;
}
}
}
public function searchLienRef($query, $type = null)
{
$params = new stdClass();
$params->query = $query;
$params->type = $type;
$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;
}
}
}
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;
}
}
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;
}
}
}
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;
}
}
}
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;
}
}
}
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;
}
}
}
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;
}
}
}
/**
* 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;
}
}
/**
* 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;
}
}
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;
}
}
}
/**
* Set Score Cut Off
* @param string $siren
* @param int $encours
* @param int $scoreSolv
* @param int $scoreDir
* @param int $scoreConf
* @param string $remarque
* @param boolean delete
* @return boolean
*/
public function setScoreCutoff($siren, $encours, $scoreSolv, $scoreDir, $scoreConf, $remarque, $delete)
{
$infos = array(
'siren' => $siren,
'encours' => $encours,
'scoreSolv' => $scoreSolv,
'scoreDir' => $scoreDir,
'scoreConf' => $scoreConf,
'remarque' => $remarque,
);
$params = new stdClass();
$params->infos = json_encode($infos);
$params->delete = $delete;
$client = $this->loadClient('saisie');
try {
$reponse = $client->setScoreCutoff($params);
return $reponse->setScoreCutoffResult;
} catch (SoapFault $fault) {
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
return $fault->faultstring;
}
}
public function getLienDoc($id, $type = null, $groupe = false)
{
$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;
}
}
/**
* getDirigeantsOp
* @param string $siren
*/
public function getDirigeantsOp($siren, $id = null)
{
$filename = 'dirigeantsop-'.$siren.'-'.intval($id);
if ($this->cacheWrite) {
$cache = new Cache($filename);
if ($cache->exist() && $this->cacheEnable ){
return $cache->getBlock();
}
}
$params = new StdClass();
$params->siren = $siren;
$params->id = $id;
$client = $this->loadClient('interne');
try {
$reponse = $client->getDirigeantsOp($params);
if ($this->cacheWrite) {
$cache->deletefile();
$cache->setBlock($reponse->getDirigeantsOpResult);
}
return $reponse->getDirigeantsOpResult;
} catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}
/**
* setDirigeantsOp
* @param array $infos
*/
public function setDirigeantsOp($infos, $mode, $id)
{
$params = new stdClass();
$params->infos = $infos;
$params->mode = $mode;
$params->id = $id;
$client = $this->loadClient('saisie');
try {
$reponse = $client->setDirigeantsOp($params);
return $reponse->setDirigeantsOpResult;
} 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;
}
}
}
}