issue #0000078 : Ajout afficahge du nombre d'annonces par catégorie

This commit is contained in:
Michael RICOIS 2012-09-05 14:22:23 +00:00
parent 271a788da0
commit 496ffeb9ed
4 changed files with 58 additions and 8 deletions

View File

@ -430,6 +430,32 @@ class JuridiqueController extends Zend_Controller_Action
}
public function annoncenumAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$siren = $request->getParam('siren');
$ws = new WsScores();
$result = $ws->getAnnoncesNum($siren);
Zend_Registry::get('firebug')->info($result);
$numWS = array();
if (count($result->item)>0) {
foreach ($result->item as $item) {
$numWS[$item->type] = $item->num;
}
}
$types = array('bodacc', 'balo', 'boamp', 'asso');
$num = array();
foreach($types as $type) {
if ( array_key_exists($type, $numWS) ) {
$num['Type'.ucfirst($type)] = $numWS[$type];
}
}
$this->view->assign('num', $num);
}
}

View File

@ -0,0 +1 @@
<?=json_encode($this->num)?>

View File

@ -79,6 +79,20 @@ div.blockType:hover {
border-color:#2f343a;
}
div.blockTypeActive span.nb {
background-color: #87CEFA;
/*border-radius: 10px 10px 10px 10px;*/
font-weight: bold;
padding: 3px;
}
div.blockType span.nb {
background-color: #778899;
/*border-radius: 10px 10px 10px 10px;*/
font-weight: bold;
padding: 3px;
}
a.lienType {
width:140px;
vertical-align:middle;
@ -90,21 +104,21 @@ a.lienType {
</style>
<div class="paragraph" style="width:680px;">
<div class="clearfix" style="margin:0 auto; width:640px;">
<div class="clearfix" style="margin:0 auto 5px auto; width:640px;">
<div class="blockType<?php if ($this->vue=='bodacc') echo 'Active';?>">
<div id="TypeBodacc" class="blockType<?php if ($this->vue=='bodacc') echo 'Active';?>">
<a class="lienType" title="Annonces légales" href="<?=$this->url(array('controller'=>'juridique', 'action'=>'annonces', 'vue'=>'bodacc', 'siret'=>$this->siret, 'id'=>$this->id))?>">Annonces Légales</a>
</div>
<div class="blockType<?php if ($this->vue=='balo') echo 'Active';?>">
<div id="TypeBalo" class="blockType<?php if ($this->vue=='balo') echo 'Active';?>">
<a class="lienType" title="Bulletin des Annonces Légales Obligatoires" href="<?=$this->url(array('controller'=>'juridique', 'action'=>'annonces', 'vue'=>'balo', 'siret'=>$this->siret, 'id'=>$this->id))?>">B.A.L.O.</a>
</div>
<div class="blockType<?php if ($this->vue=='bomp') echo 'Active';?>">
<div id="TypeBoamp" class="blockType<?php if ($this->vue=='bomp') echo 'Active';?>">
<a class="lienType" title="Bulletin officiel des annonces des marchés publics" href="<?=$this->url(array('controller'=>'juridique', 'action'=>'annonces', 'vue'=>'bomp', 'siret'=>$this->siret, 'id'=>$this->id))?>">B.O.A.M.P.</a>
</div>
<div class="blockType<?php if ($this->vue=='asso') echo 'Active';?>">
<div id="TypeAsso" class="blockType<?php if ($this->vue=='asso') echo 'Active';?>">
<a class="lienType" title="Journal Officiel des Associations" href="<?=$this->url(array('controller'=>'juridique', 'action'=>'annonces', 'vue'=>'asso', 'siret'=>$this->siret, 'id'=>$this->id))?>">J.O Associations</a>
</div>
@ -196,4 +210,13 @@ Néant
<?php if (empty($this->AutrePage)) {?>
<?=$this->render('cgu.phtml', $this->cgu)?>
</div>
<?php }?>
<?php }?>
<script>
$.get('/juridique/annoncenum/siren/<?=$this->siren?>', function(data){
for (var type in data) {
$('div#'+type).append('<span class="nb">'+data[type]+'</span>');
}
}, 'json');
</script>

View File

@ -1,6 +1,6 @@
$(document).ready(function(){
$('.tiptxt').each(function(){
$('a.tiptxt').each(function(){
var texte = $(this).parent().find('span').html();
if (texte!=''){
$(this).qtip( {