Annonces légales

This commit is contained in:
Michael RICOIS 2016-09-07 17:44:01 +02:00
parent 351b4cce4a
commit 11dfca7a5a
2 changed files with 62 additions and 75 deletions

View File

@ -108,25 +108,21 @@ class Legal_JuridiqueController extends Zend_Controller_Action
);
$user = new Scores_Utilisateur();
// Lien edition
if ($user->checkModeEdition()) {
$this->view->InputLinks[] = array(
'title' => 'Edition Fiche',
'label' => '<span class="glyphicon glyphicon-pencil"></span> Editer la fiche',
'href' => $this->view->url(array('module'=>'input', 'controller'=>'index', 'action'=>'index',
'siret'=>$this->siret, 'id'=>$this->id), 'default', true),
);
}
$this->view->assign('exportObjet', $infos);
$this->view->assign('surveillance', $user->checkPerm('survannonce'));
// --- Affichage pour une annonce
if (!empty($idAnn) && in_array($vue, array('bodacc', 'abod', 'balo', 'asso', 'bomp')) ) {
if ( $user->checkModeEdition() ){
// Lien edition
$this->view->InputLinks[] = array(
'title' => 'Edition Fiche',
'label' => '<span class="glyphicon glyphicon-pencil"></span> Editer la fiche',
'href' => $this->view->url(array('module'=>'input', 'controller'=>'index', 'action'=>'index',
'siret'=>$this->siret, 'id'=>$this->id), 'default', true),
);
$this->view->headScript()->appendFile($this->theme->pathScript.'/saisieannonces.js', 'text/javascript');
}
$classType = 'annonces'.ucfirst($vue);
foreach($objAnnonces->$classType as $ann) {
if($ann->id==$idAnn) break;
@ -155,13 +151,49 @@ class Legal_JuridiqueController extends Zend_Controller_Action
$this->view->assign('idAnn', $idAnn);
$this->view->assign('annonce', $annonce);
if ($request->getParam('q')=='ajax')
{
if ($request->getParam('q')=='ajax') {
$this->_helper->layout()->disableLayout();
//$this->_helper->viewRenderer->setNoRender(true);
$this->renderScript('juridique/annonce-ajax.phtml');
} else {
// Lien edition
if ($user->checkModeEdition()) {
$this->view->InputLinks[] = array(
'title' => 'Edition annonce',
'label' => '<span class="glyphicon glyphicon-pencil"></span> Editer l\'annonce',
'class' => 'annonceSaisie',
'href' => $this->view->url(array('module'=>'input', 'controller'=>'index',
'action'=>'annoncedialog', 'siret'=>$this->siret, 'op'=>'edit',
'code'=>$annonce['Code'], 'idAnn'=>$idAnn), 'default', true),
);
$this->view->InputLinks[] = array(
'title' => 'Suppression annonce',
'label' => '<span class="glyphicon glyphicon-pencil"></span> Supprimer l\'annonce',
'class' => 'annonceSaisie',
'href' => $this->view->url(array('module'=>'input', 'controller'=>'index',
'action'=>'annoncedialog', 'siret'=>$this->siret, 'op'=>'delete',
'code'=>$annonce['Code'], 'idAnn'=>$idAnn), 'default', true),
);
$this->view->InputLinks[] = array(
'title' => 'Dupliquer sur autre Siren',
'label' => '<span class="glyphicon glyphicon-duplicate"></span> Dupliquer sur un autre Siren',
'class' => 'annonceSaisie',
'href' => $this->view->url(array('module'=>'input', 'controller'=>'index',
'action'=>'annoncedialog', 'siret'=>$this->siret, 'op'=>'copy',
'code'=>$annonce['Code'], 'idAnn'=>$idAnn), 'default', true),
);
$this->view->InputLinks[] = array(
'title' => "Modifier le type d'événement",
'label' => '<span class="glyphicon glyphicon-time"></span> Dupliquer sur un autre Siren',
'class' => 'annonceSaisie',
'href' => $this->view->url(array('module'=>'input', 'controller'=>'index',
'action'=>'annoncedialog', 'siret'=>$this->siret, 'op'=>'even',
'code'=>$annonce['Code'], 'idAnn'=>$idAnn), 'default', true),
);
$this->view->headScript()->appendFile($this->theme->pathScript.'/saisieannonces.js', 'text/javascript');
}
$this->view->assign('PageCurrent', $page);
//Définir url pour téléchargement pdf

View File

@ -4,24 +4,21 @@
<h1><?=$this->raisonSociale?> <small><?=$this->SirenTexte($this->siren)?></small></h1>
</div>
<h2 class="titre">Annonces légales</h2>
<h2 class="titre">Annonces légales
<?php
switch ($this->annonce['Type']) {
case 'balo':
?><h2>BALO</h2><?php
case 'balo': ?>- BALO<?php
break;
case 'bodacc':
case 'abod':
?><h3>Ev&eacute;nements l&eacute;gaux</h3><?php
case 'abod':?>- Ev&eacute;nements l&eacute;gaux<?php
break;
case 'asso':
?><h2>Associations</h2><?php
case 'asso':?>- Associations<?php
break;
case 'bomp'
?><h2>Marchés publics</h2><?php
case 'bomp'?>- Marchés publics<?php
break;
}
?>
</h2>
<?php if (!empty($this->annonce['Deleted'])) {?>
<div class="ui-widget">
@ -32,62 +29,23 @@ switch ($this->annonce['Type']) {
</div>
<?php }?>
<p class="StyleInfoData">
<?=$this->annonce['Desc'].' '.$this->annonce['Entree'].' '.$this->annonce['EntreeSD'];?>
<?php
if ($this->UserModeEdit){
$liensEdit = array(
'edit' => array(
'class' => 'annonceSaisie',
'title' => 'Edition annonce',
'img' => '<img src="/themes/default/images/interfaces/editer.png"/>',
),
'delete' => array(
'class' => 'annonceSaisie',
'title' => 'Suppression annonce',
'img' => '<img src="/themes/default/images/interfaces/supprimer.png"/>',
),
'copy' => array(
'class' => 'annonceSaisie',
'title' => 'Dupliquer sur autre Siren',
'img' => '<img src="/themes/default/images/interfaces/save_copy.png"/>',
),
'even' => array(
'class' => 'annonceSaisie',
'title' => "Modifier le type d'événement",
'img' => '<img src="/themes/default/images/interfaces/even.png"/>',
),
);
foreach ( $liensEdit as $lienId => $lienItem ){
?>
<a class="<?=$lienItem['class']?>" title="<?=$lienItem['title']?>" href="<?=$this->url(array(
'module'=>'input', 'controller'=>'index', 'action'=>'annoncedialog', 'siret'=>$this->siret,
'op'=>$lienId, 'code'=>$this->annonce['Code'], 'idAnn'=>$this->idAnn), 'default', true)?>">
<?=$lienItem['img']?></a>
<?php
}
}
?>
</p>
<p><b><?=$this->annonce['Even']?></b></p>
<p class="strong"><?=$this->annonce['Even']?></p>
<blockquote>
<p><samp><?=$this->RemplaceSiren($this->annonce['Texte'])?></samp></p>
</blockquote>
<div class="text-center">
<?php if ( $this->lienBodacc ) { ?>
<div class="text-center">
<span id="bodacc" style="padding-bottom:10px;border-bottom:1px solid #cccccc;">
<a href="<?=$this->lienBodacc?>">
<img src="/themes/default/images/interfaces/pdf.png" alt="Bodacc au format PDF">
Télécharger le bulletin officiel</a>
</span>
<?php } ?>
</div>
<?php } ?>
<div class="paragraph">
<?php if (count($this->annonce['Entites'])>0) {?>
<?php if (count($this->annonce['Entites']) > 0) {?>
<div>
<p>Entités concernées par l'annonce :</p>
<table width="100%">
<?php foreach ($this->annonce['Entites'] as $entite) {?>
@ -104,17 +62,14 @@ Télécharger le bulletin officiel</a>
</tr>
<?php }?>
</table>
<?php }?>
</div>
<?php }?>
<div class="text-center">
<?php if (intval($this->siret)!=0) {?>
<?php
$href = $this->url(array('module'=>'legal', 'controller' => 'juridique', 'action' => 'annonces',
<a href="<?=$this->url(array('module'=>'legal', 'controller' => 'juridique', 'action' => 'annonces',
'siret' => $this->siret, 'id' => $this->id, 'vue' => $this->vue, 'page' => $this->PageCurrent),
'default', true);
?>
<a href="<?=$href?>">Revenir à la liste des annonces</a>
'default', true)?>">Revenir à la liste des annonces</a>
<?php }?>
</div>