Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
275c302020 | ||
|
f3ba67be30 | ||
|
7111104200 | ||
|
225e3f403c | ||
|
c6143be377 | ||
|
7d7b1073ce | ||
|
726e5299ee | ||
|
c1c55c7671 | ||
|
a408b5ac01 | ||
|
742ead7a85 | ||
|
97bc6debe9 |
@ -97,10 +97,13 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
$router = $front->getRouter();
|
||||
|
||||
//Route pour prestations
|
||||
$route = new Zend_Controller_Router_Route('/id/:client/*', array(
|
||||
$route = new Zend_Controller_Router_Route(
|
||||
'/id/:client/*',
|
||||
array(
|
||||
'controller' => 'presta',
|
||||
'action' => 'index',
|
||||
));
|
||||
)
|
||||
);
|
||||
$router->addRoute('presta', $route);
|
||||
return $router;
|
||||
}
|
||||
|
11
application/autoload_classmap.php
Normal file
11
application/autoload_classmap.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
// Generated by ZF's ./bin/classmap_generator.php
|
||||
return array(
|
||||
'Bootstrap' => dirname(__FILE__) . '/Bootstrap.php',
|
||||
'DashboardController' => dirname(__FILE__) . '/controllers/DashboardController.php',
|
||||
'ErrorController' => dirname(__FILE__) . '/controllers/ErrorController.php',
|
||||
'IndexController' => dirname(__FILE__) . '/controllers/IndexController.php',
|
||||
'PrestaController' => dirname(__FILE__) . '/controllers/PrestaController.php',
|
||||
'ReportController' => dirname(__FILE__) . '/controllers/ReportController.php',
|
||||
'UserController' => dirname(__FILE__) . '/controllers/UserController.php',
|
||||
);
|
@ -48,7 +48,7 @@ class DashboardController extends Zend_Controller_Action
|
||||
//Lister les commandes OK eta = 0
|
||||
else {
|
||||
$commandM = new Application_Model_Command();
|
||||
$sql = $commandM->select()->where('eta = ?',0);
|
||||
$sql = $commandM->select()->order('dateInsert DESC');
|
||||
$this->view->Commands = $commandM->fetchAll($sql);
|
||||
//Télécharger le rapport
|
||||
//Regénérer le rapport
|
||||
|
267
application/controllers/DeliveryController.php
Normal file
267
application/controllers/DeliveryController.php
Normal file
@ -0,0 +1,267 @@
|
||||
<?php
|
||||
class DeliveryController extends Zend_Controller_Action
|
||||
{
|
||||
/**
|
||||
* Distribute pdf file
|
||||
*/
|
||||
public function pdfAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$file = false;
|
||||
|
||||
//Commande ID
|
||||
$cmdId = $request->getParam('id');
|
||||
|
||||
//Est ce que la commande existe
|
||||
$commandM = new Application_Model_Command();
|
||||
$where = $commandM->select()->where('cmdId=?', $cmdId);
|
||||
$row = $commandM->fetchRow($where);
|
||||
if ( $row !== null ) {
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$html = $c->profil->path->pages . '/' . $row->cmdId . '.html';
|
||||
|
||||
//Save the HTML file
|
||||
copy($html, $c->profil->path->data . '/' . $row->cmdId . '.html');
|
||||
|
||||
//Generate the PDF
|
||||
$pdf = new Scores_Wkhtml_Pdf();
|
||||
$file = $pdf->exec($html);
|
||||
|
||||
}
|
||||
|
||||
//Distribute it to the output
|
||||
if ( $file ) {
|
||||
if( file_exists($file) && filesize($file)>0 ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: application/pdf');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($file);
|
||||
} else {
|
||||
echo "Erreur lors de l'affichage du fichier.";
|
||||
}
|
||||
} else {
|
||||
echo "Erreur lors de la génération du fichier.";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Affichage du fichier Pdf généré pour la commande
|
||||
*/
|
||||
public function getcmdAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$cmdId = $request->getParam('id');
|
||||
$regen = $request->getParam('regen');
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
//If auth => file
|
||||
if ($auth->hasIdentity()
|
||||
//If REF and EMAIL and eta = 0, OK => file et commande moins d'un mois
|
||||
|
||||
) {
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
|
||||
//Regen command
|
||||
if ($regen !== null) {
|
||||
|
||||
$source = $c->profil->path->data . '/' . $cmdId . '.html';
|
||||
$dest = $c->profil->path->pages . '/' . $cmdId . '.html';
|
||||
copy($source, $dest);
|
||||
|
||||
//Generate the PDF
|
||||
$pdf = new Scores_Wkhtml_Pdf();
|
||||
$file = $pdf->exec($dest);
|
||||
}
|
||||
|
||||
//Serve the file
|
||||
$path = $c->profil->path->pages;
|
||||
$file = $path . DIRECTORY_SEPARATOR . $cmdId . '.pdf';
|
||||
if( file_exists($file) && filesize($file)>0 ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: application/pdf');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($file);
|
||||
} else {
|
||||
echo "Erreur lors de l'affichage du fichier.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create bill and send it as Pdf
|
||||
*/
|
||||
public function billAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$cmdId = $request->getParam('id');
|
||||
$regen = $request->getParam('regen');
|
||||
|
||||
//Selection de la commande
|
||||
$commandM = new Application_Model_Command();
|
||||
$sql = $commandM->select()->where('cmdId = ?',$cmdId);
|
||||
$row = $commandM->fetchRow($sql);
|
||||
|
||||
//Verif
|
||||
if ( $row !== null) {
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->data.'/bill/';
|
||||
|
||||
//Selection de la facture
|
||||
$billM = new Application_Model_ReportBill();
|
||||
$sql = $billM->select()->where('cmdId = ?', $cmdId);
|
||||
$bill = $billM->fetchRow($sql);
|
||||
|
||||
if ( $bill === null ) {
|
||||
$regen = true;
|
||||
} elseif ( empty($bill->file) ) {
|
||||
$regen = true;
|
||||
}
|
||||
|
||||
//Générer la facture
|
||||
if ( $regen !== null ) {
|
||||
|
||||
//Prepare information in database
|
||||
if ( $bill === null ) {
|
||||
$annee = substr($row->dateInsert, 0,4);
|
||||
$mois = substr($row->dateInsert, 5,2);
|
||||
|
||||
$lastItemSql = $billM->select()
|
||||
->where('annee=?', $annee)
|
||||
->where('mois=?', $mois)
|
||||
->order('num DESC')->limit(1);
|
||||
$lastItem = $billM->fetchRow($lastItemSql);
|
||||
$NumCmd = $lastItem->num + 1;
|
||||
$billM->insert(array(
|
||||
'cmdId' => $cmdId,
|
||||
'annee' => $annee,
|
||||
'mois' => $mois,
|
||||
'num' => $NumCmd,
|
||||
));
|
||||
} else {
|
||||
$NumCmd = $bill->num;
|
||||
}
|
||||
|
||||
//Set filename
|
||||
$file = 'bill-'.$cmdId.'-'.$NumCmd.'.pdf';
|
||||
|
||||
$date = new Zend_Date($row->dateInsert, 'yyyy-MM-dd HH:mm:ss');
|
||||
|
||||
//Create PDF
|
||||
//$pdf = new Zend_Pdf();
|
||||
//$pdf->load(APPLICATION_PATH . '/controllers/bill_modele.pdf');
|
||||
$pdf = Zend_Pdf::load(APPLICATION_PATH . '/controllers/bill_modele.pdf');
|
||||
|
||||
$page = $pdf->pages[0];
|
||||
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
|
||||
$page->setFont($font, 8);
|
||||
|
||||
//Numero de facture
|
||||
$page->drawText('P144.'.$date->toString('yy').'.'.$date->toString('MM').'.'.str_pad($NumCmd, 5, '0', STR_PAD_LEFT), 300, 720, 'UTF-8');
|
||||
//Date
|
||||
$page->drawText($date->toString('dd/MM/yyyy'), 390, 720, 'UTF-8');
|
||||
//Numéro client
|
||||
$page->drawText('P144.'.str_pad($NumCmd, 5, '0', STR_PAD_LEFT), 475, 720, 'UTF-8');
|
||||
|
||||
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
|
||||
$page->setFont($font, 10);
|
||||
//Prestataire
|
||||
$prestataireL1 = 'Scores & Décisions';
|
||||
$prestataireL2 = '1 rue de Clairefontaine';
|
||||
$prestataireL3 = '78120 Rambouillet';
|
||||
$prestataireL4 = 'Contact : compta@scores-decisions.com';
|
||||
$prestataireL5 = 'R.C.S. : 2008B04241 RCS Versailles';
|
||||
$prestataireL6 = 'N.I.I. : FR84 494967938';
|
||||
$page->drawText($prestataireL1, 60, 640, 'UTF-8');
|
||||
$page->drawText($prestataireL2, 60, 625, 'UTF-8');
|
||||
$page->drawText($prestataireL3, 60, 610, 'UTF-8');
|
||||
$page->drawText($prestataireL4, 60, 595, 'UTF-8');
|
||||
$page->drawText($prestataireL5, 60, 580, 'UTF-8');
|
||||
$page->drawText($prestataireL6, 60, 565, 'UTF-8');
|
||||
//Destinataire
|
||||
$destinataireL1 = strtoupper($row->rs);
|
||||
$destinataireL2 = strtoupper($row->nom . ' ' .$row->prenom);
|
||||
$destinataireL3 = '';
|
||||
$destinataireL4 = strtoupper($row->adresse);
|
||||
$destinataireL5 = strtoupper($row->cp . ' ' . $row->ville);
|
||||
$destinataireL6 = strtoupper($row->pays);
|
||||
$page->drawText($destinataireL1, 300, 640, 'UTF-8');
|
||||
$page->drawText($destinataireL2, 300, 625, 'UTF-8');
|
||||
$page->drawText($destinataireL3, 300, 610, 'UTF-8');
|
||||
$page->drawText($destinataireL4, 300, 595, 'UTF-8');
|
||||
$page->drawText($destinataireL5, 300, 580, 'UTF-8');
|
||||
$page->drawText($destinataireL6, 300, 565, 'UTF-8');
|
||||
//Article
|
||||
$page->drawText($date->toString('dd/MM/yyyy'), 60, 450, 'UTF-8');
|
||||
$page->drawText($row->cmdId, 150, 450, 'UTF-8');
|
||||
$page->drawText("Rapport financier", 250, 450, 'UTF-8');
|
||||
$page->drawText("1", 360, 450, 'UTF-8');
|
||||
$page->drawText(number_format($row->mt, 2).' €', 420, 450, 'UTF-8');
|
||||
$page->drawText(number_format($row->mt, 2).' €', 485, 450, 'UTF-8');
|
||||
//Summary TotalHT TVA MontantTVA TotalTTC NetAPayer
|
||||
$page->drawText(number_format($row->mt,2).' €', 90, 208, 'UTF-8');
|
||||
$page->drawText(number_format($row->tax,2).' %', 190, 208, 'UTF-8');
|
||||
|
||||
$mtTAX = $row->mt * $row->tax/100 ;
|
||||
$mtTTC = $mtNET = $row->mt * ( 1 + $row->tax/100 ) ;
|
||||
|
||||
$page->drawText(number_format($mtTAX,2).' €', 290, 208, 'UTF-8');
|
||||
$page->drawText(number_format($mtTTC,2).' €', 390, 208, 'UTF-8');
|
||||
$page->drawText(number_format($mtNET,2).' €', 490, 208, 'UTF-8');
|
||||
|
||||
//Mode de paiement
|
||||
$page->drawText("Paiement en ligne - Carte bancaire", 100, 134, 'UTF-8');
|
||||
//Date de paiement
|
||||
$page->drawText($date->toString('dd/MM/yyyy HH:mm:ss'), 370, 134, 'UTF-8');
|
||||
|
||||
$pdf->save($path.$file);
|
||||
|
||||
$billM->update(array('file' => $file), 'cmdId="'.$cmdId.'"');
|
||||
}
|
||||
//Distribuer la facture
|
||||
else {
|
||||
$file = $bill->file;
|
||||
}
|
||||
|
||||
//Display Bill
|
||||
if( file_exists($path.$file) && filesize($path.$file)>0 ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: application/pdf');
|
||||
header('Content-Length: ' . filesize($path.$file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
|
||||
header('Content-Disposition: filename="' . basename($path.$file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($path.$file);
|
||||
} else {
|
||||
echo "Erreur lors de l'affichage du fichier.";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
14
application/controllers/PaiementController.php
Normal file
14
application/controllers/PaiementController.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class PaiementController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function checkAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -6,14 +6,31 @@ class PrestaController extends Zend_Controller_Action
|
||||
$request = $this->getRequest();
|
||||
|
||||
$id = $request->getParam('client');
|
||||
$prestation = $request->getParam('p', 1);
|
||||
|
||||
switch($id) {
|
||||
//Prestation KOMPASS, livraison rapport pdf
|
||||
switch( $id ) {
|
||||
|
||||
// Prestation KOMPASS, livraison rapport pdf
|
||||
case '144':
|
||||
$siren = $request->getParam('siren');
|
||||
$url = '/report/index/siren/'.$siren;
|
||||
$url = '/report/index/siren/'.$siren.'/p/144-1';
|
||||
$this->redirect($url);
|
||||
break;
|
||||
|
||||
// Prestation CORPORAMA
|
||||
case '186':
|
||||
$siren = $request->getParam('siren');
|
||||
switch ( $prestation ) {
|
||||
case 1:
|
||||
$url = '/report/index/siren/'.$siren.'/p/186-1';
|
||||
break;
|
||||
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
$this->redirect($url);
|
||||
break;
|
||||
|
||||
default:
|
||||
//Erreur
|
||||
break;
|
||||
|
@ -1,18 +1,69 @@
|
||||
<?php
|
||||
class ReportController extends Zend_Controller_Action
|
||||
{
|
||||
protected $montant = 0;
|
||||
protected $montant;
|
||||
protected $montantht;
|
||||
protected $tva;
|
||||
protected $pLogin;
|
||||
protected $pPassword;
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->view->headLink()
|
||||
->appendStylesheet('/themes/default/css/justified-nav.css', 'all');
|
||||
$request = $this->getRequest();
|
||||
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/css/justified-nav.css', 'all');
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$year = date('Y');
|
||||
$this->tva = $c->profil->report->tva->{$year};
|
||||
$this->montantht = $c->profil->report->montantht;
|
||||
$this->montant = $this->montantht * (1 + $this->tva / 100);
|
||||
|
||||
//Create TVA tab
|
||||
$tabTVA = array();
|
||||
foreach ( $c->profil->tva as $date => $value) {
|
||||
$tabTVA[$date] = $value;
|
||||
}
|
||||
krsort($tabTVA);
|
||||
|
||||
$prestation = null;
|
||||
|
||||
$session = new Zend_Session_Namespace('Cmd');
|
||||
$session->unlock();
|
||||
|
||||
// Get partner parameters
|
||||
if ( isset($session->p) ) {
|
||||
$prestation = $session->p;
|
||||
} else {
|
||||
$p = $request->getParam('p');
|
||||
if ( $p !== null ) {
|
||||
$prestation = 'p'.$p;
|
||||
}
|
||||
}
|
||||
|
||||
// Set Prestation params
|
||||
if ( $prestation !== null ) {
|
||||
$today = date('Ymd');
|
||||
foreach ( $tabTVA as $date => $value ) {
|
||||
$this->tva = $value;
|
||||
if ( $today > $date ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
$tarif = $c->prestation->toArray();
|
||||
if ( array_key_exists($prestation, $tarif) ) {
|
||||
$this->montantht = $tarif[$prestation]['montantht'];
|
||||
$this->montant = round($this->montantht * (1 + $this->tva / 100), 2);
|
||||
$this->pLogin = $tarif[$prestation]['username'];
|
||||
$this->pPassword = $tarif[$prestation]['password'];
|
||||
} else {
|
||||
$prestation = null;
|
||||
}
|
||||
}
|
||||
|
||||
$action = $request->getActionName();
|
||||
$actionWithPrestation = array('index', 'cmd', 'paiement');
|
||||
|
||||
if ( $prestation === null && in_array($action, $actionWithPrestation) ) {
|
||||
$url = $this->view->url(array('controller' => 'report', 'action' => 'error'), null, true);
|
||||
$this->redirect($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -31,9 +82,12 @@ class ReportController extends Zend_Controller_Action
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
//Define title
|
||||
$p = $request->getParam('p');
|
||||
if ( $p !== null ) {
|
||||
$session->p = 'p'.$p;
|
||||
}
|
||||
|
||||
//Control the prestation with the database - inject additionnaly parameters
|
||||
//Define title
|
||||
|
||||
//Get parameters
|
||||
$siren = $request->getParam('siren');
|
||||
@ -41,13 +95,9 @@ class ReportController extends Zend_Controller_Action
|
||||
if (intval($siren)>100) {
|
||||
//Vérifier que le SIREN existe en base
|
||||
require_once 'Scores/WsScores.php';
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$login = $c->profil->report->username;
|
||||
$password = $c->profil->report->password;
|
||||
|
||||
$ws = new WsScores($login, $password);
|
||||
$ws = new WsScores($this->pLogin, $this->pPassword);
|
||||
$response = $ws->getIdentiteLight($siren);
|
||||
|
||||
if ($response !== false) {
|
||||
|
||||
//Identite
|
||||
@ -173,9 +223,7 @@ class ReportController extends Zend_Controller_Action
|
||||
if ( !isset($session->CmdID) || empty($session->CmdID) ) {
|
||||
//Get the report
|
||||
if (intval($siren)>100) {
|
||||
$login = $c->profil->report->username;
|
||||
$password = $c->profil->report->password;
|
||||
$report = new Scores_Partner_Report('indiscore3', $siren, $login, $password);
|
||||
$report = new Scores_Partner_Report('indiscore3', $siren, $this->pLogin, $this->pPassword);
|
||||
$html = $report->getContent();
|
||||
if ( $html !== false ) {
|
||||
|
||||
@ -268,8 +316,8 @@ class ReportController extends Zend_Controller_Action
|
||||
$paybox->setEmail($row->email);
|
||||
$paybox->setReference($cmdId);
|
||||
$paybox->setMontant($this->montant);
|
||||
$paybox->setUrlRepondreA("http://".$request->getHttpHost()."/report/checkpmt");
|
||||
$paybox->setUrlParameters("http://".$request->getHttpHost()."/report/retour");
|
||||
//$paybox->setUrlParameters();
|
||||
$paybox->calculateHMAC();
|
||||
|
||||
$this->view->PayboxUrl = $paybox->getFormUrl();
|
||||
@ -331,8 +379,6 @@ class ReportController extends Zend_Controller_Action
|
||||
if ($row !== null) {
|
||||
//Enregistrement des valeurs de paiement
|
||||
$data = array(
|
||||
'mt' => $this->montantht,
|
||||
'tax' => $this->tva,
|
||||
'eta' => $params['eta'],
|
||||
'auto' => $params['auto'],
|
||||
'type' => $params['type'],
|
||||
@ -368,6 +414,15 @@ class ReportController extends Zend_Controller_Action
|
||||
//Commande ID
|
||||
$cmdId = $request->getParam('id');
|
||||
|
||||
//If REF and eta = 0, OK => file et commande moins d'un mois
|
||||
$ref = $request->getParam('ref');
|
||||
|
||||
$commandM = new Application_Model_Command();
|
||||
$where = $commandM->select()->where('cmdId=?', $cmdId);
|
||||
|
||||
if ( $ref === null ) {
|
||||
|
||||
//Session
|
||||
$cmdState = 5;
|
||||
|
||||
$session = new Zend_Session_Namespace('Cmd');
|
||||
@ -383,10 +438,27 @@ class ReportController extends Zend_Controller_Action
|
||||
}
|
||||
|
||||
//Est ce que la commande existe
|
||||
$commandM = new Application_Model_Command();
|
||||
$where = $commandM->select()->where('cmdId=?', $cmdId);
|
||||
$this->view->CmdValide = false;
|
||||
|
||||
} elseif( $ref == 'lst' ) {
|
||||
|
||||
$cmdId = strtolower($cmdId);
|
||||
|
||||
//Check date
|
||||
$date = new Zend_Date();
|
||||
$dateN2 = $date->toString('yyyy-MM-dd HH:mm:ss');
|
||||
$date->sub(1, Zend_Date::MONTH);
|
||||
$dateN1 = $date->toString('yyyy-MM-dd HH:mm:ss');
|
||||
|
||||
$where->where("dateInsert BETWEEN '".$dateN1."' AND '".$dateN2."'");
|
||||
}
|
||||
|
||||
$row = $commandM->fetchRow($where);
|
||||
if ( $row!==null ) {
|
||||
if ( $row === null ) {
|
||||
$this->view->msg = "Commande introuvable !";
|
||||
} else {
|
||||
|
||||
$this->view->msg = "Validation du paiement incorrecte.";
|
||||
|
||||
if ($row->eta == 0) {
|
||||
|
||||
@ -405,13 +477,12 @@ class ReportController extends Zend_Controller_Action
|
||||
|
||||
$links = array();
|
||||
|
||||
if ( file_exists($pathCmd . DIRECTORY_SEPARATOR . $row->cmdId . '.html') ) {
|
||||
//Define links to get the HTML and/or PDF
|
||||
$links[] = array(
|
||||
'title' => 'Fichier PDF',
|
||||
'desc' => 'Télécharger le bilan financier',
|
||||
'url' => $this->view->url(array(
|
||||
'controller'=>'report',
|
||||
'controller'=>'delivery',
|
||||
'action'=>'pdf',
|
||||
'id' => $row->cmdId))
|
||||
);
|
||||
@ -420,17 +491,63 @@ class ReportController extends Zend_Controller_Action
|
||||
'title' => 'Facture',
|
||||
'desc' => 'Télécharger votre facture',
|
||||
'url' => $this->view->url(array(
|
||||
'controller'=>'report',
|
||||
'controller'=>'delivery',
|
||||
'action'=>'bill',
|
||||
'id' => $row->cmdId))
|
||||
);
|
||||
}
|
||||
|
||||
$this->view->links = $links;
|
||||
$this->view->CmdValide = true;
|
||||
$this->view->msg = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* IPN Url to check paiement autorisation
|
||||
*/
|
||||
public function checkpmtAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getParams();
|
||||
|
||||
//@todo : Check IP
|
||||
|
||||
|
||||
//Vérification que la commande existe
|
||||
$commandM = new Application_Model_Command();
|
||||
$row = $commandM->fetchRow('cmdId="'.$cmdId.'"');
|
||||
if ($row !== null) {
|
||||
/**
|
||||
* PBX_RETOUR
|
||||
* mt:M => Montant de la transaction
|
||||
* eta:E
|
||||
* id:R => Référence commande (précisée dans PBX_CMD)
|
||||
* auto:A => numéro d'Autorisation (numéro remis par le centre d’autorisation)
|
||||
* type:P => Type de Paiement retenu (cf. PBX_TYPEPAIEMENT)
|
||||
* idtrans:S => Numéro de TranSaction Paybox
|
||||
* sign:K => Signature sur les variables de l'URL. Format : url-encodé (toujours en dernier)
|
||||
*/
|
||||
$verify = new Paybox_Response();
|
||||
$verify->setData($params);
|
||||
if ( $verify->checkData() !== false ) {
|
||||
$montant = round($row->mt * (1 + $row->tax / 100), 2);
|
||||
//Vérifier le montant
|
||||
if ( $montant == $params['mt'] ) {
|
||||
//Enregistrement des valeurs
|
||||
$data = array(
|
||||
'eta' => $params['eta'],
|
||||
'auto' => $params['auto'],
|
||||
'type' => $params['type'],
|
||||
'idtrans' => $params['idtrans'],
|
||||
);
|
||||
$commandM->update($data, 'id='.$row->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display in blank page the html
|
||||
@ -462,10 +579,10 @@ class ReportController extends Zend_Controller_Action
|
||||
if ( $row !== null ) {
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$html = $c->profil->path->pages . DIRECTORY_SEPARATOR . $row->cmdId . '.html';
|
||||
$html = $c->profil->path->pages . '/' . $row->cmdId . '.html';
|
||||
|
||||
//Save the HTML file
|
||||
copy($html, $c->profil->path->data . DIRECTORY_SEPARATOR . 'html' . DIRECTORY_SEPARATOR . $id.'.html');
|
||||
copy($html, $c->profil->path->data . '/' . $id . '.html');
|
||||
|
||||
//Generate the PDF
|
||||
$pdf = new Scores_Wkhtml_Pdf();
|
||||
@ -518,8 +635,8 @@ class ReportController extends Zend_Controller_Action
|
||||
//Regen command
|
||||
if ($regen !== null) {
|
||||
|
||||
$source = $c->profil->path->data . DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR . $cmdId . 'html';
|
||||
$dest = $c->profil->path->pages . DIRECTORY_SEPARATOR . $cmdId . '.html';
|
||||
$source = $c->profil->path->data . '/' . $cmdId . 'html';
|
||||
$dest = $c->profil->path->pages . '/' . $cmdId . '.html';
|
||||
copy($source, $dest);
|
||||
|
||||
//Generate the PDF
|
||||
@ -529,7 +646,7 @@ class ReportController extends Zend_Controller_Action
|
||||
|
||||
//Serve the file
|
||||
$path = $c->profil->path->pages;
|
||||
$file = $path . DIRECTORY_SEPARATOR . $cmdId . '.pdf';
|
||||
$file = $path . '/' . $cmdId . '.pdf';
|
||||
if( file_exists($file) && filesize($file)>0 ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: application/pdf');
|
||||
@ -579,14 +696,23 @@ class ReportController extends Zend_Controller_Action
|
||||
|
||||
//Prepare information in database
|
||||
if ( $bill === null ) {
|
||||
$lastItemSql = $billM->select()->order('id DESC')->limit(1);
|
||||
$annee = substr($row->dateInsert, 0,4);
|
||||
$mois = substr($row->dateInsert, 5,2);
|
||||
|
||||
$lastItemSql = $billM->select()
|
||||
->where('annee=?', $annee)
|
||||
->where('mois=?', $mois)
|
||||
->order('num DESC')->limit(1);
|
||||
$lastItem = $billM->fetchRow($lastItemSql);
|
||||
$NumCmd = $billM->insert(array(
|
||||
'id' => $lastItem->id+1,
|
||||
$NumCmd = $lastItem->num + 1;
|
||||
$billM->insert(array(
|
||||
'cmdId' => $cmdId,
|
||||
'annee' => $annee,
|
||||
'mois' => $mois,
|
||||
'num' => $NumCmd,
|
||||
));
|
||||
} elseif ( $bill !== null && $regen !== null ) {
|
||||
$NumCmd = $bill->id;
|
||||
$NumCmd = $bill->num;
|
||||
}
|
||||
|
||||
//Set filename
|
||||
@ -688,4 +814,10 @@ class ReportController extends Zend_Controller_Action
|
||||
}
|
||||
}
|
||||
|
||||
public function errorAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -15,7 +15,9 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->Commands as $cmd) {?>
|
||||
<tr>
|
||||
<?php $class = '';?>
|
||||
<?php if ($cmd->eta!==0) { $class=' class="danger"'; }?>
|
||||
<tr<?=$class?>>
|
||||
<td><?=$cmd->cmdId?></td>
|
||||
<td><?=$cmd->siren?></td>
|
||||
<td><?=$cmd->email?></td>
|
||||
@ -35,11 +37,13 @@
|
||||
<a href="#" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
|
||||
Action <span class="caret"></span>
|
||||
</a>
|
||||
<?php if ($cmd->eta===0) {?>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="<?=$this->url(array('controller'=>'report', 'action'=>'getcmd', 'id'=>$cmd->cmdId))?>" target="_blank">Télécharger le document (si disponible)</a></li>
|
||||
<li><a href="<?=$this->url(array('controller'=>'delivery', 'action'=>'getcmd', 'id'=>$cmd->cmdId))?>" target="_blank">Télécharger le document (si disponible)</a></li>
|
||||
<li><a href="#" target="_blank">Générer le document</a></li>
|
||||
<li><a href="<?=$this->url(array('controller'=>'report', 'action'=>'bill', 'id'=>$cmd->cmdId))?>" target="_blank">Télécharger la facture</a></li>
|
||||
<li><a href="<?=$this->url(array('controller'=>'delivery', 'action'=>'bill', 'id'=>$cmd->cmdId))?>" target="_blank">Télécharger la facture</a></li>
|
||||
</ul>
|
||||
<?php }?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
1
application/views/scripts/delivery/bill.phtml
Normal file
1
application/views/scripts/delivery/bill.phtml
Normal file
@ -0,0 +1 @@
|
||||
<?php
|
73
application/views/scripts/delivery/deliver.phtml
Normal file
73
application/views/scripts/delivery/deliver.phtml
Normal file
@ -0,0 +1,73 @@
|
||||
<?php echo $this->render('report/header.phtml')?>
|
||||
|
||||
<?php if ($this->CmdValide===true) {?>
|
||||
|
||||
<div class="page-header">
|
||||
<h2>RAPPORT FINANCIER COMPLET <small>Livraison du rapport complet</small></h2>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Détails de votre commande</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<address>
|
||||
<strong>Suivi commande</strong><br>
|
||||
N° de commande : <?=$this->Infos->NumCommande?><br/>
|
||||
En date du : <?=$this->Infos->DateCommande?>
|
||||
</address>
|
||||
|
||||
<address>
|
||||
<strong><?=$this->Infos->RaisonSociale?></strong><br>
|
||||
<?=$this->Infos->NomPrenom?><br>
|
||||
<?=$this->Infos->Adresse?><br>
|
||||
<?php if (!empty($this->Infos->Tel)) {?>
|
||||
<abbr title="Téléphone">Tel :</abbr> <?=$this->Infos->Tel?><br>
|
||||
<?php }?>
|
||||
<?php if (!empty($this->Infos->Mob)) {?>
|
||||
<abbr title="Mobile">Tel :</abbr> <?=$this->Infos->Mob?>
|
||||
<?php }?>
|
||||
</address>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Liste des fichiers</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<?php if ( count($this->links) ) {?>
|
||||
|
||||
<?php foreach ( $this->links as $link ) {?>
|
||||
<div class="list-group">
|
||||
<a href="<?=$link['url']?>" class="list-group-item">
|
||||
<h4 class="list-group-item-heading"><?=$link['title']?></h4>
|
||||
<p class="list-group-item-text"><?=$link['desc']?></p>
|
||||
</a>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php }?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } else {?>
|
||||
|
||||
<div class="alert alert-danger"><?=$this->msg?></div>
|
||||
|
||||
<?php }?>
|
||||
|
||||
<?php echo $this->render('report/footer.phtml')?>
|
1
application/views/scripts/delivery/pdf.phtml
Normal file
1
application/views/scripts/delivery/pdf.phtml
Normal file
@ -0,0 +1 @@
|
||||
<?php
|
1
application/views/scripts/report/checkpmt.phtml
Normal file
1
application/views/scripts/report/checkpmt.phtml
Normal file
@ -0,0 +1 @@
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php echo $this->render('report/header.phtml')?>
|
||||
|
||||
<?php if ($this->CmdValide===true) {?>
|
||||
|
||||
<div class="page-header">
|
||||
<h2>RAPPORT FINANCIER COMPLET <small>Livraison du rapport complet</small></h2>
|
||||
</div>
|
||||
@ -62,4 +64,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } else {?>
|
||||
|
||||
<div class="alert alert-danger"><?=$this->msg?></div>
|
||||
|
||||
<?php }?>
|
||||
|
||||
<?php echo $this->render('report/footer.phtml')?>
|
5
application/views/scripts/report/error.phtml
Normal file
5
application/views/scripts/report/error.phtml
Normal file
@ -0,0 +1,5 @@
|
||||
<?php echo $this->render('report/header.phtml')?>
|
||||
|
||||
<div class="alert alert-danger"><strong>Erreur !</strong> Paramètres incorrects.</div>
|
||||
|
||||
<?php echo $this->render('report/footer.phtml')?>
|
@ -1,6 +1,18 @@
|
||||
<!-- Site footer -->
|
||||
<div class="footer">
|
||||
<p>© Scores & Décisions <?=date('Y')?></p>
|
||||
<div class="col-md-4"><p>© Scores & Décisions <?=date('Y')?></p></div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<form class="form-inline" method="post" action="<?=$this->url(array('controller'=>'report', 'action'=>'deliver'), null, true)?>">
|
||||
<div class="form-group col-md-6">
|
||||
<label class="sr-only" for="reference">Référence</label>
|
||||
<input type="text" class="form-control" id="reference" placeholder="Votre référence de commande" name="id">
|
||||
<input type="hidden" name="ref" value="lst" />
|
||||
</div>
|
||||
<button type="submit" class="btn btn-default">Ok</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
248
bin/classmap_generator.php
Normal file
248
bin/classmap_generator.php
Normal file
@ -0,0 +1,248 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Loader
|
||||
* @subpackage Exception
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Generate class maps for use with autoloading.
|
||||
*
|
||||
* Usage:
|
||||
* --help|-h Get usage message
|
||||
* --library|-l [ <string> ] Library to parse; if none provided, assumes
|
||||
* current directory
|
||||
* --output|-o [ <string> ] Where to write autoload file; if not provided,
|
||||
* assumes "autoload_classmap.php" in library directory
|
||||
* --append|-a Append to autoload file if it exists
|
||||
* --overwrite|-w Whether or not to overwrite existing autoload
|
||||
* file
|
||||
* --ignore|-i [ <string> ] Comma-separated namespaces to ignore
|
||||
*/
|
||||
|
||||
$libPath = dirname(__FILE__) . '/../library';
|
||||
if (!is_dir($libPath)) {
|
||||
// Try to load StandardAutoloader from include_path
|
||||
if (false === include('Zend/Loader/StandardAutoloader.php')) {
|
||||
echo "Unable to locate autoloader via include_path; aborting" . PHP_EOL;
|
||||
exit(2);
|
||||
}
|
||||
} else {
|
||||
// Try to load StandardAutoloader from library
|
||||
if (false === include(dirname(__FILE__) . '/../library/Zend/Loader/StandardAutoloader.php')) {
|
||||
echo "Unable to locate autoloader via library; aborting" . PHP_EOL;
|
||||
exit(2);
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure library/ is on include_path
|
||||
set_include_path(implode(PATH_SEPARATOR, array(
|
||||
realpath($libPath),
|
||||
get_include_path(),
|
||||
)));
|
||||
|
||||
$libraryPath = getcwd();
|
||||
|
||||
// Setup autoloading
|
||||
$loader = new Zend_Loader_StandardAutoloader(array('autoregister_zf' => true));
|
||||
$loader->setFallbackAutoloader(true);
|
||||
$loader->register();
|
||||
|
||||
$rules = array(
|
||||
'help|h' => 'Get usage message',
|
||||
'library|l-s' => 'Library to parse; if none provided, assumes current directory',
|
||||
'output|o-s' => 'Where to write autoload file; if not provided, assumes "autoload_classmap.php" in library directory',
|
||||
'append|a' => 'Append to autoload file if it exists',
|
||||
'overwrite|w' => 'Whether or not to overwrite existing autoload file',
|
||||
'ignore|i-s' => 'Comma-separated namespaces to ignore',
|
||||
);
|
||||
|
||||
try {
|
||||
$opts = new Zend_Console_Getopt($rules);
|
||||
$opts->parse();
|
||||
} catch (Zend_Console_Getopt_Exception $e) {
|
||||
echo $e->getUsageMessage();
|
||||
exit(2);
|
||||
}
|
||||
|
||||
if ($opts->getOption('h')) {
|
||||
echo $opts->getUsageMessage();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$ignoreNamespaces = array();
|
||||
if (isset($opts->i)) {
|
||||
$ignoreNamespaces = explode(',', $opts->i);
|
||||
}
|
||||
|
||||
$relativePathForClassmap = '';
|
||||
if (isset($opts->l)) {
|
||||
if (!is_dir($opts->l)) {
|
||||
echo 'Invalid library directory provided' . PHP_EOL
|
||||
. PHP_EOL;
|
||||
echo $opts->getUsageMessage();
|
||||
exit(2);
|
||||
}
|
||||
$libraryPath = $opts->l;
|
||||
}
|
||||
$libraryPath = str_replace(DIRECTORY_SEPARATOR, '/', realpath($libraryPath));
|
||||
|
||||
$usingStdout = false;
|
||||
$appending = $opts->getOption('a');
|
||||
$output = $libraryPath . '/autoload_classmap.php';
|
||||
if (isset($opts->o)) {
|
||||
$output = $opts->o;
|
||||
if ('-' == $output) {
|
||||
$output = STDOUT;
|
||||
$usingStdout = true;
|
||||
} elseif (is_dir($output)) {
|
||||
echo 'Invalid output file provided' . PHP_EOL
|
||||
. PHP_EOL;
|
||||
echo $opts->getUsageMessage();
|
||||
exit(2);
|
||||
} elseif (!is_writeable(dirname($output))) {
|
||||
echo "Cannot write to '$output'; aborting." . PHP_EOL
|
||||
. PHP_EOL
|
||||
. $opts->getUsageMessage();
|
||||
exit(2);
|
||||
} elseif (file_exists($output) && !$opts->getOption('w') && !$appending) {
|
||||
echo "Autoload file already exists at '$output'," . PHP_EOL
|
||||
. "but 'overwrite' or 'appending' flag was not specified; aborting." . PHP_EOL
|
||||
. PHP_EOL
|
||||
. $opts->getUsageMessage();
|
||||
exit(2);
|
||||
} else {
|
||||
// We need to add the $libraryPath into the relative path that is created in the classmap file.
|
||||
$classmapPath = str_replace(DIRECTORY_SEPARATOR, '/', realpath(dirname($output)));
|
||||
|
||||
// Simple case: $libraryPathCompare is in $classmapPathCompare
|
||||
if (strpos($libraryPath, $classmapPath) === 0) {
|
||||
$relativePathForClassmap = substr($libraryPath, strlen($classmapPath) + 1) . '/';
|
||||
} else {
|
||||
$libraryPathParts = explode('/', $libraryPath);
|
||||
$classmapPathParts = explode('/', $classmapPath);
|
||||
|
||||
// Find the common part
|
||||
$count = count($classmapPathParts);
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
if (!isset($libraryPathParts[$i]) || $libraryPathParts[$i] != $classmapPathParts[$i]) {
|
||||
// Common part end
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Add parent dirs for the subdirs of classmap
|
||||
$relativePathForClassmap = str_repeat('../', $count - $i);
|
||||
|
||||
// Add library subdirs
|
||||
$count = count($libraryPathParts);
|
||||
for (; $i < $count; $i++) {
|
||||
$relativePathForClassmap .= $libraryPathParts[$i] . '/';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$usingStdout) {
|
||||
if ($appending) {
|
||||
echo "Appending to class file map '$output' for library in '$libraryPath'..." . PHP_EOL;
|
||||
} else {
|
||||
echo "Creating class file map for library in '$libraryPath'..." . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the ClassFileLocator, and pass it the library path
|
||||
$l = new Zend_File_ClassFileLocator($libraryPath);
|
||||
|
||||
// Iterate over each element in the path, and create a map of
|
||||
// classname => filename, where the filename is relative to the library path
|
||||
$map = new stdClass;
|
||||
foreach ($l as $file) {
|
||||
$filename = str_replace($libraryPath . '/', '', str_replace(DIRECTORY_SEPARATOR, '/', $file->getPath()) . '/' . $file->getFilename());
|
||||
|
||||
// Add in relative path to library
|
||||
$filename = $relativePathForClassmap . $filename;
|
||||
|
||||
foreach ($file->getClasses() as $class) {
|
||||
foreach ($ignoreNamespaces as $ignoreNs) {
|
||||
if ($ignoreNs == substr($class, 0, strlen($ignoreNs))) {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
$map->{$class} = $filename;
|
||||
}
|
||||
}
|
||||
|
||||
if ($appending) {
|
||||
$content = var_export((array) $map, true) . ';';
|
||||
|
||||
// Prefix with dirname(__FILE__); modify the generated content
|
||||
$content = preg_replace("#(=> ')#", "=> dirname(__FILE__) . '", $content);
|
||||
|
||||
// Fix \' strings from injected DIRECTORY_SEPARATOR usage in iterator_apply op
|
||||
$content = str_replace("\\'", "'", $content);
|
||||
|
||||
// Convert to an array and remove the first "array("
|
||||
$content = explode("\n", $content);
|
||||
array_shift($content);
|
||||
|
||||
// Load existing class map file and remove the closing "bracket ");" from it
|
||||
$existing = file($output, FILE_IGNORE_NEW_LINES);
|
||||
array_pop($existing);
|
||||
|
||||
// Merge
|
||||
$content = implode("\n", array_merge($existing, $content));
|
||||
} else {
|
||||
// Create a file with the class/file map.
|
||||
// Stupid syntax highlighters make separating < from PHP declaration necessary
|
||||
$content = '<' . "?php\n"
|
||||
. "// Generated by ZF's ./bin/classmap_generator.php\n"
|
||||
. 'return ' . var_export((array) $map, true) . ';';
|
||||
|
||||
// Prefix with dirname(__FILE__); modify the generated content
|
||||
$content = preg_replace("#(=> ')#", "=> dirname(__FILE__) . '", $content);
|
||||
|
||||
// Fix \' strings from injected DIRECTORY_SEPARATOR usage in iterator_apply op
|
||||
$content = str_replace("\\'", "'", $content);
|
||||
}
|
||||
|
||||
// Remove unnecessary double-backslashes
|
||||
$content = str_replace('\\\\', '\\', $content);
|
||||
|
||||
// Exchange "array (" width "array("
|
||||
$content = str_replace('array (', 'array(', $content);
|
||||
|
||||
// Align "=>" operators to match coding standard
|
||||
preg_match_all('(\n\s+([^=]+)=>)', $content, $matches, PREG_SET_ORDER);
|
||||
$maxWidth = 0;
|
||||
|
||||
foreach ($matches as $match) {
|
||||
$maxWidth = max($maxWidth, strlen($match[1]));
|
||||
}
|
||||
|
||||
$content = preg_replace('(\n\s+([^=]+)=>)e', "'\n \\1' . str_repeat(' ', " . $maxWidth . " - strlen('\\1')) . '=>'", $content);
|
||||
|
||||
// Make the file end by EOL
|
||||
$content = rtrim($content, "\n") . "\n";
|
||||
|
||||
// Write the contents to disk
|
||||
file_put_contents($output, $content);
|
||||
|
||||
if (!$usingStdout) {
|
||||
echo "Wrote classmap file to '" . realpath($output) . "'" . PHP_EOL;
|
||||
}
|
44
bin/zf.bat
Normal file
44
bin/zf.bat
Normal file
@ -0,0 +1,44 @@
|
||||
@ECHO off
|
||||
REM Zend Framework
|
||||
REM
|
||||
REM LICENSE
|
||||
REM
|
||||
REM This source file is subject to the new BSD license that is bundled
|
||||
REM with this package in the file LICENSE.txt.
|
||||
REM It is also available through the world-wide-web at this URL:
|
||||
REM http://framework.zend.com/license/new-bsd
|
||||
REM If you did not receive a copy of the license and are unable to
|
||||
REM obtain it through the world-wide-web, please send an email
|
||||
REM to license@zend.com so we can send you a copy immediately.
|
||||
REM
|
||||
REM Zend
|
||||
REM Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
REM http://framework.zend.com/license/new-bsd New BSD License
|
||||
|
||||
|
||||
REM Test to see if this was installed via pear
|
||||
SET ZTMPZTMPZTMPZ=@ph
|
||||
SET TMPZTMPZTMP=%ZTMPZTMPZTMPZ%p_bin@
|
||||
REM below @php_bin@
|
||||
FOR %%x IN ("@php_bin@") DO (if %%x=="%TMPZTMPZTMP%" GOTO :NON_PEAR_INSTALLED)
|
||||
|
||||
GOTO PEAR_INSTALLED
|
||||
|
||||
:NON_PEAR_INSTALLED
|
||||
REM Assume php.exe is executable, and that zf.php will reside in the
|
||||
REM same file as this one
|
||||
SET PHP_BIN=php.exe
|
||||
SET PHP_DIR=%~dp0
|
||||
GOTO RUN
|
||||
|
||||
:PEAR_INSTALLED
|
||||
REM Assume this was installed via PEAR and use replacements php_bin & php_dir
|
||||
SET PHP_BIN=@php_bin@
|
||||
SET PHP_DIR=@php_dir@
|
||||
GOTO RUN
|
||||
|
||||
:RUN
|
||||
SET ZF_SCRIPT=%PHP_DIR%\zf.php
|
||||
"%PHP_BIN%" -d safe_mode=Off -f "%ZF_SCRIPT%" -- %*
|
||||
|
||||
|
624
bin/zf.php
Normal file
624
bin/zf.php
Normal file
@ -0,0 +1,624 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* ZF
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class ZF
|
||||
{
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $_clientLoaded = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_mode = 'runTool';
|
||||
|
||||
/**
|
||||
* @var array of messages
|
||||
*/
|
||||
protected $_messages = array();
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_homeDirectory = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_storageDirectory = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_configFile = null;
|
||||
|
||||
/**
|
||||
* main()
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function main()
|
||||
{
|
||||
$zf = new self();
|
||||
$zf->bootstrap();
|
||||
$zf->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* bootstrap()
|
||||
*
|
||||
* @return ZF
|
||||
*/
|
||||
public function bootstrap()
|
||||
{
|
||||
// detect settings
|
||||
$this->_mode = $this->_detectMode();
|
||||
$this->_homeDirectory = $this->_detectHomeDirectory();
|
||||
$this->_storageDirectory = $this->_detectStorageDirectory();
|
||||
$this->_configFile = $this->_detectConfigFile();
|
||||
|
||||
// setup
|
||||
$this->_setupPHPRuntime();
|
||||
$this->_setupToolRuntime();
|
||||
}
|
||||
|
||||
/**
|
||||
* run()
|
||||
*
|
||||
* @return ZF
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
switch ($this->_mode) {
|
||||
case 'runError':
|
||||
$this->_runError();
|
||||
$this->_runInfo();
|
||||
break;
|
||||
case 'runSetup':
|
||||
if ($this->_runSetup() === false) {
|
||||
$this->_runInfo();
|
||||
}
|
||||
break;
|
||||
case 'runInfo':
|
||||
$this->_runInfo();
|
||||
break;
|
||||
case 'runTool':
|
||||
default:
|
||||
$this->_runTool();
|
||||
break;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* _detectMode()
|
||||
*
|
||||
* @return ZF
|
||||
*/
|
||||
protected function _detectMode()
|
||||
{
|
||||
$arguments = $_SERVER['argv'];
|
||||
|
||||
$mode = 'runTool';
|
||||
|
||||
if (!isset($arguments[0])) {
|
||||
return $mode;
|
||||
}
|
||||
|
||||
if ($arguments[0] == $_SERVER['PHP_SELF']) {
|
||||
$this->_executable = array_shift($arguments);
|
||||
}
|
||||
|
||||
if (!isset($arguments[0])) {
|
||||
return $mode;
|
||||
}
|
||||
|
||||
if ($arguments[0] == '--setup') {
|
||||
$mode = 'runSetup';
|
||||
} elseif ($arguments[0] == '--info') {
|
||||
$mode = 'runInfo';
|
||||
}
|
||||
|
||||
return $mode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* _detectHomeDirectory() - detect the home directory in a variety of different places
|
||||
*
|
||||
* @param bool $mustExist Should the returned value already exist in the file system
|
||||
* @param bool $returnMessages Should it log messages for output later
|
||||
* @return string
|
||||
*/
|
||||
protected function _detectHomeDirectory($mustExist = true, $returnMessages = true)
|
||||
{
|
||||
$homeDirectory = null;
|
||||
|
||||
$homeDirectory = getenv('ZF_HOME'); // check env var ZF_HOME
|
||||
if ($homeDirectory) {
|
||||
$this->_logMessage('Home directory found in environment variable ZF_HOME with value ' . $homeDirectory, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($homeDirectory))) {
|
||||
return $homeDirectory;
|
||||
} else {
|
||||
$this->_logMessage('Home directory does not exist at ' . $homeDirectory, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
$homeDirectory = getenv('HOME'); // HOME environment variable
|
||||
|
||||
if ($homeDirectory) {
|
||||
$this->_logMessage('Home directory found in environment variable HOME with value ' . $homeDirectory, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($homeDirectory))) {
|
||||
return $homeDirectory;
|
||||
} else {
|
||||
$this->_logMessage('Home directory does not exist at ' . $homeDirectory, $returnMessages);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$homeDirectory = getenv('HOMEPATH');
|
||||
|
||||
if ($homeDirectory) {
|
||||
$this->_logMessage('Home directory found in environment variable HOMEPATH with value ' . $homeDirectory, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($homeDirectory))) {
|
||||
return $homeDirectory;
|
||||
} else {
|
||||
$this->_logMessage('Home directory does not exist at ' . $homeDirectory, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
$homeDirectory = getenv('USERPROFILE');
|
||||
|
||||
if ($homeDirectory) {
|
||||
$this->_logMessage('Home directory found in environment variable USERPROFILE with value ' . $homeDirectory, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($homeDirectory))) {
|
||||
return $homeDirectory;
|
||||
} else {
|
||||
$this->_logMessage('Home directory does not exist at ' . $homeDirectory, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* _detectStorageDirectory() - Detect where the storage directory is from a variaty of possiblities
|
||||
*
|
||||
* @param bool $mustExist Should the returned value already exist in the file system
|
||||
* @param bool $returnMessages Should it log messages for output later
|
||||
* @return string
|
||||
*/
|
||||
protected function _detectStorageDirectory($mustExist = true, $returnMessages = true)
|
||||
{
|
||||
$storageDirectory = false;
|
||||
|
||||
$storageDirectory = getenv('ZF_STORAGE_DIR');
|
||||
if ($storageDirectory) {
|
||||
$this->_logMessage('Storage directory path found in environment variable ZF_STORAGE_DIR with value ' . $storageDirectory, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($storageDirectory))) {
|
||||
return $storageDirectory;
|
||||
} else {
|
||||
$this->_logMessage('Storage directory does not exist at ' . $storageDirectory, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
$homeDirectory = ($this->_homeDirectory) ? $this->_homeDirectory : $this->_detectHomeDirectory(true, false);
|
||||
|
||||
if ($homeDirectory) {
|
||||
$storageDirectory = $homeDirectory . '/.zf/';
|
||||
$this->_logMessage('Storage directory assumed in home directory at location ' . $storageDirectory, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($storageDirectory))) {
|
||||
return $storageDirectory;
|
||||
} else {
|
||||
$this->_logMessage('Storage directory does not exist at ' . $storageDirectory, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* _detectConfigFile() - Detect config file location from a variety of possibilities
|
||||
*
|
||||
* @param bool $mustExist Should the returned value already exist in the file system
|
||||
* @param bool $returnMessages Should it log messages for output later
|
||||
* @return string
|
||||
*/
|
||||
protected function _detectConfigFile($mustExist = true, $returnMessages = true)
|
||||
{
|
||||
$configFile = null;
|
||||
|
||||
$configFile = getenv('ZF_CONFIG_FILE');
|
||||
if ($configFile) {
|
||||
$this->_logMessage('Config file found environment variable ZF_CONFIG_FILE at ' . $configFile, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($configFile))) {
|
||||
return $configFile;
|
||||
} else {
|
||||
$this->_logMessage('Config file does not exist at ' . $configFile, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
$homeDirectory = ($this->_homeDirectory) ? $this->_homeDirectory : $this->_detectHomeDirectory(true, false);
|
||||
if ($homeDirectory) {
|
||||
$configFile = $homeDirectory . '/.zf.ini';
|
||||
$this->_logMessage('Config file assumed in home directory at location ' . $configFile, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($configFile))) {
|
||||
return $configFile;
|
||||
} else {
|
||||
$this->_logMessage('Config file does not exist at ' . $configFile, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
$storageDirectory = ($this->_storageDirectory) ? $this->_storageDirectory : $this->_detectStorageDirectory(true, false);
|
||||
if ($storageDirectory) {
|
||||
$configFile = $storageDirectory . '/zf.ini';
|
||||
$this->_logMessage('Config file assumed in storage directory at location ' . $configFile, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($configFile))) {
|
||||
return $configFile;
|
||||
} else {
|
||||
$this->_logMessage('Config file does not exist at ' . $configFile, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* _setupPHPRuntime() - parse the config file if it exists for php ini values to set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _setupPHPRuntime()
|
||||
{
|
||||
// set php runtime settings
|
||||
ini_set('display_errors', true);
|
||||
|
||||
// support the changing of the current working directory, necessary for some providers
|
||||
$cwd = getenv('ZEND_TOOL_CURRENT_WORKING_DIRECTORY');
|
||||
if ($cwd != '' && realpath($cwd)) {
|
||||
chdir($cwd);
|
||||
}
|
||||
|
||||
if (!$this->_configFile) {
|
||||
return;
|
||||
}
|
||||
$zfINISettings = parse_ini_file($this->_configFile);
|
||||
$phpINISettings = ini_get_all();
|
||||
foreach ($zfINISettings as $zfINIKey => $zfINIValue) {
|
||||
if (substr($zfINIKey, 0, 4) === 'php.') {
|
||||
$phpINIKey = substr($zfINIKey, 4);
|
||||
if (array_key_exists($phpINIKey, $phpINISettings)) {
|
||||
ini_set($phpINIKey, $zfINIValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _setupToolRuntime() - setup the tools include_path and load the proper framwork parts that
|
||||
* enable Zend_Tool to work.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _setupToolRuntime()
|
||||
{
|
||||
|
||||
$includePathPrepend = getenv('ZEND_TOOL_INCLUDE_PATH_PREPEND');
|
||||
$includePathFull = getenv('ZEND_TOOL_INCLUDE_PATH');
|
||||
|
||||
// check if the user has not provided anything
|
||||
if (!($includePathPrepend || $includePathFull)) {
|
||||
if ($this->_tryClientLoad()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// if ZF is not in the include_path, but relative to this file, put it in the include_path
|
||||
if ($includePathPrepend || $includePathFull) {
|
||||
if (isset($includePathPrepend) && ($includePathPrepend !== false)) {
|
||||
set_include_path($includePathPrepend . PATH_SEPARATOR . get_include_path());
|
||||
} elseif (isset($includePathFull) && ($includePathFull !== false)) {
|
||||
set_include_path($includePathFull);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->_tryClientLoad()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$zfIncludePath['relativePath'] = dirname(__FILE__) . '/../library/';
|
||||
if (file_exists($zfIncludePath['relativePath'] . 'Zend/Tool/Framework/Client/Console.php')) {
|
||||
set_include_path(realpath($zfIncludePath['relativePath']) . PATH_SEPARATOR . get_include_path());
|
||||
}
|
||||
|
||||
if (!$this->_tryClientLoad()) {
|
||||
$this->_mode = 'runError';
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _tryClientLoad() - Attempt to load the Zend_Tool_Framework_Client_Console to enable the tool to run.
|
||||
*
|
||||
* This method will return false if its not loaded to allow the consumer to alter the environment in such
|
||||
* a way that it can be called again to try loading the proper file/class.
|
||||
*
|
||||
* @return bool if the client is actuall loaded or not
|
||||
*/
|
||||
protected function _tryClientLoad()
|
||||
{
|
||||
$this->_clientLoaded = false;
|
||||
$fh = @fopen('Zend/Tool/Framework/Client/Console.php', 'r', true);
|
||||
if (!$fh) {
|
||||
return $this->_clientLoaded; // false
|
||||
} else {
|
||||
fclose($fh);
|
||||
unset($fh);
|
||||
include 'Zend/Tool/Framework/Client/Console.php';
|
||||
$this->_clientLoaded = class_exists('Zend_Tool_Framework_Client_Console');
|
||||
}
|
||||
|
||||
return $this->_clientLoaded;
|
||||
}
|
||||
|
||||
/**
|
||||
* _runError() - Output the error screen that tells the user that the tool was not setup
|
||||
* in a sane way
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runError()
|
||||
{
|
||||
|
||||
echo <<<EOS
|
||||
|
||||
***************************** ZF ERROR ********************************
|
||||
In order to run the zf command, you need to ensure that Zend Framework
|
||||
is inside your include_path. There are a variety of ways that you can
|
||||
ensure that this zf command line tool knows where the Zend Framework
|
||||
library is on your system, but not all of them can be described here.
|
||||
|
||||
The easiest way to get the zf command running is to give it the include
|
||||
path via an environment variable ZEND_TOOL_INCLUDE_PATH or
|
||||
ZEND_TOOL_INCLUDE_PATH_PREPEND with the proper include path to use,
|
||||
then run the command "zf --setup". This command is designed to create
|
||||
a storage location for your user, as well as create the zf.ini file
|
||||
that the zf command will consult in order to run properly on your
|
||||
system.
|
||||
|
||||
Example you would run:
|
||||
|
||||
$ ZEND_TOOL_INCLUDE_PATH=/path/to/library zf --setup
|
||||
|
||||
Your are encourged to read more in the link that follows.
|
||||
|
||||
EOS;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* _runInfo() - this command will produce information about the setup of this script and
|
||||
* Zend_Tool
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runInfo()
|
||||
{
|
||||
echo 'Zend_Tool & CLI Setup Information' . PHP_EOL
|
||||
. '(available via the command line "zf --info")'
|
||||
. PHP_EOL;
|
||||
|
||||
echo ' * ' . implode(PHP_EOL . ' * ', $this->_messages) . PHP_EOL;
|
||||
|
||||
echo PHP_EOL;
|
||||
|
||||
echo 'To change the setup of this tool, run: "zf --setup"';
|
||||
|
||||
echo PHP_EOL;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* _runSetup() - parse the request to see which setup command to run
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runSetup()
|
||||
{
|
||||
$setupCommand = (isset($_SERVER['argv'][2])) ? $_SERVER['argv'][2] : null;
|
||||
|
||||
switch ($setupCommand) {
|
||||
case 'storage-directory':
|
||||
$this->_runSetupStorageDirectory();
|
||||
break;
|
||||
case 'config-file':
|
||||
$this->_runSetupConfigFile();
|
||||
break;
|
||||
default:
|
||||
$this->_runSetupMoreInfo();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _runSetupStorageDirectory() - if the storage directory does not exist, create it
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runSetupStorageDirectory()
|
||||
{
|
||||
$storageDirectory = $this->_detectStorageDirectory(false, false);
|
||||
|
||||
if (file_exists($storageDirectory)) {
|
||||
echo 'Directory already exists at ' . $storageDirectory . PHP_EOL
|
||||
. 'Cannot create storage directory.';
|
||||
return;
|
||||
}
|
||||
|
||||
mkdir($storageDirectory);
|
||||
|
||||
echo 'Storage directory created at ' . $storageDirectory . PHP_EOL;
|
||||
}
|
||||
|
||||
/**
|
||||
* _runSetupConfigFile()
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runSetupConfigFile()
|
||||
{
|
||||
$configFile = $this->_detectConfigFile(false, false);
|
||||
|
||||
if (file_exists($configFile)) {
|
||||
echo 'File already exists at ' . $configFile . PHP_EOL
|
||||
. 'Cannot write new config file.';
|
||||
return;
|
||||
}
|
||||
|
||||
$includePath = get_include_path();
|
||||
|
||||
$contents = 'php.include_path = "' . $includePath . '"';
|
||||
|
||||
file_put_contents($configFile, $contents);
|
||||
|
||||
$iniValues = ini_get_all();
|
||||
if ($iniValues['include_path']['global_value'] != $iniValues['include_path']['local_value']) {
|
||||
echo 'NOTE: the php include_path to be used with the tool has been written' . PHP_EOL
|
||||
. 'to the config file, using ZEND_TOOL_INCLUDE_PATH (or other include_path setters)' . PHP_EOL
|
||||
. 'is no longer necessary.' . PHP_EOL . PHP_EOL;
|
||||
}
|
||||
|
||||
echo 'Config file written to ' . $configFile . PHP_EOL;
|
||||
}
|
||||
|
||||
/**
|
||||
* _runSetupMoreInfo() - return more information about what can be setup, and what is setup
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runSetupMoreInfo()
|
||||
{
|
||||
$homeDirectory = $this->_detectHomeDirectory(false, false);
|
||||
$storageDirectory = $this->_detectStorageDirectory(false, false);
|
||||
$configFile = $this->_detectConfigFile(false, false);
|
||||
|
||||
echo <<<EOS
|
||||
|
||||
ZF Command Line Tool - Setup
|
||||
----------------------------
|
||||
|
||||
Current Paths (Existing or not):
|
||||
Home Directory: {$homeDirectory}
|
||||
Storage Directory: {$storageDirectory}
|
||||
Config File: {$configFile}
|
||||
|
||||
Important Environment Variables:
|
||||
ZF_HOME
|
||||
- the directory this tool will look for a home directory
|
||||
- directory must exist
|
||||
ZF_STORAGE_DIR
|
||||
- where this tool will look for a storage directory
|
||||
- directory must exist
|
||||
ZF_CONFIG_FILE
|
||||
- where this tool will look for a configuration file
|
||||
ZF_TOOL_INCLUDE_PATH
|
||||
- set the include_path for this tool to use this value
|
||||
ZF_TOOL_INCLUDE_PATH_PREPEND
|
||||
- prepend the current php.ini include_path with this value
|
||||
|
||||
Search Order:
|
||||
Home Directory:
|
||||
- ZF_HOME, then HOME (*nix), then HOMEPATH (windows)
|
||||
Storage Directory:
|
||||
- ZF_STORAGE_DIR, then {home}/.zf/
|
||||
Config File:
|
||||
- ZF_CONFIG_FILE, then {home}/.zf.ini, then {home}/zf.ini,
|
||||
then {storage}/zf.ini
|
||||
|
||||
Commands:
|
||||
zf --setup storage-directory
|
||||
- setup the storage directory, directory will be created
|
||||
zf --setup config-file
|
||||
- create the config file with some default values
|
||||
|
||||
|
||||
EOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* _runTool() - This is where the magic happens, dispatch Zend_Tool
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runTool()
|
||||
{
|
||||
|
||||
$configOptions = array();
|
||||
if (isset($this->_configFile) && $this->_configFile) {
|
||||
$configOptions['configOptions']['configFilepath'] = $this->_configFile;
|
||||
}
|
||||
if (isset($this->_storageDirectory) && $this->_storageDirectory) {
|
||||
$configOptions['storageOptions']['directory'] = $this->_storageDirectory;
|
||||
}
|
||||
|
||||
// ensure that zf.php loads the Zend_Tool_Project features
|
||||
$configOptions['classesToLoad'] = 'Zend_Tool_Project_Provider_Manifest';
|
||||
|
||||
$console = new Zend_Tool_Framework_Client_Console($configOptions);
|
||||
$console->dispatch();
|
||||
}
|
||||
|
||||
/**
|
||||
* _logMessage() - Internal method used to log setup and information messages.
|
||||
*
|
||||
* @param string $message
|
||||
* @param bool $storeMessage
|
||||
* @return void
|
||||
*/
|
||||
protected function _logMessage($message, $storeMessage = true)
|
||||
{
|
||||
if (!$storeMessage) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->_messages[] = $message;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!getenv('ZF_NO_MAIN')) {
|
||||
ZF::main();
|
||||
}
|
45
bin/zf.sh
Normal file
45
bin/zf.sh
Normal file
@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
#############################################################################
|
||||
# Zend Framework
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# This source file is subject to the new BSD license that is bundled
|
||||
# with this package in the file LICENSE.txt.
|
||||
# It is also available through the world-wide-web at this URL:
|
||||
# http://framework.zend.com/license/new-bsd
|
||||
# If you did not receive a copy of the license and are unable to
|
||||
# obtain it through the world-wide-web, please send an email
|
||||
# to license@zend.com so we can send you a copy immediately.
|
||||
#
|
||||
# Zend
|
||||
# Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
# http://framework.zend.com/license/new-bsd New BSD License
|
||||
#############################################################################
|
||||
|
||||
|
||||
# find php: pear first, command -v second, straight up php lastly
|
||||
if test "@php_bin@" != '@'php_bin'@'; then
|
||||
PHP_BIN="@php_bin@"
|
||||
elif command -v php 1>/dev/null 2>/dev/null; then
|
||||
PHP_BIN=`command -v php`
|
||||
else
|
||||
PHP_BIN=php
|
||||
fi
|
||||
|
||||
# find zf.php: pear first, same directory 2nd,
|
||||
if test "@php_dir@" != '@'php_dir'@'; then
|
||||
PHP_DIR="@php_dir@"
|
||||
else
|
||||
SELF_LINK="$0"
|
||||
SELF_LINK_TMP="$(readlink "$SELF_LINK")"
|
||||
while test -n "$SELF_LINK_TMP"; do
|
||||
SELF_LINK="$SELF_LINK_TMP"
|
||||
SELF_LINK_TMP="$(readlink "$SELF_LINK")"
|
||||
done
|
||||
PHP_DIR="$(dirname "$SELF_LINK")"
|
||||
fi
|
||||
|
||||
"$PHP_BIN" -d safe_mode=Off -f "$PHP_DIR/zf.php" -- "$@"
|
||||
|
@ -96,6 +96,12 @@ class Paybox_System extends Paybox_Config
|
||||
*/
|
||||
protected $PBX_REFUSE;
|
||||
|
||||
/**
|
||||
* URL IPN (Instant Payement Notification)
|
||||
* @var string
|
||||
*/
|
||||
protected $PBX_REPONDRE_A;
|
||||
|
||||
/**
|
||||
* Configuration de la réponse
|
||||
* Chaine <nom de variable>:<lettre> concaténé par ;
|
||||
@ -209,6 +215,15 @@ class Paybox_System extends Paybox_Config
|
||||
$this->PBX_PORTEUR = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the IPN Url
|
||||
* @param string $url
|
||||
*/
|
||||
public function setUrlRepondreA($url)
|
||||
{
|
||||
$this->PBX_REPONDRE_A = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define URL parameters as string to calculate HMAC
|
||||
* @param string $withReturnUrl
|
||||
@ -225,6 +240,12 @@ class Paybox_System extends Paybox_Config
|
||||
));
|
||||
}
|
||||
|
||||
if ( !empty($this->PBX_REPONDRE_A) ) {
|
||||
$this->stackfields = array_merge($this->stackfields, array(
|
||||
'PBX_REPONDRE_A',
|
||||
));
|
||||
}
|
||||
|
||||
$dateTime = date('c');
|
||||
$this->PBX_TIME = $dateTime;
|
||||
$params = '';
|
||||
|
@ -1,6 +1,4 @@
|
||||
<?php
|
||||
require_once 'common/dates.php';
|
||||
|
||||
class Annonces
|
||||
{
|
||||
public $annoncesBodacc = array();
|
||||
@ -58,7 +56,7 @@ class Annonces
|
||||
' du '.$this->dateAnnonce($ann->DateParution);
|
||||
} else {
|
||||
$view = new Zend_View();
|
||||
$session = new SessionEntreprise(null);
|
||||
$session = new Scores_Session_Entreprise(null);
|
||||
$href = $view->url(array(
|
||||
'controller' => 'juridique',
|
||||
'action' => 'competences',
|
||||
@ -230,7 +228,12 @@ class Annonces
|
||||
*/
|
||||
protected function dateAnnonce($date)
|
||||
{
|
||||
return WDate::dateT('Y-m-d', 'd/m/Y', $date);
|
||||
if ( $date!='' ) {
|
||||
$dateS = new Zend_Date($date, 'yyyy-MM-dd');
|
||||
return $dateS->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
protected function logoTitleAnnonce($ann)
|
||||
@ -317,7 +320,8 @@ class Annonces
|
||||
$numEven = $even->CodeEven*1;
|
||||
if ($numEven>3000 && $numEven<3999) {
|
||||
if (isset($ann->dateEffet)){
|
||||
$lib.= ' (clôture au '.WDate::dateT('Y-m-d','d/m/Y',$ann->dateEffet).')';
|
||||
$date = new Zend_Date($ann->dateEffet, 'yyyy-MM-dd');
|
||||
$lib.= ' (clôture au '.$date->toString('dd/MM/yyyy').')';
|
||||
}
|
||||
}
|
||||
$user = new Scores_Utilisateur();
|
||||
@ -339,7 +343,8 @@ class Annonces
|
||||
foreach ($this->annonces as $i => $ann)
|
||||
{
|
||||
//Génération id pour tri
|
||||
$id = WDate::dateT('Y-m-d','Ymd',$ann->DateParution).':'.$ann->id;
|
||||
$date = new Zend_Date($ann->DateParution,'yyyy-MM-dd');
|
||||
$id = $date->toString('yyyyMMdd').':'.$ann->id;
|
||||
if ($this->isBodacc($ann->BodaccCode)){
|
||||
$this->annoncesBodacc[$id] = $ann;
|
||||
} elseif ($this->isBalo($ann->BodaccCode)) {
|
||||
@ -356,7 +361,8 @@ class Annonces
|
||||
|
||||
public function getAnnee($ann)
|
||||
{
|
||||
return WDate::dateT('Y-m-d','Y',$ann->DateParution);
|
||||
$date = new Zend_Date($ann->DateParution,'yyyy-MM-dd');
|
||||
return $date->toString('yyyy');
|
||||
}
|
||||
|
||||
public function getNum($ann)
|
||||
|
@ -1,151 +0,0 @@
|
||||
<?php
|
||||
class Scores_AuthAdapter implements Zend_Auth_Adapter_Interface
|
||||
{
|
||||
protected $_username;
|
||||
protected $_password;
|
||||
protected $_timeout = 1800;
|
||||
protected $_checkIp = false;
|
||||
|
||||
public function __construct($username, $password, $iponly = false)
|
||||
{
|
||||
$this->_username = $username;
|
||||
$this->_password = $password;
|
||||
if ($iponly){
|
||||
$this->_password = 'iponly:'.$_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
$this->_checkIp = $iponly;
|
||||
}
|
||||
|
||||
public function authenticate()
|
||||
{
|
||||
$adressIp = $_SERVER['REMOTE_ADDR'];
|
||||
|
||||
require_once 'Scores/WsScores.php';
|
||||
$ws = new WsScores($this->_username, $this->_password);
|
||||
$InfosLogin = $ws->getInfosLogin($this->_username, $adressIp);
|
||||
$identity = new stdClass();
|
||||
$identity->username = $this->_username;
|
||||
$identity->password = $this->_password;
|
||||
$identity->email = $InfosLogin->result->email;
|
||||
$identity->profil = $InfosLogin->result->profil;
|
||||
$identity->pref = $InfosLogin->result->pref;
|
||||
$identity->droits = $InfosLogin->result->droits;
|
||||
$identity->droitsClients = $InfosLogin->result->droitsClients;
|
||||
$identity->nom = $InfosLogin->result->nom;
|
||||
$identity->prenom = $InfosLogin->result->prenom;
|
||||
$identity->tel = $InfosLogin->result->tel;
|
||||
$identity->fax = $InfosLogin->result->fax;
|
||||
$identity->mobile = $InfosLogin->result->mobile;
|
||||
$identity->id = $InfosLogin->result->id;
|
||||
$identity->idClient = $InfosLogin->result->idClient;
|
||||
$identity->reference = $InfosLogin->result->reference;
|
||||
$identity->nbReponses = $InfosLogin->result->nbReponses;
|
||||
$identity->typeScore = $InfosLogin->result->typeScore;
|
||||
$identity->dateValidation = $InfosLogin->result->dateValidation;
|
||||
$identity->nombreConnexions = $InfosLogin->result->nombreConnexions;
|
||||
$identity->dateDerniereConnexion = $InfosLogin->result->dateDerniereConnexion;
|
||||
$identity->dateDebutCompte = $InfosLogin->result->dateDebutCompte;
|
||||
$identity->dateFinCompte = $InfosLogin->result->dateFinCompte;
|
||||
$identity->acceptationCGU = $InfosLogin->result->acceptationCGU;
|
||||
$identity->ip = $adressIp;
|
||||
$identity->modeEdition = false;
|
||||
|
||||
$timeout = (!empty($InfosLogin->result->timeout)) ? $InfosLogin->result->timeout : $this->_timeout;
|
||||
$identity->timeout = $timeout;
|
||||
|
||||
$identity->time = time() + $timeout;
|
||||
|
||||
$lang = in_array($InfosLogin->result->lang, array('fr','en')) ? $InfosLogin->result->lang : 'fr';
|
||||
$identity->lang = $lang;
|
||||
$identity->langtmp = $lang;
|
||||
|
||||
/*
|
||||
* Adresse Ip interdites
|
||||
*/
|
||||
$ipInterdites =
|
||||
'81.252.88.0-81.252.88.7' // CTE D AGGLOMERATION DE SOPHIA
|
||||
. ';' . '195.200.187.163' // PacWan
|
||||
. ';' . '213.11.81.41' // Verizon France SAS
|
||||
. ';' . '83.206.171.252' // FR-BASE-D-INFORMATIONS-LEGALES-BI
|
||||
. ';' . '81.255.32.139'
|
||||
. ';' . '212.155.191.1*' // Satair A/S
|
||||
. ';' . '217.70.1*.17' // OJSC "Sibirtelecom"
|
||||
. ';' . '212.37.196.156' // GENERALE-MULTIMEDIA-SUD
|
||||
. ';' . '80.245.60.121' // Planete Marseille - Mailclub
|
||||
. ';' . '213.246.57.101' // IKOULA
|
||||
. ';' . '193.104.158.0-193.104.158.255' // Altares.fr
|
||||
. ';' . '195.6.3.0-195.6.3.255' // ORT
|
||||
. ';' . '217.144.112.0-217.144.116.63' // Coface
|
||||
;
|
||||
if ( $this->checkPlagesIp($ipInterdites, $adressIp) ) {
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity);
|
||||
}
|
||||
|
||||
// Renvoi
|
||||
if ( is_string($InfosLogin) || $InfosLogin->error->errnum!=0){
|
||||
$message = $InfosLogin;
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $identity, array($message));
|
||||
} elseif ($this->_username == $InfosLogin->result->login) {
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $identity);
|
||||
} else {
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Controle si une adresse IP est dans une liste des IP communiquées sous la forme 192.168.3.5-192.68.3.10;192.168.3.*;192.168.3.10
|
||||
* @param string $strPlageIP La plage d'adresses IP
|
||||
* @param string $adresseIP L'adresse IP à tester
|
||||
*/
|
||||
protected function checkPlagesIp($strPlageIP, $adresseIP)
|
||||
{
|
||||
$connected = false;
|
||||
$tabIpAllowed = explode(';', trim($strPlageIP));
|
||||
if (count($tabIpAllowed)==1 && $tabIpAllowed[0]=='') $tabIpAllowed = array();
|
||||
|
||||
foreach ($tabIpAllowed as $ip) {
|
||||
$tabPlages = explode('-', $ip);
|
||||
// C'est une plage d'adresse '-'
|
||||
if (isset($tabPlages[1]))
|
||||
$connected = $this->in_plage($tabPlages[0],$tabPlages[1],$adresseIP);
|
||||
else {
|
||||
// C'est une adresse avec ou sans masque '*'
|
||||
if (preg_match('/^'.str_replace('*','.*',str_replace('.','\.',$ip)).'$/', $adresseIP) )
|
||||
$connected=true;
|
||||
}
|
||||
if ($connected) break;
|
||||
}
|
||||
if (count($tabIpAllowed)==0) return false;
|
||||
elseif (!$connected) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enter description here ...
|
||||
* @param unknown_type $plage_1
|
||||
* @param unknown_type $plage_2
|
||||
* @param unknown_type $ip
|
||||
* @return boolean
|
||||
*/
|
||||
protected function in_plage($plage_1,$plage_2,$ip)
|
||||
{
|
||||
$ip2 = $this->getIpNumber($ip);
|
||||
if ($ip2>=$this->getIpNumber($plage_1) && $ip2<=$this->getIpNumber($plage_2))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converti une IP en nombre
|
||||
* @param string $ip Adresse IP
|
||||
* @return integer
|
||||
*/
|
||||
protected function getIpNumber($ip) {
|
||||
$tab=explode('.', $ip);
|
||||
return (($tab[0]*256*256*256) + ($tab[1]*256*256) + ($tab[2]*256) + ($tab[3]));
|
||||
}
|
||||
|
||||
}
|
@ -1,282 +0,0 @@
|
||||
<?php
|
||||
class AvisSituation
|
||||
{
|
||||
protected static $timeout = 10;
|
||||
protected static $retryDelay = 300;
|
||||
protected $fichierErreur;
|
||||
protected $pathLog;
|
||||
protected $pathAvisPdf;
|
||||
protected $siret;
|
||||
|
||||
public function __construct($siret)
|
||||
{
|
||||
require_once 'common/curl.php';
|
||||
$c = Zend_Registry::get('config');
|
||||
$this->pathAvisPdf = $c->profil->path->files;
|
||||
$this->pathLog = realpath($c->profil->path->data).'/log';
|
||||
$this->fichierErreur = $this->pathLog.'/aviserreur.lock';
|
||||
$this->siret = $siret;
|
||||
}
|
||||
|
||||
public function erreurcpt($action)
|
||||
{
|
||||
switch($action){
|
||||
case 'plus':
|
||||
if (file_exists($this->fichierErreur)){
|
||||
$handle = fopen($this->fichierErreur, 'r');
|
||||
$data = fgetcsv($handle, '1000', ';');
|
||||
$date_creation = $data[0];
|
||||
$date_modification = time();
|
||||
$nb = $data[2];
|
||||
fclose($handle);
|
||||
} else {
|
||||
$date_creation = time();
|
||||
$date_modification = time();
|
||||
$nb = 0;
|
||||
}
|
||||
$nb++;
|
||||
$handle = fopen($this->fichierErreur, 'w');
|
||||
fputcsv($handle, array($date_creation, $date_modification, $nb), ';');
|
||||
fclose($handle);
|
||||
break;
|
||||
case 'raz':
|
||||
$handle = fopen($this->fichierErreur, 'w');
|
||||
$date_creation = time();
|
||||
$date_modification = time();
|
||||
$nb = 0;
|
||||
fputcsv($handle, array($date_creation, $date_modification, $nb), ';');
|
||||
fclose($handle);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function nberreur()
|
||||
{
|
||||
if (file_exists($this->fichierErreur)){
|
||||
$handle = fopen($this->fichierErreur, 'r');
|
||||
$data = fgetcsv($handle, '1000', ';');
|
||||
$nb = $data[2];
|
||||
fclose($handle);
|
||||
} else {
|
||||
$nb = 1;
|
||||
}
|
||||
return $nb;
|
||||
}
|
||||
|
||||
public function erreur()
|
||||
{
|
||||
if (file_exists($this->fichierErreur))
|
||||
{
|
||||
$handle = fopen($this->fichierErreur, 'r');
|
||||
$data = fgetcsv($handle, '1000', ';');
|
||||
$date_creation = $data[0];
|
||||
$date_modification = $data[1];
|
||||
$nb = $data[2];
|
||||
fclose($handle);
|
||||
} else {
|
||||
$date_creation = 0;
|
||||
$date_modification = 0;
|
||||
}
|
||||
if ($nb>0 && $date_modification<$date_creation+$this->retryDelay){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function mailerreur()
|
||||
{
|
||||
$user = new Scores_Utilisateur();
|
||||
|
||||
$objet = "AVIS INSEE - (Date :".date("d")."/".date("m")."/".date("Y").")";
|
||||
$texte = 'Accès impossible au site de situation INSEE : '.
|
||||
$this->siret.EOL.
|
||||
'http://avis-situation-sirene.insee.fr'.EOL.
|
||||
'pour login '.$user->getLogin().EOL;
|
||||
|
||||
require_once 'Scores/Mail.php';
|
||||
$mail = new Mail();
|
||||
$mail->setFrom('contact');
|
||||
$mail->addToKey('support');
|
||||
$mail->setSubject($objet);
|
||||
$mail->setBodyText($texte);
|
||||
$mail->send();
|
||||
}
|
||||
|
||||
public function erreurmsg(){
|
||||
return "<h3>Le site partenaire n'a pas répondu correctement ou est indisponible. Merci d'essayer à nouveau ultérieurement.</h3>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupére l'avis de situtation à partir du site au format pdf
|
||||
* @param string $format Format 'pdf' ou 'array'
|
||||
* @param boolean $force True aller obligatoirement le chercher à l'insee
|
||||
* @return string Le PDF demandé
|
||||
*/
|
||||
public function get($format='pdf', $force=0)
|
||||
{
|
||||
$force=$force*1;
|
||||
$date=date('Ymd');
|
||||
$siren=trim(substr($this->siret,0,9));
|
||||
$nic=trim(substr($this->siret,9,5));
|
||||
$fichier = $this->pathAvisPdf.'/avis-'.$siren.'-'.$nic.'-'.$date.'.pdf';
|
||||
if ($format!='pdf') return 'Format pdf uniquement';
|
||||
if ($force==0 && file_exists($fichier))
|
||||
{
|
||||
// On délivre l'avis en base
|
||||
return file_get_contents($fichier);
|
||||
}
|
||||
else
|
||||
{
|
||||
/** Initialisation de la session sur le site de l'Insee **/
|
||||
$url = 'http://avis-situation-sirene.insee.fr/avisitu/jsp/avis.jsp';
|
||||
//http://avis-situation-sirene.insee.fr/avisituV2/jsp/avis.jsp';
|
||||
$referer = $cookie = '';
|
||||
$page = getUrl($url, $cookie, '', $referer, false, 'avis-situation-sirene.insee.fr', '', $this->timeout);
|
||||
//Code en 4xx ou 5xx signifie une erreur du serveur
|
||||
$codeN = floor($page['code']/100);
|
||||
if($codeN==4 || $codeN==5)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$referer = $url;
|
||||
$body = $page['body'];
|
||||
$serviceDispo = true;
|
||||
|
||||
//On doit retrouver sur la page
|
||||
/*
|
||||
<form name="demForm" method="post" action="/avisitu/IdentificationListeSiret.do
|
||||
*/
|
||||
if (preg_match("/<form name=\"demForm\" method=\"post\" action=\"\/avisitu\/IdentificationListeSiret.do/Uis", $body, $matches))
|
||||
{
|
||||
$fp = @fopen($fichier, "a");
|
||||
@fwrite($fp, $body);
|
||||
@fclose($fp);
|
||||
$cookie = $page['header']['Set-Cookie'];
|
||||
usleep(round(rand(500000,2000000)));
|
||||
|
||||
$dep=$depActif='';
|
||||
if ($nic=='') $crit='S'; // l'établissement siège
|
||||
else $crit=''; // établissement particulier, saisissez le NIC
|
||||
/* $crit='T'; // tous les établissements de l'entreprise
|
||||
$crit='T'; // tous les établissements de l'entreprise du département $dep
|
||||
$crit='A'; // tous les établissements actifs de l'entreprise
|
||||
$crit='A'; // tous les établissements actifs de l'entreprise du département $depActif
|
||||
*/
|
||||
//Post du formulaire
|
||||
$url = 'http://avis-situation-sirene.insee.fr/avisitu/IdentificationListeSiret.do';
|
||||
//$url='http://avis-situation-sirene.insee.fr/avisituV2/IdentificationDetailEtab.do';
|
||||
$post = array(
|
||||
'siren' => $siren,
|
||||
'critere' => $crit, // S pour le siège ou vide avec un NIC !!!
|
||||
'nic' => $nic,
|
||||
'departement' => $dep,
|
||||
'departement_actif' => $depActif,
|
||||
'bSubmit' => 'Valider');
|
||||
$page = getUrl($url, $cookie, $post, $referer, false, 'avis-situation-sirene.insee.fr', '', AVIS_TIMEOUT);
|
||||
|
||||
$body = $page['body'];
|
||||
$fp=@fopen($fichier, "a");
|
||||
@fwrite($fp, $body);
|
||||
@fclose($fp);
|
||||
|
||||
if (preg_match("/<h3>Fiche établissement<\/h3>/Uis", $body, $matches))//<li class="ongletActif">établissement</li>
|
||||
$tabInfos['fiche']='etab';
|
||||
|
||||
if (preg_match('/<div class="TitreGauche">(.*)<br\/>/Uis', $body, $matches)) {
|
||||
$tabInfos['raiSoc']=trim($matches[1]);
|
||||
}
|
||||
|
||||
if (preg_match("/Dernière mise à jour : (.*)<\/div>/Uis", $body, $matches))
|
||||
$tabInfos['dateMaj']=trim($matches[1]);
|
||||
|
||||
$s1=substr($siren,0,3);
|
||||
$s2=substr($siren,3,3);
|
||||
$s3=substr($siren,6,3);
|
||||
if (preg_match('/<div class="TitreDroite">(?:.*)('.$s1.'(?:.*)'.$s2.'(?:.*)'.$s3.')(?:.*)('.$nic.')(?:.*)<\/div>/Uis', $body, $matches)) {
|
||||
$tabInfos['siren'] = trim($matches[1]);
|
||||
$tabInfos['nic'] = trim($matches[2]);
|
||||
}
|
||||
|
||||
if (preg_match('/<label id="labelFiche">Etat : <\/label>(.*)depuis le(.*)<\/p>/Uis', $body, $matches)) {
|
||||
$tabInfos['etat'] = trim($matches[1]);
|
||||
$tabInfos['dateEtat']= trim($matches[2]);
|
||||
}
|
||||
|
||||
if (preg_match('/<label id="labelFiche">Catégorie d\'établissement : <\/label>(.*)<\/p>/Uis', $body, $matches)) {
|
||||
$tabInfos['typeEtab']= trim($matches[1]);
|
||||
}
|
||||
|
||||
$tabAdresse=array();
|
||||
if (preg_match('/<label id="labelFiche">Adresse d\'implantation : <\/label>(?:.*)<ul id="adresse">(.*)<\/ul>/Uis', $body, $matches)) {
|
||||
$strTmp=trim($matches[1]);
|
||||
$tabTmp=explode('</li>', $strTmp);
|
||||
foreach ($tabTmp as $i=>$strTmp)
|
||||
$tabAdresse[$i]=trim(str_replace('<li>','',$strTmp));
|
||||
}
|
||||
|
||||
if (preg_match('/<label id="labelFiche">(?:.*)Catégorie juridique :(?:.*)<\/label>(.*) - (.*)<\/p>/Uis', $body, $matches)) {
|
||||
$tabInfos['fjCod']= trim($matches[1]);
|
||||
$tabInfos['fjLib']= trim($matches[2]);
|
||||
}
|
||||
|
||||
if (preg_match('/<label id="labelFiche">Activité principale exercée :(?:.*)<\/label>(.*) - (.*)<\/p>/Uis', $body, $matches)) {
|
||||
$tabInfos['nafCod']=trim($matches[1]);
|
||||
$tabInfos['nafLib']=trim($matches[2]);
|
||||
}
|
||||
|
||||
if (preg_match('/<label id="labelFiche">(?:.*)Tranche d'effectif(.*)<\/label>(.*)<\/p>/Uis', $body, $matches)) {
|
||||
$tabInfos['effPeriode']=trim($matches[1]);
|
||||
$tabInfos['effTranche']=trim($matches[2]);
|
||||
}
|
||||
|
||||
$strCsv=$siren.';'.$nic.';'.$tabInfos['fiche'].';'.$tabInfos['dateMaj'].';'.
|
||||
$tabInfos['siren'].';'.$tabInfos['nic'].';'.$tabInfos['raiSoc'].';'.
|
||||
$tabInfos['etat'].';'.$tabInfos['dateEtat'].';'.$tabInfos['fjCod'].';'.$tabInfos['fjLib'].';'.
|
||||
$tabInfos['nafCod'].';'.$tabInfos['nafLib'].';'.$tabInfos['effPeriode'].';'.
|
||||
$tabInfos['effTranche'].';'.
|
||||
$tabInfos['typeEtab'].';'.@implode(';',@$tabAdresse).
|
||||
";\n";
|
||||
$fp=@fopen($this->pathLog."/avis.csv", "a");
|
||||
@fwrite($fp, $strCsv);
|
||||
@fclose($fp);
|
||||
|
||||
// $body contient l'avis de situation au format html
|
||||
$tabErreurs=array();
|
||||
if (preg_match('/name="erreurs" value="(.*)" class="erreurText" readonly/Ui', $body, $matches1) ||
|
||||
preg_match('/name="erreurs_bis" value="(.*)" class="erreurTextBis" readonly/Ui', $body, $matches2)) {
|
||||
$tabErreurs[]=@$matches1[1];
|
||||
$tabErreurs[]=@$matches2[1];
|
||||
die('<font color="red">ERREUR '.utf8_encode(implode(' ', $tabErreurs)).'</font>'); // Gérer le retour d'une erreur
|
||||
}
|
||||
usleep(round(rand(500000,1000000)));
|
||||
|
||||
if ($format=='pdf')
|
||||
{
|
||||
$referer = $url;
|
||||
$url = 'http://avis-situation-sirene.insee.fr/avisitu/AvisPdf.do';
|
||||
//$url='http://avis-situation-sirene.insee.fr/avisituV2/AvisPdf.do';
|
||||
$post = array(
|
||||
'siren'=>$siren,
|
||||
'nic'=>$nic,
|
||||
'bSubmit'=>'Avis+de+Situation'
|
||||
);
|
||||
$page = getUrl($url, $cookie, $post, $referer, false, 'avis-situation-sirene.insee.fr', '', AVIS_TIMEOUT);
|
||||
$body = $page['body'];
|
||||
$fp = @fopen($fichier, "w");
|
||||
@fwrite($fp, $body);
|
||||
@fclose($fp);
|
||||
} // Fin format PDF
|
||||
}
|
||||
else
|
||||
{
|
||||
$body = false;
|
||||
}
|
||||
return $body;
|
||||
} // Fin erreur initialisation
|
||||
} // Fin fichier disponible
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
require_once 'common/curl.php';
|
||||
|
||||
class BDF
|
||||
{
|
||||
@ -40,15 +39,18 @@ class BDF
|
||||
|
||||
function bdf_loadpage($url)
|
||||
{
|
||||
$page = getUrl($url, '', '', '', false, '', '',15);
|
||||
//Fichier non disponible
|
||||
if($page['code']==408 || $page['code']==400){
|
||||
try {
|
||||
$client = new Zend_Http_Client($url);
|
||||
$response = $client->request('GET');
|
||||
if ( $response->isSuccessful() ) {
|
||||
$output = $response->getBody();
|
||||
} else {
|
||||
$output = false;
|
||||
//Ecriture du fichier sur le serveur en local
|
||||
}else{
|
||||
$body = $page['body'];
|
||||
$output = $body;
|
||||
}
|
||||
} catch (Zend_Http_Client_Exception $e) {
|
||||
$output = false;
|
||||
}
|
||||
|
||||
|
||||
$output = utf8_encode($output);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class ExportCSV
|
||||
class Scores_Export_ArrayCsv
|
||||
{
|
||||
protected $entete = array();
|
||||
protected $enteteKey = array();
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class PagePrint
|
||||
class Scores_Export_Print
|
||||
{
|
||||
protected $controller = null;
|
||||
protected $action = null;
|
||||
@ -11,6 +11,7 @@ class PagePrint
|
||||
'identite-liens' => 'siret,id',
|
||||
'identite-groupe' => 'siret',
|
||||
'identite-evenements' => 'siret,id',
|
||||
'identite-contacts' => 'siret,id,get,filter',
|
||||
'dirigeant-liste' => 'siret,id',
|
||||
'dirigeant-histo' => 'siret,id',
|
||||
'finance-synthese' => 'siret,id,typeBilan',
|
||||
@ -30,11 +31,11 @@ class PagePrint
|
||||
'evaluation-valorisation' => 'siret,id',
|
||||
'pieces-bilans' => 'siret,id',
|
||||
'pieces-actes' => 'siret,id',
|
||||
'giant-full' => 'Pays,Type,CompanyId',
|
||||
'giant-compact' => 'Pays,Type,CompanyId',
|
||||
'giant-creditrecommendation' => 'Pays,Type,CompanyId',
|
||||
'giant-full' => 'Pays,Type,CompanyId,Language',
|
||||
'giant-compact' => 'Pays,Type,CompanyId,Language',
|
||||
'giant-creditrecommendation' => 'Pays,Type,CompanyId,Language',
|
||||
'surveillance-fichier' => 'nomFic,filtre',
|
||||
'worldcheck-matchcontent' => 'matchIdentifier',
|
||||
'worldcheck-matchcontent' => 'matchIdentifier,nameType',
|
||||
);
|
||||
|
||||
protected $pagePDF = array(
|
||||
@ -44,6 +45,7 @@ class PagePrint
|
||||
'identite-liens' => 'siret,id',
|
||||
'identite-groupe' => 'siret',
|
||||
'identite-evenements' => 'siret,id',
|
||||
'identite-contacts' => 'siret,id,get,filter',
|
||||
'dirigeant-liste' => 'siret,id',
|
||||
'dirigeant-histo' => 'siret,id',
|
||||
'finance-synthese' => 'siret,id,typeBilan',
|
||||
@ -63,10 +65,10 @@ class PagePrint
|
||||
'evaluation-valorisation' => 'siret,id',
|
||||
'pieces-bilans' => 'siret,id',
|
||||
'pieces-actes' => 'siret,id',
|
||||
'giant-full' => 'Pays,Type,CompanyId',
|
||||
'giant-compact' => 'Pays,Type,CompanyId',
|
||||
'giant-creditrecommendation' => 'Pays,Type,CompanyId',
|
||||
'worldcheck-matchcontent' => 'matchIdentifier',
|
||||
'giant-full' => 'Pays,Type,CompanyId,Language',
|
||||
'giant-compact' => 'Pays,Type,CompanyId,Language',
|
||||
'giant-creditrecommendation' => 'Pays,Type,CompanyId,Language',
|
||||
'worldcheck-matchcontent' => 'matchIdentifier,nameType',
|
||||
);
|
||||
|
||||
protected $pageXML = array(
|
||||
@ -75,6 +77,7 @@ class PagePrint
|
||||
'identite-etablissements' => 'siret,id,actif',
|
||||
'identite-liens' => 'siret,id',
|
||||
'identite-evenements' => 'siret,id',
|
||||
'identite-contacts' => 'siret,id,get,filter',
|
||||
'dirigeant-liste' => 'siret,id',
|
||||
'dirigeant-histo' => 'siret,id',
|
||||
'finance-synthese' => 'siret,id,typeBilan',
|
||||
@ -91,7 +94,10 @@ class PagePrint
|
||||
'evaluation-indiscore2' => 'siret,id',
|
||||
'evaluation-indiscore3' => 'siret,id',
|
||||
'evaluation-valorisation' => 'siret,id',
|
||||
'worldcheck-matchcontent' => 'matchIdentifier',
|
||||
'giant-full' => 'Pays,Type,CompanyId,Language',
|
||||
'giant-compact' => 'Pays,Type,CompanyId,Language',
|
||||
'giant-creditrecommendation' => 'Pays,Type,CompanyId,Language',
|
||||
'worldcheck-matchcontent' => 'matchIdentifier,nameType',
|
||||
);
|
||||
|
||||
public function __construct($controller, $action)
|
@ -32,26 +32,31 @@ class Scores_Finance_Liasse
|
||||
'source' => $data->SOURCE,
|
||||
);
|
||||
|
||||
$postesData = array();
|
||||
foreach ( $data->POSTES->item as $element ) {
|
||||
$postesData[$element->id] = $element->val;
|
||||
}
|
||||
|
||||
//Transformation Simplifié en Normal
|
||||
if ( $data->CONSOLIDE == 'S'){
|
||||
$postesData = $this->bilanSimplifie2Normal($postesData);
|
||||
}
|
||||
|
||||
//Affectaction des postes
|
||||
foreach ($data->POSTES->item as $element){
|
||||
foreach ($postesData as $id => $val){
|
||||
if (in_array($element->id, array(
|
||||
'YP', 'YP1', '376', // Effectifs 2033 et 2050
|
||||
'M2G', 'M2H', // Autres effectifs
|
||||
'ZK', 'ZK1', // Taux
|
||||
'IJ', 'JG', 'JH', 'JJ', 'ZR', // pour holding/ste mere
|
||||
'XP' //numero de centre de gestion agréé
|
||||
'XP' // numero de centre de gestion agréé
|
||||
)))
|
||||
{
|
||||
$this->postes[$element->id] = number_format($element->val, 0, '', ' ');
|
||||
$this->postes[$id] = number_format($val, 0, '', ' ');
|
||||
} else {
|
||||
$this->postes[$element->id] = $this->dMontant($element->val);
|
||||
$this->postes[$id] = $this->dMontant($val);
|
||||
}
|
||||
}
|
||||
|
||||
//Transformation Simplifié en Normal
|
||||
if ( $data->CONSOLIDE == 'S'){
|
||||
$this->postes = $this->bilanSimplifie2Normal($this->postes);
|
||||
}
|
||||
}
|
||||
|
||||
public function getInfo($key)
|
||||
@ -72,115 +77,245 @@ class Scores_Finance_Liasse
|
||||
function bilanSimplifie2Normal($bilanRS)
|
||||
{
|
||||
$tabBS2BN = array(
|
||||
'AH'=>'010',
|
||||
'AI'=>'012',
|
||||
'AI1'=>'013',
|
||||
'AJ'=>'014',
|
||||
'AK'=>'016',
|
||||
'AK1'=>'017',
|
||||
'AT'=>'028',
|
||||
'AU'=>'030',
|
||||
'AU1'=>'031',
|
||||
'BH'=>'040',
|
||||
'BI'=>'042',
|
||||
'BI1'=>'043',
|
||||
'BJ'=>'044',
|
||||
'BK'=>'048',
|
||||
'BK1'=>'049',
|
||||
'BL'=>'050',
|
||||
'BM'=>'052',
|
||||
'BM1'=>'053',
|
||||
'BT'=>'060',
|
||||
'BU'=>'062',
|
||||
'BU1'=>'063',
|
||||
'BV'=>'064',
|
||||
'BW'=>'066',
|
||||
'BW1'=>'067',
|
||||
'BX'=>'068',
|
||||
'BY'=>'070',
|
||||
'BY1'=>'071',
|
||||
'BZ'=>'072',
|
||||
'CA'=>'074',
|
||||
'CA1'=>'075',
|
||||
'CD'=>'080',
|
||||
'CE'=>'082',
|
||||
'CE1'=>'083',
|
||||
'CF'=>'084',
|
||||
'CG'=>'086',
|
||||
'CG1'=>'087',
|
||||
'CH'=>'092',
|
||||
'CI'=>'094',
|
||||
'CI1'=>'095',
|
||||
'CJ'=>'096',
|
||||
'CK'=>'098',
|
||||
'CK1'=>'099',
|
||||
'CO'=>'110',
|
||||
'1A'=>'112',
|
||||
'1A1'=>'113',
|
||||
'DA'=>'120',
|
||||
'DC'=>'124',
|
||||
'DD'=>'126',
|
||||
'DF'=>'130',
|
||||
'DG'=>'132',
|
||||
'DH'=>'134',
|
||||
'DI'=>'136',
|
||||
'DK'=>'140',
|
||||
'DL'=>'142',
|
||||
'DR'=>'154',
|
||||
'DP'=>'154',
|
||||
'DU'=>'156',
|
||||
'DV'=>'169',
|
||||
'DW'=>'164',
|
||||
'DX'=>'166',
|
||||
'EA'=>'172-169',
|
||||
'EB'=>'174',
|
||||
'EC'=>'176',
|
||||
'EE'=>'180',
|
||||
'EH'=>'156-195',
|
||||
'FA'=>'210-209',
|
||||
'FB'=>'209',
|
||||
'FC'=>'210',
|
||||
'FD'=>'214-215',
|
||||
'FE'=>'215',
|
||||
'FF'=>'214',
|
||||
'FH'=>'217',
|
||||
'FI'=>'218',
|
||||
'FK'=>'209+215+217',
|
||||
'FL'=>'210+214+218',
|
||||
'FM'=>'222',
|
||||
'FN'=>'224',
|
||||
'FO'=>'226',
|
||||
'FQ'=>'230',
|
||||
'FR'=>'232',
|
||||
'FS'=>'234',
|
||||
'FT'=>'236',
|
||||
'FU'=>'238',
|
||||
'FV'=>'240',
|
||||
'FW'=>'242',
|
||||
'FX'=>'244',
|
||||
'FY'=>'250',
|
||||
'FZ'=>'252',
|
||||
'GA'=>'254',
|
||||
'GE'=>'262',
|
||||
'GF'=>'264',
|
||||
'GG'=>'270',
|
||||
'GP'=>'280',
|
||||
'GU'=>'294',
|
||||
'GW'=>'270+280+294',
|
||||
'HD'=>'290',
|
||||
'HH'=>'300',
|
||||
'HI'=>'290-300',
|
||||
'HK'=>'306',
|
||||
'HL'=>'232+280+290',
|
||||
'HM'=>'264+294+300+306',
|
||||
'HN'=>'310',
|
||||
'YY'=>'374',
|
||||
'YZ'=>'378',
|
||||
'YP'=>'376',
|
||||
//2033 ACTIF PASSIF
|
||||
'AH' => '010',
|
||||
'AI' => '012',
|
||||
'AI1' => '013',
|
||||
'AI2' => 'N00',
|
||||
|
||||
//@todo : Traiter N-1
|
||||
'AJ' => '014',
|
||||
'AK' => '016',
|
||||
'AK1' => '017',
|
||||
'AK2' => 'N01',
|
||||
|
||||
'AT' => '028',
|
||||
'AU' => '030',
|
||||
'AU1' => '031',
|
||||
'AU2' => 'N02',
|
||||
|
||||
'BH' => '040',
|
||||
'BI' => '042',
|
||||
'BI1' => '043',
|
||||
'BI2' => 'N03',
|
||||
|
||||
'BJ' => '044',
|
||||
'BK' => '048',
|
||||
'BK1' => '049',
|
||||
'BK2' => 'N04',
|
||||
|
||||
'BL' => '050',
|
||||
'BM' => '052',
|
||||
'BM1' => '053',
|
||||
'BM2' => 'N05',
|
||||
|
||||
'BT' => '060',
|
||||
'BU' => '062',
|
||||
'BU1' => '063',
|
||||
'BU2' => 'N06',
|
||||
|
||||
'BV' => '064',
|
||||
'BW' => '066',
|
||||
'BW1' => '067',
|
||||
'BW2' => 'N07',
|
||||
|
||||
'BX' => '068',
|
||||
'BY' => '070',
|
||||
'BY1' => '071',
|
||||
'BY2' => 'N08',
|
||||
|
||||
'BZ' => '072',
|
||||
'CA' => '074',
|
||||
'CA1' => '075',
|
||||
'CA2' => 'N09',
|
||||
|
||||
'CD' => '080',
|
||||
'CE' => '082',
|
||||
'CE1' => '083',
|
||||
'CE2' => 'N10',
|
||||
|
||||
'CF' => '084',
|
||||
'CG' => '086',
|
||||
'CG1' => '087',
|
||||
'CG2' => 'N11',
|
||||
|
||||
'CH' => '092',
|
||||
'CI' => '094',
|
||||
'CI1' => '095',
|
||||
'CI2' => 'N13',
|
||||
|
||||
'CJ' => '096',
|
||||
'CK' => '098',
|
||||
'CK1' => '099',
|
||||
'CK2' => 'N14',
|
||||
|
||||
'CO' => '110',
|
||||
'1A' => '112',
|
||||
'1A1' => '113',
|
||||
'1A2' => 'N15',
|
||||
|
||||
'DA' => '120',
|
||||
'DA1' => 'N16',
|
||||
|
||||
'DC' => '124',
|
||||
'DC1' => 'N17',
|
||||
|
||||
'DD' => '126',
|
||||
'DD1' => 'N18',
|
||||
|
||||
'DF' => '130',
|
||||
'DF1' => 'N19',
|
||||
|
||||
'DG' => '132',
|
||||
'DG1' => 'N20',
|
||||
|
||||
'DH' => '134',
|
||||
'DH1' => 'N21',
|
||||
|
||||
'DI' => '136',
|
||||
'DI1' => 'N22',
|
||||
|
||||
'DK' => '140',
|
||||
'DK1' => 'N23',
|
||||
|
||||
'DL' => '142',
|
||||
'DL1' => 'N24',
|
||||
|
||||
'DR' => '154',
|
||||
'DR1' => 'N25',
|
||||
|
||||
'DU' => '156',
|
||||
'DU1' => 'N26',
|
||||
|
||||
'DW' => '164',
|
||||
'DW1' => 'N27',
|
||||
|
||||
'DX' => '166',
|
||||
'DX1' => 'N28',
|
||||
|
||||
'EA' => '172',
|
||||
'EA1' => 'N29',
|
||||
|
||||
'EB' => '174',
|
||||
'EB1' => 'N30',
|
||||
|
||||
'EC' => '176',
|
||||
'EC1' => 'N31',
|
||||
|
||||
'EE' => '180',
|
||||
'EE1' => 'N32',
|
||||
|
||||
'EH' => '156-195',
|
||||
|
||||
//2033 CDR
|
||||
'FA' => '210-209',
|
||||
'FB' => '209',
|
||||
'FC' => '210',
|
||||
'FC1' => 'N33',
|
||||
|
||||
'FD' => '214-215',
|
||||
'FE' => '215',
|
||||
'FF' => '214',
|
||||
'FF1' => 'N34',
|
||||
|
||||
'FG' => '218-217',
|
||||
'FH' => '217',
|
||||
'FI' => '218',
|
||||
'FI1' => 'N35',
|
||||
|
||||
'FJ' => '210+214+218-209-215-217',
|
||||
'FK' => '209+215+217',
|
||||
'FL' => '210+214+218',
|
||||
'FL1' => 'N33+N34+N35',
|
||||
|
||||
'FM' => '222',
|
||||
'FM1' => 'N36',
|
||||
|
||||
'FN' => '224',
|
||||
'FN1' => 'N37',
|
||||
|
||||
'FO' => '226',
|
||||
'FO1' => 'N38',
|
||||
|
||||
'FQ' => '230',
|
||||
'FQ1' => 'N39',
|
||||
|
||||
'FR' => '232',
|
||||
'FR1' => 'N40',
|
||||
|
||||
'FS' => '234',
|
||||
'FS1' => 'N41',
|
||||
|
||||
'FT' => '236',
|
||||
'FT1' => 'N42',
|
||||
|
||||
'FU' => '238',
|
||||
'FU1' => 'N43',
|
||||
|
||||
'FV' => '240',
|
||||
'FV1' => 'N44',
|
||||
|
||||
'FW' => '242',
|
||||
'FW1' => 'N45',
|
||||
|
||||
'FX' => '244',
|
||||
'FX1' => 'N46',
|
||||
|
||||
'FY' => '250',
|
||||
'FY1' => 'N47',
|
||||
|
||||
'FZ' => '252',
|
||||
'FZ1' => 'N48',
|
||||
|
||||
'GA' => '254',
|
||||
'GA1' => 'N49',
|
||||
|
||||
'GE' => '262',
|
||||
'GE1' => 'N51',
|
||||
|
||||
'GF' => '264',
|
||||
'GF1' => 'N52',
|
||||
|
||||
'GG' => '270',
|
||||
'GG1' => 'N53',
|
||||
|
||||
'GP' => '280',
|
||||
'GP1' => 'N54',
|
||||
|
||||
'GU' => '294',
|
||||
'GU1' => 'N56',
|
||||
|
||||
'GV' => '280-294', //GP-GU
|
||||
'GV1' => 'N54-N56', //GP1-GU1
|
||||
|
||||
'GW' => '270+280+294', //GG+GH-GI+GV ???
|
||||
'GW1' => 'N53+N54+N56',
|
||||
|
||||
'HD' => '290',
|
||||
'HD1' => 'N55',
|
||||
|
||||
'HH' => '300',
|
||||
'HH1' => 'N57',
|
||||
|
||||
'HI' => '290-300',
|
||||
'HI1' => 'N55-N57',
|
||||
|
||||
'HK' => '306',
|
||||
'HK1' => 'N58',
|
||||
|
||||
'HL' => '232+280+290',
|
||||
'HL1' => 'N40+N54+N55',
|
||||
|
||||
'HM' => '264+294+300+306',
|
||||
'HM1' => 'N52+N56+N57+N58',
|
||||
|
||||
'HN' => '310',
|
||||
'HN1' => 'N59',
|
||||
|
||||
'YY' => '374',
|
||||
|
||||
'YZ' => '378',
|
||||
|
||||
'YP' => '376',
|
||||
);
|
||||
|
||||
$bilanRN=array();
|
||||
@ -206,7 +341,7 @@ class Scores_Finance_Liasse
|
||||
}
|
||||
else $bilanRN[$posteRN]=$bilanRS[$formule];
|
||||
}
|
||||
if ($bilanRS['240']<>0) {
|
||||
if ( $bilanRS['240']<>0 ) {
|
||||
$bilanRN['BL']=$bilanRS['050'];
|
||||
$bilanRN['BM']=$bilanRS['052'];
|
||||
} else {
|
||||
@ -214,22 +349,31 @@ class Scores_Finance_Liasse
|
||||
$bilanRN['BO']=$bilanRS['052'];
|
||||
}
|
||||
|
||||
if ($bilanRS['070']<>0 || $bilanRS['074']<>0 || $bilanRS['052']<>0 || $bilanRS['062']<>0)
|
||||
if ( $bilanRS['070']<>0 || $bilanRS['074']<>0 || $bilanRS['052']<>0 || $bilanRS['062']<>0 ) {
|
||||
$bilanRN['GC']=$bilanRS['256'];
|
||||
elseif ($bilanRS['070']==0 && $bilanRS['074']==0 && $bilanRS['052']==0 && $bilanRS['062']==0 && $bilanRS['254']<>0)
|
||||
} elseif ($bilanRS['070']==0 && $bilanRS['074']==0 && $bilanRS['052']==0 && $bilanRS['062']==0 && $bilanRS['254']<>0 ) {
|
||||
$bilanRN['GD']=$bilanRS['256'];
|
||||
}
|
||||
|
||||
if ($bilanRS['584']<>0) {
|
||||
if ( $bilanRS['071']<>0 || $bilanRS['075']<>0 || $bilanRS['053']<>0 || $bilanRS['063']<>0 ) {
|
||||
$bilanRN['GC1']=$bilanRS['N50'];
|
||||
} elseif ($bilanRS['071']==0 || $bilanRS['075']==0 || $bilanRS['053']==0 || $bilanRS['063']==0 && $bilanRS['N49']<>0 ) {
|
||||
$bilanRN['GD1']=$bilanRS['N50'];
|
||||
}
|
||||
|
||||
if ( $bilanRS['584']<>0 ) {
|
||||
$bilanRN['HB']=$bilanRS['584'];
|
||||
$bilanRN['HA']=$bilanRS['290']-$bilanRS['584'];
|
||||
} else
|
||||
} else {
|
||||
$bilanRN['HA']=$bilanRS['290'];
|
||||
}
|
||||
|
||||
if ($bilanRS['582']<>0) {
|
||||
if ( $bilanRS['582']<>0 ) {
|
||||
$bilanRN['HF']=$bilanRS['582'];
|
||||
$bilanRN['HE']=$bilanRS['582']-$bilanRS['300'];
|
||||
} else
|
||||
} else {
|
||||
$bilanRN['HE']=$bilanRS['300'];
|
||||
}
|
||||
|
||||
return $bilanRN;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Google
|
||||
class Scores_Google_Maps
|
||||
{
|
||||
protected $url = 'http://maps.google.fr/maps?f=q&hl=fr&geocode=&q=';
|
||||
protected $urlPhoto = '';
|
@ -22,7 +22,7 @@ class Scores_Google_Streetview
|
||||
|
||||
/**
|
||||
* GPS ou Adresse
|
||||
* @var strign
|
||||
* @var string
|
||||
*/
|
||||
protected $location = null;
|
||||
|
||||
@ -53,7 +53,7 @@ class Scores_Google_Streetview
|
||||
/**
|
||||
* Indicates the compass heading of the camera (0 to 360)
|
||||
*/
|
||||
protected $heading = 0;
|
||||
protected $heading = null;
|
||||
|
||||
/**
|
||||
* Number of image by the circle (360°)
|
||||
@ -74,14 +74,51 @@ class Scores_Google_Streetview
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public function __construct()
|
||||
protected $siret;
|
||||
|
||||
/**
|
||||
* Maximum request per day
|
||||
* @var int
|
||||
*/
|
||||
protected $maxRequestPerDay = 25000;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var unknown
|
||||
*/
|
||||
protected $mode;
|
||||
|
||||
/**
|
||||
* Mode GPS
|
||||
* @var unknown
|
||||
*/
|
||||
const MODE_GPS = 1;
|
||||
|
||||
/**
|
||||
* Mode Adresse
|
||||
* @var unknown
|
||||
*/
|
||||
const MODE_ADDRESS = 2;
|
||||
|
||||
/**
|
||||
* Google Streetview
|
||||
* Get image by GPS coord or by adresse
|
||||
* Save image reference in a database
|
||||
* GpsLat, GpsLong, Adresse, Image, Date
|
||||
* Save request that give no imagery
|
||||
* Siren, Nic, Date
|
||||
* Save in database, with a counter the number of request by day
|
||||
*/
|
||||
public function __construct($siret)
|
||||
{
|
||||
$this->size = '320x320';
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$ths->path = realpath($c->profil->path->data).'/google/streetview';
|
||||
$this->siret = $siret;
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$this->path = realpath($c->profil->path->data).'/google/streetview';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -91,18 +128,23 @@ class Scores_Google_Streetview
|
||||
*/
|
||||
public function setLocationGeo($lattitude, $longitude)
|
||||
{
|
||||
$this->mode = self::MODE_GPS;
|
||||
$this->location = $lattitude.','.$longitude;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown $adresse
|
||||
* @param string $adresse
|
||||
*/
|
||||
public function setLocationTxt($adresse){}
|
||||
public function setLocationTxt($adresse)
|
||||
{
|
||||
$this->mode = self::MODE_ADDRESS;
|
||||
$this->location = $adresse;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown $num
|
||||
* @param int $num
|
||||
*/
|
||||
public function setHeading($num)
|
||||
{
|
||||
@ -127,7 +169,7 @@ class Scores_Google_Streetview
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Construct the image URL
|
||||
* @return string
|
||||
*/
|
||||
public function urlImg()
|
||||
@ -137,7 +179,7 @@ class Scores_Google_Streetview
|
||||
$params = array( 'size', 'location', 'fov', 'pitch', 'sensor', 'heading' );
|
||||
foreach ($params as $param) {
|
||||
if ( $this->{$param} !== null ) {
|
||||
$url.= '&'.$param.'='. $this->{$param};
|
||||
$url.= '&'.$param.'='. urlencode($this->{$param});
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,12 +191,19 @@ class Scores_Google_Streetview
|
||||
*/
|
||||
public function getImg()
|
||||
{
|
||||
require_once 'common/curl.php';
|
||||
$page = getUrl($this->url, '', '', '', false);
|
||||
|
||||
if ( !in_array($page['code'], array(400, 408, 403)) ) {
|
||||
$body = $page['body'];
|
||||
file_put_contents($this->pathImg(), $body);
|
||||
try {
|
||||
$client = new Zend_Http_Client($this->url);
|
||||
$client->setStream();
|
||||
$response = $client->request('GET');
|
||||
if ( $response->isSuccessful() ) {
|
||||
if (!copy($response->getStreamName(), $this->pathImg())) {
|
||||
Zend_Registry::get('firebug')->info('Erreur copie image !');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} catch (Zend_Http_Client_Exception $e) {
|
||||
Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,7 +213,11 @@ class Scores_Google_Streetview
|
||||
*/
|
||||
public function pathImg()
|
||||
{
|
||||
if ($this->mode == self::MODE_GPS) {
|
||||
$filename = $this->siret.'-'.$this->heading . '.' . $this->extension;
|
||||
} else if ($this->mode == self::MODE_ADDRESS) {
|
||||
$filename = $this->siret.'-ADDRESS' . $this->extension;
|
||||
}
|
||||
return $this->path . DIRECTORY_SEPARATOR . $filename;
|
||||
}
|
||||
|
||||
@ -172,14 +225,33 @@ class Scores_Google_Streetview
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function display()
|
||||
public function serveUrl()
|
||||
{
|
||||
$file = $this->pathImg();
|
||||
if ( !file_exists($file) ) {
|
||||
$this->getImg();
|
||||
return $this->urlImg();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function serveImg()
|
||||
{
|
||||
$this->url = $this->urlImg();
|
||||
Zend_Registry::get('firebug')->info('URL = '.$file);
|
||||
$file = $this->pathImg();
|
||||
Zend_Registry::get('firebug')->info('Filename = '.$file);
|
||||
$imgExist = false;
|
||||
if ( !file_exists($file) && APPLICATION_ENV == 'production' ) {
|
||||
$imgExist = $this->getImg();
|
||||
} elseif (file_exists($file)) {
|
||||
$imgExist = true;
|
||||
}
|
||||
|
||||
if ($imgExist) {
|
||||
return basename($file);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -11,7 +11,6 @@ class IdentiteEntreprise
|
||||
*/
|
||||
public function __construct($identite)
|
||||
{
|
||||
require_once 'common/dates.php';
|
||||
$this->identite = $identite;
|
||||
$this->view = new Zend_View();
|
||||
}
|
||||
@ -110,7 +109,7 @@ class IdentiteEntreprise
|
||||
|
||||
public function getCapitalisationLabel()
|
||||
{
|
||||
return 'Capitalisation';
|
||||
return 'Capitalisation boursière';
|
||||
}
|
||||
public function getCapitalisationTexte()
|
||||
{
|
||||
@ -118,8 +117,9 @@ class IdentiteEntreprise
|
||||
if ($this->identite->Isin == '' || intval($capitalisation) == 0)
|
||||
return false;
|
||||
|
||||
return number_format($capitalisation, 0, '', ' ').' € au '.
|
||||
WDate::dateT('Y-m-d', 'd/m/Y', $this->identite->Bourse->derCoursDate);
|
||||
$date = new Zend_Date($this->identite->Bourse->derCoursDate, 'yyyy-MM-dd');
|
||||
|
||||
return number_format($capitalisation, 0, '', ' ').' € au '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
public function getNumRCLabel()
|
||||
@ -217,8 +217,8 @@ class IdentiteEntreprise
|
||||
if( $this->identite->Actif != 0) {
|
||||
//Activité économique
|
||||
if (!empty($this->identite->ActifEcoDate)) {
|
||||
$title.= "Absence d'activité économique depuis le ".
|
||||
WDate::dateT('Ymd', 'd/m/Y', $this->identite->ActifEcoDate)."<br/>";
|
||||
$date = new Zend_Date($this->identite->ActifEcoDate, 'yyyyMMdd');
|
||||
$title.= "Absence d'activité économique depuis le ".$date->toString('dd/MM/yyyy')."<br/>";
|
||||
}
|
||||
|
||||
//Activité economique type
|
||||
@ -226,17 +226,26 @@ class IdentiteEntreprise
|
||||
case 'NPAI':
|
||||
$title.= '<img src="/themes/default/images/interfaces/icone_courrier.png"/>';
|
||||
$title.= ' NPAI ';
|
||||
if (!empty($this->identite->ActifEcoDate)) $title.= ' depuis le '.WDate::dateT('Ymd', 'd/m/Y', $this->identite->ActifEcoDate);
|
||||
if (!empty($this->identite->ActifEcoDate)) {
|
||||
$date = new Zend_Date($this->identite->ActifEcoDate, 'yyyyMMdd');
|
||||
$title.= ' depuis le '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
$title.= '<br/>';
|
||||
break;
|
||||
case 'PFER':
|
||||
$title.= 'Etablisement présumé fermé';
|
||||
if (!empty($this->identite->ActifEcoDate)) $title.= ' depuis le '.WDate::dateT('Ymd', 'd/m/Y', $this->identite->ActifEcoDate);
|
||||
if (!empty($this->identite->ActifEcoDate)) {
|
||||
$date = new Zend_Date($this->identite->ActifEcoDate, 'yyyyMMdd');
|
||||
$title.= ' depuis le '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
$title.= '<br/>';
|
||||
break;
|
||||
case 'ECOF':
|
||||
$title.= 'Cessation économique';
|
||||
if (!empty($this->identite->ActifEcoDate)) $title.= ' depuis le '.WDate::dateT('Ymd', 'd/m/Y', $this->identite->ActifEcoDate);
|
||||
if (!empty($this->identite->ActifEcoDate)) {
|
||||
$date = new Zend_Date($this->identite->ActifEcoDate, 'yyyyMMdd');
|
||||
$title.= ' depuis le '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
$title.= '<br/>';
|
||||
break;
|
||||
}
|
||||
@ -244,15 +253,16 @@ class IdentiteEntreprise
|
||||
|
||||
//Ancien siege
|
||||
if (!empty($this->identite->AncienSiegeDateFin)){
|
||||
$title.= "Cet établissement était le siège social jusqu'au ".
|
||||
WDate::dateT('Ymd', 'd/m/Y', $this->identite->AncienSiegeDateFin)."<br/>";
|
||||
$date = new Zend_Date($this->identite->AncienSiegeDateFin, 'yyyyMMdd');
|
||||
$title.= "Cet établissement était le siège social jusqu'au ".$date->toString('dd/MM/yyyy')."<br/>";
|
||||
}
|
||||
if (count($this->identite->AutreSiret->item)>0){
|
||||
//Prédécesseur
|
||||
foreach($this->identite->AutreSiret->item as $pre){
|
||||
if ($pre->type == 'pre'){
|
||||
if (!empty($pre->dateEve)) {
|
||||
$title.= "Avant le ".WDate::dateT('Ymd', 'd/m/Y', $pre->dateEve).", ";
|
||||
$date = new Zend_Date($pre->dateEve, 'yyyyMMdd');
|
||||
$title.= "Avant le ".$date->toString('dd/MM/yyyy').", ";
|
||||
}
|
||||
$adresse = '';
|
||||
for($i=1;$i<=7;$i++){
|
||||
@ -276,7 +286,8 @@ class IdentiteEntreprise
|
||||
if ($suc->type == 'suc'){
|
||||
$title.= "Cet établissement a déménagé ";
|
||||
if (!empty($suc->dateEve)) {
|
||||
$title.= "le ".WDate::dateT('Ymd', 'd/m/Y', $suc->dateEve)." ";
|
||||
$date = new Zend_Date($suc->dateEve, 'yyyyMMdd');
|
||||
$title.= "le ".$date->toString('dd/MM/yyyy')." ";
|
||||
}
|
||||
$adresse = '';
|
||||
for($i=1;$i<=7;$i++){
|
||||
@ -317,7 +328,8 @@ class IdentiteEntreprise
|
||||
}
|
||||
|
||||
if ($this->identite->Actif==0 && $this->identite->DateClotEt != '') {
|
||||
$data.= "<i> (Fin d'activité en ".WDate::dateT('Ymd', 'm/Y', $this->identite->DateClotEt).')</i>';
|
||||
$date = new Zend_Date($this->identite->DateClotEt, 'yyyyMMdd');
|
||||
$data.= "<i> (Fin d'activité en ".$date->toString('dd/MM/yyyy').')</i>';
|
||||
}
|
||||
|
||||
$user = new Scores_Utilisateur();
|
||||
@ -339,7 +351,8 @@ class IdentiteEntreprise
|
||||
if ( in_array(substr($this->identite->SituationJuridique,0,1), array('P', 'R')) ) {
|
||||
$dateRad = '';
|
||||
if($this->identite->DateRadiation!='' && $this->identite->DateRadiation!='0000-00-00'){
|
||||
$dateRad = WDate::dateT('Ymd', 'd/m/Y', str_replace('-','',$this->identite->DateRadiation));
|
||||
$date = new Zend_Date(str_replace('-','',$this->identite->DateRadiation),'yyyyMMdd');
|
||||
$dateRad = $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
//Procédure collective
|
||||
if ($this->identite->SituationJuridique=='PL') {
|
||||
@ -411,7 +424,7 @@ class IdentiteEntreprise
|
||||
|
||||
public function getRaisonSocialeLabel()
|
||||
{
|
||||
return 'Raison Sociale';
|
||||
return 'Dénomination Sociale';
|
||||
}
|
||||
public function getRaisonSocialeTexte()
|
||||
{
|
||||
@ -428,7 +441,7 @@ class IdentiteEntreprise
|
||||
}
|
||||
public function getRaisonSocialeAide()
|
||||
{
|
||||
return "Raison sociale / Nom de l'entreprise (format court avec abréviations)";
|
||||
return "Dénomination sociale / Nom de l'entreprise (format court avec abréviations)";
|
||||
}
|
||||
|
||||
public function getNomCommercialLabel()
|
||||
@ -491,8 +504,8 @@ class IdentiteEntreprise
|
||||
$data = $this->identite->FJ.' : '.$this->identite->FJ_Lib;
|
||||
if ($this->identite->FJ!=$this->identite->FJ2 &&
|
||||
$this->identite->FJ2!='' && $this->identite->FJ2_Lib!='') {
|
||||
$data.= '<img src="/themes/default/images/interfaces/exclamation.png" title="Forme jurique à l\'INSEE : '.
|
||||
$this->identite->FJ2_Lib.' ('.$this->identite->FJ2.')"/>';
|
||||
$data.= '<span class="ui-icon ui-icon-info" title="Forme jurique à l\'INSEE : '.
|
||||
$this->identite->FJ2_Lib.' ('.$this->identite->FJ2.')" style="float:right; margin-right: .3em;"></span>';
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
@ -506,7 +519,9 @@ class IdentiteEntreprise
|
||||
if (empty($this->identite->DateImmat) || $this->identite->DateImmat=='0000-00-00') {
|
||||
return false;
|
||||
}
|
||||
return WDate::dateT('Y-m-d', 'd/m/Y',$this->identite->DateImmat);
|
||||
|
||||
$date = new Zend_Date($this->identite->DateImmat, 'yyyy-MM-dd');
|
||||
return $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
public function getDateCreaEnLabel()
|
||||
@ -516,10 +531,14 @@ class IdentiteEntreprise
|
||||
public function getDateCreaEnTexte()
|
||||
{
|
||||
$dateCreationEn = str_replace('-', '', $this->identite->DateCreaEn);
|
||||
if ( $dateCreationEn!='' ) {
|
||||
if (substr($dateCreationEn, -2) * 1 == 0) {
|
||||
$data = WDate::dateT('Ymd', 'm/Y', $dateCreationEn);
|
||||
$date = new Zend_Date($dateCreationEn, 'yyyyMMdd');
|
||||
$data = $date->toString('MM/yyyy');
|
||||
} else {
|
||||
$data = WDate::dateT('Ymd', 'd/m/Y', $dateCreationEn);
|
||||
$date = new Zend_Date($dateCreationEn, 'yyyyMMdd');
|
||||
$data = $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
@ -532,11 +551,12 @@ class IdentiteEntreprise
|
||||
{
|
||||
$dateCreationEt = str_replace('-', '', $this->identite->DateCreaEt);
|
||||
if ($dateCreationEt * 1 <> 0) {
|
||||
$date = new WDate();
|
||||
if (substr($dateCreationEt, -2) * 1 == 0) {
|
||||
$data = $date->dateT('Ymd', 'm/Y', $dateCreationEt);
|
||||
$date = new Zend_Date($dateCreationEt, 'yyyyMMdd');
|
||||
$data = $date->toString('MM/yyyy');
|
||||
} else {
|
||||
$data = $date->dateT('Ymd', 'd/m/Y', $dateCreationEt);
|
||||
$date = new Zend_Date($dateCreationEt, 'yyyyMMdd');
|
||||
$data = $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
} else {
|
||||
$data = 'N/C';
|
||||
@ -574,9 +594,11 @@ class IdentiteEntreprise
|
||||
if (!empty($this->identite->Adresse2)) {
|
||||
$data.= '<span>'.$this->identite->Adresse2.'</span>';
|
||||
}
|
||||
$data.= '<span>';
|
||||
if (intval($this->identite->CP)!=0) {
|
||||
$data.= '<span>'.$this->identite->CP.' '.$this->identite->Ville.'</span>';
|
||||
$data.= $this->identite->CP.' ';
|
||||
}
|
||||
$data.= $this->identite->Ville.'</span>';
|
||||
if ($this->identite->Pays!='' && strtoupper(substr($this->identite->Pays,0,3))!='FRA'){
|
||||
$data.= '<span>'.$this->identite->Pays.'</span>';
|
||||
}
|
||||
@ -588,7 +610,10 @@ class IdentiteEntreprise
|
||||
case 'NPAI':
|
||||
$data.= '<div>';
|
||||
$txtNpai = 'NPAI ';
|
||||
if (!empty($this->identite->ActifEcoDate)) $txtNpai.= 'depuis le '.WDate::dateT('Ymd', 'd/m/Y', $this->identite->ActifEcoDate);
|
||||
if (!empty($this->identite->ActifEcoDate)) {
|
||||
$date = new Zend_Date($this->identite->ActifEcoDate, 'yyyyMMdd');
|
||||
$txtNpai.= 'depuis le '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
$data.= '<img title="'.$txtNpai.'" src="/themes/default/images/interfaces/icone_courrier.png" />';
|
||||
$data.= '</div>';
|
||||
break;
|
||||
@ -670,8 +695,6 @@ class IdentiteEntreprise
|
||||
public function getTelTexte()
|
||||
{
|
||||
$data = '';
|
||||
$data.= '<div class="txtAdresse">';
|
||||
$data.= '<p>';
|
||||
|
||||
if (trim($this->identite->Tel)=='')
|
||||
$data.= 'N/C';
|
||||
@ -690,11 +713,18 @@ class IdentiteEntreprise
|
||||
$adresse = substr($this->identite->Adresse,1,strlen($this->identite->Adresse)-1);
|
||||
if ($i_adr>4) break;
|
||||
}
|
||||
$data.= ' <a title="Rechercher le numéro de téléphone dans l\'annuaire" target="_blank" href="http://local.search.ke.voila.fr/S/searchproxi?act=&nom='.$libNom.
|
||||
|
||||
$data.= '<br/><a href="'.$this->view->url(array(
|
||||
'controller'=>'identite',
|
||||
'action'=>'contacts',
|
||||
'siret'=>$this->identite->Siret,
|
||||
'id'=>$this->identite->id), null, true).
|
||||
'"/>Plus de contacts</a>';
|
||||
|
||||
$data.= ' - <a title="Rechercher le numéro de téléphone dans l\'annuaire" target="_blank" href="http://local.search.ke.voila.fr/S/searchproxi?act=&nom='.$libNom.
|
||||
'&adr='.urlencode($this->identite->Adresse).
|
||||
'&loc='.urlencode($this->identite->CP.' '.$this->identite->Ville).
|
||||
'&x=0&y=0&bhv=searchproxi&profil=enville&guidelocid=&guideregid=&guidedepid=&actid=&ke=&locid=">(Recherche annuaire)</a></p>';
|
||||
$data.= '</div>';
|
||||
'&x=0&y=0&bhv=searchproxi&profil=enville&guidelocid=&guideregid=&guidedepid=&actid=&ke=&locid=">Recherche annuaire</a>';
|
||||
|
||||
return $data;
|
||||
}
|
||||
@ -908,9 +938,9 @@ class IdentiteEntreprise
|
||||
|
||||
public function getCapitalLabel()
|
||||
{
|
||||
$lib = 'Capital';
|
||||
$lib = 'Capital social';
|
||||
if ($this->identite->CapitalType == 'V') {
|
||||
$lib .= ' variable';
|
||||
$lib = 'Capital variable';
|
||||
}
|
||||
return $lib;
|
||||
}
|
||||
@ -925,7 +955,8 @@ class IdentiteEntreprise
|
||||
$this->deviseText($this->identite->Bilan->Devise);
|
||||
}
|
||||
if (!empty($this->identite->Bilan->Cloture)) {
|
||||
$title .= ' au '. WDate::dateT('Ymd', 'd/m/Y',$this->identite->Bilan->Cloture);
|
||||
$date = new Zend_Date($this->identite->Bilan->Cloture, 'yyyyMMdd');
|
||||
$title .= ' au '. $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
return $title;
|
||||
}
|
||||
@ -972,7 +1003,8 @@ class IdentiteEntreprise
|
||||
$this->deviseText($this->identite->Bilan->Devise);
|
||||
}
|
||||
if (!empty($this->identite->Bilan->Cloture)) {
|
||||
$title .= ' au '.WDate::dateT('Ymd', 'd/m/Y',$this->identite->Bilan->Cloture);
|
||||
$date = new Zend_Date($this->identite->Bilan->Cloture, 'yyyyMMdd');
|
||||
$title .= ' au '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
}
|
||||
return $title;
|
||||
@ -1000,7 +1032,8 @@ class IdentiteEntreprise
|
||||
$dir1DateNaiss = '';
|
||||
if ($this->identite->dir1DateNaiss != '' &&
|
||||
$this->identite->dir1DateNaiss != '0000-00-00') {
|
||||
$dir1DateNaiss = WDate::dateT('Y-m-d', 'd/m/Y',$this->identite->dir1DateNaiss);
|
||||
$date = new Zend_Date($this->identite->dir1DateNaiss, 'yyyy-MM-dd');
|
||||
$dir1DateNaiss = $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
$dir1LieuNaiss = '';
|
||||
if ($this->identite->dir1LieuNaiss != '') {
|
||||
@ -1009,7 +1042,8 @@ class IdentiteEntreprise
|
||||
$dir2DateNaiss = '';
|
||||
if ($this->identite->dir2DateNaiss != '' &&
|
||||
$this->identite->dir2DateNaiss != '0000-00-00') {
|
||||
$dir2DateNaiss = WDate::dateT('Y-m-d', 'd/m/Y',$this->identite->dir2DateNaiss);
|
||||
$date = new Zend_Date($this->identite->dir2DateNaiss, 'yyyy-MM-dd');
|
||||
$dir2DateNaiss = $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
$dir2LieuNaiss = '';
|
||||
if ($this->identite->dir2LieuNaiss != '') {
|
||||
@ -1068,7 +1102,8 @@ class IdentiteEntreprise
|
||||
}
|
||||
$data.= $this->identite->Bilan->Effectif.' salarié(s) au bilan';
|
||||
if (!empty($this->identite->Bilan->Cloture)) {
|
||||
$data.= " cloturé le ".WDate::dateT('Ymd', 'd/m/Y',$this->identite->Bilan->Cloture);
|
||||
$date = new Zend_Date($this->identite->Bilan->Cloture, 'yyyyMMdd');
|
||||
$data.= " cloturé le ".$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,8 +121,14 @@ class IdentiteProcol
|
||||
$output.= html_entity_decode($annonce->evenements->item[0]->LibEven);
|
||||
$output.= '</a>';
|
||||
|
||||
if(!empty($annonce->dateJugement) && substr($annonce->dateJugement,0,4)!='0000') $output.= ', le '.WDate::dateT('Y-m-d','d/m/Y',$annonce->dateJugement);
|
||||
elseif(!empty($annonce->dateEffet) && substr($annonce->dateEffet,0,4)!='0000') $output.= ', le '.WDate::dateT('Y-m-d','d/m/Y',$annonce->dateEffet);
|
||||
if(!empty($annonce->dateJugement) && substr($annonce->dateJugement,0,4)!='0000') {
|
||||
$date = new Zend_Date($annonce->dateJugement, 'yyyy-MM-dd');
|
||||
$output.= ', le '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
elseif(!empty($annonce->dateEffet) && substr($annonce->dateEffet,0,4)!='0000') {
|
||||
$date = new Zend_Date($annonce->dateEffet, 'yyyy-MM-dd');
|
||||
$output.= ', le '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
$output.= ', publié au ';
|
||||
$tabSource=explode('-', $annonce->BodaccCode);
|
||||
@ -137,7 +143,10 @@ class IdentiteProcol
|
||||
}else{
|
||||
$output.='JAL';
|
||||
}
|
||||
if(!empty($annonce->DateParution)) $output.= ' le '.WDate::dateT('Y-m-d','d/m/Y',$annonce->DateParution);
|
||||
if(!empty($annonce->DateParution)) {
|
||||
$date = new Zend_Date($annonce->DateParution,'yyyy-MM-dd');
|
||||
$output.= ' le '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
$output.= '</p>';
|
||||
}
|
||||
}
|
||||
@ -165,11 +174,13 @@ class IdentiteProcol
|
||||
$data = '';
|
||||
if(!empty($this->procol->StatutsConst) && $this->procol->StatutsConst!='0000-00-00')
|
||||
{
|
||||
$data.= 'Constitués le '.WDate::dateT('Y-m-d', 'd/m/Y', $this->procol->StatutsConst);
|
||||
$date = new Zend_Date($this->procol->StatutsConst, 'yyyy-MM-dd');
|
||||
$data.= 'Constitués le '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
if(!empty($this->procol->StatutsConstDepot) && $this->procol->StatutsConstDepot!='0000-00-00')
|
||||
{
|
||||
$data.= ' en dépôt du '.WDate::dateT('Y-m-d', 'd/m/Y', $this->procol->StatutsConstDepot);
|
||||
$date = new Zend_Date($this->procol->StatutsConstDepot, 'yyyy-MM-dd');
|
||||
$data.= ' en dépôt du '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
if(empty($data)) return false;
|
||||
return $data;
|
||||
@ -184,12 +195,14 @@ class IdentiteProcol
|
||||
$data = '';
|
||||
if(!empty($this->procol->StatutsModif) && $this->procol->StatutsModif!='0000-00-00')
|
||||
{
|
||||
$data.= 'Modifiés le '.WDate::dateT('Y-m-d', 'd/m/Y', $this->procol->StatutsModif);
|
||||
$date = new Zend_Date($this->procol->StatutsModif, 'yyyy-MM-dd');
|
||||
$data.= 'Modifiés le '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
if(!empty($this->procol->StatutsModifDepot) && $this->procol->StatutsModifDepot!='0000-00-00')
|
||||
{
|
||||
$data.= ' en dépôt du '.WDate::dateT('Y-m-d', 'd/m/Y', $this->procol->StatutsModifDepot);
|
||||
$date = new Zend_Date($this->procol->StatutsModifDepot, 'yyyy-MM-dd');
|
||||
$data.= ' en dépôt du '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
if(empty($data)) return false;
|
||||
return $data;
|
||||
@ -203,8 +216,9 @@ class IdentiteProcol
|
||||
{
|
||||
if (empty($this->procol->CessionOffreDate)) return false;
|
||||
|
||||
return 'Offres de reprises possibles jusqu\'au '.
|
||||
WDate::DateT('Y-m-d', 'd/m/Y', $this->procol->CessionOffreDate);
|
||||
$date = new Zend_Date($this->procol->CessionOffreDate, 'yyyy-MM-dd');
|
||||
|
||||
return 'Offres de reprises possibles jusqu\'au '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
public function getCessionInvenDateLabel()
|
||||
@ -215,8 +229,9 @@ class IdentiteProcol
|
||||
{
|
||||
if (empty($this->procol->CessionInvenDate)) return false;
|
||||
|
||||
return 'Inventaire déposé au greffe le '.
|
||||
WDate::DateT('Y-m-d', 'd/m/Y', $this->procol->CessionInvenDate);
|
||||
$date = new Zend_Date($this->procol->CessionInvenDate, 'yyyy-MM-dd');
|
||||
|
||||
return 'Inventaire déposé au greffe le '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
public function getCessionDescLabel()
|
||||
|
292
library/Scores/Insee/AvisSituation.php
Normal file
292
library/Scores/Insee/AvisSituation.php
Normal file
@ -0,0 +1,292 @@
|
||||
<?php
|
||||
class Scores_Insee_AvisSituation
|
||||
{
|
||||
protected static $timeout = 10;
|
||||
protected static $retryDelay = 300;
|
||||
protected $fichierErreur;
|
||||
protected $pathLog;
|
||||
protected $pathAvisPdf;
|
||||
protected $siret;
|
||||
|
||||
public function __construct($siret)
|
||||
{
|
||||
$c = Zend_Registry::get('config');
|
||||
$this->pathAvisPdf = $c->profil->path->files;
|
||||
$this->pathLog = realpath($c->profil->path->data).'/log';
|
||||
$this->fichierErreur = $this->pathLog.'/aviserreur.lock';
|
||||
$this->siret = $siret;
|
||||
}
|
||||
|
||||
public function erreurcpt($action)
|
||||
{
|
||||
switch($action){
|
||||
case 'plus':
|
||||
if (file_exists($this->fichierErreur)){
|
||||
$handle = fopen($this->fichierErreur, 'r');
|
||||
$data = fgetcsv($handle, '1000', ';');
|
||||
$date_creation = $data[0];
|
||||
$date_modification = time();
|
||||
$nb = $data[2];
|
||||
fclose($handle);
|
||||
} else {
|
||||
$date_creation = time();
|
||||
$date_modification = time();
|
||||
$nb = 0;
|
||||
}
|
||||
$nb++;
|
||||
$handle = fopen($this->fichierErreur, 'w');
|
||||
fputcsv($handle, array($date_creation, $date_modification, $nb), ';');
|
||||
fclose($handle);
|
||||
break;
|
||||
case 'raz':
|
||||
$handle = fopen($this->fichierErreur, 'w');
|
||||
$date_creation = time();
|
||||
$date_modification = time();
|
||||
$nb = 0;
|
||||
fputcsv($handle, array($date_creation, $date_modification, $nb), ';');
|
||||
fclose($handle);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function nberreur()
|
||||
{
|
||||
if (file_exists($this->fichierErreur)){
|
||||
$handle = fopen($this->fichierErreur, 'r');
|
||||
$data = fgetcsv($handle, '1000', ';');
|
||||
$nb = $data[2];
|
||||
fclose($handle);
|
||||
} else {
|
||||
$nb = 1;
|
||||
}
|
||||
return $nb;
|
||||
}
|
||||
|
||||
public function erreur()
|
||||
{
|
||||
if (file_exists($this->fichierErreur))
|
||||
{
|
||||
$handle = fopen($this->fichierErreur, 'r');
|
||||
$data = fgetcsv($handle, '1000', ';');
|
||||
$date_creation = $data[0];
|
||||
$date_modification = $data[1];
|
||||
$nb = $data[2];
|
||||
fclose($handle);
|
||||
} else {
|
||||
$date_creation = 0;
|
||||
$date_modification = 0;
|
||||
}
|
||||
if ($nb>0 && $date_modification<$date_creation+$this->retryDelay){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function mailerreur()
|
||||
{
|
||||
$user = new Scores_Utilisateur();
|
||||
|
||||
$objet = "AVIS INSEE - (Date :".date("d")."/".date("m")."/".date("Y").")";
|
||||
$texte = 'Accès impossible au site de situation INSEE : '.
|
||||
$this->siret.EOL.
|
||||
'http://avis-situation-sirene.insee.fr'.EOL.
|
||||
'pour login '.$user->getLogin().EOL;
|
||||
|
||||
$mail = new Scores_Mail();
|
||||
$mail->setFrom('contact');
|
||||
$mail->addToKey('support');
|
||||
$mail->setSubject($objet);
|
||||
$mail->setBodyText($texte);
|
||||
$mail->send();
|
||||
}
|
||||
|
||||
public function erreurmsg(){
|
||||
return "<h3>Le site partenaire n'a pas répondu correctement ou est indisponible. Merci d'essayer à nouveau ultérieurement.</h3>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupére l'avis de situtation à partir du site au format pdf
|
||||
* @param string $format Format 'pdf' ou 'array'
|
||||
* @param boolean $force True aller obligatoirement le chercher à l'insee
|
||||
* @return string Le PDF demandé
|
||||
*/
|
||||
public function get($format='pdf', $force=0)
|
||||
{
|
||||
$force=$force*1;
|
||||
$date=date('Ymd');
|
||||
$siren=trim(substr($this->siret,0,9));
|
||||
$nic=trim(substr($this->siret,9,5));
|
||||
$fichier = $this->pathAvisPdf.'/avis-'.$siren.'-'.$nic.'-'.$date.'.pdf';
|
||||
if ($format!='pdf') return 'Format pdf uniquement';
|
||||
|
||||
// On délivre l'avis en base
|
||||
if ($force==0 && file_exists($fichier)) {
|
||||
return file_get_contents($fichier);
|
||||
}
|
||||
|
||||
// On télécharge le fichier sur le site
|
||||
else {
|
||||
|
||||
$body = false;
|
||||
$cookie = false;
|
||||
|
||||
//Initialisation de la session sur le site de l'Insee
|
||||
$url = 'http://avis-situation-sirene.insee.fr/avisitu/jsp/avis.jsp';
|
||||
try {
|
||||
$client = new Zend_Http_Client($url);
|
||||
$client->setCookieJar();
|
||||
$response = $client->request('GET');
|
||||
if ( $response->isSuccessful() ) {
|
||||
$body = $response->getBody();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (Zend_Http_Client_Exception $e) {
|
||||
if (APPLICATION_ENV=='development') {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
$cookie = $client->getCookieJar();
|
||||
|
||||
if (preg_match("/<form name=\"demForm\" method=\"post\" action=\"\/avisitu\/IdentificationListeSiret.do/Uis", $body, $matches)) {
|
||||
|
||||
$dep=$depActif='';
|
||||
if ($nic=='') $crit='S'; // l'établissement siège
|
||||
else $crit=''; // établissement particulier, saisissez le NIC
|
||||
|
||||
//Post du formulaire - Liste
|
||||
$url = 'http://avis-situation-sirene.insee.fr/avisitu/IdentificationListeSiret.do';
|
||||
$post = array(
|
||||
'siren' => $siren,
|
||||
'critere' => $crit, // S pour le siège ou vide avec un NIC !!!
|
||||
'nic' => $nic,
|
||||
'departement' => $dep,
|
||||
'departement_actif' => $depActif,
|
||||
'bSubmit' => 'Valider'
|
||||
);
|
||||
try {
|
||||
$client = new Zend_Http_Client($url);
|
||||
$client->setCookieJar($cookie);
|
||||
$client->setParameterPost($post);
|
||||
$response = $client->request('POST');
|
||||
if ( $response->isSuccessful() ) {
|
||||
$body = $response->getBody();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (Zend_Http_Client_Exception $e) {
|
||||
if (APPLICATION_ENV=='development') {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
$cookie = $client->getCookieJar();
|
||||
|
||||
if (preg_match("/<h3>Fiche établissement<\/h3>/Uis", $body, $matches))//<li class="ongletActif">établissement</li>
|
||||
$tabInfos['fiche']='etab';
|
||||
|
||||
if (preg_match('/<div class="TitreGauche">(.*)<br\/>/Uis', $body, $matches)) {
|
||||
$tabInfos['raiSoc']=trim($matches[1]);
|
||||
}
|
||||
|
||||
if (preg_match("/Dernière mise à jour : (.*)<\/div>/Uis", $body, $matches))
|
||||
$tabInfos['dateMaj']=trim($matches[1]);
|
||||
|
||||
$s1=substr($siren,0,3);
|
||||
$s2=substr($siren,3,3);
|
||||
$s3=substr($siren,6,3);
|
||||
if (preg_match('/<div class="TitreDroite">(?:.*)('.$s1.'(?:.*)'.$s2.'(?:.*)'.$s3.')(?:.*)('.$nic.')(?:.*)<\/div>/Uis', $body, $matches)) {
|
||||
$tabInfos['siren'] = trim($matches[1]);
|
||||
$tabInfos['nic'] = trim($matches[2]);
|
||||
}
|
||||
|
||||
if (preg_match('/<label id="labelFiche">Etat : <\/label>(.*)depuis le(.*)<\/p>/Uis', $body, $matches)) {
|
||||
$tabInfos['etat'] = trim($matches[1]);
|
||||
$tabInfos['dateEtat']= trim($matches[2]);
|
||||
}
|
||||
|
||||
if (preg_match('/<label id="labelFiche">Catégorie d\'établissement : <\/label>(.*)<\/p>/Uis', $body, $matches)) {
|
||||
$tabInfos['typeEtab']= trim($matches[1]);
|
||||
}
|
||||
|
||||
$tabAdresse=array();
|
||||
if (preg_match('/<label id="labelFiche">Adresse d\'implantation : <\/label>(?:.*)<ul id="adresse">(.*)<\/ul>/Uis', $body, $matches)) {
|
||||
$strTmp=trim($matches[1]);
|
||||
$tabTmp=explode('</li>', $strTmp);
|
||||
foreach ($tabTmp as $i=>$strTmp)
|
||||
$tabAdresse[$i]=trim(str_replace('<li>','',$strTmp));
|
||||
}
|
||||
|
||||
if (preg_match('/<label id="labelFiche">(?:.*)Catégorie juridique :(?:.*)<\/label>(.*) - (.*)<\/p>/Uis', $body, $matches)) {
|
||||
$tabInfos['fjCod']= trim($matches[1]);
|
||||
$tabInfos['fjLib']= trim($matches[2]);
|
||||
}
|
||||
|
||||
if (preg_match('/<label id="labelFiche">Activité principale exercée :(?:.*)<\/label>(.*) - (.*)<\/p>/Uis', $body, $matches)) {
|
||||
$tabInfos['nafCod']=trim($matches[1]);
|
||||
$tabInfos['nafLib']=trim($matches[2]);
|
||||
}
|
||||
|
||||
if (preg_match('/<label id="labelFiche">(?:.*)Tranche d'effectif(.*)<\/label>(.*)<\/p>/Uis', $body, $matches)) {
|
||||
$tabInfos['effPeriode']=trim($matches[1]);
|
||||
$tabInfos['effTranche']=trim($matches[2]);
|
||||
}
|
||||
|
||||
$strCsv=$siren.';'.$nic.';'.$tabInfos['fiche'].';'.$tabInfos['dateMaj'].';'.
|
||||
$tabInfos['siren'].';'.$tabInfos['nic'].';'.$tabInfos['raiSoc'].';'.
|
||||
$tabInfos['etat'].';'.$tabInfos['dateEtat'].';'.$tabInfos['fjCod'].';'.$tabInfos['fjLib'].';'.
|
||||
$tabInfos['nafCod'].';'.$tabInfos['nafLib'].';'.$tabInfos['effPeriode'].';'.
|
||||
$tabInfos['effTranche'].';'.
|
||||
$tabInfos['typeEtab'].';'.@implode(';',@$tabAdresse).
|
||||
";\n";
|
||||
$fp=fopen($this->pathLog."/avis.csv", "a");
|
||||
fwrite($fp, $strCsv);
|
||||
fclose($fp);
|
||||
|
||||
// $body contient l'avis de situation au format html
|
||||
$tabErreurs=array();
|
||||
if (preg_match('/name="erreurs" value="(.*)" class="erreurText" readonly/Ui', $body, $matches1)
|
||||
|| preg_match('/name="erreurs_bis" value="(.*)" class="erreurTextBis" readonly/Ui', $body, $matches2)) {
|
||||
$tabErreurs[]=@$matches1[1];
|
||||
$tabErreurs[]=@$matches2[1];
|
||||
die('<font color="red">ERREUR '.utf8_encode(implode(' ', $tabErreurs)).'</font>'); // Gérer le retour d'une erreur
|
||||
}
|
||||
usleep(round(rand(500000,1000000)));
|
||||
|
||||
// Get format PDF
|
||||
if ( $format == 'pdf' ) {
|
||||
$referer = $url;
|
||||
$url = 'http://avis-situation-sirene.insee.fr/avisitu/AvisPdf.do';
|
||||
$post = array(
|
||||
'siren' => $siren,
|
||||
'nic' => $nic,
|
||||
'bSubmit' => 'Avis+de+Situation'
|
||||
);
|
||||
try {
|
||||
$client = new Zend_Http_Client($url);
|
||||
$client->setCookieJar($cookie);
|
||||
$client->setParameterPost($post);
|
||||
$response = $client->request('POST');
|
||||
if ( $response->isSuccessful() ) {
|
||||
$body = $response->getBody();
|
||||
file_put_contents($fichier, $body);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (Zend_Http_Client_Exception $e) {
|
||||
if (APPLICATION_ENV=='development') {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
$cookie = $client->getCookieJar();
|
||||
} // Fin format PDF
|
||||
}
|
||||
|
||||
return $body;
|
||||
} // Fin fichier disponible
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Iris
|
||||
class Scores_Insee_Iris
|
||||
{
|
||||
protected static $timeout = 10;
|
||||
protected $pathIrisPdf;
|
||||
@ -8,7 +8,6 @@ class Iris
|
||||
|
||||
public function __construct($codeCommune)
|
||||
{
|
||||
require_once 'common/curl.php';
|
||||
$c = Zend_Registry::get('config');
|
||||
$this->pathIrisPdf = realpath($c->profil->path->data).'/iris';
|
||||
$this->codeCommune = $codeCommune;
|
||||
@ -35,21 +34,18 @@ class Iris
|
||||
else
|
||||
{
|
||||
$url = 'http://www.insee.fr/fr/methodes/zonages/iris/cartes/carte_iris_'.$this->codeCommune.'.pdf';
|
||||
$referer = $cookie = '';
|
||||
$page = getUrl($url, $cookie, '', $referer, false, 'www.insee.fr', '', $this->timeout);
|
||||
//Code en 4xx ou 5xx signifie une erreur du serveur
|
||||
$codeN = floor($page['code']/100);
|
||||
if($codeN==4 || $codeN==5 || substr($page['body'],0,4)!='%PDF')
|
||||
{
|
||||
try {
|
||||
$client = new Zend_Http_Client($url);
|
||||
$client->setStream();
|
||||
$response = $client->request('GET');
|
||||
if ($response->isSuccessful() && substr($response->getBody(),0,4)=='%PDF') {
|
||||
copy($response->getStreamName(), $fichier);
|
||||
} else {
|
||||
$this->erreur = "Fichier introuvable à l'insee !";
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$fp = fopen($fichier, "w");
|
||||
fwrite($fp, $page['body']);
|
||||
fclose($fp);
|
||||
return $page['body'];
|
||||
} catch (Zend_Http_Client_Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -38,27 +38,30 @@ class Logo
|
||||
public function getFromUrl($siteWeb)
|
||||
{
|
||||
$img = false;
|
||||
require_once 'common/curl.php';
|
||||
if (substr($siteWeb,-1)!='/') $siteWeb.='/';
|
||||
|
||||
$arrUrl = parse_url($siteWeb);
|
||||
$page = getUrl($siteWeb, '', '', '', false, $arrUrl['host'], '', 3);
|
||||
$body = $page['body'];
|
||||
if (preg_match('/<img(?:.*)src=(?:"|\')((?:.*)logo(?:.*)(?:gif|png|jpg|jpeg))/Ui', $body, $matches)) {
|
||||
try {
|
||||
$client = new Zend_Http_Client($url);
|
||||
$response = $client->request('GET');
|
||||
$siteBody = $response->getBody();
|
||||
} catch (Zend_Http_Client_Exception $e) {
|
||||
}
|
||||
|
||||
if (preg_match('/<img(?:.*)src=(?:"|\')((?:.*)logo(?:.*)(?:gif|png|jpg|jpeg))/Ui', $siteBody, $matches)) {
|
||||
$logo = trim(strtr($matches[1],'"\'',' '));
|
||||
$urlLogo = $siteWeb.$logo;
|
||||
$tmp = explode('.', basename($logo));
|
||||
$ext = end($tmp);
|
||||
$page = getUrl($urlLogo, '', '', $siteWeb, false, $arrUrl['host']);
|
||||
if($page['code']!=400)
|
||||
{
|
||||
$body = $page['body'];
|
||||
try {
|
||||
$client = new Zend_Http_Client($url);
|
||||
$client->setStream();
|
||||
$response = $client->request('GET');
|
||||
if ( $response->isSuccessful() ) {
|
||||
$img = $this->path.'/'.$this->siren.'.'.$ext;
|
||||
$fp = fopen($img, 'a');
|
||||
fwrite($fp, $body);
|
||||
fclose($fp);
|
||||
copy($response->getStreamName(), $img);
|
||||
chmod($img, 0755);
|
||||
}
|
||||
} catch (Zend_Http_Client_Exception $e) {}
|
||||
}
|
||||
return $img;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Mail
|
||||
class Scores_Mail
|
||||
{
|
||||
protected $config;
|
||||
protected $mail;
|
||||
|
@ -60,9 +60,9 @@ class Mappy
|
||||
public function villeCouverte($ville)
|
||||
{
|
||||
$ville = $this->cleanAdress($ville);
|
||||
if (in_array(strtoupper($ville),$this->villes)){
|
||||
/*if (in_array(strtoupper($ville),$this->villes)){
|
||||
return true;
|
||||
}
|
||||
}*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Menu
|
||||
class Scores_Menu
|
||||
{
|
||||
protected $menu = null;
|
||||
protected $siret = null;
|
||||
@ -101,6 +101,9 @@ class Menu
|
||||
),
|
||||
array(
|
||||
'label' => 'IDENTITE',
|
||||
'activateMenu' => array(
|
||||
array('controller'=>'identite', 'action'=>'contacts'),
|
||||
),
|
||||
'pages' => array(
|
||||
array(
|
||||
'label' => "Fiche d'identité",
|
||||
@ -139,10 +142,16 @@ class Menu
|
||||
'label' => "Modifications Insee",
|
||||
'controller' => 'identite',
|
||||
'action' => 'evenements',
|
||||
'permission' => 'eveninsee',
|
||||
'forceVisible' => true,
|
||||
'permission' => 'EVENINSEE',
|
||||
),
|
||||
array(
|
||||
'label' => "Actualités Web/Internet",
|
||||
'title' => "Toute la puissance des réseaux sociaux professionnels pour identifier rapidement un interlocuteur et accéder à ses coordonnées",
|
||||
'controller' => 'identite',
|
||||
'action' => 'corporama',
|
||||
'forceVisible' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
array(
|
||||
@ -169,6 +178,9 @@ class Menu
|
||||
),
|
||||
array(
|
||||
'label' => 'ELEMENTS FINANCIERS',
|
||||
'activateMenu' => array(
|
||||
array('controller'=>'finance', 'action'=>'subvention'),
|
||||
),
|
||||
'pages' => array(
|
||||
array(
|
||||
'label' => "Synthèse",
|
||||
@ -219,6 +231,12 @@ class Menu
|
||||
'forceVisible' => true,
|
||||
'permission' => 'BANQUE',
|
||||
),
|
||||
array(
|
||||
'label' => "Subventions",
|
||||
'controller' => 'finance',
|
||||
'action' => 'subventions',
|
||||
'forceVisible' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
array(
|
||||
@ -355,7 +373,6 @@ class Menu
|
||||
array('controller'=> 'pieces', 'action'=>'associationbilans'),
|
||||
array('controller'=> 'pieces', 'action'=>'cmdcourrier'),
|
||||
array('controller'=> 'pieces', 'action'=>'kbis'),
|
||||
array('controller'=> 'pieces', 'action'=>'kbispasserelle'),
|
||||
),
|
||||
'pages' => array(
|
||||
array(
|
||||
@ -404,11 +421,6 @@ class Menu
|
||||
'action' => 'liste',
|
||||
'permission' => 'SURVLISTE'
|
||||
),
|
||||
array(
|
||||
'label' => "Monitoring",
|
||||
'controller' => 'giant',
|
||||
'action' => 'retrive',
|
||||
),
|
||||
array(
|
||||
'label' => "Surveillances fichier",
|
||||
'controller' => 'surveillance',
|
||||
@ -480,8 +492,6 @@ class Menu
|
||||
*/
|
||||
public function __construct($parameters)
|
||||
{
|
||||
require_once 'Scores/SessionEntreprise.php';
|
||||
|
||||
//Special case, edit foreign company
|
||||
if (array_key_exists('lienref', $parameters)) {
|
||||
$this->lienref = $parameters['lienref'];
|
||||
@ -495,7 +505,7 @@ class Menu
|
||||
$this->id = $parameters['id'];
|
||||
}
|
||||
if (empty($this->siret) && empty($this->id)) {
|
||||
$session = new SessionEntreprise(null);
|
||||
$session = new Scores_Session_Entreprise(null);
|
||||
$this->siret = $session->getSiret();
|
||||
$this->id = $session->getId();
|
||||
}
|
||||
@ -613,7 +623,7 @@ class Menu
|
||||
protected function computePage($pages)
|
||||
{
|
||||
$computePages = array();
|
||||
foreach($pages as $page){
|
||||
foreach( $pages as $page ) {
|
||||
$visible = false;
|
||||
if (array_key_exists('forceVisible', $page)){
|
||||
$visible = $page['forceVisible'];
|
||||
@ -624,34 +634,45 @@ class Menu
|
||||
$perm = $this->checkPermission($page['permission']);
|
||||
}
|
||||
|
||||
if (!$perm && $visible){
|
||||
$computePage = array();
|
||||
|
||||
if ( !$perm && $visible ) {
|
||||
|
||||
$computePage['label'] = $page['label'];
|
||||
$computePage['class'] = 'inactif';
|
||||
$computePage['uri'] = '#';
|
||||
$computePages[] = $computePage;
|
||||
} elseif ($perm){
|
||||
if ($this->checkParams($page['controller'], $page['action'])){
|
||||
$computePage = array();
|
||||
|
||||
} elseif ( $perm ) {
|
||||
|
||||
if ( $this->checkParams($page['controller'], $page['action']) ) {
|
||||
|
||||
$computePage = $page;
|
||||
$computePage['params'] = $this->setParams($page['controller'], $page['action']);
|
||||
|
||||
if (array_key_exists('pref', $page)){
|
||||
if ($this->hasPref('demanderef') && in_array('demanderef', $page['pref']) ){ // @todo: Erreur data
|
||||
$computePage['class'] = 'demanderef';
|
||||
}
|
||||
}
|
||||
|
||||
$computePages[] = $computePage;
|
||||
} elseif ($visible) {
|
||||
$computePage = array();
|
||||
} elseif ( $visible ) {
|
||||
|
||||
$computePage['label'] = $page['label'];
|
||||
$computePage['class'] = 'inactif';
|
||||
$computePage['uri'] = '#';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( array_key_exists('title', $page) ) {
|
||||
$computePage['title'] = $page['title'];
|
||||
}
|
||||
|
||||
if ( count($computePage)>0 ) {
|
||||
$computePages[] = $computePage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $computePages;
|
||||
}
|
||||
|
||||
@ -726,8 +747,7 @@ class Menu
|
||||
case 'last':
|
||||
case 'list':
|
||||
//Vérifier la présence d'au moins une recherche
|
||||
require_once 'Scores/RechercheHistorique.php';
|
||||
$recherches = new RechercheHistorique();
|
||||
$recherches = new Scores_Session_Recherche();
|
||||
if (count($recherches->liste()>0)){
|
||||
return true;
|
||||
}
|
||||
@ -743,9 +763,6 @@ class Menu
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
case 'giant':
|
||||
return true;
|
||||
break;
|
||||
case 'user':
|
||||
switch($action){
|
||||
case 'liste':
|
||||
@ -795,6 +812,7 @@ class Menu
|
||||
case 'groupe':
|
||||
case 'etablissements':
|
||||
case 'evenements':
|
||||
case 'corporama':
|
||||
if ( !empty($this->siret) && intval($this->siret)!=0 ){
|
||||
return true;
|
||||
}
|
||||
|
@ -31,4 +31,9 @@ class Scores_Partner_Report_Html extends Scores_Partner_Report_Helpers
|
||||
{
|
||||
$this->{$name} = $value;
|
||||
}
|
||||
|
||||
public function translate($txt)
|
||||
{
|
||||
return $txt;
|
||||
}
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
<h1>DIRIGEANTS</h1>
|
||||
<h2>Liste des dirigeants actifs</h2>
|
||||
<h2><?=$this->translate("Liste des dirigeants actifs")?></h2>
|
||||
<div class="paragraph">
|
||||
<?php if ( count($this->dirigeants)>0 ) { ?>
|
||||
<table class="data">
|
||||
@ -7,33 +6,68 @@
|
||||
<tr>
|
||||
<td class="StyleInfoData" width="200"><?=$dir->Titre?></td>
|
||||
<td class="StyleInfoData" width="320">
|
||||
|
||||
<?php if ($dir->Societe != '') { ?>
|
||||
<a href="<?=$this->url(array('controller' => 'recherche', 'action' => 'liste', 'type' => 'ent','raisonSociale' => $dir->Societe), null, true)?>"
|
||||
title="<?=$this->translate("Recherche à partir de la dénomination sociale")?>">
|
||||
<?=$dir->Societe?>
|
||||
</a>
|
||||
<br/>
|
||||
<?php }?>
|
||||
|
||||
<?php if ($dir->Nom != '') { ?>
|
||||
<a href="<?=$this->url(array(
|
||||
'controller' => 'recherche',
|
||||
'action' => 'liste',
|
||||
'type' => 'dir',
|
||||
'dirNom' => $dir->Nom,
|
||||
'dirPrenom' => $dir->Prenom,
|
||||
'dirDateNaissJJ' => substr($dir->NaissDate,0,2),
|
||||
'dirDateNaissMM' => substr($dir->NaissDate,3,2),
|
||||
'dirDateNaissAAAA' => substr($dir->NaissDate,6,4),
|
||||
'dirCpVille' => $dir->NaissVille,
|
||||
), null, true)?>" title="<?=$this->translate("Recherche à partir du nom du dirigeant")?>">
|
||||
<?=$dir->Nom.' '.$dir->Prenom?>
|
||||
</a>
|
||||
<?php
|
||||
if (trim($dir->NaissDate) != '' && trim($dir->NaissVille.' '.$dir->NaissDepPays) != '') { ?>
|
||||
<br/>né(e) le <?=$dir->NaissDate?> à <?=$dir->NaissVille?>
|
||||
<?php if (trim($dir->NaissDepPays) != '') { ?>
|
||||
(<?=$dir->NaissDepPays?>)
|
||||
<?php }
|
||||
} else if (trim($dir->NaissDate) != '') {
|
||||
?>
|
||||
<?php if (trim($dir->NaissDepPays) != '') { ?> (<?=$dir->NaissDepPays?>)<?php }?>
|
||||
<?php } else if (trim($dir->NaissDate) != '') { ?>
|
||||
né(e) le <?=$dir->NaissDate?>
|
||||
<?php
|
||||
} else if (trim($dir->NaissVille.' '.$dir->NaissDepPays) != '') {
|
||||
?>
|
||||
<?php } else if (trim($dir->NaissVille.' '.$dir->NaissDepPays) != '') { ?>
|
||||
né(e) à <?=$dir->NaissVille?> (<?=$dir->NaissDepPays?>)
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</td>
|
||||
<td class="StyleInfoData" width="100" valign="top">
|
||||
<?php if ($dir->Siren!='') {?>
|
||||
<?=$this->SirenTexte($dir->Siren)?>
|
||||
<a title="<?=$this->translate("Consulter la fiche identité")?>" href="<?=$this->url(array('controller'=>'identite', 'action'=>'fiche', 'siret'=>$dir->Siren), null, true)?>">
|
||||
<?=$this->SirenTexte($dir->Siren)?></a>
|
||||
|
||||
<?php if (empty($this->AutrePage) && $this->edition) {?>
|
||||
<div style="line-height:16px;">
|
||||
<a class="dialog" title="<?=$this->translate("Ajouter un actionnaire")?>" href="<?=$this->url(array('controller'=>'saisie','action'=>'lien','type'=>'actionnaire','mode'=>'add','siren'=>$this->siren,'createfiche'=>$dir->Siren),null,true)?>">
|
||||
<img style="vertical-align:middle;" src="/themes/default/images/interfaces/ajouter.png" /></a>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</td>
|
||||
<?php if (empty($this->AutrePage) && $this->accessWorldCheck) {?>
|
||||
<td>
|
||||
<?php if ($dir->Societe != '') { ?>
|
||||
<img style="cursor:pointer;" class="wcheck" data-url="<?=$this->url(array(
|
||||
'controller'=>'worldcheck','action'=>'occurence','siren'=>substr($this->siret,0,9),
|
||||
'dirType'=>'ORGANISATION','dirSociete'=>$dir->Societe),null,true);?>" src="/themes/default/images/worldcheck/wc.png"/>
|
||||
<?php }?>
|
||||
<?php if ($dir->Nom != '') { ?>
|
||||
<img style="cursor:pointer;" class="wcheck" data-url="<?=$this->url(array(
|
||||
'controller'=>'worldcheck','action'=>'occurence','siren'=>substr($this->siret,0,9),
|
||||
'dirType'=>'INDIVIDUAL','dirNom'=>$dir->Nom,'dirPrenom'=>$dir->Prenom),null,true);?>" src="/themes/default/images/worldcheck/wc.png"/>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<?php }?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
@ -41,7 +75,7 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td class="StyleInfoData" width="550">
|
||||
Aucune donnée n'est présente dans notre base
|
||||
<?=$this->translate("Aucune donnée n'est présente dans notre base")?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 545 B |
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
@ -1,7 +1,26 @@
|
||||
/*! normalize.css v2.1.2 */
|
||||
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */
|
||||
|
||||
/* ==========================================================================
|
||||
HTML5 display definitions
|
||||
/**
|
||||
* 1. Set default font family to sans-serif.
|
||||
* 2. Prevent iOS text size adjust after orientation change, without disabling
|
||||
* user zoom.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-family: sans-serif; /* 1 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove default margin.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* HTML5 display definitions
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
@ -24,13 +43,16 @@ summary {
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct `inline-block` display not defined in IE 8/9.
|
||||
* 1. Correct `inline-block` display not defined in IE 8/9.
|
||||
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
|
||||
*/
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
progress,
|
||||
video {
|
||||
display: inline-block;
|
||||
display: inline-block; /* 1 */
|
||||
vertical-align: baseline; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
@ -44,47 +66,24 @@ audio:not([controls]) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 8/9.
|
||||
* Address `[hidden]` styling not present in IE 8/9.
|
||||
* Hide the `template` element in IE, Safari, and Firefox < 22.
|
||||
*/
|
||||
|
||||
[hidden] {
|
||||
[hidden],
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Base
|
||||
/* Links
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Set default font family to sans-serif.
|
||||
* 2. Prevent iOS text size adjust after orientation change, without disabling
|
||||
* user zoom.
|
||||
* Remove the gray background color from active links in IE 10.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-family: sans-serif; /* 1 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove default margin.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Links
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address `outline` inconsistency between Chrome and other browsers.
|
||||
*/
|
||||
|
||||
a:focus {
|
||||
outline: thin dotted;
|
||||
a {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -96,20 +95,9 @@ a:hover {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Typography
|
||||
/* Text-level semantics
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address variable `h1` font-size and margin within `section` and `article`
|
||||
* contexts in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 8/9, Safari 5, and Chrome.
|
||||
*/
|
||||
@ -136,13 +124,13 @@ dfn {
|
||||
}
|
||||
|
||||
/**
|
||||
* Address differences between Firefox and other browsers.
|
||||
* Address variable `h1` font-size and margin within `section` and `article`
|
||||
* contexts in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
hr {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -154,34 +142,6 @@ mark {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct font family set oddly in Safari 5 and Chrome.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/**
|
||||
* Improve readability of pre-formatted text in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set consistent quote types.
|
||||
*/
|
||||
|
||||
q {
|
||||
quotes: "\201C" "\201D" "\2018" "\2019";
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent and variable font size in all browsers.
|
||||
*/
|
||||
@ -210,8 +170,7 @@ sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Embedded content
|
||||
/* Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
@ -230,8 +189,7 @@ svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Figures
|
||||
/* Grouping content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
@ -239,63 +197,77 @@ svg:not(:root) {
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 0;
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Forms
|
||||
/**
|
||||
* Address differences between Firefox and other browsers.
|
||||
*/
|
||||
|
||||
hr {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Contain overflow in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address odd `em`-unit font size rendering in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/* Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Define consistent border, margin, and padding.
|
||||
* Known limitation: by default, Chrome and Safari on OS X allow very limited
|
||||
* styling of `select`, unless a `border` property is set.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #c0c0c0;
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct `color` not being inherited in IE 8/9.
|
||||
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
|
||||
*/
|
||||
|
||||
legend {
|
||||
border: 0; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct font family not being inherited in all browsers.
|
||||
* 2. Correct font size not being inherited in all browsers.
|
||||
* 1. Correct color not being inherited.
|
||||
* Known issue: affects color of disabled elements.
|
||||
* 2. Correct font properties not being inherited.
|
||||
* 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit; /* 1 */
|
||||
font-size: 100%; /* 2 */
|
||||
color: inherit; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
margin: 0; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
|
||||
* the UA stylesheet.
|
||||
* Address `overflow` set to `hidden` in IE 8/9/10.
|
||||
*/
|
||||
|
||||
button,
|
||||
input {
|
||||
line-height: normal;
|
||||
button {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent `text-transform` inheritance for `button` and `select`.
|
||||
* All other form control elements do not inherit `text-transform` values.
|
||||
* Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
|
||||
* Correct `select` style inheritance in Firefox 4+ and Opera.
|
||||
* Correct `button` style inheritance in Firefox, IE 8+, and Opera
|
||||
* Correct `select` style inheritance in Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
@ -329,8 +301,30 @@ html input[disabled] {
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Address box sizing set to `content-box` in IE 8/9.
|
||||
* 2. Remove excess padding in IE 8/9.
|
||||
* Remove inner padding and border in Firefox 4+.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
|
||||
* the UA stylesheet.
|
||||
*/
|
||||
|
||||
input {
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
/**
|
||||
* It's recommended that you don't attempt to style these elements.
|
||||
* Firefox's implementation doesn't respect box-sizing, padding, or width.
|
||||
*
|
||||
* 1. Address box sizing set to `content-box` in IE 8/9/10.
|
||||
* 2. Remove excess padding in IE 8/9/10.
|
||||
*/
|
||||
|
||||
input[type="checkbox"],
|
||||
@ -339,6 +333,17 @@ input[type="radio"] {
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
|
||||
* `font-size` values of the `input`, it causes the cursor style of the
|
||||
* decrement button to change from `default` to `text`.
|
||||
*/
|
||||
|
||||
input[type="number"]::-webkit-inner-spin-button,
|
||||
input[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
|
||||
* 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
|
||||
@ -353,8 +358,9 @@ input[type="search"] {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and search cancel button in Safari 5 and Chrome
|
||||
* on OS X.
|
||||
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
|
||||
* Safari (but not Chrome) clips the cancel button when the search input has
|
||||
* padding (and `textfield` appearance).
|
||||
*/
|
||||
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
@ -363,27 +369,43 @@ input[type="search"]::-webkit-search-decoration {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and border in Firefox 4+.
|
||||
* Define consistent border, margin, and padding.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
fieldset {
|
||||
border: 1px solid #c0c0c0;
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Remove default vertical scrollbar in IE 8/9.
|
||||
* 2. Improve readability and alignment in all browsers.
|
||||
* 1. Correct `color` not being inherited in IE 8/9.
|
||||
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
|
||||
*/
|
||||
|
||||
legend {
|
||||
border: 0; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove default vertical scrollbar in IE 8/9.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto; /* 1 */
|
||||
vertical-align: top; /* 2 */
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Tables
|
||||
/**
|
||||
* Don't inherit the `font-weight` (applied by a rule above).
|
||||
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
|
||||
*/
|
||||
|
||||
optgroup {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Tables
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
@ -395,27 +417,33 @@ table {
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
td,
|
||||
th {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Main
|
||||
----------------------------------*/
|
||||
body{font-family: Verdana, Arial, sans-serif;font-size: 11px;text-align: center; /* pour corriger le bug de centrage IE */ }
|
||||
#global {text-align:left;}
|
||||
#content {padding:0;margin:0;}
|
||||
body {background-color:#bebebe;font-family: Verdana, Arial, sans-serif;font-size:11px;text-align:center; /* pour corriger le bug de centrage IE */ }
|
||||
#global {width:900px; margin:0 auto; text-align:left;}
|
||||
#content {float:right;clear:both;width:680px;padding:0;margin:0;padding-top:20px;}
|
||||
#center {background-color:#fff;padding:5px 0;}
|
||||
#footer {clear:both;text-align:center;margin-top:15px;}
|
||||
#footer p {font:0.9em Arial, Helvetica, sans-serif; }
|
||||
#center h1 {clear:both;margin:5px;padding:5px; background:#606060; color:#ffffff;font:600 1.4em Arial, Verdana, Sans-serif; letter-spacing:1px; line-height:1.2em;}
|
||||
#center h2 {clear:both; margin:5px; padding:5px; background:#00008c; color:#ffffff; font:bold 1.2em Arial, Verdana, Sans-serif; }
|
||||
#center h1 {clear:both;margin:5px;padding:5px;background:#606060;color:#ffffff;font:600 1.4em Arial, Verdana, Sans-serif;letter-spacing:1px;line-height:1.2em;}
|
||||
#center h2 {clear:both; margin:5px; padding:5px;background:#00008c;color:#ffffff;font:bold 1.2em Arial, Verdana, Sans-serif; }
|
||||
div.paragraph {margin:5px;padding:5px;}
|
||||
.clearfix:after {content: ".";display: block;height: 0;clear: both;visibility: hidden;zoom:1;}
|
||||
.clearfix:after {content:".";display:block;height:0;clear:both;visibility:hidden;zoom:1;}
|
||||
a:link {color: #9c093a; text-decoration:none;}
|
||||
a:visited {color: #0000CC; text-decoration:none;}
|
||||
a:hover {color: #000066; text-decoration:none;}
|
||||
.StyleInfoLib {font-family: Arial, Helvetica, sans-serif;font-size: 11px;font-weight: bold;color:#535353; vertical-align:top;}
|
||||
.StyleInfoData {font-family: Arial, Helvetica, sans-serif;font-size: 11px;color:#535353;}
|
||||
.StyleInfoDataActif {font-family: Arial, Helvetica, sans-serif;font-size: 11px;}
|
||||
.StyleInfoLib {font-family: Arial, Helvetica, sans-serif;font-size:11px;font-weight:bold;color:#535353; vertical-align:top;line-height:16px;}
|
||||
.StyleInfoData {font-family: Arial, Helvetica, sans-serif;font-size:11px;color:#535353;line-height:16px;}
|
||||
.StyleInfoDataActif {font-family: Arial, Helvetica, sans-serif;font-size:11px;line-height:16px;}
|
||||
table.identite {border-collapse:separate;border-spacing:4px;}
|
||||
table.data {width:100%;}
|
||||
table.data td {border:1px solid #ccc; padding:5px;}
|
||||
table.data th {border:1px solid #ccc; padding:5px;}
|
||||
.confidentiel {border-top:1px solid; padding-top:5px; font-style:italic; font-size:9px;}
|
||||
.ui-dialog {text-align:left;}
|
||||
.ui-widget {font-size: 1em;}
|
||||
@ -424,12 +452,42 @@ input, select {border: 1px solid #999999;vertical-align: middle;font: 11px Arial
|
||||
div.ui-state-highlight p {margin: 10px;}
|
||||
div.ui-state-highlight a {text-decoration: underline;}
|
||||
.noborder {border:0;}
|
||||
img { vertical-align:middle; }
|
||||
|
||||
img {vertical-align:middle;}
|
||||
.pagination {border:1px solid #CDCDCD;border-radius:3px;width:224px;margin:0 auto;}
|
||||
.pagination span {
|
||||
border: medium none;
|
||||
float: left;
|
||||
height: 26px;
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
outline: medium none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
width: 120px;
|
||||
}
|
||||
.pagination a:first-child {border: medium none;border-radius: 2px 0 0 2px;}
|
||||
.pagination a:last-child {border:medium none;border-radius:0 2px 2px 0;}
|
||||
.pagination a {border-left: 1px solid #CDCDCD; border-right: 1px solid #CDCDCD;}
|
||||
.pagination a {
|
||||
background: -moz-linear-gradient(center top , #F3F3F3 0%, #D3D3D3 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);
|
||||
color: #555555;
|
||||
display: block;
|
||||
float: left;
|
||||
font-family: Times,'Times New Roman',Georgia,Palatino;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
height: 26px;
|
||||
outline: medium none;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
vertical-align: middle;
|
||||
width: 25px;
|
||||
}
|
||||
|
||||
/* Menu
|
||||
----------------------------------*/
|
||||
div#menu {display:none;}
|
||||
div#menu {position: absolute;width:200px;}
|
||||
div#menu .ui-widget {font-family:Arial, Sans-serif;font-size:12px;}
|
||||
div#menu ul.navigation li {list-style-type:none;}
|
||||
div#menu ul.navigation li a {display:block;padding:0 20px;text-decoration:none;font-weight:bold;color:#fff;height:25px;line-height:25px;background:#808080 url(/themes/default/images/menu/title.gif);}
|
||||
@ -451,7 +509,6 @@ div#menu div.icones {text-align:center;margin-top:5px;}
|
||||
|
||||
/* Recherche
|
||||
----------------------------------*/
|
||||
/*#center{padding:5px;}*/
|
||||
#center-recherche{text-align:center; padding:0;}
|
||||
#recherche{margin:78px auto 20px auto;}
|
||||
#recherche h3{color:#ffffff; font-size:medium; font-weight:bold;}
|
||||
@ -518,10 +575,10 @@ a.AncienSiege { background-color: #4D90FE; border: 1px solid #3079ED; color: #FF
|
||||
#liasseForm th {color:#606060;font-weight:bold;}
|
||||
#liasseForm {margin-left:30px;}
|
||||
#liasseForm td {color:#606060;}
|
||||
#synthese {border-collapse: collapse;clear: both;font-size: 12px;padding: 2px;text-align: left;width: 100%;font-family: arial,sans-serif;font-size: 11px;}
|
||||
#synthese .head {font-weight: bold;}
|
||||
#synthese th {background: none repeat scroll 0 0 #B9C9FE;border: 1px solid #FFFFFF;color: #003399;font-size: 13px;font-weight: normal;padding: 4px;}
|
||||
#synthese td.right {text-align: right;}
|
||||
#synthese {border-collapse: collapse;clear: both;font-size: 12px;margin: 10px 0px 0;padding: 2px;text-align: left;width: 100%;font-family: arial,sans-serif;font-size: 11px;}
|
||||
#synthese td {background: none repeat scroll 0 0 #E8EDFF;border: 1px solid #FFFFFF;color: #666699;padding: 4px;}
|
||||
#synthese tr:hover td {background: none repeat scroll 0 0 #D0DAFD;}
|
||||
#tabbed_box {margin: 0px auto 0px auto;width:300px;}
|
||||
@ -575,13 +632,6 @@ div.blocdegrade .echelleleft{float:left;}
|
||||
div.blocdegrade .echelleright{float:right;}
|
||||
.textdegrademin { position:absolute;overflow:hidden; margin-left:10px;line-height: 20px;color: #000;font-size:11px;font-weight: bold;font-family: monospace;}
|
||||
.regle {clear:both; }
|
||||
.clearfix:after {clear: both;content: ".";display: block;height: 0;visibility: hidden;}
|
||||
#synthese .head {font-weight: bold;}
|
||||
#synthese th {background: none repeat scroll 0 0 #B9C9FE;border: 1px solid #FFFFFF;color: #003399;font-size: 13px;font-weight: normal;padding: 4px;}
|
||||
#synthese td.right {text-align: right;}
|
||||
#synthese{border-collapse: collapse;clear: both;font-size: 12px;margin: 10px 0px 0;padding: 2px;text-align: left;width: 100%;font-family: arial,sans-serif;font-size: 11px;}
|
||||
#synthese td {background: none repeat scroll 0 0 #E8EDFF;border: 1px solid #FFFFFF;color: #666699;padding: 4px;}
|
||||
#synthese tr:hover td {background: none repeat scroll 0 0 #D0DAFD;}
|
||||
|
||||
/* Comment
|
||||
----------------------------------*/
|
||||
@ -633,8 +683,6 @@ div.blocdegrade .echelleright{float:right;}
|
||||
#formSurveillance input.search {border:1px solid; padding:3px 5px;width:200px;}
|
||||
#formSurveillance input.search:focus {border:1px solid #4D90FE;}
|
||||
#formSurveillance input.submit {font-weight:bold;padding:2px 5px; background-color:#4D90FE; border:1px solid #3079ED;color:#ffffff; }
|
||||
.pagination {background: none repeat scroll 0 0 transparent; border: 0 none; font-weight: bold; margin: 0; min-width: 1.5em; padding: 0.3em 0.5em;}
|
||||
.pagination:hover {background: black repeat scroll 0 0;color:white;}
|
||||
|
||||
/* Pieces
|
||||
----------------------------------*/
|
||||
@ -654,23 +702,24 @@ fieldset legend{ padding:0 0 0 10px;}
|
||||
.field .smallfield{width:95px;}
|
||||
.field .medfield{width:110px;}
|
||||
.field span { display:block; }
|
||||
.field input, .field select{ font-size:110%; margin:2px 0; }
|
||||
.field input[type="radio"] { margin:0 5px 0 5px; border:0; }
|
||||
input[type="checkbox"] { margin:0 5px 0 5px; border:0; }
|
||||
.field input, .field select{font-size:110%; margin:2px 0;}
|
||||
.field input[type="radio"] {margin:0 5px 0 5px; border:0;}
|
||||
input[type="checkbox"] {margin:0 5px 0 5px; border:0;}
|
||||
.submit {text-align:center;}
|
||||
.noborder {border:none;}
|
||||
#message {margin:10px 0 10px 30px;}
|
||||
table.greffe {width:100%;border-collapse:collapse;}
|
||||
table.greffe th {border:1px solid #000000;padding:8px 4px 8px 4px;background-color:#eeeeee;text-align:center; }
|
||||
table.greffe td.date {text-align:center;background-color:#2b2b8b;color:white;font-weight:bold;width:90px;}
|
||||
table.greffe td { border:1px solid #000000;padding:8px 4px 8px 4px;}
|
||||
table.greffe td.decision {}
|
||||
table.greffe td.type {text-align:center;}
|
||||
table.greffe td {padding:8px 4px 8px 4px;border:1px solid #000000;border-bottom: 1px dashed; vertical-align:top;}
|
||||
table.greffe td.decision {min-width:150px;}
|
||||
table.greffe td.type {min-width:250px;}
|
||||
table.greffe td.saisie {border-top: 1px dashed;}
|
||||
|
||||
/* Kbis
|
||||
----------------------------------*/
|
||||
/* progress bar container */
|
||||
#progressbar { border:1px solid black;width:200px;height:20px;position:relative;color:black;}
|
||||
#progressbar {border:1px solid black;width:200px;height:20px;position:relative;color:black;}
|
||||
/* color bar */
|
||||
#progressbar div.progress {position:absolute;width:0;height:100%;overflow:hidden;background-color:#369;}
|
||||
/* text on bar */
|
||||
@ -678,3 +727,14 @@ table.greffe td.type {text-align:center;}
|
||||
/* text off bar */
|
||||
#progressbar div.text {position:absolute;width:100%;height:100%;text-align:center;}
|
||||
|
||||
|
||||
/* Print
|
||||
----------------------------------*/
|
||||
@media print {
|
||||
body {font-family:Verdana, Arial, sans-serif;font-size: 11px;}
|
||||
#global {width:auto !important;text-align:left;}
|
||||
#content {margin:0; padding:0; width:auto; }
|
||||
table {page-break-inside:avoid}
|
||||
div.paragraph {page-break-inside:avoid}
|
||||
div#menu {display:none;}
|
||||
}
|
||||
|
@ -1,22 +0,0 @@
|
||||
<?php
|
||||
class SelectLang
|
||||
{
|
||||
protected $curLang = 'fr';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$utilisateur = new Scores_Utilisateur();
|
||||
$this->curLang = $utilisateur->getLang();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le titre de la colonne de la table selon la langue choisie
|
||||
* @param string Column Name
|
||||
* @return string New Column Name
|
||||
*/
|
||||
public function langSetDB($colName)
|
||||
{
|
||||
$newColName = ($this->curLang == 'fr') ? $colName : $colName.ucfirst($this->curLang);
|
||||
return $newColName;
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class SessionEntreprise
|
||||
class Scores_Session_Entreprise
|
||||
{
|
||||
protected $index = 'entrep';
|
||||
|
@ -8,7 +8,7 @@
|
||||
* ['consult'] = tableau des informations lors de la consultation d'une fiche
|
||||
* ['giant'] = tableau des informations lors de la consultation de la recherche giant.
|
||||
*/
|
||||
class RechercheHistorique
|
||||
class Scores_Session_Recherche
|
||||
{
|
||||
protected $index = 'recherches';
|
||||
protected $listeRecherche = array();
|
@ -36,7 +36,8 @@ class Scores_Wkhtml_Pdf
|
||||
if (empty($fileOut)) {$fileOut = str_replace('.html', '.pdf', $fileIn); }
|
||||
if(file_exists($fileOut)){ unlink($fileOut); }
|
||||
|
||||
$options = '--disable-internal-links';
|
||||
$options = '--print-media-type';
|
||||
$options.= ' --disable-internal-links';
|
||||
if ( count($this->options) )
|
||||
{
|
||||
foreach ( $this->options as $name => $value )
|
||||
|
160
library/Scores/Ws.php
Normal file
160
library/Scores/Ws.php
Normal file
@ -0,0 +1,160 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Load User Info
|
||||
*/
|
||||
require_once 'Scores/Utilisateur.php';
|
||||
|
||||
|
||||
/**
|
||||
* Distribute Scores Webservice
|
||||
*/
|
||||
class Scores_Ws
|
||||
{
|
||||
/**
|
||||
* User login
|
||||
* @var string
|
||||
*/
|
||||
protected $login = null;
|
||||
|
||||
/**
|
||||
* Password
|
||||
* @var string
|
||||
*/
|
||||
protected $password = null;
|
||||
|
||||
/**
|
||||
* Enable/Disable Cache
|
||||
* @var boolean
|
||||
*/
|
||||
protected $cache = true;
|
||||
|
||||
/**
|
||||
* Enable/Disable cache writing
|
||||
* Override the cache flag
|
||||
* @var boolean
|
||||
*/
|
||||
protected $cacheWrite = true;
|
||||
|
||||
/**
|
||||
* Number of response
|
||||
* @var int
|
||||
*/
|
||||
protected $nbReponses = 20;
|
||||
|
||||
protected $obj = null;
|
||||
|
||||
/**
|
||||
* Scores_Ws
|
||||
* @param string $login
|
||||
* @param string $password
|
||||
*/
|
||||
public function __construct($login = null, $password = null)
|
||||
{
|
||||
if ( !empty($login) && !empty($password) ){
|
||||
$this->login = $login;
|
||||
$this->password = $password;
|
||||
} else {
|
||||
$user = new Scores_Utilisateur();
|
||||
$this->login = $user->getLogin();
|
||||
$this->password = $user->getPassword();
|
||||
$this->nbReponses = $user->getNbRep();
|
||||
if ( $user->checkModeEdition() ) {
|
||||
//Disable cache
|
||||
$this->cache = false;
|
||||
//Don't write cache
|
||||
if ( APPLICATION_ENV == 'staging' ) {
|
||||
$this->cacheWrite = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Distribute call on each separate class for each service
|
||||
* Schema for $name is {Class}_{Method}
|
||||
* @param string $name
|
||||
* @param array $args
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call($name, $args)
|
||||
{
|
||||
$response = false;
|
||||
|
||||
$pos = strpos($name, '_');
|
||||
$className = substr($name, 0, $pos);
|
||||
$methodName = substr($name, $pos+1);
|
||||
|
||||
$objR = new ReflectionClass('Scores_Ws_'.$className);
|
||||
|
||||
$this->obj = $objR->newInstance($methodName);
|
||||
$this->obj->setSoapClientOption('login', $this->login);
|
||||
$this->obj->setSoapClientOption('password', $this->password);
|
||||
|
||||
//Check cache
|
||||
if ($this->cacheWrite && $this->obj->getCache()) {
|
||||
$filename = $this->obj->getFilename();
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
$response = $cache->getBlock();
|
||||
}
|
||||
}
|
||||
//Execute the request
|
||||
else {
|
||||
call_user_func_array(array($this->obj, $methodName), $args);
|
||||
if ( !$this->obj->isError() || !$this->obj->isMessage() ) {
|
||||
$response = $obj->getSoapResponse();
|
||||
//Put in cache the response
|
||||
if ($this->cacheWrite && $obj->getCache()) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($responses);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Type du retour
|
||||
* @return string
|
||||
* ERR or MSG
|
||||
*/
|
||||
public function getResponseType()
|
||||
{
|
||||
if ( $this->obj->isError() ) {
|
||||
return 'ERR';
|
||||
} elseif ( $this->obj->isMessage() ) {
|
||||
return 'MSG';
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Message de retour pour affichage
|
||||
* @return string
|
||||
*/
|
||||
public function getResponseMsg()
|
||||
{
|
||||
return $this->obj->getMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les éléments pour debuggage
|
||||
* @return object
|
||||
*/
|
||||
public function getError()
|
||||
{
|
||||
$error = new stdClass();
|
||||
$error->service = $this->obj->getServiceName();
|
||||
$error->method = $this->obj->getMethodName();
|
||||
//Request Parameter
|
||||
$error->args = $this->obj->getParams();
|
||||
$error->faultCode = $this->obj->getFaultCode();
|
||||
$error->faultMessage = $this->obj->getMessage();
|
||||
|
||||
return $error;
|
||||
}
|
||||
}
|
254
library/Scores/Ws/Abstract.php
Normal file
254
library/Scores/Ws/Abstract.php
Normal file
@ -0,0 +1,254 @@
|
||||
<?php
|
||||
require_once 'Scores/Ws/Config.php';
|
||||
|
||||
/** @see Scores_Ws_Interface */
|
||||
require_once 'Scores/Ws/Interface.php';
|
||||
|
||||
/**
|
||||
* Abstract class for Scores_Ws.
|
||||
*/
|
||||
abstract class Scores_Ws_Abstract implements Scosres_Ws_Interface
|
||||
{
|
||||
/**
|
||||
* Service name
|
||||
* @var string
|
||||
*/
|
||||
protected $service = null;
|
||||
|
||||
/**
|
||||
* Method Name
|
||||
* @var string
|
||||
*/
|
||||
protected $method = null;
|
||||
|
||||
/**
|
||||
* Params for soap call as stdClass
|
||||
* @var stdClass
|
||||
*/
|
||||
protected $params = null;
|
||||
|
||||
/**
|
||||
* Default max response
|
||||
* @var int
|
||||
*/
|
||||
protected $nbReponses = 20;
|
||||
|
||||
/**
|
||||
* Set to false to disable cache for one method
|
||||
* @var boolean
|
||||
*/
|
||||
protected $cache = true;
|
||||
|
||||
/**
|
||||
* WSDL URI
|
||||
* @var string
|
||||
*/
|
||||
protected $wsdl = null;
|
||||
|
||||
/**
|
||||
* Options for WSDL
|
||||
* @var array
|
||||
*/
|
||||
protected $options = array();
|
||||
|
||||
/**
|
||||
* Soap Response
|
||||
* @var object
|
||||
*/
|
||||
protected $response = null;
|
||||
|
||||
/**
|
||||
* 0 = no error
|
||||
* 1 = error
|
||||
* 2 = message
|
||||
* @var int
|
||||
*/
|
||||
protected $error = 0;
|
||||
|
||||
/**
|
||||
* Error / Message
|
||||
* @var string
|
||||
*/
|
||||
protected $message = '';
|
||||
|
||||
/**
|
||||
* Original soap fault code
|
||||
* @var string
|
||||
*/
|
||||
protected $faultcode = null;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$config = new Scores_Ws_Config();
|
||||
$config->setLocation('local');
|
||||
$serviceConfig = $config->getService($this->service);
|
||||
|
||||
$this->setSoapClientWsdl($serviceConfig['wsdl']);
|
||||
|
||||
foreach ( $serviceConfig['options'] as $name => $value ) {
|
||||
$this->setSoapClientOption($name, $value);
|
||||
}
|
||||
|
||||
$this->setSoapClientOption('features', SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS);
|
||||
$this->setSoapClientOption('compression', SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE);
|
||||
$this->setSoapClientOption('trace', true);
|
||||
$this->setSoapClientOption('encoding', 'utf-8');
|
||||
|
||||
if (APPLICATION_ENV == 'development'){
|
||||
$this->setSoapClientOption('cache_wsdl', WSDL_CACHE_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::setService()
|
||||
*/
|
||||
public function setService($name)
|
||||
{
|
||||
$this->service = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Interface::getServiceName()
|
||||
*/
|
||||
public function getServiceName()
|
||||
{
|
||||
return $this->service;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Interface::getMethodName()
|
||||
*/
|
||||
public function getMethodName()
|
||||
{
|
||||
return $this->method;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Interface::getParams()
|
||||
*/
|
||||
public function getParams()
|
||||
{
|
||||
return var_export($this->params, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Interface::getFaultCode()
|
||||
*/
|
||||
public function getFaultCode()
|
||||
{
|
||||
return $this->faultcode;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::setNbReponses()
|
||||
*/
|
||||
public function setNbReponses($nb)
|
||||
{
|
||||
$this->nbReponses = $nb;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::setSoapClientWsdl()
|
||||
*/
|
||||
public function setSoapClientWsdl($wsdl = null)
|
||||
{
|
||||
$this->wsdl = $wsdl;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::setSoapClientOption()
|
||||
*/
|
||||
public function setSoapClientOption($name = null , $value = null)
|
||||
{
|
||||
$this->options[$name] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::getSoapClient()
|
||||
*/
|
||||
public function getSoapClient()
|
||||
{
|
||||
$client = false;
|
||||
try {
|
||||
$client = new SoapClient($this->wsdl, $this->options);
|
||||
} catch (Exception $e) {
|
||||
throw new Exception('Application Error');
|
||||
}
|
||||
return $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::isError()
|
||||
*/
|
||||
public function isError()
|
||||
{
|
||||
if ( $this->error == 1 ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::isMessage()
|
||||
*/
|
||||
public function isMessage()
|
||||
{
|
||||
if ( $this->error == 2 ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::getSoapResponse()
|
||||
*/
|
||||
public function getSoapResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::getMessage()
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::getFilename()
|
||||
*/
|
||||
public function getFilename($method, $args)
|
||||
{
|
||||
$filename = $this->service . '-' . $method . '-' . implode('-', $args);
|
||||
return $filename;
|
||||
}
|
||||
|
||||
public function getCache()
|
||||
{
|
||||
return $this->cache;
|
||||
}
|
||||
|
||||
public function setCache($enable = true)
|
||||
{
|
||||
$this->cache = $enable;
|
||||
}
|
||||
|
||||
}
|
183
library/Scores/Ws/Catalog.php
Normal file
183
library/Scores/Ws/Catalog.php
Normal file
@ -0,0 +1,183 @@
|
||||
<?php
|
||||
|
||||
require_once 'Scores/Ws/Abstract.php';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Scores_Ws_Catalog extends Scores_Ws_Abstract
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->setService('catalog');
|
||||
$this->cache = false;
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename for a mathod
|
||||
* @param string $method
|
||||
* @param array $args
|
||||
*/
|
||||
public function getFilename($method, $args){}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown $id
|
||||
* @param unknown $columns
|
||||
*/
|
||||
public function getEvent($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns = $columns;
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getEvent($params);
|
||||
$this->response = $response->getEventResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->message = $fault->faultstring;
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getCatalogCurrency()
|
||||
{
|
||||
$filename = 'catalog-currency';
|
||||
$cache = new Cache($filename);
|
||||
if ( $cache->exist() ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
public function getCatalogCountry()
|
||||
{
|
||||
$filename = 'catalog-country';
|
||||
$cache = new Cache($filename);
|
||||
if ( $cache->exist() ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
229
library/Scores/Ws/Config.php
Normal file
229
library/Scores/Ws/Config.php
Normal file
@ -0,0 +1,229 @@
|
||||
<?php
|
||||
/**
|
||||
* WebService Configuration
|
||||
*/
|
||||
class Scores_Ws_Config
|
||||
{
|
||||
protected $location = null;
|
||||
|
||||
protected $services = array(
|
||||
//Local
|
||||
'local' => array(
|
||||
'interne' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.dev/interne/v0.6?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'entreprise' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.dev/entreprise/v0.8?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'gestion' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.dev/gestion/v0.3?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'saisie' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.dev/saisie/v0.2?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'pieces' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.dev/pieces/v0.1?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'catalog' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.dev/catalog/v0.1?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
//Development
|
||||
'development' => array(
|
||||
'interne' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.lan/interne/v0.6?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'entreprise' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.lan/entreprise/v0.8?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'gestion' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.lan/gestion/v0.3?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'saisie' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.lan/saisie/v0.2?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'pieces' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.lan/pieces/v0.1?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'catalog' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.lan/catalog/v0.1?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
//sd-25137
|
||||
'sd-25137' => array(
|
||||
'interne' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'entreprise' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/entreprise/v0.8?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'gestion' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/gestion/v0.3?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'saisie' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/saisie/v0.2?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'pieces' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/pieces/v0.1?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'catalog' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/catalog/v0.1?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
//Celeste
|
||||
'celeste' => array(
|
||||
'interne' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'entreprise' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/entreprise/v0.8?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'gestion' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/gestion/v0.3?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'saisie' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/saisie/v0.2?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'pieces' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/pieces/v0.1?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'catalog' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/catalog/v0.1?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
//Celeste Staging
|
||||
'celeste-staging' => array(
|
||||
'interne' => array(
|
||||
'wsdl' => "http://wsrec.scores-decisions.com:8000/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'entreprise' => array(
|
||||
'wsdl' => "http://wsrec.scores-decisions.com:8000/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'gestion' => array(
|
||||
'wsdl' => "http://wsrec.scores-decisions.com:8000/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'saisie' => array(
|
||||
'wsdl' => "http://wsrec.scores-decisions.com:8000/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'pieces' => array(
|
||||
'wsdl' => "http://wsrec.scores-decisions.com:8000/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'catalog' => array(
|
||||
'wsdl' => "http://wsrec.scores-decisions.com:8000/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setLocation($name)
|
||||
{
|
||||
$this->location = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return service parameters
|
||||
* @param string $name
|
||||
* @return array
|
||||
*/
|
||||
public function getService($name)
|
||||
{
|
||||
return $this->services[$this->location][$name];
|
||||
}
|
||||
|
||||
}
|
952
library/Scores/Ws/Entreprise.php
Normal file
952
library/Scores/Ws/Entreprise.php
Normal file
@ -0,0 +1,952 @@
|
||||
<?php
|
||||
require_once 'Scores/Ws/Abstract.php';
|
||||
|
||||
class Scores_Ws_Entreprise extends Scores_Ws_Abstract
|
||||
{
|
||||
public function __construct($method = null)
|
||||
{
|
||||
//Set service to use
|
||||
$this->setService('entreprise');
|
||||
|
||||
//Prepare method configuration
|
||||
if(null !== $method && method_exists($this, $method)) {
|
||||
$this->{$method.'Params'}();
|
||||
}
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* getAnnonces
|
||||
* @param string $siren
|
||||
* @param integer $filtre
|
||||
* @param string $idAnn
|
||||
* @param integer $position
|
||||
* @param integer $nbRep
|
||||
* @void
|
||||
*/
|
||||
public function getAnnonces($siren, $filtre=0, $idAnn='', $position=0, $nbRep=100)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->filtre = $filtre;
|
||||
$this->params->idAnn = $idAnn;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getAnnonces($this->params);
|
||||
$this->response = $response->getAnnoncesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getAnnoncesAsso
|
||||
* @param string $siren
|
||||
* @param string $idAnn
|
||||
* @param string $filtre
|
||||
* @param number $position
|
||||
* @param number $nbRep
|
||||
*/
|
||||
public function getAnnoncesAsso($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->idAnn = $idAnn;
|
||||
$this->params->filtre = $filtre;
|
||||
$this->params->position = $position;
|
||||
$this->params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getAnnoncesAsso($this->params);
|
||||
$this->response = $response->getAnnoncesAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getAnnoncesBalo
|
||||
* @param string $siren
|
||||
* @param string $idAnn
|
||||
* @param string $filtre
|
||||
* @param number $position
|
||||
* @param number $nbRep
|
||||
* @void
|
||||
*/
|
||||
public function getAnnoncesBalo($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->idAnn = $idAnn;
|
||||
$this->params->filtre = $filtre;
|
||||
$this->params->position = $position;
|
||||
$this->params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getAnnoncesBalo($this->params);
|
||||
$this->response = $response->getAnnoncesBaloResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getAnnoncesBoamp
|
||||
* @param string $siren
|
||||
* @param string $idAnn
|
||||
* @param string $filtre
|
||||
* @param number $position
|
||||
* @param number $nbRep
|
||||
* @void
|
||||
*/
|
||||
public function getAnnoncesBoamp($siren, $idAnn=null, $filtre = null, $position=0, $nbRep=20)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->idAnn = $idAnn;
|
||||
$this->params->filtre = null;
|
||||
if (!empty($filtre) && in_array($filtre,array('A','M'))) {
|
||||
$filtreStruct = new stdClass();
|
||||
$filtreStruct->key = 'type';
|
||||
$filtreStruct->value = $filtre;
|
||||
$this->params->filtre[] = $filtreStruct;
|
||||
}
|
||||
$this->params->position = $position;
|
||||
$this->params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getAnnoncesBoamp($this->params);
|
||||
$this->response = $response->getAnnoncesBoampResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getAnnoncesLegales
|
||||
* @param string $siren
|
||||
* @param string $idAnn
|
||||
* @param string $filtre
|
||||
* @param number $position
|
||||
* @param number $nbRep
|
||||
* @void
|
||||
*/
|
||||
public function getAnnoncesLegales($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->idAnn = $idAnn;
|
||||
$this->params->filtre = $filtre;
|
||||
$this->params->position = $position;
|
||||
$this->params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getAnnoncesLegales($this->params);
|
||||
$this->response = $response->getAnnoncesLegalesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getAnnoncesNum
|
||||
* @param string $siren
|
||||
* @void
|
||||
*/
|
||||
public function getAnnoncesNum($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getAnnoncesNum($this->params);
|
||||
$this->response = $response->getAnnoncesNumResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getBanques
|
||||
* @param string $siren
|
||||
* @void
|
||||
*/
|
||||
public function getBanques($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getBanques($this->params);
|
||||
$this->response = $response->getBanquesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getBilan
|
||||
* @param string $siren
|
||||
* @param string $millesime
|
||||
* @param string $typeBilan
|
||||
* @param string $ref
|
||||
* @void
|
||||
*/
|
||||
public function getBilan($siren, $millesime, $typeBilan, $ref)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->millesime = $millesime;
|
||||
$this->params->typeBilan = $typeBilan;
|
||||
$this->params->ref = $ref;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getBilan($this->params);
|
||||
$this->response = $response->getBilanResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getIdentiteParams
|
||||
* @void
|
||||
*/
|
||||
public function getIdentiteParams()
|
||||
{
|
||||
$this->setCache(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* getIdentite
|
||||
* @param string $siret
|
||||
* @param int $id
|
||||
* @void
|
||||
*/
|
||||
public function getIdentite($siret, $id = 0)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siret = $siret;
|
||||
$this->params->id = $id;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getIdentite($this->params);
|
||||
$this->response = $response->getIdentiteResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('1020')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getIdentiteProcol
|
||||
* @param string $siret
|
||||
* @param int $id
|
||||
* @void
|
||||
*/
|
||||
public function getIdentiteProcol($siret, $id = 0)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siret = $siret;
|
||||
$this->params->id = $id;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getIdentiteProcol($this->params);
|
||||
$this->response = $response->getIdentiteProcolResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getIndiScore
|
||||
* @param string $siren
|
||||
* @param string $nic
|
||||
* @param integer $niveau
|
||||
* @param boolean $plus
|
||||
* @param string $ref
|
||||
* @param integer $encours
|
||||
* @param string $email
|
||||
*/
|
||||
public function getIndiScore($siren, $nic=0, $niveau=2, $plus=false, $ref='', $encours=0, $email='')
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->nic = $nic;
|
||||
$this->params->niveau = $niveau;
|
||||
$this->params->plus = $plus;
|
||||
$this->params->ref = $ref;
|
||||
$this->params->encours = $encours;
|
||||
$this->params->email = $email;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getIndiScore($this->params);
|
||||
$this->response = $response->getIndiScoreResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('1020')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getInfosBourse
|
||||
* @param string $siren
|
||||
* @void
|
||||
*/
|
||||
public function getInfosBourse($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getInfosBourse($this->params);
|
||||
$this->response = $response->getInfosBourseResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('1030')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getInfosReg
|
||||
* @param string $siren
|
||||
* @param mixed $id
|
||||
* @void
|
||||
*/
|
||||
public function getInfosReg($siren, $id = false)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->id = $id;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getInfosReg($this->params);
|
||||
$this->response = $response->getInfosRegResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('1030')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getDirigeants
|
||||
* @param string $siren
|
||||
* @param boolean $histo
|
||||
* @void
|
||||
*/
|
||||
public function getDirigeants($siren, $histo=false)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->histo = $histo;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getDirigeants($this->params);
|
||||
$this->response = $response->getDirigeantsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getLienRef
|
||||
* @param string $id
|
||||
* @void
|
||||
*/
|
||||
public function getLienRef($id)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->id = $id;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getLienRef($this->params);
|
||||
$this->response = $response->getLienRefResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('ERR','MSG')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getLiens
|
||||
* @param string $siren
|
||||
* @void
|
||||
*/
|
||||
public function getLiens($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getLiens($this->params);
|
||||
$this->response = $response->getLiensResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('MSG')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getLiensById
|
||||
* @param int $id
|
||||
* @void
|
||||
*/
|
||||
public function getLiensById($id)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->id = $id;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getLiensById($this->params);
|
||||
$this->response = $response->getLiensByIdResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('MSG')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeBilans
|
||||
* @param string $siren
|
||||
*/
|
||||
public function getListeBilans($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getListeBilans($this->params);
|
||||
$this->response = $response-getListeBilansResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeCompetences
|
||||
* @param string $siret
|
||||
* @param string $type
|
||||
* @param string $codeInsee
|
||||
*/
|
||||
public function getListeCompetences($siret, $type, $codeInsee)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siret = $siret;
|
||||
$this->params->type = $type;
|
||||
$this->params->codeInsee = $codeInsee;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getListeCompetences($this->params);
|
||||
$this->response = $response->getListeCompetencesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeEtablissements
|
||||
* @param string $siren
|
||||
* @void
|
||||
*/
|
||||
public function getListeEtablissements($siren, $actif = -1, $position = 0)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$params->siren = $siren;
|
||||
$params->actif = $actif;
|
||||
$params->position = $position;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getListeEtablissements($this->params);
|
||||
$this->response = $response->getListeEtablissementsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeEvenements
|
||||
* @param string $siren
|
||||
* @param string $nic
|
||||
* @param integer $position
|
||||
* @param integer $nbRep
|
||||
* @void
|
||||
*/
|
||||
public function getListeEvenements($siren, $nic=0, $position=0, $nbRep=200)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$params->siren = $siren;
|
||||
$params->nic = $nic;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getListeEvenements($this->params);
|
||||
$this->response = $response->getListeEvenementsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getRapport
|
||||
* @param string $siren
|
||||
* @param integer $niveau
|
||||
* @param integer $id
|
||||
* @param boolean $plus
|
||||
* @param string $ref
|
||||
* @param integer $encours
|
||||
* @param string $email
|
||||
* @void
|
||||
*/
|
||||
public function getRapport($siren, $niveau=3, $id=0, $plus=false, $ref='', $encours=0, $email='')
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->niveau = $niveau;
|
||||
$this->params->d = $id;
|
||||
$this->params->plus = $plus;
|
||||
$this->params->ref = $ref;
|
||||
$this->params->encours = $encours;
|
||||
$this->params->email = $email;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getRapport($this->params);
|
||||
$this->response = $response->getRapportResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getRatios
|
||||
* @param string $siren
|
||||
* @param string $page
|
||||
*/
|
||||
public function getRatios($siren, $page = 'ratios')
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->page = $page;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getRapport($this->params);
|
||||
$this->response = $response->getRapportResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getSurveillancesParams
|
||||
*/
|
||||
public function getSurveillancesParams()
|
||||
{
|
||||
$this->setCache(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* getSurveillances
|
||||
* @param object $filtre
|
||||
* @param integer $deb
|
||||
* @param integer $nbRep
|
||||
* @param string $tri
|
||||
*/
|
||||
public function getSurveillances($filtre, $deb=0, $nbRep=100)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->filtre = $filtre;
|
||||
$this->params->position = $deb;
|
||||
$this->params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getSurveillances($this->params);
|
||||
$this->response = $response->getSurveillancesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getValo
|
||||
* @param string $siren
|
||||
* @void
|
||||
*/
|
||||
public function getValo($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getValo($this->params);
|
||||
$this->response = $response->getValoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('1020')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* isSirenExistant
|
||||
* @param string $siren
|
||||
*/
|
||||
public function isSirenExistant($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->isSirenExistant($this->params);
|
||||
$this->response = $response->isSirenExistantResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* rechercheAnnonceParams
|
||||
* @void
|
||||
*/
|
||||
public function rechercheAnnonceParams()
|
||||
{
|
||||
$this->setCache(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recherche Annonce
|
||||
* @param string $source
|
||||
* @param string $dateAnnee
|
||||
* @param integer $numParution
|
||||
* @param integer $numAnnonce
|
||||
*/
|
||||
public function rechercheAnnonce($source, $dateAnnee, $numParution, $numAnnonce)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->source = $source;
|
||||
$this->params->dateAnnee = $dateAnnee;
|
||||
$this->params->numParution = $numParution;
|
||||
$this->params->numAnnonce = $numAnnonce;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->rechercheAnnonce($this->params);
|
||||
$this->response = $response->rechercheAnnonceResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* searchEntrepriseParams
|
||||
* @void
|
||||
*/
|
||||
public function searchEntrepriseParams()
|
||||
{
|
||||
$this->setCache(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* searchEntreprise
|
||||
* @param array $criteres
|
||||
* @param int $position
|
||||
* @param int $nbRep
|
||||
* @param int $actif
|
||||
*/
|
||||
public function searchEntreprise($criteres, $position = 0, $nbRep = null)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->criteres = new StdClass;
|
||||
$this->params->criteres->identifiant = $criteres['identifiant'];
|
||||
$this->params->criteres->raisonSociale = $criteres['raisonSociale'];
|
||||
$this->params->criteres->adresse = $criteres['adresse'];
|
||||
$this->params->criteres->codePostal = $criteres['codePostal'];
|
||||
$this->params->criteres->ville = $criteres['ville'];
|
||||
$this->params->criteres->telFax = $criteres['telFax'];
|
||||
$this->params->criteres->naf = $criteres['naf'];
|
||||
$this->params->criteres->siege = false;
|
||||
$this->params->criteres->actif = in_array($criteres['actif'], array(0,1,2)) ? $criteres['actif'] : 2;
|
||||
$this->params->criteres->fj = $criteres['fj'];
|
||||
$this->params->position = $position;
|
||||
$this->params->nbRep = empty($nbRep) ? $this->nbReponses : $nbRep ;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->searchEntreprise($this->params);
|
||||
$this->response = $response->searchEntrepriseeResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* searchDirParams
|
||||
* @void
|
||||
*/
|
||||
public function searchDirParams()
|
||||
{
|
||||
$this->setCache(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recherche par dirigeants
|
||||
* @param array $criteres
|
||||
* @param integer $deb
|
||||
* @param integer $nbRep
|
||||
* @param integer $maxRep
|
||||
*/
|
||||
public function searchDir($criteres, $deb=0, $nbRep=20, $maxRep=200)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->criteres->nom = $criteres['dirNom'];
|
||||
$this->params->criteres->prenom = $criteres['dirPrenom'];
|
||||
$this->params->criteres->dateNaiss = $criteres['dirDateNaiss'];
|
||||
$this->params->criteres->lieuNaiss = $criteres['lieuNaiss'];
|
||||
$this->params->criteres->pertinence = ($criteres['pertinence']===true) ? true : false ;
|
||||
$this->params->deb = $deb;
|
||||
$this->params->nbRep = $nbRep;
|
||||
$this->params->maxRep = $maxRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->searchDir($this->params);
|
||||
$this->response = $response->searchDirResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* searchRefClientParams
|
||||
* @void
|
||||
*/
|
||||
public function searchRefClientParams()
|
||||
{
|
||||
$this->setCache(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recherche par référence client
|
||||
* @param string $search
|
||||
* @param integer $position
|
||||
* @param integer $nbRep
|
||||
*/
|
||||
public function searchRefClient($search, $position=0, $nbRep=20)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->search = $search;
|
||||
$this->params->position = $position;
|
||||
$this->params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->searchRefClient($this->params);
|
||||
$this->response = $response->searchRefClientResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* setSurveillance
|
||||
* @param string $siret
|
||||
* @param string $email
|
||||
* @param string $ref
|
||||
* @param string $source
|
||||
* @param boolean $delete
|
||||
* @param integer $encoursClient
|
||||
* @void
|
||||
*/
|
||||
public function setSurveillance($siret, $email, $ref = '', $source='annonces', $delete=false, $encoursClient=0)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siret = $siret;
|
||||
$this->params->email = $email;
|
||||
$this->params->ref = $ref;
|
||||
$this->params->source = $source;
|
||||
$this->params->delete = $delete;
|
||||
$this->params->encoursClient = $encoursClient;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->setSurveillance($this->params);
|
||||
$this->response = $response->setSurveillanceResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
459
library/Scores/Ws/Gestion.php
Normal file
459
library/Scores/Ws/Gestion.php
Normal file
@ -0,0 +1,459 @@
|
||||
<?php
|
||||
class Scores_Ws_Gestion extends Scores_Ws_Abstract
|
||||
{
|
||||
|
||||
/**
|
||||
* getCategory
|
||||
*/
|
||||
public function getCategory()
|
||||
{
|
||||
$filename = 'category';
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getListeDroits
|
||||
*/
|
||||
public function getListeDroits()
|
||||
{
|
||||
$filename = 'droits';
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock('droits');
|
||||
}
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->getListeDroits();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getListeDroitsResult);
|
||||
return $reponse->getListeDroitsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getNextLogin
|
||||
* @param int $idClient
|
||||
*/
|
||||
public function getNextLogin($idClient)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idClient = $idClient;
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->getNextLogin($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
return $reponse->getNextLoginResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
Zend_Registry::get('firebug')->info($fault);
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getLogs
|
||||
*/
|
||||
public function getLogs()
|
||||
{
|
||||
$filename = 'logs';
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListePrefs
|
||||
*/
|
||||
public function getListePrefs()
|
||||
{
|
||||
$filename = 'prefs';
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock('prefs');
|
||||
}
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->getListePrefs();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getListePrefsResult);
|
||||
return $reponse->getListePrefsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enregistre ou modifie un client
|
||||
* @param unknown_type $infos
|
||||
* @return boolean
|
||||
*/
|
||||
public function setClient($infos)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->infos = json_encode($infos);
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->setClient($params);
|
||||
return $reponse->setClientResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
Zend_Registry::get('firebug')->info($fault);
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* setInfosLogin
|
||||
* @param string $login
|
||||
* @param string $action
|
||||
* @param array $infos
|
||||
*/
|
||||
public function setInfosLogin($login, $action, $infos = null)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$params->action = $action;
|
||||
if ($infos !== null ) {
|
||||
$params->infos = json_encode($infos);
|
||||
}
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->setInfosLogin($params);
|
||||
return $reponse->setInfosLoginResult;
|
||||
} catch (SoapFault $fault) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getInfosLogin
|
||||
* @param string $login
|
||||
* @param string $ipUtilisateur
|
||||
*/
|
||||
public function getInfosLogin($login, $ipUtilisateur = '')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$params->ipUtilisateur = $ipUtilisateur;
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->getInfosLogin($params);
|
||||
return $reponse->getInfosLoginResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if (substr($fault->faultcode,0,1)=='0'){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeUtilisateurs
|
||||
* Enter description here ...
|
||||
* @param string $login
|
||||
* @param integer $idClient
|
||||
*/
|
||||
public function getListeUtilisateurs($login, $idClient = -1)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$params->idClient = $idClient;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getListeUtilisateurs($params);
|
||||
return $reponse->getListeUtilisateursResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeClients
|
||||
* @param unknown_type $idClient
|
||||
*/
|
||||
public function getListeClients($idClient=false)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idClient = $idClient;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getListeClients($params);
|
||||
return $reponse->getListeClientsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getLogsClients($params);
|
||||
return $reponse->getLogsClientsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getServiceUsers($idClient, $service)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idClient = $idClient;
|
||||
$params->serviceCode = $service;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getServiceUsers($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
return $reponse->getServiceUsersResult;
|
||||
} 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 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function setClientTarif($idClient, $log, $service, $type, $priceUnit, $limit, $date, $duree, $doublon)
|
||||
{
|
||||
$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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getClientTarifs($idClient, $service = null)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idClient = $idClient;
|
||||
$params->service = $service;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getClientTarifs($params);
|
||||
return $reponse->getClientTarifsResult;
|
||||
} 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 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 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;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setUserService($login, $code)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$params->code = $code;
|
||||
$client = $this->loadClient('gestion');
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
88
library/Scores/Ws/Interface.php
Normal file
88
library/Scores/Ws/Interface.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* Interface class for Scores_Ws
|
||||
*/
|
||||
interface Scores_Ws_Interface
|
||||
{
|
||||
/**
|
||||
* Define service name
|
||||
* @param string $name
|
||||
*/
|
||||
public function setService($name);
|
||||
|
||||
/**
|
||||
* Get the service name
|
||||
* @void
|
||||
*/
|
||||
public function getServiceName();
|
||||
|
||||
/**
|
||||
* Get Method name
|
||||
* @void
|
||||
*/
|
||||
public function getMethodName();
|
||||
|
||||
/**
|
||||
* Get Params
|
||||
* @void
|
||||
*/
|
||||
public function getParams();
|
||||
|
||||
/**
|
||||
* Get fault code
|
||||
* @void
|
||||
*/
|
||||
public function getFaultCode();
|
||||
|
||||
/**
|
||||
* Set the default for max responses
|
||||
* @param int $nb
|
||||
*/
|
||||
public function setNbReponses($nb);
|
||||
|
||||
/**
|
||||
* Define WSDL URI
|
||||
* @param string $wsdl
|
||||
*/
|
||||
public function setSoapClientWsdl($wsdl = null);
|
||||
|
||||
/**
|
||||
* Define options for SoapClient
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
*/
|
||||
public function setSoapClientOption($name = null , $value = null);
|
||||
|
||||
/**
|
||||
* Instantiate Soap Client
|
||||
*/
|
||||
public function getSoapClient();
|
||||
|
||||
/**
|
||||
* Get Soap Response
|
||||
*/
|
||||
public function getSoapResponse();
|
||||
|
||||
/**
|
||||
* True if the response is an error
|
||||
*/
|
||||
public function isError();
|
||||
|
||||
/**
|
||||
* True if the response is a message
|
||||
*/
|
||||
public function isMessage();
|
||||
|
||||
/**
|
||||
* Return message (error)
|
||||
*/
|
||||
public function getMessage();
|
||||
|
||||
/**
|
||||
* Get the filename for a mathod
|
||||
* @param string $method
|
||||
* @param array $args
|
||||
*/
|
||||
public function getFilename($method, $args);
|
||||
|
||||
}
|
654
library/Scores/Ws/Interne.php
Normal file
654
library/Scores/Ws/Interne.php
Normal file
@ -0,0 +1,654 @@
|
||||
<?php
|
||||
class Scores_Ws_Interne extends Scores_Ws_Abstract
|
||||
{
|
||||
|
||||
/**
|
||||
* setCmdAsso
|
||||
* @param unknown_type $infosCommande
|
||||
* @param unknown_type $infosDemandeur
|
||||
* @return boolean
|
||||
*/
|
||||
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) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
Zend_Registry::get('firebug')->info($fault);
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getIdentiteLight
|
||||
* @param string $siret
|
||||
* @param int $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function getIdentiteLight($siret, $id = 0)
|
||||
{
|
||||
$filename = 'identitelight-'.$siret.'-'.$id;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new StdClass();
|
||||
$params->siret = $siret;
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getIdentiteLight($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getIdentiteLightResult);
|
||||
}
|
||||
return $reponse->getIdentiteLightResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getDirigeantsOp
|
||||
* @param string $siren
|
||||
*/
|
||||
public function getDirigeantsOp($siren)
|
||||
{
|
||||
$filename = 'dirigeantsop-'.$siren;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new StdClass();
|
||||
$params->siren = $siren;
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getPortefeuille
|
||||
* @param object $filtre
|
||||
* @param integer $position
|
||||
* @param integer $nbAffichage
|
||||
*/
|
||||
public function getPortefeuille($filtre, $position = 0, $nbAffichage = 100)
|
||||
{
|
||||
$params = new StdClass;
|
||||
$params->filtre = $filtre;
|
||||
$params->deb = $position;
|
||||
$params->nbRep = $nbAffichage;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getPortefeuille($params);
|
||||
return $reponse->getPortefeuilleResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeConventions
|
||||
* Enter description here ...
|
||||
* @param string $siren
|
||||
*/
|
||||
public function getListeConventions($siren)
|
||||
{
|
||||
$filename = 'conventions-'.$siren;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getListeConventions($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getListeConventionsResult);
|
||||
}
|
||||
return $reponse->getListeConventionsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getMarques
|
||||
* Enter description here ...
|
||||
* @param string $siren
|
||||
* @param integer $idDepot
|
||||
*/
|
||||
public function getMarques($siren, $idDepot = 0)
|
||||
{
|
||||
$filename = 'marques-'.$siren.'-'.$idDepot;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->idDepot = $idDepot;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getMarques($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getMarquesResult);
|
||||
}
|
||||
return $reponse->getMarquesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getPrivilegesDetail
|
||||
* Enter description here ...
|
||||
* @param unknown_type $siren
|
||||
* @param unknown_type $tabTypes
|
||||
*/
|
||||
public function getPrivilegesDetail($siren, $tabTypes = array() )
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->tabTypes = $tabTypes;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getPrivilegesDetail($params);
|
||||
return $reponse->getPrivilegesDetailResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getDevises
|
||||
* Enter description here ...
|
||||
* @param unknown_type $codeIsoDevise
|
||||
*/
|
||||
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) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getPrivilegesCumul
|
||||
* Enter description here ...
|
||||
* @param unknown_type $siren
|
||||
* @param unknown_type $tabTypes
|
||||
*/
|
||||
public function getPrivilegesCumul($siren, $tabTypes = array() )
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->tabTypes = $tabTypes;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getPrivilegesCumul($params);
|
||||
return $reponse->getPrivilegesCumulResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getTribunaux
|
||||
* Enter description here ...
|
||||
* @param unknown_type $tabTypes
|
||||
*/
|
||||
public function getTribunaux($tabTypes = array())
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->tabTypes = $tabTypes;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getTribunaux($params);
|
||||
return $reponse->getTribunauxResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeJalCollecte
|
||||
* Enter description here ...
|
||||
*/
|
||||
public function getListeJalCollecte()
|
||||
{
|
||||
$filename = 'listejalcollecte';
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
$params = new stdClass();
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getListeJalCollecte();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getListeJalCollecteResult);
|
||||
return $reponse->getListeJalCollecteResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function searchAct($nom, $cpVille='', $siren='', $pays='', $pctMin=0, $pctMax=100, $deb=0)
|
||||
{
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* searchMandataires
|
||||
* @param unknown_type $nom
|
||||
* @param unknown_type $type
|
||||
* @param unknown_type $cpDep
|
||||
*/
|
||||
public function searchMandataires($nom, $type=array(), $cpDep=0)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->nom = $nom;
|
||||
$params->type = $type;
|
||||
$params->cpDep = $cpDep;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->searchMandataires($params);
|
||||
return $reponse->searchMandatairesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* setMandataire
|
||||
* Enter description here ...
|
||||
* @param unknown_type $infos
|
||||
*/
|
||||
public function setMandataire($infos)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$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'];
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->setMandataire($params);
|
||||
return $reponse->setMandataireResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* setLog
|
||||
* @param string $page
|
||||
* @param string $siret
|
||||
* @param string $id
|
||||
* @param string $ref
|
||||
*/
|
||||
public function setLog ($page, $siret, $id=0, $ref = '')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->page = $page;
|
||||
$params->siret = $siret;
|
||||
$params->id = $id;
|
||||
$params->ref = $ref;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->setLog($params);
|
||||
return true;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getPortefeuilleCsv
|
||||
* @param unknown_type $login
|
||||
* @param unknown_type $idClient
|
||||
*/
|
||||
public function getPortefeuilleCsv($login='', $idClient=0)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$params->idClient = $idClient;
|
||||
|
||||
//@todo : Seulement pour aider Altysis
|
||||
$c = Zend_Registry::get('config');
|
||||
$location = $c->profil->webservice->location;
|
||||
|
||||
$cWS = new Zend_Config_Ini(realpath(dirname(__FILE__)) . '/webservices.ini');
|
||||
$config = $cWS->toArray();
|
||||
$this->webservices = $config[$location]['webservices'];
|
||||
//@todo
|
||||
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getPortefeuilleCsv($params);
|
||||
return $reponse->getPortefeuilleCsvResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enter description here ...
|
||||
* @param unknown_type $siren
|
||||
* @return Ambigous <boolean, mixed>|boolean
|
||||
*/
|
||||
public function getListeDepots($siren)
|
||||
{
|
||||
$filename = 'listedepots-'.$siren;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getListeDepots($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getListeDepotsResult);
|
||||
}
|
||||
return $reponse->getListeDepotsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'arborescence d'un groupe
|
||||
* @param string $siren
|
||||
* @param int pctMin
|
||||
* @param int $nbNiveaux
|
||||
*/
|
||||
public function getGroupesArbo($siren, $pctMin=33, $nbNiveaux=10)
|
||||
{
|
||||
$filename = 'groupesarbo-'.$siren.'-'.$pctMin;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new StdClass;
|
||||
$params->siren = $siren;
|
||||
$params->pctMin = $pctMin;
|
||||
$params->nbNiveaux = $nbNiveaux;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getGroupesArbo($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getGroupesArboResult);
|
||||
}
|
||||
return $reponse->getGroupesArboResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('Error')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
75
library/Scores/Ws/Pieces.php
Normal file
75
library/Scores/Ws/Pieces.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
class Scores_Ws_Pieces extends Scores_Ws_Abstract
|
||||
{
|
||||
/**
|
||||
* Récupération des kbis
|
||||
*/
|
||||
public function getKbis($siren, $diffusion, $reference='')
|
||||
{
|
||||
$params = new StdClass;
|
||||
$params->siren = $siren;
|
||||
$params->diffusion = $diffusion;
|
||||
$params->reference = $reference;
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getKbis($params);
|
||||
return $reponse->getKbisResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('0000', 'MSG')) ){
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste des bilans
|
||||
* @param string $siren
|
||||
* @todo : Cache
|
||||
*/
|
||||
public function getPiecesBilans($siren)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->identifiant = $siren;
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bilan URL
|
||||
* @param string $siren
|
||||
* @param string $diffusion
|
||||
* @param string $dateCloture
|
||||
* @param string $reference
|
||||
*/
|
||||
public function getPiecesBilan($siren, $diffusion, $dateCloture, $reference)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->identifiant = $siren;
|
||||
$params->diffusion = $diffusion;
|
||||
$params->dateCloture = $dateCloture;
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
511
library/Scores/Ws/Saisie.php
Normal file
511
library/Scores/Ws/Saisie.php
Normal file
@ -0,0 +1,511 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -31,13 +31,13 @@ class WsScores
|
||||
* Enable/Disable using of cache
|
||||
* @var unknown
|
||||
*/
|
||||
protected $cacheEnable = false;
|
||||
protected $cacheEnable = true;
|
||||
|
||||
/**
|
||||
* Enbale/Disable cache writing
|
||||
* @var boolean
|
||||
*/
|
||||
protected $cacheWrite = false;
|
||||
protected $cacheWrite = true;
|
||||
|
||||
/**
|
||||
* Load WebService config
|
||||
@ -101,6 +101,154 @@ class WsScores
|
||||
return $client;
|
||||
}
|
||||
|
||||
public function getEntrepriseLiasseInfos($siren)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getLiasseInfos($params);
|
||||
return $reponse->getLiasseInfosResult;
|
||||
} 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 setSaisieContactEt($siret, $type, $value, $info, $id=null, $delete=false)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->siret = $siret;
|
||||
$params->type = $type;
|
||||
$params->value = $value;
|
||||
$params->info = $info;
|
||||
$params->delete = $delete;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setContactEt($params);
|
||||
return $reponse->setContactEtResult;
|
||||
} 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;
|
||||
}
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siret = $siret;
|
||||
$params->filtre = $filter;
|
||||
$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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
public function getEntrepriseValo($siren, $nic=0, $niveau=2)
|
||||
{
|
||||
$filename = 'getvalo-'.$siren.'-'.$nic.'-'.$niveau;
|
||||
@ -230,6 +378,26 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getCatalogLegalForm($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
@ -779,13 +947,18 @@ class WsScores
|
||||
|
||||
/**
|
||||
* Liste des bilans
|
||||
* @param string $siren
|
||||
* @todo : Cache
|
||||
* @param string $identifiant
|
||||
* Siren
|
||||
* @param int $position
|
||||
* @param int $nbRep
|
||||
*
|
||||
*/
|
||||
public function getPiecesBilans($siren)
|
||||
public function getPiecesBilans($identifiant, $position = 0, $nbRep = 200)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->identifiant = $siren;
|
||||
$params->identifiant = $identifiant;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getBilans($params);
|
||||
@ -800,16 +973,18 @@ class WsScores
|
||||
/**
|
||||
* Bilan URL
|
||||
* @param string $siren
|
||||
* @param string $type
|
||||
* @param string $diffusion
|
||||
* @param string $dateCloture
|
||||
* @param string $reference
|
||||
*/
|
||||
public function getPiecesBilan($siren, $diffusion, $dateCloture, $reference)
|
||||
public function getPiecesBilan($siren, $type, $diffusion, $dateCloture, $reference = '')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->identifiant = $siren;
|
||||
$params->diffusion = $diffusion;
|
||||
$params->dateCloture = $dateCloture;
|
||||
$params->type = $type;
|
||||
$params->diffusion = $diffusion;
|
||||
$params->reference = $reference;
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
@ -823,6 +998,47 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function setCGU()
|
||||
{
|
||||
$params = new stdClass();
|
||||
@ -856,6 +1072,54 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get secondary email
|
||||
* @param string $login
|
||||
* @param int $id
|
||||
* @return boolean
|
||||
*/
|
||||
public function getGestionEmail($login, $id=null)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getEmail($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
return $reponse->getEmailResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set secondary email
|
||||
* @param string $email
|
||||
* @param login $login
|
||||
* @param int $id
|
||||
* @param string $action
|
||||
* @return boolean
|
||||
*/
|
||||
public function setGestionEmail($email, $login, $id=null, $action = 'set')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->email = $email;
|
||||
$params->login = $login;
|
||||
$params->idClient = $idClient;
|
||||
$params->id = $id;
|
||||
$params->action = $action;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->setEmail($params);
|
||||
return $reponse->setEmailResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les infos du groupe
|
||||
* @param string $siren
|
||||
@ -884,9 +1148,13 @@ class WsScores
|
||||
* @param int pctMin
|
||||
* @param int $nbNiveaux
|
||||
*/
|
||||
public function getGroupesArbo($siren, $pctMin=33, $nbNiveaux=10)
|
||||
public function getGroupesArbo($siren, $pctMin=33, $nbNiveaux=10, $stopAtIsin = false)
|
||||
{
|
||||
$filename = 'groupesarbo-'.$siren.'-'.$pctMin;
|
||||
$filename.= '-0';
|
||||
if ($stopAtIsin === true) {
|
||||
$filename.= '-1';
|
||||
}
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
@ -898,7 +1166,7 @@ class WsScores
|
||||
$params = new StdClass;
|
||||
$params->siren = $siren;
|
||||
$params->pctMin = $pctMin;
|
||||
$params->stopAtIsin = false;
|
||||
$params->stopAtIsin = $stopAtIsin;
|
||||
$params->nbNiveaux = $nbNiveaux;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
@ -917,10 +1185,12 @@ class WsScores
|
||||
/**
|
||||
* Récupération des kbis
|
||||
*/
|
||||
public function getKbis($siren)
|
||||
public function getKbis($siren, $diffusion, $reference='')
|
||||
{
|
||||
$params = new StdClass;
|
||||
$params->siren = $siren;
|
||||
$params->diffusion = $diffusion;
|
||||
$params->reference = $reference;
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getKbis($params);
|
||||
@ -2322,9 +2592,9 @@ class WsScores
|
||||
* getDirigeantsOp
|
||||
* @param string $siren
|
||||
*/
|
||||
public function getDirigeantsOp($siren)
|
||||
public function getDirigeantsOp($siren, $id = null)
|
||||
{
|
||||
$filename = 'dirigeantsop-'.$siren;
|
||||
$filename = 'dirigeantsop-'.$siren.'-'.intval($id);
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
@ -2335,6 +2605,7 @@ class WsScores
|
||||
|
||||
$params = new StdClass();
|
||||
$params->siren = $siren;
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getDirigeantsOp($params);
|
||||
@ -2349,6 +2620,31 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getIdentiteLight
|
||||
* @param string $siret
|
||||
@ -2378,6 +2674,7 @@ class WsScores
|
||||
}
|
||||
return $reponse->getIdentiteLightResult;
|
||||
} catch (SoapFault $fault) {
|
||||
print_r($fault);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -2742,6 +3039,26 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getScoreHistorique pour les derniers 5 ans
|
||||
* @param string $siret
|
||||
* @param string $type
|
||||
*/
|
||||
public function getScoresHisto($siret, $type = 'indiscore')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siret = $siret;
|
||||
$params->type = $type;
|
||||
try {
|
||||
$client = $this->loadClient('interne');
|
||||
$reponse = $client->getScoresHisto($params);
|
||||
return $reponse->getScoresHistoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getNextLogin
|
||||
* @param int $idClient
|
||||
@ -2885,13 +3202,15 @@ class WsScores
|
||||
|
||||
$message.= "Requete :\n ".$requete."\n";
|
||||
$message.= "Reponse :\n ".$reponse."\n";
|
||||
|
||||
if (APPLICATION_ENV == 'production' || APPLICATION_ENV == 'staging') {
|
||||
$c = Zend_Registry::get('config');
|
||||
require_once 'Scores/Mail.php';
|
||||
$mail = new Mail();
|
||||
$mail = new Scores_Mail();
|
||||
$mail->setSubject('[ERREUR SOAP] - '.$c->profil->server->name.' -'.date('Ymd'));
|
||||
$mail->setBodyTexte($message);
|
||||
$mail->setFrom('supportdev');
|
||||
$mail->addToKey('supportdev');
|
||||
$mail->send();
|
||||
}
|
||||
}
|
||||
}
|
45
library/Scores/autoload_classmap.php
Normal file
45
library/Scores/autoload_classmap.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
// Generated by ZF's ./bin/classmap_generator.php
|
||||
return array(
|
||||
'Annonces' => dirname(__FILE__) . '/Annonces.php',
|
||||
'Scores_Auth_Adapter_Db' => dirname(__FILE__) . '/Auth/Adapter/Db.php',
|
||||
'Scores_Auth_Adapter_Ws' => dirname(__FILE__) . '/Auth/Adapter/Ws.php',
|
||||
'BDF' => dirname(__FILE__) . '/Bdf.php',
|
||||
'Cache' => dirname(__FILE__) . '/Cache.php',
|
||||
'Scores_Export_ArrayCsv' => dirname(__FILE__) . '/Export/ArrayCsv.php',
|
||||
'Scores_Export_Print' => dirname(__FILE__) . '/Export/Print.php',
|
||||
'Scores_Finance_Liasse_XLS' => dirname(__FILE__) . '/Finance/Liasse/XLS.php',
|
||||
'Scores_Finance_Liasse' => dirname(__FILE__) . '/Finance/Liasse.php',
|
||||
'Scores_Finance_Ratios_Data' => dirname(__FILE__) . '/Finance/Ratios/Data.php',
|
||||
'Scores_Finance_Ratios_Graph' => dirname(__FILE__) . '/Finance/Ratios/Graph.php',
|
||||
'GestionCommande' => dirname(__FILE__) . '/GestionCommandes.php',
|
||||
'Scores_Google_Maps' => dirname(__FILE__) . '/Google/Maps.php',
|
||||
'Scores_Google_Streetview' => dirname(__FILE__) . '/Google/Streetview.php',
|
||||
'IdentiteEntreprise' => dirname(__FILE__) . '/IdentiteEntreprise.php',
|
||||
'IdentiteProcol' => dirname(__FILE__) . '/IdentiteProcol.php',
|
||||
'Scores_Insee_AvisSituation' => dirname(__FILE__) . '/Insee/AvisSituation.php',
|
||||
'Scores_Insee_Iris' => dirname(__FILE__) . '/Insee/Iris.php',
|
||||
'Logo' => dirname(__FILE__) . '/Logo.php',
|
||||
'Scores_Mail' => dirname(__FILE__) . '/Mail.php',
|
||||
'Mappy' => dirname(__FILE__) . '/Mappy.php',
|
||||
'Scores_Menu' => dirname(__FILE__) . '/Menu.php',
|
||||
'Scores_Mobile_Detect' => dirname(__FILE__) . '/Mobile/Detect.php',
|
||||
'RapportComment' => dirname(__FILE__) . '/RapportComment.php',
|
||||
'Scores_Serializer_Adapter_Xml' => dirname(__FILE__) . '/Serializer/Adapter/Xml.php',
|
||||
'Scores_Session_Entreprise' => dirname(__FILE__) . '/Session/Entreprise.php',
|
||||
'Scores_Session_Recherche' => dirname(__FILE__) . '/Session/Recherche.php',
|
||||
'Siren' => dirname(__FILE__) . '/Siren.php',
|
||||
'Scores_Utilisateur' => dirname(__FILE__) . '/Utilisateur.php',
|
||||
'Scores_Wkhtml_Pdf' => dirname(__FILE__) . '/Wkhtml/Pdf.php',
|
||||
'Scores_Ws_Abstract' => dirname(__FILE__) . '/Ws/Abstract.php',
|
||||
'Scores_Ws_Catalog' => dirname(__FILE__) . '/Ws/Catalog.php',
|
||||
'Scores_Ws_Config' => dirname(__FILE__) . '/Ws/Config.php',
|
||||
'Scores_Ws_Entreprise' => dirname(__FILE__) . '/Ws/Entreprise.php',
|
||||
'Scores_Ws_Gestion' => dirname(__FILE__) . '/Ws/Gestion.php',
|
||||
'Scores_Ws_Interface' => dirname(__FILE__) . '/Ws/Interface.php',
|
||||
'Scores_Ws_Interne' => dirname(__FILE__) . '/Ws/Interne.php',
|
||||
'Scores_Ws_Pieces' => dirname(__FILE__) . '/Ws/Pieces.php',
|
||||
'Scores_Ws_Saisie' => dirname(__FILE__) . '/Ws/Saisie.php',
|
||||
'Scores_Ws' => dirname(__FILE__) . '/Ws.php',
|
||||
'WsScores' => dirname(__FILE__) . '/WsScores.php',
|
||||
);
|
@ -1,173 +0,0 @@
|
||||
<?
|
||||
if ( !function_exists('htmlspecialchars_decode') )
|
||||
{
|
||||
function htmlspecialchars_decode($text)
|
||||
{
|
||||
return strtr($text, array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
|
||||
}
|
||||
}
|
||||
|
||||
require_once 'common/curl.php';
|
||||
|
||||
if ( !function_exists('supprDecimales') )
|
||||
{
|
||||
function supprDecimales($dec) {
|
||||
if ($dec>0 )
|
||||
return floor($dec);
|
||||
else
|
||||
return ceil($dec);
|
||||
}
|
||||
}
|
||||
|
||||
if ( !function_exists('dec2dms') )
|
||||
{
|
||||
function dec2dms($dec) {
|
||||
$d = supprDecimales($dec);
|
||||
$m = supprDecimales(($dec - $d) * 60);
|
||||
$s = abs(round(((($dec - $d) * 60) - $m) * 60));
|
||||
$m = abs($m);
|
||||
return $d.'°'.$m."'".$s.'"';
|
||||
}
|
||||
}
|
||||
|
||||
/** Retourne la distance en kilomètres entre 2 points à la surface de la terre
|
||||
** Calcul effectué avec la sphère « GRS80 » de rayon R = 6378,187 km
|
||||
** Autre sphère possible : « Picard » de rayon R = 6371,598 km
|
||||
**
|
||||
** @param double $latA Latitude du point A en décimal
|
||||
** @param double $lonA Longitude du point A en décimal
|
||||
** @param double $latB Latitude du point B en décimal
|
||||
** @param double $lonB Longitude du point B en décimal
|
||||
** @return unknown
|
||||
**/
|
||||
function distance($latA=0, $lonA=0, $latB=0, $lonB=0) {
|
||||
//s(AB) = arc cos (sinjA sinjB + cos jA cosjB cosdl)
|
||||
// avec dl = lB - lA
|
||||
$e=pi()*$latA/180;
|
||||
$f=pi()*$lonA/180;
|
||||
$g=pi()*$latB/180;
|
||||
$h=pi()*$lonB/180;
|
||||
|
||||
$j=acos(cos($e)*cos($g)*cos($f)*cos($h) + cos($e)*sin($f)*cos($g)*sin($h) + sin($e)*sin($g));
|
||||
|
||||
return round(6371.598*$j,3); // div par 1.852 ==> résultat en miles nautiques
|
||||
}
|
||||
|
||||
class MMap {
|
||||
|
||||
public $body = '';
|
||||
public $header = '';
|
||||
public $cookie = '';
|
||||
public $codeRetour = 0;
|
||||
public $codeRetour2 = 0;
|
||||
|
||||
public $latitudeDec= 0; // Latitude en Décimal
|
||||
public $latitudeDeg= 0; // Latitude en Dégrés
|
||||
public $longitudeDec= 0; // Longitude en Décimal
|
||||
public $longitudeDeg= 0; // Longitude en Dégrés
|
||||
|
||||
public $precision = 0;
|
||||
public $adresseValidee='';
|
||||
|
||||
function __construct($adresse, $cp, $ville, $pays='France') {
|
||||
/*
|
||||
$referer='http://maps.google.fr/?output=html';
|
||||
$page=getUrl($referer, '', '', $referer, false, 'maps.google.fr');
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
$this->cookie=$this->header['Set-Cookie'];
|
||||
|
||||
$url='http://maps.google.fr/maps?f=q&output=html&q='.urlencode($adresse.', '.$cp.' '. $ville.', '.$pays);
|
||||
$page=getUrl($url, $this->cookie, '', $referer, false, 'maps.google.fr');
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
if (strpos($this->body, '<p>Nous ne sommes pas parvenus à localiser l\'adresse : <br />')===true) return false;
|
||||
|
||||
$this->adresseValidee=strtoupper(htmlspecialchars_decode(str_replace('<br>', ', ', @getTextInHtml($this->body, '<p><table cellpadding="0" cellspacing="0" border="0"><tr><td valign="center" nowrap>', ' nowrap>', '</td>')), ENT_QUOTES));
|
||||
|
||||
$this->latitudeDec=@getTextInHtml($this->body, 'latitude_e6=', '=','&')/1000000;
|
||||
$this->longitudeDec=@getTextInHtml($this->body, 'longitude_e6=', '=','&');
|
||||
if ($this->longitudeDec>1000000000)
|
||||
$this->longitudeDec=-(4294967293-$this->longitudeDec)/1000000;
|
||||
else
|
||||
$this->longitudeDec=$this->longitudeDec/1000000;
|
||||
|
||||
$this->latitudeDeg=dec2dms($this->latitudeDec);
|
||||
$this->longitudeDeg=dec2dms($this->longitudeDec);
|
||||
|
||||
if ($this->codeRetour==200)
|
||||
return true;
|
||||
|
||||
//$latitude_range = (180 * $range) / ($pi * $radius_of_earth);
|
||||
//$longitude_range = (180 * $range) / ($pi * $radius_of_earth * sin((90 - $alat) * $pi / 180));
|
||||
*/
|
||||
$apiKey='ABQIAAAAuKBtUyFonYJBl1fqfc78tRQvADPcxwXf3Q2QIE-M32vuSkrxiBRLUHDB_YSLeTscTDeWRKM_wILaaw';
|
||||
$url='http://maps.google.com/maps/geo?q='.urlencode($adresse.', '.$cp.' '. $ville.', '.$pays).'&output=xml&key='.$apiKey;
|
||||
$referer='';//http://maps.google.fr/?output=html';
|
||||
$page=getUrl($url, '', '', $referer, false, 'maps.google.com', '', 2);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
//die($this->body=$page['body']);
|
||||
//{"name":"3 rue viète, 75017 paris, france","Status":{"code":200,"request":"geocode"},"Placemark":[{"id":"p1","address":"3, Rue Viète, 75017 17ème Arrondissement, Paris, France","AddressDetails":{"Country":{"CountryNameCode":"FR","AdministrativeArea":{"AdministrativeAreaName":"Ile-de-France","SubAdministrativeArea":{"SubAdministrativeAreaName":"Paris","Locality":{"LocalityName":"Paris","DependentLocality":{"DependentLocalityName":"17ème Arrondissement","Thoroughfare":{"ThoroughfareName":"3, Rue Viète"},"PostalCode":{"PostalCodeNumber":"75017"}}}}}},"Accuracy": 8},"Point":{"coordinates":[2.306174,48.883705,0]}}]}
|
||||
/*<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.0"><Response><name>3 rue viète, 75017 paris, france</name><Status><code>200</code><request>geocode</request></Status><Placemark id="p1"><address>3, Rue Viète, 75017 17ème Arrondissement, Paris, France</address><AddressDetails Accuracy="8" xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0"><Country><CountryNameCode>FR</CountryNameCode><AdministrativeArea><AdministrativeAreaName>Ile-de-France</AdministrativeAreaName><SubAdministrativeArea><SubAdministrativeAreaName>Paris</SubAdministrativeAreaName><Locality><LocalityName>Paris</LocalityName><DependentLocality><DependentLocalityName>17ème Arrondissement</DependentLocalityName><Thoroughfare><ThoroughfareName>3, Rue Viète</ThoroughfareName></Thoroughfare><PostalCode><PostalCodeNumber>75017</PostalCodeNumber></PostalCode></DependentLocality></Locality></SubAdministrativeArea></AdministrativeArea></Country></AddressDetails><Point><coordinates>2.306174,48.883705,0</coordinates></Point></Placemark></Response></kml>*/
|
||||
|
||||
/*
|
||||
0 Unknown location. (Since 2.59)
|
||||
1 Country level accuracy. (Since 2.59)
|
||||
2 Region (state, province, prefecture, etc.) level accuracy. (Since 2.59)
|
||||
3 Sub-region (county, municipality, etc.) level accuracy. (Since 2.59)
|
||||
4 Town (city, village) level accuracy. (Since 2.59)
|
||||
5 Post code (zip code) level accuracy. (Since 2.59)
|
||||
6 Street level accuracy. (Since 2.59)
|
||||
7 Intersection level accuracy. (Since 2.59)
|
||||
8 Address level accuracy. (Since 2.59)
|
||||
*/
|
||||
$this->precision=@getTextInHtml($this->body, '<AddressDetails Accuracy', '="', ' ');
|
||||
|
||||
$this->adresseValidee=strtoupper(@getTextInHtml($this->body, '<address>', 'adress>', '</address>'));
|
||||
$strTmp=@getTextInHtml($this->body, '<Point><coordinates>', '<coordinates>', '</coordinates>');
|
||||
$tabTmp=explode(',', $strTmp);
|
||||
if (isset($tabTmp[1]) == false) {
|
||||
return false;
|
||||
}
|
||||
$this->latitudeDec = $tabTmp[1];
|
||||
$this->longitudeDec = $tabTmp[0];
|
||||
$this->latitudeDeg = dec2dms($this->latitudeDec);
|
||||
$this->longitudeDeg = dec2dms($this->longitudeDec);
|
||||
|
||||
/*
|
||||
200 G_GEO_SUCCESS No errors occurred; the address was successfully parsed and its geocode has been returned.
|
||||
400 G_GEO_BAD_REQUEST A directions request could not be successfully parsed.
|
||||
500 G_GEO_SERVER_ERROR A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.
|
||||
601 G_GEO_MISSING_QUERY The HTTP q parameter was either missing or had no value. For geocoding requests, this means that an empty address was
|
||||
specified as input. For directions requests, this means that no query was specified in the input.
|
||||
602 G_GEO_UNKNOWN_ADDRESS No corresponding geographic location could be found for the specified address. This may be due to the fact that the address
|
||||
is relatively new, or it may be incorrect.
|
||||
603 G_GEO_UNAVAILABLE_ADDRESS The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual
|
||||
reasons.
|
||||
604 G_GEO_UNKNOWN_DIRECTIONS The GDirections object could not compute directions between the points mentioned in the query. This is usually because
|
||||
there is no route available between the two points, or because we do not have data for routing in that region.
|
||||
610 G_GEO_BAD_KEY The given key is either invalid or does not match the domain for which it was given.
|
||||
620 G_GEO_TOO_MANY_QUERIES The given key has gone over the requests limit in the 24 hour period.
|
||||
*/
|
||||
if ($this->codeRetour2==200)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
/* if (latnorth == 'S') latdir='-'
|
||||
if (lonwest == 'W') longdir='-'
|
||||
latdec=Math.round(lat1)+lat2/60
|
||||
londec=Math.round(long1)+long2/60
|
||||
gmdatalat=latdir+latdec.toFixed(6)
|
||||
gmdatalon=longdir+londec.toFixed(6)
|
||||
//GM_log( 'Latdec:'+gmdatalat+' LongDec:'+gmdatalon)
|
||||
gmx=gmdatalat*Math.pow(10,6)
|
||||
gmy=gmdatalon*Math.pow(10,6)
|
||||
if (gmx < 0) gmx=gmx+Math.pow(2,32)*/
|
||||
}
|
||||
|
||||
?>
|
@ -1,29 +1,29 @@
|
||||
[local]
|
||||
webservices.interne.wsdl = "http://webservice-2.4.sd.dev/interne/v0.6?wsdl-auto"
|
||||
webservices.interne.wsdl = "http://webservice-2.7.sd.dev/interne/v0.6?wsdl-auto"
|
||||
webservices.interne.options.soap_version = SOAP_1_2
|
||||
webservices.entreprise.wsdl = "http://webservice-2.4.sd.dev/entreprise/v0.8?wsdl-auto"
|
||||
webservices.entreprise.wsdl = "http://webservice-2.7.sd.dev/entreprise/v0.8?wsdl-auto"
|
||||
webservices.entreprise.options.soap_version = SOAP_1_2
|
||||
webservices.gestion.wsdl = "http://webservice-2.4.sd.dev/gestion/v0.3?wsdl-auto"
|
||||
webservices.gestion.wsdl = "http://webservice-2.7.sd.dev/gestion/v0.3?wsdl-auto"
|
||||
webservices.gestion.options.soap_version = SOAP_1_2
|
||||
webservices.saisie.wsdl = "http://webservice-2.4.sd.dev/saisie/v0.2?wsdl-auto"
|
||||
webservices.saisie.wsdl = "http://webservice-2.7.sd.dev/saisie/v0.2?wsdl-auto"
|
||||
webservices.saisie.options.soap_version = SOAP_1_2
|
||||
webservices.pieces.wsdl = "http://webservice-2.4.sd.dev/pieces/v0.1?wsdl-auto"
|
||||
webservices.pieces.wsdl = "http://webservice-2.7.sd.dev/pieces/v0.1?wsdl-auto"
|
||||
webservices.pieces.options.soap_version = SOAP_1_2
|
||||
webservices.catalog.wsdl = "http://webservice-2.4.sd.dev/catalog/v0.1?wsdl-auto"
|
||||
webservices.catalog.wsdl = "http://webservice-2.7.sd.dev/catalog/v0.1?wsdl-auto"
|
||||
webservices.catalog.options.soap_version = SOAP_1_2
|
||||
|
||||
[sdsrvdev01]
|
||||
webservices.interne.wsdl = "http://webservice-2.4.sd.lan/interne/v0.6?wsdl-auto"
|
||||
webservices.interne.wsdl = "http://webservice-2.7.sd.lan/interne/v0.6?wsdl-auto"
|
||||
webservices.interne.options.soap_version = SOAP_1_2
|
||||
webservices.entreprise.wsdl = "http://webservice-2.4.sd.lan/entreprise/v0.8?wsdl-auto"
|
||||
webservices.entreprise.wsdl = "http://webservice-2.7.sd.lan/entreprise/v0.8?wsdl-auto"
|
||||
webservices.entreprise.options.soap_version = SOAP_1_2
|
||||
webservices.gestion.wsdl = "http://webservice-2.4.sd.lan/gestion/v0.3?wsdl-auto"
|
||||
webservices.gestion.wsdl = "http://webservice-2.7.sd.lan/gestion/v0.3?wsdl-auto"
|
||||
webservices.gestion.options.soap_version = SOAP_1_2
|
||||
webservices.saisie.wsdl = "http://webservice-2.4.sd.lan/saisie/v0.2?wsdl-auto"
|
||||
webservices.saisie.wsdl = "http://webservice-2.7.sd.lan/saisie/v0.2?wsdl-auto"
|
||||
webservices.saisie.options.soap_version = SOAP_1_2
|
||||
webservices.pieces.wsdl = "http://webservice-2.4.sd.lan/pieces/v0.1?wsdl-auto"
|
||||
webservices.pieces.wsdl = "http://webservice-2.7.sd.lan/pieces/v0.1?wsdl-auto"
|
||||
webservices.pieces.options.soap_version = SOAP_1_2
|
||||
webservices.catalog.wsdl = "http://webservice-2.4.sd.lan/catalog/v0.1?wsdl-auto"
|
||||
webservices.catalog.wsdl = "http://webservice-2.7.sd.lan/catalog/v0.1?wsdl-auto"
|
||||
webservices.catalog.options.soap_version = SOAP_1_2
|
||||
|
||||
[sd-25137]
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Acl.php 24771 2012-05-07 01:13:06Z adamlundrigan $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ require_once 'Zend/Acl/Resource.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Acl
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ require_once 'Zend/Acl/Resource/Interface.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Acl_Assert_Interface
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Exception.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Acl_Exception extends Zend_Exception
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Resource.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Acl/Resource/Interface.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Acl_Resource implements Zend_Acl_Resource_Interface
|
||||
|
@ -14,16 +14,16 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Acl_Resource_Interface
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Role.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Acl/Role/Interface.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Acl_Role implements Zend_Acl_Role_Interface
|
||||
|
@ -14,16 +14,16 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Acl_Role_Interface
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Registry.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Acl/Role/Interface.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Acl_Role_Registry
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Acl/Exception.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Acl_Role_Registry_Exception extends Zend_Acl_Exception
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Auth.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** @see Zend_Amf_Auth_Abstract */
|
||||
@ -28,12 +28,15 @@ require_once 'Zend/Acl.php';
|
||||
/** @see Zend_Auth_Result */
|
||||
require_once 'Zend/Auth/Result.php';
|
||||
|
||||
/** @see Zend_Xml_Security */
|
||||
require_once 'Zend/Xml/Security.php';
|
||||
|
||||
/**
|
||||
* This class implements authentication against XML file with roles for Flex Builder.
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Adobe
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Adobe_Auth extends Zend_Amf_Auth_Abstract
|
||||
@ -61,7 +64,7 @@ class Zend_Amf_Adobe_Auth extends Zend_Amf_Auth_Abstract
|
||||
public function __construct($rolefile)
|
||||
{
|
||||
$this->_acl = new Zend_Acl();
|
||||
$xml = simplexml_load_file($rolefile);
|
||||
$xml = Zend_Xml_Security::scanFile($rolefile);
|
||||
/*
|
||||
Roles file format:
|
||||
<roles>
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: DbInspector.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -24,7 +24,7 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Adobe
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Adobe_DbInspector
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Introspector.php 25024 2012-07-30 15:08:15Z rob $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** @see Zend_Amf_Parse_TypeLoader */
|
||||
@ -33,7 +33,7 @@ require_once 'Zend/Server/Reflection.php';
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Adobe
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Adobe_Introspector
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** @see Zend_Auth_Adapter_Interface */
|
||||
@ -27,7 +27,7 @@ require_once 'Zend/Auth/Adapter/Interface.php';
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Auth
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Amf_Auth_Abstract implements Zend_Auth_Adapter_Interface
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Constants.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -24,7 +24,7 @@
|
||||
* deserialization to detect the AMF marker and encoding types.
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
final class Zend_Amf_Constants
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -26,7 +26,7 @@ require_once 'Zend/Exception.php';
|
||||
|
||||
/**
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Exception extends Zend_Exception
|
||||
|
@ -15,14 +15,17 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse_Amf0
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Deserializer.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Constants */
|
||||
require_once 'Zend/Amf/Constants.php';
|
||||
|
||||
/** Zend_Xml_Security */
|
||||
require_once 'Zend/Xml/Security.php';
|
||||
|
||||
/** @see Zend_Amf_Parse_Deserializer */
|
||||
require_once 'Zend/Amf/Parse/Deserializer.php';
|
||||
|
||||
@ -33,7 +36,7 @@ require_once 'Zend/Amf/Parse/Deserializer.php';
|
||||
* @todo Class could be implemented as Factory Class with each data type it's own class
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse_Amf0
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Parse_Amf0_Deserializer extends Zend_Amf_Parse_Deserializer
|
||||
@ -248,7 +251,7 @@ class Zend_Amf_Parse_Amf0_Deserializer extends Zend_Amf_Parse_Deserializer
|
||||
public function readXmlString()
|
||||
{
|
||||
$string = $this->_stream->readLongUTF();
|
||||
return simplexml_load_string($string);
|
||||
return Zend_Xml_Security::scan($string); //simplexml_load_string($string);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse_Amf0
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Serializer.php 25179 2012-12-22 21:29:30Z rob $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Constants */
|
||||
@ -32,7 +32,7 @@ require_once 'Zend/Amf/Parse/Serializer.php';
|
||||
* @uses Zend_Amf_Parse_Serializer
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse_Amf0
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Parse_Amf0_Serializer extends Zend_Amf_Parse_Serializer
|
||||
|
@ -15,14 +15,17 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse_Amf3
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Deserializer.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Parse_Deserializer */
|
||||
require_once 'Zend/Amf/Parse/Deserializer.php';
|
||||
|
||||
/** Zend_Xml_Security */
|
||||
require_once 'Zend/Xml/Security.php';
|
||||
|
||||
/** Zend_Amf_Parse_TypeLoader */
|
||||
require_once 'Zend/Amf/Parse/TypeLoader.php';
|
||||
|
||||
@ -34,7 +37,7 @@ require_once 'Zend/Amf/Parse/TypeLoader.php';
|
||||
* @todo Class could be implemented as Factory Class with each data type it's own class.
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse_Amf3
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Parse_Amf3_Deserializer extends Zend_Amf_Parse_Deserializer
|
||||
@ -417,6 +420,6 @@ class Zend_Amf_Parse_Amf3_Deserializer extends Zend_Amf_Parse_Deserializer
|
||||
$xmlReference = $this->readInteger();
|
||||
$length = $xmlReference >> 1;
|
||||
$string = $this->_stream->readBytes($length);
|
||||
return simplexml_load_string($string);
|
||||
return Zend_Xml_Security::scan($string);
|
||||
}
|
||||
}
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse_Amf3
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Serializer.php 25179 2012-12-22 21:29:30Z rob $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Constants */
|
||||
@ -35,7 +35,7 @@ require_once 'Zend/Amf/Parse/TypeLoader.php';
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse_Amf3
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Parse_Amf3_Serializer extends Zend_Amf_Parse_Serializer
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Deserializer.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -30,7 +30,7 @@
|
||||
* @see http://opensource.adobe.com/svn/opensource/blazeds/trunk/modules/core/src/java/flex/messaging/io/amf/
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Amf_Parse_Deserializer
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: InputStream.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Util_BinaryStream */
|
||||
@ -31,7 +31,7 @@ require_once 'Zend/Amf/Util/BinaryStream.php';
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Parse_InputStream extends Zend_Amf_Util_BinaryStream
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: OutputStream.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Util_BinaryStream */
|
||||
@ -32,7 +32,7 @@ require_once 'Zend/Amf/Util/BinaryStream.php';
|
||||
* @uses Zend_Amf_Util_BinaryStream
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Parse_OutputStream extends Zend_Amf_Util_BinaryStream
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: MysqlResult.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -26,7 +26,7 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Parse_Resource_MysqlResult
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: MysqliResult.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -26,7 +26,7 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Parse_Resource_MysqliResult
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Stream.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -25,7 +25,7 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Parse_Resource_Stream
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Serializer.php 25179 2012-12-22 21:29:30Z rob $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -25,7 +25,7 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Amf_Parse_Serializer
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: TypeLoader.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -47,7 +47,7 @@ require_once 'Zend/Amf/Value/Messaging/RemotingMessage.php';
|
||||
* @todo PHP 5.3 can drastically change this class w/ namespace and the new call_user_func w/ namespace
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
final class Zend_Amf_Parse_TypeLoader
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Request.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** @see Zend_Amf_Parse_InputStream */
|
||||
@ -40,7 +40,7 @@ require_once 'Zend/Amf/Value/MessageBody.php';
|
||||
*
|
||||
* @todo Currently not checking if the object needs to be Type Mapped to a server object.
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Request
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Request
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Http.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** @see Zend_Amf_Request */
|
||||
@ -32,7 +32,7 @@ require_once 'Zend/Amf/Request.php';
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Request
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Request_Http extends Zend_Amf_Request
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Response.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** @see Zend_Amf_Constants */
|
||||
@ -32,7 +32,7 @@ require_once 'Zend/Amf/Parse/Amf0/Serializer.php';
|
||||
* Handles converting the PHP object ready for response back into AMF
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Response
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Response
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Http.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Response */
|
||||
@ -28,7 +28,7 @@ require_once 'Zend/Amf/Response.php';
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Response
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Response_Http extends Zend_Amf_Response
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Server.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** @see Zend_Server_Interface */
|
||||
@ -52,7 +52,7 @@ require_once 'Zend/Auth.php';
|
||||
* @todo Make the reflection methods cache and autoload.
|
||||
* @package Zend_Amf
|
||||
* @subpackage Server
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Server implements Zend_Server_Interface
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Server
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Exception */
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Amf/Exception.php';
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Server
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Server_Exception extends Zend_Amf_Exception
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Util
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: BinaryStream.php 25241 2013-01-22 11:07:36Z frosch $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -25,7 +25,7 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Util
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Util_BinaryStream
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ByteArray.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -25,7 +25,7 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Value_ByteArray
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: MessageBody.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -33,7 +33,7 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Value_MessageBody
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: MessageHeader.php 24593 2012-01-05 20:35:02Z matthew $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -28,7 +28,7 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Value_MessageHeader
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user