2009-04-06 17:05:03 +00:00
|
|
|
|
<?php
|
|
|
|
|
|
2009-04-16 16:34:13 +00:00
|
|
|
|
$path = PATH_DATA.'/graydon/method';
|
|
|
|
|
$fileName = strtolower('CompanyMatchIdentifiers-'.$pays);
|
|
|
|
|
|
2009-05-06 17:04:22 +00:00
|
|
|
|
/** Recherche des identifiants et mise en cache **/
|
|
|
|
|
$q = Doctrine_Query::create()
|
|
|
|
|
->from('Matchidentifiers')
|
|
|
|
|
->where('country = ?', $pays);
|
|
|
|
|
|
|
|
|
|
$matchidentifiers = new Matchidentifiers();
|
|
|
|
|
$matchidentifiers = $q->fetchOne();
|
2009-04-16 16:34:13 +00:00
|
|
|
|
|
2009-05-06 17:04:22 +00:00
|
|
|
|
/** Recup des types d'identifiants pour le pays **/
|
2009-05-14 16:44:01 +00:00
|
|
|
|
if($matchidentifiers == FALSE){
|
2009-05-06 17:04:22 +00:00
|
|
|
|
//R<>cup<75>ration des intitul<75>s identifiant
|
|
|
|
|
$request = new StdClass();
|
|
|
|
|
$request->Authentication_Parameters = $authentication;
|
|
|
|
|
$request->Country = $pays;
|
|
|
|
|
$firephp->log($request,'REQUETE CompanyMatchIdentifier');
|
2009-04-16 16:34:13 +00:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
$result = $graydon->getCompanyMatchIdentifiers($request);
|
2009-04-24 14:14:48 +00:00
|
|
|
|
//Enregistrement de l'action dans les logs
|
|
|
|
|
$transactionIdentifier = $result->Service_Log->TransactionIdentifier;
|
|
|
|
|
$sessionID = $result->Service_Log->SessionID;
|
2009-05-11 09:52:19 +00:00
|
|
|
|
|
2009-05-14 16:44:01 +00:00
|
|
|
|
graydonRequeteLog( $tabInfo['login'], $page, 'getCompanyMatchIdentifiers', $transactionIdentifier, $sessionID);
|
2009-05-11 09:52:19 +00:00
|
|
|
|
|
|
|
|
|
//Log de la requete dans la bdd
|
|
|
|
|
$log = new Requetelog();
|
2009-05-14 16:44:01 +00:00
|
|
|
|
$log->login = $tabInfo['login'];
|
2009-05-11 09:52:19 +00:00
|
|
|
|
$log->action = 'getCompanyMatchIdentifiers';
|
|
|
|
|
$log->request = serialize($request);
|
|
|
|
|
$log->transactionIdentifier = $transactionIdentifier;
|
|
|
|
|
$log->sessionID = $sessionID;
|
|
|
|
|
$log->mode = $mode;
|
|
|
|
|
$log->save();
|
|
|
|
|
|
2009-05-06 17:04:22 +00:00
|
|
|
|
$count = count($result->CompanyMatchIdentifiers);
|
2009-04-16 16:34:13 +00:00
|
|
|
|
if ($count>1){
|
2009-05-06 17:04:22 +00:00
|
|
|
|
$identifiers = $result->CompanyMatchIdentifiers->CompanyMatchIdentifier->CompanyIdentifier;
|
2009-04-16 16:34:13 +00:00
|
|
|
|
}elseif($count==1){
|
2009-05-06 17:04:22 +00:00
|
|
|
|
$identifiers[] = $result->CompanyMatchIdentifiers->CompanyMatchIdentifier->CompanyIdentifier;
|
2009-04-16 16:34:13 +00:00
|
|
|
|
}
|
2009-05-06 17:04:22 +00:00
|
|
|
|
//Stockage du r<>sultat de la m<>thode en cache
|
|
|
|
|
$matchidentifiers = new Matchidentifiers();
|
|
|
|
|
$matchidentifiers->country = $pays;
|
|
|
|
|
$matchidentifiers->identifiers = serialize($identifiers);
|
|
|
|
|
$matchidentifiers->replace();
|
2009-04-16 16:34:13 +00:00
|
|
|
|
|
|
|
|
|
}catch( SoapFault $fault ){
|
2009-05-07 16:06:00 +00:00
|
|
|
|
$code = $fault->detail->GraydonCompanyData_Fault->FaultReturnCode;
|
|
|
|
|
$text = $fault->detail->GraydonCompanyData_Fault->FaultMessage;
|
|
|
|
|
$firephp->log($text,'texterror');
|
2009-05-13 16:05:50 +00:00
|
|
|
|
require_once 'graydon/graydon_error.php';
|
2009-05-07 16:06:00 +00:00
|
|
|
|
if(graydon_error($code, $text)==FALSE){
|
|
|
|
|
graydon_processSoapFault($graydon,$fault,$tabInfo);
|
|
|
|
|
}
|
2009-05-06 17:04:22 +00:00
|
|
|
|
}
|
2009-04-16 16:34:13 +00:00
|
|
|
|
}else{
|
2009-05-06 17:04:22 +00:00
|
|
|
|
$identifiers = unserialize($matchidentifiers->identifiers);
|
2009-04-16 16:34:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isset($identifiers)){
|
2009-04-07 17:44:17 +00:00
|
|
|
|
$firephp->log($identifiers,'identifiers');
|
2009-04-16 16:34:13 +00:00
|
|
|
|
$count = 0;
|
2009-04-07 17:44:17 +00:00
|
|
|
|
foreach($identifiers as $identifier){
|
2009-04-06 17:05:03 +00:00
|
|
|
|
?>
|
2009-04-20 12:54:22 +00:00
|
|
|
|
<input type="hidden" name="method" value="identifier" />
|
2009-05-06 17:04:22 +00:00
|
|
|
|
<label><?php print $identifier->Description ?></label>
|
2009-04-20 12:54:22 +00:00
|
|
|
|
<input type="text" name="frmRecherche[Identifier]" value="" />
|
2009-04-16 16:34:13 +00:00
|
|
|
|
<?php
|
|
|
|
|
$count++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|