2012-12-07 08:05:13 +00:00

279 lines
10 KiB
PHTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php if (empty($this->AutrePage)) {?>
<div id="center">
<?php }?>
<?php if (empty($this->AutrePage)) {?>
<h1>LIENS INTER-ENTREPRISES</h1>
<div class="paragraph">
<table class="identite">
<?php if ($this->siren) {?>
<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>
<?php }?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Raison Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
<?php if ($this->liengroupe) { ?>
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="2" class="StyleInfoLib">
<a id="groupesarbo" title="Arborescence du groupe" href="<?=$this->liengroupe?>">Organigramme du groupe</a>
</td>
</tr>
<?php }?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib" valign="top">Documents</td>
<td width="350" class="StyleInfoLib">
<?php
if ($this->siren) {
echo $this->action('liendoc', 'identite', null, array('id'=>$this->siren, 'type'=>'Siren'));
} else {
echo $this->action('liendoc', 'identite', null, array('id'=>$this->lienref, 'type'=>'Entreprise'));
}
?>
<?php if ($this->edition) {?>
<br/>
<a class="dialogDoc" title="Lier un document" href="<?=$this->url(array('controller'=>'saisie','action'=>'liendoc','siren'=>$this->siren), null, true)?>">
<img style="vertical-align:middle;" src="/themes/default/images/interfaces/page_white_put.png" />
Lier un document (organigramme du groupe)
</a>
</td>
<?php }?>
</tr>
</table>
</div>
<?php }?>
<style>
table { border-spacing: 0; border-collapse: collapse; }
table.data td { border:1px solid #ccc; padding:2px; }
</style>
<?php $liste = array('actionnaires', 'participations');?>
<?php foreach ($liste as $part) {?>
<?php if ($part == 'actionnaires') {?>
<h2>Actionnariat</h2>
<?php } else {?>
<h2>Participations</h2>
<?php }?>
<div class="paragraph">
<?php if ( count($this->$part)>0 ) {?>
<table class="data">
<?php foreach ($this->$part as $lien) {?>
<tr>
<td class="StyleInfoData" width="100">
<?php
if (intval($lien->PDetention)>0) echo $lien->PDetention.'&nbsp;%';
elseif ($lien->MajMin=='+') echo 'major.';
elseif ($lien->MajMin=='-') echo 'minor.';
elseif ($lien->MajMin=='C') echo 'major.';
elseif ($lien->MajMin=='S') echo 'minor.';
elseif ($lien->MajMin=='F') echo 'absorption';
elseif ($lien->MajMin=='A') echo 'absorbant';
else echo '&nbsp;';
?>
</td>
<td class="StyleInfoLib" width="350">
<span class="lienfiche" href="<?=$this->url(array('controller'=>'identite','action'=>'lienfiche','idFiche'=>$lien->idFiche), null, true)?>"><?=$lien->nom?></span>
<?php if ($this->edition) {?> <a href="<?=$this->url(array('controller'=>'identite','action'=>'liens','lienref'=>$lien->idFiche), null, true)?>">Basculer</a> <?php }?>
</td>
<td class="StyleInfoData" width="150">
<?php
if ( !empty($lien->siren) && intval($lien->siren)!=0 ) {
$href = $this->url(array(
'controller' => 'identite',
'action' => 'fiche',
'siret' => $lien->siren
), null, true);
echo 'Siren&nbsp;<a href="'.$href.'">'.$this->SirenTexte($lien->siren).'</a>';
}
else '&nbsp;';
if ($lien->pays<>'France') echo '<b>'.$lien->pays.'</b>';
?>
</td>
<?php if ($this->edition) {?>
<td width="150">
<a class="documentsLien" title="Documents associés" href="<?=$this->url(array('controller'=>'identite','action'=>'liendoc','id'=>$lien->id,'type'=>'Lien'))?>">+</a>
<?php if ($part == 'actionnaires') {?>
<a class="dialog" title="Modifier actionnaire" href="<?=$this->url(array('controller'=>'saisie','action'=>'lien','type'=>'actionnaire','mode'=>'edit','siren'=>$this->siren,'idLien'=>$lien->id), null, true)?>"><img src="/themes/default/images/interfaces/editer.png" /></a>
<a class="dialog" title="Supprimer actionnaire" href="<?=$this->url(array('controller'=>'saisie','action'=>'lien','type'=>'actionnaire','mode'=>'delete','siren'=>$this->siren,'idLien'=>$lien->id), null, true)?>"><img src="/themes/default/images/interfaces/supprimer.png" /></a>
<?php } else {?>
<a class="dialog" title="Modifier participation" href="<?=$this->url(array('controller'=>'saisie','action'=>'lien','type'=>'participation','mode'=>'edit','siren'=>$this->siren,'idLien'=>$lien->id), null, true)?>"><img src="/themes/default/images/interfaces/editer.png" /></a>
<a class="dialog" title="Supprimer participation" href="<?=$this->url(array('controller'=>'saisie','action'=>'lien','type'=>'participation','mode'=>'delete','siren'=>$this->siren,'idLien'=>$lien->id), null, true)?>"><img src="/themes/default/images/interfaces/supprimer.png" /></a>
<?php }?>
<a class="dialogDoc" title="Lier un document" href="<?=$this->url(array('controller'=>'saisie','action'=>'liendoc','idLien'=>$lien->id), null, true)?>"><img src="/themes/default/images/interfaces/page_white_put.png" /></a>
</td>
<?php }?>
</tr>
<?php }?>
</table>
<?php } else {?>
<?php if ($part == 'actionnaires') {?>
<div>Aucun actionnaire r&eacute;f&eacute;renc&eacute; par nos services.</div>
<?php if ($this->lienStatuts) {?>
<?php if ($this->lienStatuts) {?>
<div>Afin didentifier les actionnaires de cette entreprise, consulter ses <a href="<?=$this->lienStatuts?>">statuts</a>.</div>
<?php }?>
<?php }?>
<?php } else {?>
<div>Aucune participation r&eacute;f&eacute;renc&eacute;e par nos services.</div>
<?php if ($this->lienBilans) {?>
<?php if ($this->lienStatuts) {?>
<div>Afin didentifier les participations de cette entreprise, consulter son <a href="<?=$this->lienBilans?>">dernier bilan publié</a>.</div>
<?php }?>
<?php }?>
<?php } ?>
<?php } ?>
<?php if ($this->edition) {?>
<?php if ($part == 'actionnaires') {?>
<div style="line-height:16px;">
<a class="dialog" title="Ajouter un actionnaire" href="<?=$this->url(array('controller'=>'saisie','action'=>'lien','type'=>'actionnaire','mode'=>'add','siren'=>$this->siren,'lienref'=>$this->lienref), null, true)?>">
<img style="vertical-align:middle;" src="/themes/default/images/interfaces/ajouter.png" /> Ajouter un actionnaire</a>
</div>
<?php } else {?>
<div style="line-height:16px;">
<a class="dialog" title="Ajouter une participation" href="<?=$this->url(array('controller'=>'saisie','action'=>'lien','type'=>'participation','mode'=>'add','siren'=>$this->siren,'lienref'=>$this->lienref), null, true)?>">
<img style="vertical-align:middle;" src="/themes/default/images/interfaces/ajouter.png" /> Ajouter une participation</a>
</div>
<?php }?>
<?php }?>
</div>
<?php }?>
<?php if ( count($this->directions)>0 ) {?>
<h2>Fonctions de directions</h2>
<div class="paragraph">
<table class="data">
<?php foreach ($this->directions as $lien) {?>
<tr>
<td class="StyleInfoData" width="100" valign="top"><?=$lien->fonction?></td>
<td class="StyleInfoLib" width="500">
<?=$lien->nom?>
<?php if ( $lien->dirNom!='' ) {?>
<br/>représenté par <b><?=$lien->dirNom?></b>
<?php if( $lien->dirNaissDate && $lien->dirNaissDate!='0000-00-00' ) {?>
née le <?=substr($lien->dirNaissDate,8,2).'/'.substr($lien->dirNaissDate,5,2).'/'.substr($lien->dirNaissDate,0,4)?><?php }?>
<?php if( $lien->dirNaissLieu ) {?> à <?=$lien->dirNaissLieu?> <?php }?>
<?php }?>
</td>
<td class="StyleInfoData" width="150" valign="top">
<?php if ( !empty($lien->siren) && intval($lien->siren)!=0 ) {
$href = $this->url(array(
'controller' => 'identite',
'action' => 'fiche',
'siret' => $lien->siren
), null, true);
echo 'Siren&nbsp;<a href="'.$href.'">'.$this->SirenTexte($lien->siren).'</a>';
}?></td>
</tr>
<?php }?>
</table>
</div>
<?php }?>
<?php if (empty($this->AutrePage)) {?>
<?=$this->render('cgu.phtml', $this->cgu)?>
<?php }?>
<?php if (empty($this->AutrePage)) {?>
</div>
<?php }?>
<script>
$('span.lienfiche').each(function(){
$(this).qtip({
hide: { event: 'unfocus' },
show: { solo: true },
content: {
text: "Chargement...",
ajax: { url: $(this).attr('href') }
},
style: { classes: "ui-tooltip-cream" },
position: { my: "bottom left", at: "top right" }
});
});
</script>
<?php if ($this->edition) {?>
<script>
$('a.documentsLien').on('click', function(e){
e.preventDefault();
var tr = $(this).parents('tr');
var href = $(this).attr('href');
$(this).remove();
var contentB = '<tr><td width="30">&nbsp;</td><td width="300"class="StyleInfoData">';
var contentE = '</td><td></td</tr>';
$.post(href, function(data){ tr.after(contentB + data + contentE); });
});
$('a.dialogDoc').on('click', function(){
var href = $(this).attr('href');
if (href!='#') {
var title = $(this).attr('title');
var dialogOpts = {
bgiframe: true,
title: title,
width: 650,
height: 600,
modal: true,
open: function(event, ui) {
$(this).html('Chargement...');
$(this).load(href);
},
buttons: {
Annuler: function() { $(this).dialog('close'); }
},
close: function() { $('#dialog').remove(); }
};
$('<div id="dialog"></div>').dialog(dialogOpts);
return false;
}
});
$('a.dialog').on('click', function(){
var href = $(this).attr('href');
if (href!='#') {
var title = $(this).attr('title');
var dialogOpts = {
bgiframe: true,
title: title,
width: 650,
height: 600,
modal: true,
open: function(event, ui) {
$(this).html('Chargement...');
$(this).load(href);
},
buttons: {
Valider: function() {
if ($('input[name=mode]').val()=='delete' && $('input[name=id1]').length>0
|| $('input[name=id1]').length>0 && $('input[name=id2]').length>0) {
var form = $('form[name=lien]');
$.post(form.attr('action'), form.serialize(), function(data){
$('form[name=lien]').replaceWith(data);
}).error(function(){ alert('Unknow error'); });
} else {
alert("Quelque chose manque !");
}
},
Annuler: function() { $(this).dialog('close'); }
},
close: function() { $('#dialog').remove(); }
};
$('<div id="dialog"></div>').dialog(dialogOpts);
return false;
}
});
</script>
<?php }?>