Nouvelles méthodes sympathiques

This commit is contained in:
Michael RICOIS 2015-05-28 14:31:47 +00:00
parent 9f2f33a6b8
commit 32fda6256e
4 changed files with 212 additions and 0 deletions

View File

@ -68,4 +68,6 @@ return array(
'ScoresHisto' => 'ScoresHisto',
'EtablissementsGeoReturn' => 'EtablissementsGeoReturn',
'EtablissementGeo' => 'EtablissementGeo',
'RncsEven' => 'RncsEven',
'RncsJugement' => 'RncsJugement',
);

View File

@ -2884,4 +2884,84 @@ class Interne extends Scores_Ws_Server
$output->result = $result;
return $output;
}
/**
* Liste des événements RNCS
* @param string $companyId
* @throws SoapFault
* @return RncsEven[]
*/
public function getRncsEven($companyId)
{
$this->authenticate();
try {
$db = Zend_Db_Table_Abstract::getDefaultAdapter();
$db->setFetchMode(Zend_Db::FETCH_OBJ);
$sql = $db->select()->from('rncs_even', '*', 'jo')
->join('tabEvenRncs', 'rncs_even.codeEven = tabEvenRncs.codeEven', array('libEven'), 'jo')
->where('rncs_even.siren=?', $companyId);
$result = $db->fetchAll($sql);
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient==1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
$evenList = array();
if (count($result) > 0) {
foreach ($result as $item) {
$even = new RncsEven();
$even->Code = $item->codeEven;
$even->Label = $item->libEven;
$even->Date = $item->dateDepot;
$evenList[] = $even;
}
}
return $evenList;
}
/**
* Liste des jugements RNCS
* @param string $companyId
* @throws SoapFault
* @return RncsJugement[]
*/
public function getRncsJugement($companyId)
{
$this->authenticate();
try {
$db = Zend_Db_Table_Abstract::getDefaultAdapter();
$db->setFetchMode(Zend_Db::FETCH_OBJ);
$sql = $db->select()->from('rncs_jugements', array('siren', 'dateEffet', 'typeDate', 'dateInsert'), 'jo')
->join('tabJugeRncs', 'rncs_jugements.codeJugement = tabJugeRncs.codJugement', array('libJugement'), 'jo')
->where('rncs_jugements.siren=?', $companyId);
$result = $db->fetchAll($sql);
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient==1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
$evenList = array();
if (count($result) > 0) {
foreach ($result as $item) {
$even = new RncsJugement();
$even->Code = $item->codeJugment;
$even->Label = $item->libJugement;
$event->Type = $item->typeDate;
$even->Date = $item->dateEffet;
$evenList[] = $even;
}
}
return $evenList;
}
}

View File

@ -2884,4 +2884,84 @@ class Interne extends Scores_Ws_Server
$output->result = $result;
return $output;
}
/**
* Liste des événements RNCS
* @param string $companyId
* @throws SoapFault
* @return RncsEven[]
*/
public function getRncsEven($companyId)
{
$this->authenticate();
try {
$db = Zend_Db_Table_Abstract::getDefaultAdapter();
$db->setFetchMode(Zend_Db::FETCH_OBJ);
$sql = $db->select()->from('rncs_even', '*', 'jo')
->join('tabEvenRncs', 'rncs_even.codeEven = tabEvenRncs.codeEven', array('libEven'), 'jo')
->where('rncs_even.siren=?', $companyId);
$result = $db->fetchAll($sql);
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient==1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
$evenList = array();
if (count($result) > 0) {
foreach ($result as $item) {
$even = new RncsEven();
$even->Code = $item->codeEven;
$even->Label = $item->libEven;
$even->Date = $item->dateDepot;
$evenList[] = $even;
}
}
return $evenList;
}
/**
* Liste des jugements RNCS
* @param string $companyId
* @throws SoapFault
* @return RncsJugement[]
*/
public function getRncsJugement($companyId)
{
$this->authenticate();
try {
$db = Zend_Db_Table_Abstract::getDefaultAdapter();
$db->setFetchMode(Zend_Db::FETCH_OBJ);
$sql = $db->select()->from('rncs_jugements', array('siren', 'codeJugement', 'dateEffet', 'typeDate', 'dateInsert'), 'jo')
->join('tabJugeRncs', 'rncs_jugements.codeJugement = tabJugeRncs.codJugement', array('libJugement'), 'jo')
->where('rncs_jugements.siren=?', $companyId);
$result = $db->fetchAll($sql);
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient==1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
$evenList = array();
if (count($result) > 0) {
foreach ($result as $item) {
$even = new RncsJugement();
$even->Code = $item->codeJugement;
$even->Label = $item->libJugement;
$even->Type = $item->typeDate;
$even->Date = $item->dateEffet;
$evenList[] = $even;
}
}
return $evenList;
}
}

View File

@ -1754,4 +1754,54 @@ class EtablissementGeo
* @var string
*/
public $GeoPrecis;
}
class RncsEven
{
/**
*
* @var string
*/
public $Code;
/**
*
* @var string
*/
public $Label;
/**
*
* @var string
*/
public $Date;
}
class RncsJugement
{
/**
*
* @var string
*/
public $Code;
/**
*
* @var string
*/
public $Label;
/**
*
* @var string
*/
public $Type;
/**
*
* @var string
*/
public $Date;
}