Amélioration

This commit is contained in:
Michael RICOIS 2015-07-29 08:23:09 +00:00
parent 1a59c9894c
commit 1ec1072353
6 changed files with 25 additions and 19 deletions

View File

@ -26,12 +26,12 @@ class Scores_Ciblage_Field_One
if ( $value === '' ) {
if ( count($valueSelected['in']) == 0 ) {
$class = ' btn-primary active';
$class = ' btn-default active';
}
}
if ($valueSelected != null) {
if ( count($valueSelected['in']) != 0 && $valueSelected['in'][0] == $value ) {
$class = ' btn-primary active';
$class = ' btn-default active';
}
}

View File

@ -653,12 +653,12 @@ class Scores_Ciblage_FieldList
if ( $valueSelected !== null ) {
if ( count($valueSelected['in']) > 0 ) {
$html.= '<span class="label label-success pull-right" title="Des valeurs sont incluses dans votre sélection">'.
'<span class="glyphicon glyphicon-plus" aria-hidden="true"></span></span>';
$html.= '<button type="button" class="btn btn-success btn-xs pull-right" data-toggle="tooltip" title="Des valeurs sont incluses dans votre sélection">'.
'<span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>';
}
if (count($valueSelected['ex']) > 0 ) {
$html.= '<span class="label label-warning pull-right" title="Des valeurs sont excluses de votre sélection">'.
'<span class="glyphicon glyphicon-moins" aria-hidden="true"></span></span>';
$html.= '<button type="button" class="btn btn-warning btn-xs pull-right" data-toggle="tooltip" title="Des valeurs sont excluses de votre sélection">'.
'<span class="glyphicon glyphicon-moins" aria-hidden="true"></span></button>';
}
}

View File

@ -13,10 +13,12 @@ $(document).ready(function(){
set(key, values);
});
$('div.ciblage-range button').click(function(e){
$('div.ciblage-range').parent().find('button').click(function(e){
e.preventDefault();
var key = $(this).data('ciblagename');
console.log(key);
var values = $('#slider-'+key).val();
console.log(values);
set(key, values);
});
@ -114,24 +116,16 @@ $(document).ready(function(){
function set(key, value, ex) {
ex = typeof ex !== 'undefined' ? ex : 0;
$('div#panel div.sidebar').html('<span class="glyphicon glyphicon-refresh img-rounded"></span>');
var isCount = false;
$.post('/comptage/index', { cle:key, valeur:value, exclude:ex }, function(data, status) {
$('div#panel p#comptage').prepend('<p><span class="glyphicon glyphicon-refresh img-rounded"></span> Chargement...</p>');
$.post('/comptage/index', { cle:key, valeur:value, exclude:ex }, function(data, status) {
if (data.error==1) {
$('div#actionMessage').html('<div class="alert alert-danger"><strong>Erreur !</strong> Un problème technique est survenu.</div>');
isCount = false;
}
if (data.error==2) {
$('div#actionMessage').html('<div class="alert alert-warning"><strong>Information !</strong> Valeur saisi incorrecte.</div>');
isCount = false;
}
isCount = true;
//Resume criteres content
if (isCount) {
$.post('/index/criteres', { total:data.count, insee:data.insee }, function(data) { $('#panel').html(data); });
}
$.post('/index/criteres', { total:data.count, insee:data.insee }, function(data) { $('#panel').html(data); });
}, 'json').error(function(){
$('div#actionMessage').html('<div class="alert alert-danger"><strong>Erreur !</strong> Un problème inconnu est survenu.</div>');
isCount = false;
});
}

View File

@ -1,6 +1,6 @@
$(document).ready(function(){
resizeTabContent();
$('[data-toggle="tooltip"]').tooltip()
$('div#dialog').on('hidden.bs.modal', function () {
$(this).removeData('bs.modal');
$(this).find('div.modal-dialog').remove();

View File

@ -50,6 +50,16 @@ div.ciblage-tag-items span.label {
margin:2px;
}
div#tabs {
padding-left:5px;
padding-right:5px;
}
div#panel {
padding-left:5px;
padding-right:5px;
}
div#tabs li.list-group-item {
cursor:pointer;
}

View File

@ -0,0 +1,2 @@
# --- Lancement enrichissement
*/5 * * * * www-data php {VHOSTPATH}/scripts/jobs/enrichissement.php --cron >> {DATAPATH}/log/enrichissement.log 2>&1