274 lines
9.0 KiB
PHTML
Raw Normal View History

2012-10-15 09:12:59 +00:00
<?php if ($this->id1){ ?>
<style>
form em {color:#FF0000;}
fieldset {border:1px solid; padding:5px;}
fieldset legend {padding:5px;}
.fieldgrp {clear:both; width:100%; margin-bottom:.5em; overflow:hidden;}
.fieldgrp:after {content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0; }
.fieldgrp label {clear:both; padding:0 10px 0 0; line-height:22px; _padding-top:3px; float:left; display:block;}
.fieldgrp label span {font-weight:normal;}
.fieldgrp label abbr {color:#4B911C; font-size:120%; vertical-align:middle;}
fieldset .fieldgrp {clear:both; width:100%; margin-bottom:.5em; overflow:hidden;}
fieldset .fieldgrp:after {content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0; }
2012-10-15 09:12:59 +00:00
fieldset .fieldgrp label { clear:both; padding:0 10px 0 0; line-height:22px; _padding-top:3px; float:left; display:block;}
fieldset .fieldgrp label span {font-weight:normal;}
fieldset .fieldgrp label abbr {color:#4B911C; font-size:120%; vertical-align:middle;}
.field {float:left; padding:0 10px 0 0;line-height:22px;_padding-top:3px;}
.field .longfield {width:215px;}
.field .longfield-select {width:220px;}
.field .smallfield {width:95px;}
.field .medfield {width:110px;}
.field input, .field select { margin:2px 0; }
.field input[type="radio"] { margin:0 5px 0 5px; }
2012-10-04 16:01:20 +00:00
div#pp { display:none; }
div#etranger { display:none; }
2012-12-17 10:38:11 +00:00
.ui-widget-content { text-align:left; }
</style>
2012-10-15 09:12:59 +00:00
<?php if ($this->type=='actionnaire') {?>
<?php if ( $this->mode == 'add' ) {?>
2012-10-15 09:12:59 +00:00
<div class="fieldgrp">Saisie d'un actionnaire pour la société <?=$this->rs?> (<?=$this->siren?>)</div>
<?=$this->render('saisie/lienfiche.phtml')?>
<?php } elseif ($this->mode == 'edit') {?>
2012-10-15 09:12:59 +00:00
<div class="fieldgrp">Modification d'un actionnaire pour la société <?=$this->rs?> (<?=$this->siren?>)</div>
<?php } else {?>
<div class="fieldgrp">
2012-10-15 09:12:59 +00:00
Etes-vous certain de vouloir supprimer le lien entre <?=$this->rs?> (<?=$this->siren?>)
2012-10-24 16:10:48 +00:00
et <?=$this->rs2?> (<?=$this->siren2?>) ?
</div>
2012-10-15 09:12:59 +00:00
<?php }?>
<?php if ($this->mode=='edit' || $this->mode=='delete') {?>
<a id="lienDoc" href="<?=$this->url(array('controller'=>'saisie','action'=>'liendoc'),null, true)?>">Document de référence</a>
<div id="doc"></div>
<?php }?>
<form name="lien" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'liensave'),null, true)?>" method="post">
<input type="hidden" name="mode" value="<?=$this->mode?>" />
<input type="hidden" name="idLien" value="<?=$this->idLien?>" />
<input type="hidden" name="id1" value="<?=$this->id1?>" />
<?php if ($this->mode=='edit') {?>
<input type="hidden" name="id2" value="<?=$this->id2?>" />
<?php }?>
<?php if ($this->mode=='edit' || $this->mode=='delete') {?>
<div class="fieldgrp">
2012-10-15 09:12:59 +00:00
<label>Motif du changement :</label>
<div class="field">
<select name="motifUpdate">
<option value="">-</option>
2012-10-15 09:12:59 +00:00
<option>Fusion</option>
<option>Cession de parts</option>
<option>Acte SSP</option>
<option>TUP</option>
<option>Donation/Partage</option>
<option>Vente/Cession</option>
<option>Statuts</option>
2012-11-13 16:49:58 +00:00
<option>Dernier rapport annuel</option>
2012-11-09 11:33:00 +00:00
<option>Erreur d'affiliation</option>
2012-12-13 13:26:36 +00:00
<option>Lien indirect</option>
2012-10-15 09:12:59 +00:00
</select>
</div>
</div>
2012-10-15 09:12:59 +00:00
<?php }?>
2012-10-15 09:12:59 +00:00
<?php if ($this->mode=='add' || $this->mode=='edit') {?>
<fieldset>
<legend>Liens</legend>
<input type="hidden" name="type" value="actionnaire" />
<div class="fieldgrp">
2012-12-03 15:15:12 +00:00
<label>Pourcentage d'interêt</label>
<div class="field">
<input type="text" name="PDetention" value="<?=$this->PDetention?>" size="3"/> %
</div>
</div>
<div class="fieldgrp">
<label>Détention</label>
<div class="field">
<select name="MajMin">
<?php foreach( $this->detention as $val => $lib ) {?>
<?php $select = ''; if ($val==$this->MajMin) { $select = ' selected'; }?>
<option value="<?=$val?>"<?=$select?>><?=$lib?></option>
<?php }?>
</select>
</div>
</div>
<div class="fieldgrp">
2012-12-03 15:15:12 +00:00
<label>Pourcentage de contrôle</label>
<div class="field">
2012-12-03 15:15:12 +00:00
<input type="text" name="Pvote" value="<?=$this->Pvote?>" size="3"/> % (Droits de vote)
</div>
</div>
2012-11-14 17:21:32 +00:00
<div class="fieldgrp">
<label>Date Effet Lien</label>
<div class="field">
<input type="text" name="dateEffetLien" value="<?=$this->dateEffetLien?>"/> (JJ/MM/AAAA)
</div>
</div>
2012-11-15 10:15:44 +00:00
</fieldset>
<?php }?>
</form>
2012-10-15 09:12:59 +00:00
<?php }?>
<?php if ($this->type=='participation') {?>
<?php if ( $this->mode == 'add' ) { ?>
<div class="fieldgrp">Saisie d'une participation pour la société <?=$this->rs?> (<?=$this->siren?>)</div>
<?=$this->render('saisie/lienfiche.phtml')?>
<?php } elseif ($this->mode == 'edit') {?>
2012-10-15 09:12:59 +00:00
<div class="fieldgrp">Modification d'une participation pour la société <?=$this->rs?> (<?=$this->siren?>)</div>
<?php } else {?>
<div class="fieldgrp">
2012-10-15 09:12:59 +00:00
Etes-vous certain de vouloir supprimer le lien entre <?=$this->rs?> (<?=$this->siren?>)
2012-10-24 16:10:48 +00:00
et <?=$this->rs2?> (<?=$this->siren2?>) ?
</div>
2012-10-15 09:12:59 +00:00
<?php }?>
<?php if ($this->mode=='edit' || $this->mode=='delete') {?>
<a id="lienDoc" href="<?=$this->url(array('controller'=>'saisie','action'=>'liendoc'),null, true)?>">Document de référence</a>
<div id="doc"></div>
2012-10-15 09:12:59 +00:00
<?php }?>
<form name="lien" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'liensave'),null, true)?>" method="post">
<input type="hidden" name="mode" value="<?=$this->mode?>" />
<input type="hidden" name="idLien" value="<?=$this->idLien?>" />
<input type="hidden" name="id1" value="<?=$this->id1?>" />
<?php if ($this->mode=='edit') {?>
<input type="hidden" name="id2" value="<?=$this->id2?>" />
<?php }?>
2012-10-24 16:10:48 +00:00
<?php if ($this->mode=='edit' || $this->mode=='delete') {?>
<div class="fieldgrp">
<label>Motif du changement :</label>
<div class="field">
<select name="motifUpdate">
2012-10-24 16:10:48 +00:00
<option value="">-</option>
<option>Fusion</option>
<option>Cession de parts</option>
<option>Acte SSP</option>
<option>TUP</option>
<option>Donation/Partage</option>
<option>Vente/Cession</option>
<option>Statuts</option>
2012-11-13 16:49:58 +00:00
<option>Dernier rapport annuel</option>
2012-11-09 11:33:00 +00:00
<option>Erreur d'affiliation</option>
2012-12-13 13:26:36 +00:00
<option>Lien indirect</option>
2012-10-24 16:10:48 +00:00
</select>
</div>
</div>
<?php }?>
2012-10-24 16:10:48 +00:00
<?php if ($this->mode=='add' || $this->mode=='edit') {?>
2012-10-15 09:12:59 +00:00
<fieldset>
<legend>Liens</legend>
<input type="hidden" name="type" value="participation" />
<div class="fieldgrp">
2012-12-03 15:15:12 +00:00
<label>Pourcentage d'interêt</label>
<div class="field">
<input type="text" name="PDetention" value="<?=$this->PDetention?>" size="3"/> %
2012-10-04 16:01:20 +00:00
</div>
</div>
<div class="fieldgrp">
2012-10-15 09:12:59 +00:00
<label>Détention</label>
<div class="field">
<select name="MajMin">
<?php foreach( $this->detention as $val => $lib ) {?>
<?php $select = ''; if ($val==$this->MajMin) { $select = ' selected'; }?>
<option value="<?=$val?>"<?=$select?>><?=$lib?></option>
<?php }?>
</select>
</div>
</div>
<div class="fieldgrp">
2012-12-03 15:15:12 +00:00
<label>Pourcentage de contrôle</label>
<div class="field">
2012-12-03 15:15:12 +00:00
<input type="text" name="Pvote" value="<?=$this->Pvote?>" size="3"/> % (Droits de vote)
</div>
</div>
2012-11-14 17:21:32 +00:00
<div class="fieldgrp">
<label>Date Effet Lien</label>
<div class="field">
<input type="text" name="dateEffetLien" value="<?=$this->dateEffetLien?>"/> (JJ/MM/AAAA)
</div>
</div>
2012-11-15 10:15:44 +00:00
</fieldset>
<?php }?>
2012-11-14 17:21:32 +00:00
</form>
2012-10-15 09:12:59 +00:00
<?php }?>
<script>
2012-11-14 17:21:32 +00:00
$('input[name=dateEffetLien]').datepicker($.datepicker.regional[ "fr" ]);
$('a#lienDoc').on('click', function(e){
e.preventDefault();
$('div#doc').load($(this).attr('href'));
});
2012-11-13 17:11:40 +00:00
$('select[name=motifUpdate]').on('change', function(e){
e.preventDefault();
if ($(this).val()=='TUP') {
$('select[name=MajMin]').val('T');
$('input[name=PDetention]').val(0);
$('input[name=Pvote]').val(0);
}
});
$('select[name=MajMin]').on('change', function(e){
e.preventDefault();
if ($(this).val()=='T' || $(this).val()=='F' ) {
$('input[name=PDetention]').val(0);
$('input[name=Pvote]').val(0);
}
});
2012-11-13 17:11:40 +00:00
$('input[name=PDetention]').on('blur', function(e){
e.preventDefault();
if ($(this).val()>50){
$('select[name=MajMin]').val('+');
} else {
$('select[name=MajMin]').val('-');
}
});
2012-12-13 16:23:53 +00:00
$('#dialog').dialog({ buttons: [
{ text: "Valider", click: function() {
if ($('input[name=PDetention]').val()>100){
alert('Oups ! Pourcentage !');
} else 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 !");
}
}},
{ text: "Annuler", click: function() { $(this).dialog('close'); } }
] });
</script>
2012-10-15 09:12:59 +00:00
<?php } else {?>
Erreur.
2012-11-14 17:21:32 +00:00
<?php }?>