issue #0001704 : Ajout page de contacts

This commit is contained in:
Michael RICOIS 2013-11-21 16:08:44 +00:00
parent a559ec7c3f
commit c8b26d427b
5 changed files with 135 additions and 5 deletions

View File

@ -1283,4 +1283,21 @@ class IdentiteController extends Zend_Controller_Action
$this->view->assign('result', $result);
$this->view->assign('siren', $siren);
}
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);
$ws = new WsScores();
$result = $ws->getContactEt($siren);
Zend_Registry::get('firebug')->info($result);
if ($result->nbReponses>0) {
$this->view->assign('contacts', $result->result->item);
}
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$this->view->assign('siren', $siren);
}
}

View File

@ -0,0 +1,66 @@
<div id="center">
<h1 class="titre">CONTACTS</h1>
<div class="paragraph">
<table class="identite">
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siren</td>
<td width="350" class="StyleInfoData"><?=$this->SirenTexte($this->siren)?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Raison Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
</table>
</div>
<h2>Liste des contacts</h2>
<div class="paragraph">
<?php if ( count($this->contacts) == 0 ){?>
Aucun contacts.
<?php } else {?>
<table class="data">
<tr>
<th>Type</th>
<th>Contact</th>
<th>Date de mise à jour</th>
</tr>
<?php foreach($this->contacts as $item) {?>
<tr>
<td>
<?php
switch($item->type) {
case 'fax': echo "Fax"; break;
case 'mail': echo "E-mail"; break;
case 'tel': echo "Téléphone"; break;
case 'web': echo "Site Web"; break;
case 'mob': echo "Tel. Mobile"; break;
}
?>
</td>
<td>
<?php if ($item->type=='fax' || $item->type=='tel' || $item->type=='mob') {?>
<?=substr(chunk_split($item->value, 2, '.'), 0, -1)?>
<?php } else {?>
<?=$item->value?>
<?php }?>
</td>
<td>
<?php
if (intval($item->date)>0) {
$date = new Zend_Date($item->date, 'yyyyMMdd');
echo $date->toString('dd/MM/yyyy');
}
?>
</td>
</tr>
<?php }?>
</table>
<?php }?>
</div>
</div>

View File

@ -695,8 +695,6 @@ class IdentiteEntreprise
public function getTelTexte()
{
$data = '';
$data.= '<div class="txtAdresse">';
$data.= '<p>';
if (trim($this->identite->Tel)=='')
$data.= 'N/C';
@ -715,11 +713,18 @@ class IdentiteEntreprise
$adresse = substr($this->identite->Adresse,1,strlen($this->identite->Adresse)-1);
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></p>';
$data.= '</div>';
'&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>';
return $data;
}

View File

@ -101,6 +101,9 @@ class Scores_Menu
),
array(
'label' => 'IDENTITE',
'activateMenu' => array(
array('controller'=>'identite', 'action'=>'contacts'),
),
'pages' => array(
array(
'label' => "Fiche d'identité",

View File

@ -101,6 +101,45 @@ class WsScores
return $client;
}
public function getContactEt($siret)
{
$filename = 'getcontactset-'.$siret;
if ($this->cacheWrite) {
$cache = new Cache($filename);
if ($cache->exist() && $this->cacheEnable ){
return $cache->getBlock();
}
}
$params = new stdClass();
$params->siret = $siret;
$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();
@ -280,7 +319,7 @@ class WsScores
}
}
}
public function getCatalogCity($id, $columns)
{
$params = new stdClass();