161 lines
5.4 KiB
PHTML
Raw Normal View History

2012-06-08 13:18:09 +00:00
<div id="center">
2012-09-13 14:43:14 +00:00
<?php if ($message!='') {?>
2012-06-08 13:18:09 +00:00
<div style="margin:5px; padding: 0pt 0.7em;" class="ui-state-highlight ui-corner-all">
<p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-info"></span>
<?=$message?></p>
</div>
<?php } ?>
<h1 class="titre">Saisie ou Correction Liasse</h1>
<div class="paragraph">
2012-09-13 14:43:14 +00:00
<div class="clearfix">
2012-06-08 13:18:09 +00:00
<label>Num&eacute;ro identifiant Siret</label>
<?=$this->SiretTexte($this->siret)?>
</div>
<div class="clearfix">
<label>Raison Sociale</label>
<?=$this->raisonSociale?>
</div>
2012-09-13 14:43:14 +00:00
</div>
<div class="paragraph">
<?php if ($this->infos) {?>
<div class="tabbed_area">
<ul class="tabs">
<?php foreach ($this->ancres as $id => $name):?>
<li><a href="#<?=$id?>" title="<?=$name?>" class="tab"><?=$name?></a></li>
<?php endforeach;?>
</ul>
</div>
<div class="content">
<?php
if ($this->typeBilan=='N' || $this->typeBilan=='C') {
echo $this->partial('saisie/liasse/2050.phtml');
} elseif ($this->typeBilan=='S') {
echo $this->partial('saisie/liasse/2033.phtml');
}
?>
</div>
<div id="saveMsg" style="text-align:center;"></div>
<div style="text-align:center;"><input type="submit" class="button" id="save" name="save" value="Enregistrer" /></div>
<?=$this->partial()->view->inlineScript();?>
2012-09-13 14:43:14 +00:00
<script>
$('input#save').click(function(e){
e.preventDefault();
var strPostes = '';
$('span.poste').each(function(){
id = $(this).attr('id');
val = $(this).html();
if (val != id && val != '' && val != '-') {
if (strPostes!='') strPostes = strPostes + ';';
strPostes = strPostes + id + '=' + val;
}
});
$('input#save').css('display', 'none');
$('div#saveMsg').html('Enregistrement en cours....');
$.post('/saisie/liassesave/siren/<?=$this->siren?>', {
unite: $('span#unit').html(),
dateCloture: $('span#dateCloture').html(),
dureeMois: $('span#dureeMois').html(),
dateCloturePre: $('span#dateCloturePre').html(),
dureeMoisPre: $('span#dureeMoisPre').html(),
typeBilan: $('span#typeBilan').html(),
postes: strPostes
}, function(data) {
$('span.postes').addClass('editable-change');
2012-09-13 14:43:14 +00:00
if (data.status=='OK') {
$('div#saveMsg').html('Bilan modifié.');
} else if (data.status=='ERR' && data.postes.length>0) {
for (i in data.postes) {
$('span#'+data.postes[i]).removeClass('editable-change').addClass('editable-error');
2012-09-13 14:43:14 +00:00
}
$('div#saveMsg').html(data.message);
$('input#save').css('display', 'block');
} else if (data.status=='ERR') {
$('div#saveMsg').html(data.message);
$('input#save').css('display', 'block');
} else {
$('div#saveMsg').html('Error');
$('input#save').css('display', 'block');
}
}, 'json'
).error(function(){
$('div#saveMsg').html('Error');
$('input#save').css('display', 'block');
});
});
$('span.unit').editable(function(value, settings) {
return value;
}, {
data : " {'U':'&euro;','K':'K&euro;','M':'M&euro;'}",
type : 'select',
tooltip : 'Click to edit',
});
$('span.dateCloture').editable(function(value, settings) {
if ( isInteger(value) && value.length==8 ) {
$(this).addClass('editable-change');
var objectName = $(this).attr('id');
var objectUp = objectName.charAt(0).toUpperCase()+objectName.substring(1);
$('span.table'+objectUp).html(value);
return value;
}
}, {
tooltip : 'Click to edit',
});
$('span.duree').editable(function(value, settings) {
if ( isInteger(value) && value.length<3 ) {
$(this).addClass('editable-change');
var objectName = $(this).attr('id');
var objectUp = objectName.charAt(0).toUpperCase()+objectName.substring(1);
$('span.table'+objectUp).html(value);
return value;
}
}, {
tooltip : 'Click to edit',
});
$('span.poste').editable(function(value, settings) {
if ( isInteger(value) ) {
$(this).addClass('editable-change');
return value;
}
return $(this).attr('id');
}, {
tooltip : 'Click to edit',
}).click(function(){ $(this).find('input').select(); });
$('span.poste').bind('keydown', function(e) {
if(e.keyCode==9 || e.keyCode==13) {
$(this).find('form').submit();
var nextBox='';
var currentBoxIndex=$('span.poste').index(this);
if (currentBoxIndex == ($('span.poste').length-1)) {
nextBox=$('span.poste:first'); //last box, go to first
} else {
nextBox=$('span.poste').eq(currentBoxIndex+1); //Next box in line
}
$(this).find('input').blur();
$(nextBox).click().find('input').select(); //Go to assigned next box
return false; //Suppress normal keypress
};
});
function isInteger(number)
{
var exp = new RegExp("^[0-9]+$","g");
return exp.test(number);
}
2012-09-13 14:43:14 +00:00
</script>
<?php } else {?>
Aucune sélection.
<?php }?>
</div>
2012-06-08 13:18:09 +00:00
</div>