formulaire de validation de comptage prédéfini et bouton popup associé

This commit is contained in:
Damien LASSERRE 2012-04-13 09:36:57 +00:00
parent 75c0391a19
commit a65a9fc2a2
4 changed files with 56 additions and 45 deletions

View File

@ -4,32 +4,13 @@ Vous n'avez pas sélectionné de critères !
<div id="result">
<form method="post" id="save" name="save" action="<?=$this->url(array('controller'=>'comptage', 'action'=>'save'))?>">
<label>Votre référence</label>
<input type="text" name="ref" value="" />
<input type="submit" name="submit" value="Enregistrer">
<center>
<label>Votre référence</label><br />
<input type="text" name="ref" value="<?=date('Y-m-d:H-i-m').'_'.uniqid()?>" />
</form>
<span class="message" style="color:#ff0000;"></span>
</center>
</div>
<script type="text/javascript" src="/themes/default/scripts/jquery.form.js"></script>
<script>
$('form#save').bind('submit', function(){
var options = {
target: '#result',
dataType: 'json',
beforeSubmit: function(){},
success: function(data){
if (data.error == 0){
$('#result').html(data.msg);
$(location).attr('href','/dashboard/ciblage/id/'+data.id);
} else {
$('#result span.message').html(data.msg);
}
}
};
$(this).ajaxSubmit(options);
return false;
});
</script>
<?php endif;?>

View File

@ -440,6 +440,42 @@ Class Fields
'action' => 'geographique',
'title' => 'Localisation'
),
'ex_domtom' => array(
'label' => 'Exclusion des Dom-Tom',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
),
'famille' => 'geographique',
'activated' => true,
'type' => 'select',
'class' => null,
'action' => 'geographique',
'title' => 'Localisation'
),
'ex_entr' => array(
'label' => 'Exclusion départements étrangés',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
),
'famille' => 'geographique',
'activated' => true,
'type' => 'select',
'class' => null,
'action' => 'geographique',
'title' => 'Localisation'
),
'ex_corse' => array(
'label' => 'Exclusion corse',
'fields' => array(
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
),
'famille' => 'geographique',
'activated' => true,
'type' => 'select',
'class' => null,
'action' => 'geographique',
'title' => 'Localisation'
),
'adr_reg' => array(
'label' => 'Liste code région',
'fields' => array(

View File

@ -180,28 +180,6 @@ $(document).ready(function()
window.location.replace('/');
});
$('.saveciblage').on('click', function(){
var title = 'Sauvegarde du profil de ciblage';
var href = $(this).attr('href');
var dialogOpts = {
bgiframe: true,
title: title,
width: 500,
height: 200,
modal: true,
open: function(event, ui) {
$(this).html('Chargement...');
$(this).load(href);
},
buttons: {
Annuler: function() { $(this).dialog('close'); }
},
close: function() { $('#dialogsaveciblage').remove(); }
};
$('<div id="dialogsaveciblage"></div>').dialog(dialogOpts);
return false;
});
$('.checkbox_ex').click(function(){
if($(this).is(':checked')) {
$('#'+$(this).attr('name')+'_in').css('display', 'none');

View File

@ -19,6 +19,22 @@ $(document).ready(function(){
$(this).load(href);
},
buttons: {
Valider : function(){
var options = {
target: '#result',
dataType: 'json',
beforeSubmit: function(){},
success: function(data){
if (data.error == 0){
$('#result').html(data.msg);
$(location).attr('href','/dashboard/ciblage/id/'+data.id);
} else {
$('#result span.message').html(data.msg);
}
}
};
$('form#save').ajaxSubmit(options);
},
Annuler: function() { $(this).dialog('close'); }
},
close: function() { $('#dialogsaveciblage').remove(); }