Issue #0001653: modification of popup window. some options added for searching

This commit is contained in:
Aram HARUTYUNYAN 2013-11-27 12:18:59 +00:00
parent bb30b370f4
commit 952a4cabb6
4 changed files with 88 additions and 7 deletions

View File

@ -126,6 +126,15 @@ class WorldcheckController extends Zend_Controller_Action
if ($request->getParam('dirNom')) $data->Nom = $request->getParam('dirNom');
if ($request->getParam('dirPrenom')) $data->Prenom = $request->getParam('dirPrenom');
if ($request->getParam('dirSociete')) $data->Societe = $request->getParam('dirSociete');
$data->Soc = new stdClass();
if ($request->getParam('dirSocNom2')) $data->Soc->Nom2 = $request->getParam('dirSocNom2');
if ($request->getParam('dirSocNomLong')) $data->Soc->NomLong = $request->getParam('dirSocNomLong');
if ($request->getParam('dirSocCommercial')) $data->Soc->NomCommercial = $request->getParam('dirSocCommercial');
if ($request->getParam('dirSocSigle')) $data->Soc->Sigle = $request->getParam('dirSocSigle');
if ($request->getParam('dirSocSigleLong')) $data->Soc->SigleLong = $request->getParam('dirSocSigleLong');
if ($request->getParam('dirSocEnseigne')) $data->Soc->Enseigne = $request->getParam('dirSocEnseigne');
if ($request->getParam('dirSocEnseigneLong')) $data->Soc->EnseigneLong = $request->getParam('dirSocEnseigneLong');
$wcLocal = new Application_Model_Worldcheck();
$this->view->assign('occurrence', $wcLocal->getCount($data));

View File

@ -64,14 +64,33 @@ echo $this->partial('identite/fiche-item.phtml', $this->dBlock['AutreSiren']);
<div style="float:right;">
<img class="wcheck" src='/themes/default/images/worldcheck/wc.png'/>
</div>
<?php
$params = array(
'controller'=>'worldcheck',
'action'=>'occurence',
'dirSociete'=>$this->infos->Nom,
'dirSocNom2'=>$this->infos->Nom2,
'dirSocNomLong'=>$this->infos->NomLong,
'dirSocCommercial'=>$this->infos->NomCommercial,
'dirSocSigle'=>$this->infos->Sigle,
'dirSocSigleLong'=>$this->infos->SigleLong,
'dirSocEnseigne'=>$this->infos->Enseigne,
'dirSocEnseigneLong'=>$this->infos->EnseigneLong,
'dirType' =>'ORGANISATION',
'siren'=>substr($this->siret, 0, 9)
);
?>
<script>
$('img.wcheck').each(function(){
$(this).qtip({
hide: { event: 'unfocus' },
show: { solo: true, delay: 1000 },
content: { title: {button: true}, text: "Chargement...",
ajax: { url: '<?=$this->url(array('controller'=>'worldcheck','action'=>'occurence', 'dirSociete'=>$this->infos->Nom, 'dirType' =>'ORGANISATION', 'siren'=>substr($this->siret, 0, 9)),null,true);?>' } },
position: { my: "bottom left", at: "top center" }
show: { solo: true, delay: 500 },
content: {
button: true,
title: 'WorlCheck',
text: "Chargement...",
ajax: { url: '<?=$this->url($params,null,true);?>' } },
position: { my: 'right center', at: 'left center' }
});
});
</script>

View File

@ -24,11 +24,14 @@ function formElements()
{
if ($('select[name=dirType] option:selected').text()=='Individual')
{
$('label[for=dirNom]').text('NOM');
$('div#prenom').show();
}
else
{
$('label[for=dirNom]').text('RAISON SOCIALE / ENSEIGNE / SIGLE');
$('div#prenom').hide();
}
}
$('document').ready(function(e){

View File

@ -1,7 +1,13 @@
<?php if ($this->occurrence===false) {?>
Aucune information disponible, Lancer une recherche.
<?php } else {?>
<?=$this->occurrence?> Occurrences.
<?php } else {
if ($this->data->Societe!=''){
$title = $this->data->Societe;
} else {
$title = $this->data->Nom;
}
?>
<?=$this->occurrence?> Occurrence(s) par "<?=$title; ?>".
<?php }?>
<?php
$param = array(
@ -19,5 +25,49 @@ foreach ($param as $key =>$val) {
}
}
?>
<p>
<a href="<?=$this->url($param, null, true)?>">Rechercher dans WorldCheck</a>
</p>
<?php
if ($this->data->Societe!=''){
$alternativeParams = array(
'controller'=>'worldcheck',
'action'=>'index',
'dirSociete'=>'',
'dirType' =>$this->data->Type,
'siren'=>substr($this->siret, 0, 9));
?>
<?php
foreach ($this->data->Soc as $key=>$value) {
$alternativeParams['dirSociete'] = $value;
$key = substr(preg_replace("/([A-Z])/",' \\1',$key),1);
?><?=$key.': '?><a href="<?=$this->url($alternativeParams, null, true)?>"> <?=$value;?></a><br/>
<?php }?>
<?php
if ($this->data->Soc->NomLong!=''){
$keyWord = explode(' ', $this->data->Soc->NomLong);
} else {
$keyWord = explode(' ', $this->data->Societe);
}
if (count($keyWord)>1) {
?>
<br/>
<a href="<?=$this->url($param, null, true)?>">Rechercher dans WorldCheck</a>
Rechercher par mots clés:
<ul>
<?php
$specChar = array('.', '(', ')');
foreach ($keyWord as $value) {
str_replace($specChar, '', $value, $i);
if (strlen($value)>3 && $i==0){
$alternativeParams['dirSociete'] = $value;
?>
<li><a href="<?=$this->url($alternativeParams, null, true)?>"> <?=ucfirst(strtolower($value));?></a></li>
<?php
}
}
?>
</ul>
<?php } ?>
<?php } ?>