2012-09-21 10:13:07 +00:00
< style >
.editable { background-color:#30A5FF; }
.editable-error { background-color:#FF0000; }
.editable-change { background-color:#89FF30; }
span.unit select { width:50px; }
2012-09-24 08:12:57 +00:00
span.poste { min-width:50px; color:black; display:block; width:100%; }
2012-09-21 10:13:07 +00:00
span.poste input { width:50px; }
< / style >
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é 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 >
2012-09-27 14:08:24 +00:00
< h2 > Liasse< / h2 >
2012-09-13 14:43:14 +00:00
< div class = "paragraph" >
<?php if ( $this -> infos ) { ?>
< 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 >
2012-09-21 19:40:45 +00:00
< div style = "text-align:center;" >
2012-09-27 14:08:24 +00:00
< input type = "submit" class = "button" id = onlycheck name = "onlycheck" value = "Verifier" / >
< input type = "submit" class = "button" id = "normal" name = "normal" value = "Publier" / >
2012-09-28 07:14:39 +00:00
< input style = "display:none;" type = "submit" class = "button" id = "nocheck" name = "nocheck" value = "Forcer" / >
2012-09-21 19:40:45 +00:00
< / div >
2012-09-19 19:31:39 +00:00
<? = $this -> partial () -> view -> inlineScript (); ?>
2012-09-13 14:43:14 +00:00
< script >
2012-09-27 14:08:24 +00:00
$(document).ready(function(){
$.datepicker.setDefaults( $.datepicker.regional['fr'] );
});
2012-09-19 19:31:39 +00:00
$('span.unit').editable(function(value, settings) {
return value;
}, {
2012-09-27 14:08:24 +00:00
data : "{'U':'€ ','K':'K€ ','M':'M€ '}",
2012-09-19 19:31:39 +00:00
type : 'select',
tooltip : 'Click to edit',
});
2012-09-27 14:08:24 +00:00
$('input.dateCloture').datepicker();
2012-09-19 19:31:39 +00:00
$('span.duree').editable(function(value, settings) {
2012-10-08 15:23:19 +00:00
if ( isFloat(value) & & value.length< 3 ) {
2012-09-19 19:31:39 +00:00
$(this).addClass('editable-change');
return value;
}
}, {
2012-09-27 14:08:24 +00:00
data : "{'1':'1','2':'2','3':'3','4':'4','5':'5','6':'6','7':'7','8':'8','9':'9','10':'10','11':'11','12':'12','13':'13','14':'14','15':'15','16':'16','17':'17','18':'18','19':'19','20':'20','21':'21','22':'22','23':'23'}",
type : 'select',
2012-09-19 19:31:39 +00:00
tooltip : 'Click to edit',
});
$('span.poste').editable(function(value, settings) {
2012-09-21 16:06:51 +00:00
var id = $(this).attr('id')
2012-10-08 15:23:19 +00:00
if ( isFloat(value) & & id!=value ) {
2012-09-19 19:31:39 +00:00
$(this).addClass('editable-change');
return value;
}
2012-09-21 16:06:51 +00:00
$(this).removeClass('editable-change').addClass('editable');
return id;
2012-09-19 19:31:39 +00:00
}, {
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
};
});
2012-09-21 19:40:45 +00:00
$('input#onlycheck').click(function(e){
e.preventDefault();
$('div#saveMsg').html('Vérification en cours....');
sendInfo('onlycheck');
});
$('input#normal').click(function(e){
e.preventDefault();
$('div#saveMsg').html('Enregistrement en cours....');
sendInfo('normal');
});
$('input#nocheck').click(function(e){
e.preventDefault();
$('div#saveMsg').html('Enregistrement en cours....');
sendInfo('nocheck');
});
function sendInfo(step)
{
$('input#'+step).css('display', 'none');
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;
}
});
$.post('/saisie/liassesave/siren/<? = $this -> siren ?> ', {
step: step,
unite: $('span#unit').html(),
2012-09-27 14:08:24 +00:00
dateCloture: $('input#dateCloture').val(),
2012-09-21 19:40:45 +00:00
dureeMois: $('span#dureeMois').html(),
2012-09-27 14:08:24 +00:00
dateCloturePre: $('input#dateCloturePre').val(),
2012-09-21 19:40:45 +00:00
dureeMoisPre: $('span#dureeMoisPre').html(),
typeBilan: $('span#typeBilan').html(),
postes: strPostes
}, function(data) {
$('span.editable-error').addClass('editable-change').removeClass('editable-error');
if (data.status=='OK') {
var msg = 'Bilan saisie.';
if (step == 'onlycheck') {
msg = 'Vérification OK.';
2012-09-21 20:05:02 +00:00
$('input#'+step).css('display', 'block');
2012-09-21 19:40:45 +00:00
}
$('div#saveMsg').html('Bilan saisie.');
} else {
var msg='Unknow Error';
if (data.status=='ERR') {
if (data.postes.length>0) {
for (i in data.postes) {
$('span#'+data.postes[i]).removeClass('editable-change').addClass('editable-error');
}
2012-10-08 15:23:19 +00:00
var offset = $('span#'+data.postes[i]).offset();
window.scrollTo(window.scrollX, offset.top);
2012-09-21 19:40:45 +00:00
}
msg=data.message;
}
$('div#saveMsg').html(msg);
2012-09-28 07:14:39 +00:00
if (step=='normal') { $('input#nocheck').css('display', 'inline'); }
$('input#'+step).css('display', 'inline');
2012-09-21 19:40:45 +00:00
}
}, 'json'
).error(function(){
$('div#saveMsg').html('Error Timeout');
$('input#'+step).css('display', 'block');
});
}
2012-09-19 19:31:39 +00:00
function isInteger(number)
{
2012-09-20 14:01:50 +00:00
var exp = new RegExp("^[\-0-9]+$","g");
2012-09-19 19:31:39 +00:00
return exp.test(number);
}
2012-10-08 15:23:19 +00:00
function isFloat(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 >