issue #0001704 : Mise à jour de la page des contacts

This commit is contained in:
Michael RICOIS 2013-12-04 15:24:06 +00:00
parent ce30c50f35
commit b900da88db
6 changed files with 100 additions and 21 deletions

View File

@ -1379,13 +1379,31 @@ class IdentiteController extends Zend_Controller_Action
$this->view->assign('siren', $siren);
}
/**
* Contact Data
*/
public function contactsAction()
{
$session = new Scores_Session_Entreprise($this->siret, $this->id, true);
$siren = substr($this->siret,0,9);
Zend_Registry::get('firebug')->info($siren);
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$request = $this->getRequest();
$this->view->assign('siret', $this->siret);
$siren = substr($this->siret, 0, 9);
$all = $request->getParam('get');
if ($all == 'all') {
$companyId = substr($this->siret,0,9);
$this->view->assign('all', true);
} else {
$companyId = $this->siret;
}
$filter = $request->getParam('filter');
$this->view->assign('filter', $filter);
$ws = new WsScores();
$result = $ws->getContactEt($siren);
$result = $ws->getContactEt($companyId, $filter);
Zend_Registry::get('firebug')->info($result);
if ($result->nbReponses>0) {

View File

@ -1,6 +1,6 @@
<div id="center">
<h1 class="titre">CONTACTS</h1>
<h1 class="titre">DONNEES DE CONTACTS</h1>
<div class="paragraph">
<table class="identite">
@ -17,20 +17,72 @@
</table>
</div>
<h2>Liste des contacts</h2>
<h2>Historique des données de contact</h2>
<div class="paragraph">
<?php if ($this->all) {?>
<?php
$url = $this->url(array('controller'=>'identite', 'action'=>'contacts','siret'=>$this->siret), null, true);
?>
<div style="float:left;">
<a href="<?=$url?>">Uniquement les contacts de l'établissement</a>
</div>
<?php } else {?>
<?php
$url = $this->url(array(
'controller'=>'identite', 'action'=>'contacts',
'siret'=>$this->siret, 'get'=> 'all'
), null, true);
?>
<div style="float:left;">
<a href="<?=$url?>">Tous les contacts de l'entreprise</a>
</div>
<?php }?>
<div id="radioset" style="float:right;">
Filtre :
<input type="radio" name="filtre" id="tel"><label <?php if($this->filter=='tel') { echo ' class="ui-state-active"'; }?>data-url="<?=$url?>" for="tel">Téléphone</label>
<input type="radio" name="filtre" id="fax"><label <?php if($this->filter=='fax') { echo ' class="ui-state-active"'; }?>data-url="<?=$url?>" for="fax">Fax</label>
<input type="radio" name="filtre" id="mail"><label <?php if($this->filter=='mail') { echo ' class="ui-state-active"'; }?>data-url="<?=$url?>" for="mail">e-Mail</label>
<input type="radio" name="filtre" id="web"><label <?php if($this->filter=='web') { echo ' class="ui-state-active"'; }?>data-url="<?=$url?>" for="web">Web</label>
<input type="radio" name="filtre" id="remove"><label data-url="<?=$url?>" for="remove">Sans filtres</label>
</div>
<script>
$('#radioset').buttonset();
$('input[name=filtre]').click(function(e){
e.preventDefault();
var label = $(this).attr('id');
if (label=='remove') {
window.location.href = $('label[for='+label+']').data('url');
} else if ( $('label[for='+label+']').hasClass('ui-state-active') ) {
window.location.href = $('label[for='+label+']').data('url')+'/filter/'+label;
}
});
</script>
</div>
<div class="paragraph" style="clear:both;">
<?php if ( count($this->contacts) == 0 ){?>
Aucun contacts.
<?php } else {?>
<table class="data">
<tr>
<th>SIREN</th>
<th>Type</th>
<th>Contact</th>
<th>Date de mise à jour</th>
<th>Description</th>
<th>Mise à jour</th>
</tr>
<?php foreach($this->contacts as $item) {?>
<tr>
<?php
$class = '';
if ($item->deleted) {
$class = ' class="deleted"';
}
?>
<tr<?=$class?>>
<td><?=$this->SiretTexte($item->siren.$item->nic)?></td>
<td>
<?php
switch($item->type) {
@ -49,6 +101,7 @@ Aucun contacts.
<?=$item->value?>
<?php }?>
</td>
<td><?=$item->description?></td>
<td>
<?php
if (intval($item->date)>0) {

View File

@ -11,6 +11,7 @@ class Scores_Export_Print
'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',
@ -44,6 +45,7 @@ class Scores_Export_Print
'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',
@ -75,6 +77,7 @@ class Scores_Export_Print
'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',

View File

@ -504,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;
}
@ -714,17 +714,17 @@ class IdentiteEntreprise
if ($i_adr>4) break;
}
$data.= '&nbsp;<a title="Rechercher le num&eacute;ro de t&eacute;l&eacute;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>';
$data.= '<br/><a href="'.$this->view->url(array(
'controller'=>'identite',
'action'=>'contacts',
'siret'=>$this->identite->Siret,
'id'=>$this->identite->id), null, true).
'"/>Liste de contacts supplémentaires</a>';
'"/>Plus de contacts</a>';
$data.= ' - <a title="Rechercher le num&eacute;ro de t&eacute;l&eacute;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>';
return $data;
}

View File

@ -101,10 +101,14 @@ class WsScores
return $client;
}
public function getContactEt($siret)
public function getContactEt($siret, $filter = null)
{
$filename = 'getcontactset-'.$siret;
if ( $filter !== null ) {
$filename.= '-'.$filter;
}
if ($this->cacheWrite) {
$cache = new Cache($filename);
if ($cache->exist() && $this->cacheEnable ){
@ -114,6 +118,7 @@ class WsScores
$params = new stdClass();
$params->siret = $siret;
$params->filtre = $filter;
$client = $this->loadClient('interne');
try {
$reponse = $client->getContactEt($params);

View File

@ -406,13 +406,13 @@ body {background-color:#bebebe;font-family: Verdana, Arial, sans-serif;font-size
#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;}