Issue #0001833:
This commit is contained in:
parent
790aa91b56
commit
debe30b5a7
6
application/models/Sdv1GreffeCommandesKb.php
Normal file
6
application/models/Sdv1GreffeCommandesKb.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1GreffeCommandesKb extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'greffe_commandes_kb';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -8,11 +8,13 @@ class Pieces extends WsScore
|
||||
* Récupération d'un kbis
|
||||
* @param string $siren
|
||||
* SIREN
|
||||
* @param string $options
|
||||
* To define
|
||||
* @param string $diffusion
|
||||
* Mode de diffusion (M|C)
|
||||
* @param string $reference
|
||||
* Reference du client
|
||||
* @return string
|
||||
*/
|
||||
public function getKbis($siren, $options = '')
|
||||
public function getKbis($siren, $diffusion, $reference = '')
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('KBIS');
|
||||
@ -24,6 +26,28 @@ class Pieces extends WsScore
|
||||
$this->sendError('1020');
|
||||
}
|
||||
|
||||
switch ( $diffusion ) {
|
||||
|
||||
case 'M':
|
||||
case 'C':
|
||||
$refCommande = uniqid();
|
||||
|
||||
$iInsee = new MInsee();
|
||||
$identite = $iInsee->getIdentiteLight($siren);
|
||||
|
||||
$commande = new Application_Model_Sdv1GreffeCommandesKb();
|
||||
$id = $commande->insert(array(
|
||||
'refCommande' => $refCommande,
|
||||
'login' => $this->tabInfoUser['login'],
|
||||
'email' => $this->tabInfoUser['email'],
|
||||
'refClient' => $reference,
|
||||
'mode' => $diffusion,
|
||||
'siren' => $siren,
|
||||
'raisonSociale' => $identite['Nom'],
|
||||
'dateInsert' => date('YmdHis'),
|
||||
));
|
||||
break;
|
||||
default:
|
||||
$hostname = 'http://'.$_SERVER['SERVER_NAME'];
|
||||
if ($_SERVER['SERVER_PORT']!='80'){
|
||||
$hostname.= ':'.$_SERVER['SERVER_PORT'];
|
||||
@ -89,6 +113,7 @@ class Pieces extends WsScore
|
||||
return $hostname.DOC_WEB_URL.'kbis/'.basename($filepdf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste des bilans disponible au format image
|
||||
|
Loading…
Reference in New Issue
Block a user