Correction mise en surveillance

This commit is contained in:
Michael RICOIS 2013-03-25 10:03:09 +00:00
parent c81690903d
commit 13e136dc77
2 changed files with 25 additions and 12 deletions

View File

@ -81,16 +81,19 @@ echo $this->partial('identite/fiche-item.phtml', $this->dBlock['EffectifEtab']);
</table>
</div>
<?php if (empty($this->AutrePage)):?>
<?php if (empty($this->AutrePage)) {?>
<?=$this->action('geo', 'identite', null, array('infos' => $this->infos));?>
<?=$this->action('news', 'identite');?>
<?php endif;?>
<?php if (!empty($this->surveillance)):?>
<?php if (!empty($this->surveillance)) {?>
<div class="paragraph" style="clear:both;">
<?=$this->action('infos','surveillance', null, array('siret' => $this->siret))?>
</div>
<?php endif;?>
<?php }?>
<?php }?>
<?php if (empty($this->AutrePage)):?>
<?=$this->render('cgu.phtml', $this->cgu)?>

View File

@ -46,12 +46,12 @@ $('#dialogsurv').dialog({ buttons: [ {
<label>Types</label>
<div class="field">
<?php foreach($this->source as $s) { ?>
<input type="checkbox" name="source[]" value="<?=$s['id']?>"<?=$s['checked']?>/>&nbsp;<?=$s['txt']?><br/>
<input type="checkbox" name="source" value="<?=$s['id']?>"<?=$s['checked']?>/>&nbsp;<?=$s['txt']?><br/>
<?php } ?>
</div>
</div>
<?php } else { ?>
<input name="source[]" type="hidden" value="<?=$this->source?>"/>
<input name="source" type="hidden" value="<?=$this->source?>"/>
<?php } ?>
@ -93,15 +93,25 @@ function survSubmit(){
var encours = $('input[name=encours]').val();
var email = $('input[name=email]').val();
var source = [];
$('input[type=checkbox]').each(function(){
//Multiple source
$('input[type=checkbox][name=source]').each(function(){
if(this.checked){ source.push($(this).val()); }
});
//Unique source
if (source.length==0) {
source.push($('input[name=source]').val());
}
$('#frmSurv').replaceWith('<div id="frmSurv">Mise sous surveillance en cours...</div>');
if (source.length>0) {
$.each( source, function( key, value ) {
$.post(action, {siret: siret, ref: ref, email: email, encours: encours, source: value} ,
function(data) { $('#frmSurv').append('<br/>'+data);
}, 'text');
});
} else {
$('#frmSurv').replaceWith('<div id="frmSurv">Aucune source !</div>');
}
$('#dialogsurv').dialog({ buttons: [
{ text: "Fermer", click: function() { window.location.href = windowhref; } }
]});