Issue #0001653: updates (not finished)
@ -34,6 +34,9 @@ class DirigeantController extends Zend_Controller_Action
|
||||
|
||||
$dirigeants = $infos->result->item;
|
||||
|
||||
$wcLocal = new Application_Model_Worldcheck();
|
||||
$allOccurrences = $wcLocal->getCounts($dirigeants);
|
||||
|
||||
$session = new SessionEntreprise($this->siret, $this->id);
|
||||
|
||||
$user = new Scores_Utilisateur();
|
||||
@ -44,6 +47,8 @@ class DirigeantController extends Zend_Controller_Action
|
||||
|
||||
$this->view->assign('edition', $user->checkModeEdition());
|
||||
|
||||
$this->view->assign('allOccurrences', $allOccurrences);
|
||||
|
||||
$this->view->assign('siren', $siren);
|
||||
$this->view->assign('siret', $this->siret);
|
||||
$this->view->assign('raisonSociale', $session->getRaisonSociale());
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
class WorldcheckController extends Zend_Controller_Action
|
||||
{
|
||||
protected $siret;
|
||||
protected $id;
|
||||
protected $identity = null;
|
||||
protected $nameIdentifier;
|
||||
|
||||
public function init()
|
||||
{
|
||||
@ -14,47 +14,120 @@ class WorldcheckController extends Zend_Controller_Action
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$message = '';
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$request = $this->getRequest();
|
||||
$param = new stdClass();
|
||||
$param->dirNom = $request->getParam('dirNom');
|
||||
$param->dirPrenom = $request->getParam('dirPrenom');
|
||||
$param->dirType = $request->getParam('dirType');
|
||||
|
||||
$data = new stdClass();
|
||||
$data->name = $param->dirNom;
|
||||
$data->nameType = $param->dirType;
|
||||
|
||||
$user = new Scores_Utilisateur();
|
||||
$wc = new WsWorldCheck();
|
||||
$wcLocal = new Application_Model_Worldcheck();
|
||||
|
||||
if (!$user->getScreenerName() || $user->getScreenerName()!=$param->dirNom)
|
||||
{
|
||||
$idClient = $user->getIdClient();
|
||||
$localDBParams = $wcLocal->getScreenerId($idClient, $data);
|
||||
$this->nameIdentifier = $localDBParams->nameIdentifier;
|
||||
|
||||
//Save nameIdentifier, name, matchCount into session
|
||||
$wcheck = new stdClass();
|
||||
$wcheck->screenerNameIdentifier = $this->nameIdentifier;
|
||||
$wcheck->screenerName = $param->dirNom;
|
||||
$wcheck->matchCount = $localDBParams->matchCount;
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ( $auth->hasIdentity() ) {
|
||||
$this->identity = $auth->getIdentity();
|
||||
}
|
||||
$this->identity->wcheck = $wcheck;
|
||||
$auth->getStorage()->write($this->identity);
|
||||
//end
|
||||
}
|
||||
|
||||
$this->nameIdentifier = $user->getScreenerNameIdentifier();
|
||||
$matchCount = $user->getMatchCount();
|
||||
|
||||
if ($matchCount!=0)
|
||||
{
|
||||
$summary = new stdClass();
|
||||
$summary->nameIdentifier = $this->nameIdentifier;
|
||||
$summary->matchType = 'WATCHLIST';
|
||||
|
||||
//get results by lastName
|
||||
$unfilteredWC = new stdClass();
|
||||
$unfilteredWC = $wc->getSummariesArr($summary);
|
||||
//end
|
||||
|
||||
//get results by fullName (lastName and givenName)
|
||||
$filteredWC = array();
|
||||
foreach ($unfilteredWC as $entityId=>$shortData)
|
||||
{
|
||||
if (stripos($shortData->lastName, $param->dirNom)!==false || stripos($param->dirNom, $shortData->lastName)!==false) {
|
||||
if (stripos($shortData->givenName, $param->dirPrenom)!==false || stripos($param->dirPrenom, $shortData->givenName)!==false) {
|
||||
$filteredWC[$entityId] = $shortData;
|
||||
}
|
||||
}
|
||||
}
|
||||
//end
|
||||
|
||||
//check if display all results (search by lastName), or filtered results (search by fullName)
|
||||
$filtre = $request->getParam('filtre', 'tout');
|
||||
$resultWC = ($filtre=='filtered')?$filteredWC:$unfilteredWC;
|
||||
|
||||
$filtres = array(
|
||||
'tout' => array(
|
||||
'txt'=>'Résultats par Nom',
|
||||
'select'=>'',
|
||||
'value' => 2,
|
||||
),
|
||||
'filtered' => array(
|
||||
'txt'=>'Résultats par Nom et Prénom',
|
||||
'select'=>'',
|
||||
'value' => 1,
|
||||
)
|
||||
);
|
||||
|
||||
$filtres[$filtre]['select'] = ' selected';
|
||||
|
||||
$this->view->assign('filtres', $filtres);
|
||||
//end
|
||||
|
||||
//paginate results list
|
||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('worldcheck/controls.phtml');
|
||||
$paginator = Zend_Paginator::factory($resultWC);
|
||||
$this->view->paginator = $paginator;
|
||||
$itemCount = 15;
|
||||
$page = $this->_getParam('page', 1);
|
||||
$ol_number = ($page-1)*$itemCount+1;
|
||||
$paginator->setCurrentPageNumber($page);
|
||||
$paginator->setItemCountPerPage($itemCount);
|
||||
|
||||
$this->view->assign('ol_number', $ol_number);
|
||||
$this->view->assign('itemCount', $itemCount);
|
||||
//end
|
||||
|
||||
$this->view->assign('resultWC', $resultWC);
|
||||
$this->view->assign('allMatches', $wc->getMatchesArrName($summary));
|
||||
$this->view->assign('param', $param);
|
||||
}
|
||||
}
|
||||
|
||||
public function matchcontentAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$param->dirNom = 'HOLLANDE'; //$request->getParam('dirNom');
|
||||
$param->dirPrenom = ''; //$request->getParam('dirPrenom');
|
||||
$param->dirNaissJJ = $request->getParam('dirNaissJJ');
|
||||
$param->dirDateNaissMM = $request->getParam('dirDateNaissMM');
|
||||
$param->dirDateNaissAAAA = $request->getParam('dirDateNaissAAAA');
|
||||
$param->dirCpVille = $request->getParam('dirCpVille');
|
||||
|
||||
$data->customId1 = '1';
|
||||
$data->customId2 = '2';
|
||||
$data->name = $param->dirNom.' '.$param->dirPrenom;
|
||||
$data->nameType = 'INDIVIDUAL';
|
||||
$param = new stdClass();
|
||||
$param->matchIdentifier = $request->getParam('matchIdentifier');
|
||||
|
||||
$wc = new WsWorldCheck();
|
||||
$nameIdentifier = $wc->getScreener($data);
|
||||
|
||||
$matchCount = new stdClass();
|
||||
$matchCount = $wc->getDetailsName($nameIdentifier);
|
||||
|
||||
if ($matchCount->unresolvedMatchCount == 0)
|
||||
{
|
||||
$message = 'Aucun résultat.';
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = 'Résultats de recherche';
|
||||
$matches = $wc->getMatchesName($nameIdentifier, 'WATCHLIST', 0, $matchCount->unresolvedMatchCount);
|
||||
}
|
||||
|
||||
$this->view->assign('message', $message);
|
||||
$this->view->assign('param', $param);
|
||||
$this->view->assign('matches', $matches);
|
||||
$this->view->assign('nameIdentifier', $nameIdentifier);
|
||||
}
|
||||
|
||||
public function matchresultAction()
|
||||
{
|
||||
$content = $wc->getDetailsContent($param->matchIdentifier);
|
||||
|
||||
$this->view->assign('matchIdentifier', $param->matchIdentifier);
|
||||
$this->view->assign('content', $content);
|
||||
}
|
||||
}
|
65
application/models/Worldcheck.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
class Application_Model_Worldcheck extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'worldcheck';
|
||||
|
||||
/**
|
||||
* Return nameIdentifier and matchCount from local DB if found.
|
||||
* Otherwise get nameIdentifier and matchCount from WorldCheck
|
||||
* @param string $idClient
|
||||
* @param object $data
|
||||
* @return object
|
||||
*/
|
||||
public function getScreenerId($idClient, $data)
|
||||
{
|
||||
$result = new stdClass();
|
||||
$sql = $this->select()
|
||||
->where("idClient='".$idClient."' AND name='".$data->name."'")
|
||||
->order('dateInsert DESC');
|
||||
if ($this->fetchRow($sql))
|
||||
{
|
||||
$result->nameIdentifier = $this->fetchRow($sql)->nameIdentifier;
|
||||
$result->matchCount = $this->fetchRow($sql)->matchCount;
|
||||
}
|
||||
else {
|
||||
$wc = new WsWorldCheck();
|
||||
$result->nameIdentifier = $wc->getScreener($data);
|
||||
$result->matchCount = $wc->getDetailsName($result->nameIdentifier)->unresolvedMatchCount;
|
||||
$param = array(
|
||||
'idClient' => $idClient,
|
||||
'nameIdentifier' => $result->nameIdentifier,
|
||||
'matchCount' => $result->matchCount,
|
||||
'name' => $data->name,
|
||||
'dateInsert' => date('Y-m-d')
|
||||
);
|
||||
$sql = $this->insert($param);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array of names with matchCount
|
||||
* @param object $dirigeants
|
||||
* @return array
|
||||
*/
|
||||
public function getCounts($dirigeants)
|
||||
{
|
||||
$allOccurences = array();
|
||||
foreach ($dirigeants as $dir)
|
||||
{
|
||||
$sql = $this->select()
|
||||
->where("name='".$dir->Nom."'")
|
||||
->group('name');
|
||||
|
||||
$matchCount = NULL;
|
||||
|
||||
if ($this->fetchRow($sql))
|
||||
{
|
||||
$result=$this->fetchRow($sql);
|
||||
$matchCount = $result->matchCount;
|
||||
}
|
||||
$allOccurences[$dir->Nom] = $matchCount;
|
||||
}
|
||||
return $allOccurences;
|
||||
}
|
||||
}
|
@ -44,6 +44,7 @@
|
||||
<?php if ( count($this->dirigeants)>0 ) { ?>
|
||||
<style>
|
||||
table.data td { border:1px solid #ccc; padding:5px; }
|
||||
div.img {background:url(/themes/default/images/worldcheck/wc.png) no-repeat; height:25px; width:25px;}
|
||||
</style>
|
||||
<table class="data">
|
||||
<?php foreach ($this->dirigeants as $dir) {?>
|
||||
@ -88,17 +89,34 @@ table.data td { border:1px solid #ccc; padding:5px; }
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td><?php if($this->idClient==1) { ?>
|
||||
<a class='wcheck' href="<?=$this->url(array(
|
||||
<?php
|
||||
if ($this->allOccurrences[$dir->Nom]===NULL) {
|
||||
$qtipContent = "WorldCheck<br/>Cliquez sur l’icone WorldCheck";
|
||||
} else {
|
||||
$qtipContent = "WorldCheck<br/>Occurrences: ".$this->allOccurrences[$dir->Nom];
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($dir->Societe != '') {?>
|
||||
<a class='wcheck' tooltip='<?=$qtipContent ?>' href="<?=$this->url(array(
|
||||
'controller' => 'worldcheck',
|
||||
'action' => 'index',
|
||||
'dirNom' => $dir->Societe,
|
||||
'dirType' => 'ORGANISATION'), null, true)?>" style="cursor: pointer;" >
|
||||
<div id='<?=$this->allOccurrences[$dir->Nom];?>' class='img'></div></a><br/>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($dir->Nom != '') { ?>
|
||||
<a class='wcheck' tooltip='<?=$qtipContent ?>' href="<?=$this->url(array(
|
||||
'controller' => 'worldcheck',
|
||||
'action' => 'index',
|
||||
'dirNom' => $dir->Nom,
|
||||
'dirPrenom' => $dir->Prenom,
|
||||
'dirNaissJJ' => substr($dir->NaissDate,0,2),
|
||||
'dirDateNaissMM' => substr($dir->NaissDate,3,2),
|
||||
'dirDateNaissAAAA' => substr($dir->NaissDate,6,4),
|
||||
'dirCpVille' => $dir->NaissVille))?>" title="WorldCheck" style="cursor: pointer;" >
|
||||
<img src="/themes/default/images/worldcheck/wc.png" /></a>
|
||||
<?php }?></td>
|
||||
'dirType' => 'INDIVIDUAL'), null, true)?>" style="cursor: pointer;" >
|
||||
<div id='<?=$this->allOccurrences[$dir->Nom];?>' class='img'></div></a>
|
||||
<?php } ?>
|
||||
<?php }?>
|
||||
</td>
|
||||
<td class="StyleInfoData" width="100" valign="top">
|
||||
<?php if ($dir->Siren!='') {?>
|
||||
<a title="Consulter la fiche identité" href="<?=$this->url(array('controller'=>'identite', 'action'=>'fiche', 'siret'=>$dir->Siren))?>">
|
||||
@ -162,15 +180,19 @@ $('a.dialog').on('click', function(){
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('a.wcheck').qtip({
|
||||
content: 'WorldCheck',
|
||||
position: {
|
||||
corner: {
|
||||
target: 'topRight',
|
||||
tooltip: 'topLeft'
|
||||
}
|
||||
$(document).ready(function(){
|
||||
$('a.wcheck div').each(function(){
|
||||
if ($(this).attr('id')=='0') {
|
||||
$(this).css("backgroundImage", 'url(/themes/default/images/worldcheck/wc0.png)');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('a.wcheck').each(function(){
|
||||
$(this).qtip({
|
||||
content: $(this).attr('tooltip'),
|
||||
position: { at: "right center", my: "bottom left" }
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php }?>
|
||||
|
@ -1,21 +1,64 @@
|
||||
<div id="center">
|
||||
<h1>World-Check</h1>
|
||||
<div id="center-recherche" style='margin-left: 10px; margin-right:10px'>
|
||||
<?php if ($this->filtres) { ?>
|
||||
<div style='float:right;'>
|
||||
<select name="filtre">
|
||||
<?php foreach ($this->filtres as $k => $filtre) {?>
|
||||
<option value="<?=$this->url(array('filtre'=>$k, 'page'=>''))?>"<?=$filtre['select']?>><?=$filtre['txt']?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('select[name=filtre]').change(function(e){
|
||||
window.location = $(this).val();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php
|
||||
print_r($this->message);
|
||||
?>
|
||||
<br/>
|
||||
<?php
|
||||
$result = array();
|
||||
foreach ($this->matches->match as $key => $value)
|
||||
if (!$this->resultWC)
|
||||
{
|
||||
echo '<p>'.$this->param->dirNom.' '.$this->param->dirPrenom.'</p>';
|
||||
$result[$key] = $value;
|
||||
echo 'Match Found by: '.$result[$key]->matchFoundBy.'<br/>';
|
||||
echo 'Match Resolution: '.$result[$key]->matchResolution.'<br/>';
|
||||
echo 'Match Risk: '.$result[$key]->matchRisk.'<br/>';
|
||||
echo 'Match Score: '.$result[$key]->matchScore.'<br/>';
|
||||
}
|
||||
//print_r($this->params);
|
||||
//print_r($this->nameIdentifier);
|
||||
|
||||
?>
|
||||
<div>Aucun résultat.</div>
|
||||
<? }
|
||||
else
|
||||
{
|
||||
require_once 'common/dates.php';
|
||||
$wdate = new WDate();
|
||||
$resultWC = $this->resultWC;
|
||||
|
||||
<h1></h1>
|
||||
$reponse = count($resultWC)==1?'réponse':'réponses';
|
||||
$title = count($resultWC).' '.$reponse.' avec les critères "'.$this->param->dirNom.' '.$this->param->dirPrenom.'"';
|
||||
?>
|
||||
<div style='float:left; margin-left:15px;'><?=$title;?></div>
|
||||
<br/>
|
||||
<div>
|
||||
<ol start=<?=$this->ol_number; ?>>
|
||||
<?php
|
||||
foreach ($this->paginator as $entityId=>$shortData)
|
||||
{
|
||||
?>
|
||||
<li>
|
||||
<strong><a href="<?=$this->url(array('controller'=>'worldcheck', 'action'=>'matchcontent', 'matchIdentifier'=>$this->allMatches[$entityId]), null, true)?>"><?= $shortData->lastName.' '.$shortData->givenName;?></a></strong><br/>
|
||||
<table>
|
||||
<?php if (isset($shortData->description) && $shortData->description!='') {?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Description</td>
|
||||
<td class="StyleInfoData" width="450"><?=$shortData->description;?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if (isset($shortData->country) && $shortData->country!='') {?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Country</td>
|
||||
<td class="StyleInfoData" width="450"><?=ucfirst(strtolower($shortData->country));?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ol>
|
||||
</div>
|
||||
<p><div id="center-recherche"><?php if (count($resultWC)>$this->itemCount) { echo $this->paginator; } ?></div></p>
|
||||
<?php } ?>
|
||||
</div>
|
169
application/views/default/scripts/worldcheck/matchcontent.phtml
Normal file
@ -0,0 +1,169 @@
|
||||
<div id="center">
|
||||
<h1>World-Check</h1>
|
||||
<?php
|
||||
require_once 'common/dates.php';
|
||||
$wdate = new WDate();
|
||||
$content = array();
|
||||
if (!$this->content)
|
||||
{
|
||||
?>
|
||||
<p><div style='margin-left: 10px;'>Aucune Information</div></p>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
$content = $this->content;
|
||||
?>
|
||||
<h2><?=$this->content[0]->names->name[0]->fullName;?></h2>
|
||||
<div class="paragraph">
|
||||
<table cellpadding=3>
|
||||
<?php if (isset($content[0]->category)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Category</td>
|
||||
<td class="StyleInfoData" width="450"><?=ucfirst(strtolower($content[0]->category));?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if (isset($content[0]->gender)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Gender</td>
|
||||
<td class="StyleInfoData" width="450"><?=ucfirst(strtolower($content[0]->gender));?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if (isset($content[0]->events->event) && ($content[0]->events->event[0]->day>0) && ($content[0]->events->event[0]->month>0) && ($content[0]->events->event[0]->year>0)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Birthday</td>
|
||||
<td class="StyleInfoData" width="450"><?=$wdate->dateT('Y-m-d', 'd/m/Y', $content[0]->events->event[0]->fullDate);?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if (isset($content[0]->events->event[0]->address->region)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Birth place</td>
|
||||
<td class="StyleInfoData" width="450"><?=$content[0]->events->event[0]->address->region;?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if (isset($content[0]->countryLinks->countryLink[0]->countryText)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Nationality</td>
|
||||
<td class="StyleInfoData" width="450"><?=ucfirst(strtolower($content[0]->countryLinks->countryLink[0]->countryText));?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
foreach($content[0]->details->detail as $detail)
|
||||
{ ?>
|
||||
<?php if (isset($detail->text)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150"><?=ucfirst(strtolower($detail->detailType));?></td>
|
||||
<td class="StyleInfoData" width="450"><?=$detail->text;?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Address</td>
|
||||
<?php
|
||||
$address = array();
|
||||
if (isset($content[0]->addresses->address[0]->city)) { $address[] = $content[0]->addresses->address[0]->city;}
|
||||
if (isset($content[0]->addresses->address[0]->region)) { $address[] = $content[0]->addresses->address[0]->region;}
|
||||
if (isset($content[0]->addresses->address[0]->country)) { $address[] = ucfirst(strtolower($content[0]->addresses->address[0]->country->name));}
|
||||
?>
|
||||
<td class="StyleInfoData" width="450"><?=implode(', ', $address);?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (isset($content[0]->roles->role)){
|
||||
foreach($content[0]->roles->role as $role)
|
||||
{ ?>
|
||||
<?php if (isset($role->title)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150"><?=$role->type?></td>
|
||||
<td class="StyleInfoData" width="450"><?=$role->title;?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php }} ?>
|
||||
<?php if (isset($content[0]->weblinks->weblink)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Weblinks</td>
|
||||
<td class="StyleInfoData" width="450">
|
||||
<?php foreach($content[0]->weblinks->weblink as $weblink)
|
||||
{ ?>
|
||||
<a href="<?=$weblink->URI;?>" target="_blank"><?=$weblink->URI;?></a><br/>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if (isset($content[0]->associates->associate)) {
|
||||
foreach($content[0]->associates->associate as $associate)
|
||||
{ ?>
|
||||
<h2>
|
||||
Associate: <?=$associate->targetEntity->names->name[0]->fullName;?>
|
||||
<?php $dirType = ($associate->associatetype=='ASSOCIATE')?'INDIVIDUAL':'ORGANISATION';?>
|
||||
<a href="<?=$this->url(array(
|
||||
'controller' => 'worldcheck',
|
||||
'action' => 'index',
|
||||
'dirNom' => $associate->targetEntity->names->name[0]->lastName,
|
||||
'dirPrenom' => $associate->targetEntity->names->name[0]->givenName,
|
||||
'dirType' => $dirType), null, true)?>" title="WorldCheck" style="cursor: pointer;" >
|
||||
<div style='float:right;'><img src="/themes/default/images/worldcheck/wc-blanc.png" /></div></a>
|
||||
</h2>
|
||||
<div class="paragraph">
|
||||
<table cellpadding=3>
|
||||
<?php if (isset($associate->targetEntity->category)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Category</td>
|
||||
<td class="StyleInfoData" width="450"><?=ucfirst(strtolower($associate->targetEntity->category));?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if (isset($associate->targetEntity->gender)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Gender</td>
|
||||
<td class="StyleInfoData" width="450"><?=ucfirst(strtolower($associate->targetEntity->gender));?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if (isset($associate->targetEntity->events->event) && ($associate->targetEntity->events->event[0]->day>0) && ($associate->targetEntity->events->event[0]->month>0) && ($associate->targetEntity->events->event[0]->year>0)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Birthday</td>
|
||||
<td class="StyleInfoData" width="450"><?=$wdate->dateT('Y-m-d', 'd/m/Y', $associate->targetEntity->events->event[0]->fullDate);?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if (isset($associate->targetEntity->countryLinks->countryLink[0]->countryText)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Nationality</td>
|
||||
<td class="StyleInfoData" width="450"><?=ucfirst(strtolower($associate->targetEntity->countryLinks->countryLink[0]->countryText));?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
foreach($associate->targetEntity->details->detail as $detailAssoc)
|
||||
{ ?>
|
||||
<?php if (isset($detailAssoc->text)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150"><?=ucfirst(strtolower($detailAssoc->detailType)); ?></td>
|
||||
<td class="StyleInfoData" width="450"><?=$detailAssoc->text;?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Adresse</td>
|
||||
<?php
|
||||
$address = array();
|
||||
if (isset($associate->targetEntity->addresses->address[0]->city)) { $address[] = $associate->targetEntity->addresses->address[0]->city;}
|
||||
if (isset($associate->targetEntity->addresses->address[0]->region)) { $address[] = $associate->targetEntity->addresses->address[0]->region;}
|
||||
if (isset($associate->targetEntity->addresses->address[0]->country)) { $address[] = ucfirst(strtolower($associate->targetEntity->addresses->address[0]->country->name));}
|
||||
?>
|
||||
<td class="StyleInfoData" width="450"><?=implode(', ', $address);?></td>
|
||||
</tr>
|
||||
<?php if (isset($associate->targetEntity->weblinks->weblink)) { ?>
|
||||
<tr>
|
||||
<td class="StyleInfoLib" width="150">Weblinks</td>
|
||||
<td class="StyleInfoData" width="450">
|
||||
<?php foreach($associate->targetEntity->weblinks->weblink as $weblink)
|
||||
{ ?>
|
||||
<a href="<?=$weblink->URI;?>" target="_blank"><?=$weblink->URI;?></a><br/>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table></div>
|
||||
<?php }}} ?>
|
||||
</div>
|
@ -282,6 +282,51 @@ class Scores_Utilisateur
|
||||
return $this->identity->langtmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne nameIdentifier of WorldCheck screener
|
||||
*/
|
||||
public function getScreenerNameIdentifier()
|
||||
{
|
||||
if (isset($this->identity->wcheck))
|
||||
{
|
||||
return $this->identity->wcheck->screenerNameIdentifier;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne name of WorldCheck screener
|
||||
*/
|
||||
public function getScreenerName()
|
||||
{
|
||||
if (isset($this->identity->wcheck))
|
||||
{
|
||||
return $this->identity->wcheck->screenerName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne match count of WorldCheck search by lastName
|
||||
*/
|
||||
public function getMatchCount()
|
||||
{
|
||||
if (isset($this->identity->wcheck))
|
||||
{
|
||||
return $this->identity->wcheck->matchCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets interface's language new value
|
||||
* @param $langtmp
|
||||
|
@ -70,9 +70,10 @@ class WsWorldCheck
|
||||
//**** SCREENER WSDL ****//
|
||||
|
||||
/**
|
||||
* getScreener
|
||||
* The initial request of Worldcheck to get nameIdentifier.
|
||||
* nameType available values: 'INDIVIDUAL', 'ORGANISATION'
|
||||
* @param object $data
|
||||
* @return NameIdentifier
|
||||
* @return NameIdentifier (Unique for each request)
|
||||
*/
|
||||
public function getScreener($data)
|
||||
{
|
||||
@ -80,6 +81,8 @@ class WsWorldCheck
|
||||
$params->screenRequest = $data;
|
||||
$params->screenRequest->groupIdentifier = $this->wcData['groupIdentifier'];
|
||||
$params->screenRequest->assigneeIdentifier = $this->wcData['assigneeIdentifier'];
|
||||
$params->screenRequest->customId1 = '1';
|
||||
$params->screenRequest->customId2 = '2';
|
||||
$client = $this->loadClientWC('screener');
|
||||
try {
|
||||
return $client->screen($params)->return;
|
||||
@ -125,7 +128,7 @@ class WsWorldCheck
|
||||
$param = new stdClass();
|
||||
$param->matchIdentifier = $matchIdentifier;
|
||||
try {
|
||||
return $client->getDetails($param)->return;
|
||||
return $client->getDetails($param)->return->entitySet->entities->individual;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
@ -145,10 +148,10 @@ class WsWorldCheck
|
||||
{
|
||||
$client = $this->loadClientWC('content');
|
||||
$param = new stdClass();
|
||||
$param->matchIdentifier = $data->matchIdentifier;
|
||||
$param->nameIdentifier = $data->nameIdentifier;
|
||||
$param->matchType = $data->matchType; // value must be watchlist
|
||||
$param->start = $data->start;
|
||||
$param->limit = $data->limit;
|
||||
$param->start = $this->wcData['response']['start'];
|
||||
$param->limit = $this->wcData['response']['limit'];
|
||||
|
||||
try {
|
||||
return $client->getSummaries($param)->return;
|
||||
@ -162,6 +165,49 @@ class WsWorldCheck
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* return an array, where key=entityId, and value=fullName according to nameIdentifier
|
||||
* @param object
|
||||
* @return array
|
||||
*/
|
||||
public function getSummariesArr($data)
|
||||
{
|
||||
$allMatches = array();
|
||||
$client = $this->loadClientWC('content');
|
||||
$param = new stdClass();
|
||||
$param->nameIdentifier = $data->nameIdentifier;
|
||||
$param->matchType = $data->matchType; // value must be watchlist
|
||||
$param->start = $this->wcData['response']['start'];
|
||||
$param->limit = $this->wcData['response']['limit'];
|
||||
|
||||
try {
|
||||
$category = $client->getSummaries($param)->return->entitySummaries->categories;
|
||||
foreach ($category->category as $category)
|
||||
{
|
||||
foreach($category->summaries->summary as $summary)
|
||||
{
|
||||
$key = $summary->entityId->entityId;
|
||||
$shortData = new stdClass();
|
||||
$shortData->givenName = $summary->names->name[0]->givenName;
|
||||
$shortData->lastName = $summary->names->name[0]->lastName;
|
||||
$shortData->description = $summary->groups->group[0]->details->detail[0]->description;
|
||||
if (isset($summary->countryLinks->countryLink)){
|
||||
$shortData->country = $summary->countryLinks->countryLink[0]->countryText;
|
||||
}
|
||||
$allMatches[$key] = $shortData;
|
||||
}
|
||||
}
|
||||
return $allMatches;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getSummariesForMatch
|
||||
* @param string matchIdentifier
|
||||
@ -184,6 +230,31 @@ class WsWorldCheck
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* return object with entityId and fullName according to matchIdentifier
|
||||
* @param string matchIdentifier
|
||||
* @return object
|
||||
*/
|
||||
public function getSummariesForMatchEntityId($matchIdentifier)
|
||||
{
|
||||
$data = new stdClass();
|
||||
$client = $this->loadClientWC('content');
|
||||
$param = new stdClass();
|
||||
$param->matchIdentifier = $matchIdentifier;
|
||||
try {
|
||||
$data->entityId = $client->getSummariesForMatch($param)->return->entitySummaries->categories->category[0]->summaries->summary[0]->entityId->entityId;
|
||||
$data->fullName = $client->getSummariesForMatch($param)->return->entitySummaries->categories->category[0]->summaries->summary[0]->names->name[0]->fullName;
|
||||
return $data;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getTitles
|
||||
* @param object
|
||||
@ -195,8 +266,8 @@ class WsWorldCheck
|
||||
$param = new stdClass();
|
||||
$param->matchIdentifier = $data->matchIdentifier;
|
||||
$param->matchType = $data->matchType; // value must be watchlist
|
||||
$param->start = $data->start;
|
||||
$param->limit = $data->limit;
|
||||
$param->start = $this->wcData['response']['start'];
|
||||
$param->limit = $this->wcData['response']['limit'];
|
||||
|
||||
try {
|
||||
return $client->getTitles($param)->return;
|
||||
@ -629,18 +700,16 @@ class WsWorldCheck
|
||||
* getMatches
|
||||
* @param string nameIdentifier
|
||||
* @param string matchType
|
||||
* @param int start
|
||||
* @param int limit
|
||||
* @return object
|
||||
*/
|
||||
public function getMatchesName($nameIdentifier, $matchType, $start, $limit)
|
||||
public function getMatchesName($nameIdentifier, $matchType)
|
||||
{
|
||||
$client = $this->loadClientWC('name');
|
||||
$param = new stdClass();
|
||||
$param->nameIdentifier = $nameIdentifier;
|
||||
$param->matchType = $matchType;
|
||||
$param->start = $start;
|
||||
$param->limit = $limit;
|
||||
$param->start = $this->wcData['response']['start'];
|
||||
$param->limit = $this->wcData['response']['limit'];
|
||||
|
||||
try {
|
||||
return $client->getMatches($param)->return->matches;
|
||||
@ -654,6 +723,38 @@ class WsWorldCheck
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns array where key=entityId, and value=matchIdentifier according to nameIdentifier
|
||||
* @param object data (contains nameIdentifier, matchType)
|
||||
* @return array
|
||||
*/
|
||||
public function getMatchesArrName($data)
|
||||
{
|
||||
$allMatches = array();
|
||||
$client = $this->loadClientWC('name');
|
||||
$param = new stdClass();
|
||||
$param->nameIdentifier = $data->nameIdentifier;
|
||||
$param->matchType = $data->matchType; // value must be watchlist
|
||||
$param->start = $this->wcData['response']['start'];
|
||||
$param->limit = $this->wcData['response']['limit'];
|
||||
|
||||
try {
|
||||
$matches = $client->getMatches($param)->return->matches;
|
||||
foreach ($matches->match as $matchData)
|
||||
{
|
||||
$allMatches[$matchData->matchEntityIdentifier] = $matchData->matchIdentifier;
|
||||
}
|
||||
return $allMatches;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getSelectableAssignees
|
||||
* @param string groupIdentifier
|
||||
|
@ -5,3 +5,5 @@ worldcheck.namespace = http://screening.complinet.com/
|
||||
worldcheck.securityType = Security
|
||||
worldcheck.groupIdentifier = cng_so_64
|
||||
worldcheck.assigneeIdentifier = cnu_so_77
|
||||
worldcheck.response.limit = 1000
|
||||
worldcheck.response.start = 0
|
BIN
public/themes/default/images/worldcheck/first.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
public/themes/default/images/worldcheck/last.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
public/themes/default/images/worldcheck/next.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
public/themes/default/images/worldcheck/prev.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 3.6 KiB |
BIN
public/themes/default/images/worldcheck/wc0.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
9
scripts/build/config/_sql/structure/worldcheck.sql
Normal file
@ -0,0 +1,9 @@
|
||||
CREATE TABLE IF NOT EXISTS `worldcheck` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`idClient` char(5) NOT NULL,
|
||||
`nameIdentifier` varchar(23) NOT NULL,
|
||||
`name` varchar(50) NOT NULL,
|
||||
`matchCount` int(4) DEFAULT NULL,
|
||||
`dateInsert` date NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='worldcheck v1 2013-08-01' ;
|