Affichage des textes des annonces par tooltip, issue #0000852

This commit is contained in:
Michael RICOIS 2011-08-25 09:54:13 +00:00
parent 5b64698818
commit 9a96a34f24
4 changed files with 50 additions and 3 deletions

View File

@ -67,5 +67,9 @@ $tabScripts = array(
'list' => array('rsynthese.js'),
'pages' => array('indiscore3')
),
'scripts_annonces' => array(
'list' => array('annonces.js'),
'pages' => array('annonces')
),
);
?>

View File

@ -277,7 +277,13 @@ switch ($page)
break;
case 'annonces':
$raisonSociale = etabSession($siret, $idEntreprise);
require_once 'index_annonces.php';
$title='Annonces légales - Siren '.substr($siret,0,3).' '.substr(siret,3,3).' '.substr(siret,6,3);
$page2 = 'annonces.php';
if ($_GET['q'] == 'ajax') {
require_once realpath(dirname(__FILE__)).'/pages/'.$page2;
exit;
}
require_once realpath(dirname(__FILE__)).'/pages/main.php';
break;
case 'infosreg':
$raisonSociale = etabSession($siret, $idEntreprise);

23
www/js/annonces.js Normal file
View File

@ -0,0 +1,23 @@
$(document).ready(function(){
$('.tiptxt').each(function(){
//Si element existe alors on a le texte
var texte = $(this).find('span').html();
if (texte!=''){
$(this).qtip( {
content: { text: texte, },
solo: true,
style: { width: 500, name: 'cream' },
position: { corner: { target: 'bottomMiddle', tooltip: 'topMiddle' } }
});
} else {
$(this).qtip( {
content: { text: 'Chargement...', url: $(this).find('a').attr('href')+'&q=ajax', },
solo: true,
style: { width: 500, name: 'cream' },
position: { corner: { target: 'bottomMiddle', tooltip: 'topMiddle' } }
});
}
});
});

View File

@ -14,7 +14,18 @@ $message='';
//Récupération des infos du webservice
$annonces = scoresws_annonces($siret, $siren, $idEntreprise, $vue, $idan);
FB::log($annonces, 'annonce');
$objAnnonces = new Annonces($annonces);
if (isset($_GET['q']) && $_GET['q']=='ajax'){
require_once '../includes/siren.php';
$ann = $annonces[0];
echo $objAnnonces->getAnnonceTexte($ann);
exit;
}
?>
<div id="center">
<h1 class="titre">ANNONCES L&Eacute;GALES</h1>
@ -106,6 +117,7 @@ if ($idan && in_array($vue, array('bodacc', 'abod', 'balo', 'asso', 'bomp')))
if($ann['id']==$idan)
break;
}
FB::log($ann, 'Selection annonce');
?>
<h2>&Eacute;V&Eacute;NEMENTS L&Eacute;GAUX</h2>
<table>
@ -235,13 +247,15 @@ elseif (count($annonces) > 0)
<tr>
<td width="30">&nbsp;</td>
<td width="140" class="StyleInfoLib">
<span id="annoncesDate">Le <?=$resume['date']?> </span>
<span id="annoncesDate">Le <?=$resume['date']?></span>
<span id="annoncesImg"><?=$resume['logo']?></span>
</td>
<td width="450" colspan="2" class="StyleInfoData">
<td class="tiptxt" width="450" colspan="2" class="StyleInfoData">
<a href="/?page=annonces&siret=<?=$siret?>&idEntreprise=<?=$idEntreprise?>&<?=$resume['href']?>">
<?=$resume['lib']?>
</a>
<?php $texte = $objAnnonces->getAnnonceTexte($ann);?>
<span style="display:none;"><?=$texte?></span>
</td>
</tr>
<?php