Merge from trunk
This commit is contained in:
commit
13dc936b6c
@ -240,7 +240,8 @@ class ComptageController extends Zend_Controller_Action
|
||||
try {
|
||||
$dbMetier = Zend_Db::factory($dbConfig->jo);
|
||||
} catch ( Exception $e ) {
|
||||
exit ( $e->getMessage() );
|
||||
//@todo : Changer le message d'erreur
|
||||
exit ( $e->getMessage() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -240,11 +240,11 @@ class DashboardController extends Zend_Controller_Action
|
||||
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
|
||||
)
|
||||
->join(
|
||||
array('c' => 'comptages'), 'i.idComptage = c.id',
|
||||
array('c' => 'ciblage_comptages'), 'i.idComptage = c.id',
|
||||
array('')
|
||||
)
|
||||
->join(
|
||||
array('criteres' => 'criteres'), 'i.idCriteres = criteres.id',
|
||||
array('criteres' => 'ciblage_criteres'), 'i.idCriteres = criteres.id',
|
||||
array('')
|
||||
);
|
||||
$sql->where('i.dateStop = ?', 0)
|
||||
@ -262,11 +262,11 @@ class DashboardController extends Zend_Controller_Action
|
||||
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
|
||||
)
|
||||
->join(
|
||||
array('c' => 'comptages'), 'i.idComptage = c.id',
|
||||
array('c' => 'ciblage_comptages'), 'i.idComptage = c.id',
|
||||
array('')
|
||||
)
|
||||
->join(
|
||||
array('criteres' => 'criteres'), 'i.idCriteres = criteres.id',
|
||||
array('criteres' => 'ciblage_criteres'), 'i.idCriteres = criteres.id',
|
||||
array('')
|
||||
);
|
||||
$sql->where('criteres.idClient = ?', $user->idClient)
|
||||
@ -308,9 +308,39 @@ class DashboardController extends Zend_Controller_Action
|
||||
$this->view->assign('prefInterface'.ucfirst($name), $value);
|
||||
}
|
||||
}
|
||||
|
||||
$timestamp = strtotime( $user->dateContrat );
|
||||
$dateBegin = date( 'd/m/Y', $timestamp );
|
||||
|
||||
$timestamp = mktime(0,0,0,substr($dateBegin,3,2)+$user->periodContrat,substr($dateBegin,0,2), substr($dateBegin,6,4));
|
||||
$dateEnd = date( 'd/m/Y', $timestamp );
|
||||
|
||||
$this->view->assign('dateBegin', $dateBegin);
|
||||
$this->view->assign('dateEnd', $dateEnd);
|
||||
|
||||
//Customer params have an option on the RNCS filter
|
||||
$this->view->assign('filterRNCS', $user->filterRNCS);
|
||||
$this->view->assign('licenceINSEE', $user->licenceINSEE);
|
||||
$this->view->assign('immediatExtract', $user->immediatExtract);
|
||||
|
||||
$tarifText = '';
|
||||
//Tarifs
|
||||
if ($user->forfait!=0) {
|
||||
//Forfait de
|
||||
$tarifText = 'Forfait de '.$user->forfait.' euros';
|
||||
} else {
|
||||
$tarifText = 'Tarif unitaire à la ligne de '.$user->priceLine.' euros';
|
||||
}
|
||||
|
||||
//Paramètres
|
||||
if ( $user->limitFiles!=0 && $user->limitLines!=0 ) {
|
||||
$tarifText.= ' limité à '.$user->limitFiles.' fichiers et à '.$user->limitLines.' lignes par fichier.';
|
||||
} elseif ( $user->limitFiles!=0 && $user->limitLines==0 ) {
|
||||
$tarifText.= ' limité à '.$user->limitFiles.' fichiers';
|
||||
} elseif ( $user->limitFiles==0 && $user->limitLines!=à ) {
|
||||
$tarifText.= ' limité à '.$user->limitLines.' lignes par fichier.';
|
||||
}
|
||||
$this->view->assign('tarifText', $tarifText);
|
||||
|
||||
//List of data to extract
|
||||
$profilsM = new Application_Model_EnrichissementProfils();
|
||||
@ -331,7 +361,6 @@ class DashboardController extends Zend_Controller_Action
|
||||
}
|
||||
$profil = new stdClass();
|
||||
$profil->labels = $profilLabels;
|
||||
$profil->tarif = $result['tarifLigne'];
|
||||
$profil->reference = $result['reference'];
|
||||
$this->view->assign('profil', $profil);
|
||||
}
|
||||
|
@ -13,12 +13,14 @@
|
||||
<div id="dashboard">
|
||||
|
||||
<h2>Paramètres de votre compte</h2>
|
||||
<p>Licence INSEE : paiement à chaque extraction, non comptabilisé (déjà licencié)</p>
|
||||
<p>Filtre RNCS : actif, désactiver</p>
|
||||
<p>Extraction possible de xxx lignes, nombre de fichiers illimités sur la durée du contrat</p>
|
||||
<p>Extraction possible de xxx lignes par fichier, nombre de fichiers maximums x sur la durée du contrat</p>
|
||||
<p>Service ouvert du <?=$this->dateBegin?> au <?=$this->dateEnd?></p>
|
||||
<p><?=$this->tarifText?></p>
|
||||
<p>Licence INSEE :<?php if ($this->licenceINSEE) {?> Non comptabilisé (déjà licencié)<?php } else {?> Paiement à chaque extraction.<?php }?></p>
|
||||
<p>Filtre RNCS :<?php if ($this->filterRNCS) {?> Filtrer au seul paramètre RNCS.<?php } else {?> Aucun filtre.<?php }?></p>
|
||||
<p>Extraction de fichier : <?php if ($this->immediatExtract) {?>Immédiat<?php } else { ?>Différé<?php }?></p>
|
||||
|
||||
<br/>
|
||||
|
||||
<h2>Préférences d'affichage</h2>
|
||||
<p>
|
||||
L'application permet la modification de l'affichage des critères de ciblage afin de permettre une
|
||||
@ -44,6 +46,7 @@ Activer le mode personnalisation
|
||||
<?php }?>
|
||||
|
||||
<br/>
|
||||
|
||||
<div>
|
||||
<label>Afficher le nombre d'unité INSEE</label><br/>
|
||||
<span><i>Pour permettre une estimation du cout de la redevance INSEE, en activant cette option,
|
||||
@ -63,11 +66,10 @@ $('input[type=checkbox]').click(function(){
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<h2>Profils d'enrichissement</h2>
|
||||
|
||||
<?php if ($this->profil) {?>
|
||||
<p>Référence : <?=$this->profil->reference?></p>
|
||||
<p>Tarif à la ligne (redevance INSEE non inclus) : <?=$this->profil->tarif?> euros</p>
|
||||
<p>Liste des données extraites lors d'un enrichissement</p>
|
||||
<?php foreach($this->profil->labels as $label) {?>
|
||||
<?=$label?><br/>
|
||||
|
@ -56,7 +56,7 @@ class Ciblage
|
||||
$configuration->sphinx->host,
|
||||
intval($configuration->sphinx->port)
|
||||
);
|
||||
$this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED2);
|
||||
$this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED);
|
||||
$this->sphinx->ResetFilters();
|
||||
|
||||
//Follow each elements
|
||||
@ -191,23 +191,25 @@ class Ciblage
|
||||
$maxMatches = 50000;
|
||||
|
||||
if ( $nbReturn > 0 ) {
|
||||
$limit = $maxMatches = $nbReturn;
|
||||
$limit = $nbReturn;
|
||||
$maxMatches = $nbReturn;
|
||||
$this->sphinx->SetSortMode( SPH_SORT_EXTENDED, '@random' );
|
||||
}
|
||||
|
||||
|
||||
$this->sphinx->SetLimits(0, $limit, $maxMatches);
|
||||
$resSphinx = $this->sphinx->Query($this->alpha, $this->index);
|
||||
|
||||
$total = $resSphinx['total_found'];
|
||||
|
||||
|
||||
//Make an array with only the data needed
|
||||
$return = $this->getSiret($resSphinx);
|
||||
|
||||
if ( $limit<$total ) {
|
||||
$total = $resSphinx['total_found'];
|
||||
|
||||
if ( $nbReturn == 0 && $limit<$total ) {
|
||||
$max = ceil($total/$limit);
|
||||
//Get siret by $limit units for each request
|
||||
for($i=1; $i<$max; $i++){
|
||||
$offset = $i*$limit;
|
||||
$this->sphinx->SetLimits($offset, $limit, $maxMatches);
|
||||
$this->sphinx->SetLimits($offset, $limit);
|
||||
$resSphinx = $this->sphinx->Query($this->alpha, $this->index);
|
||||
$tmpSiret = $this->getSiret($resSphinx);
|
||||
$return = array_merge($return, $tmpSiret);
|
||||
@ -898,25 +900,6 @@ class Ciblage
|
||||
$req.= '('.implode('|', $valueIn).')';
|
||||
}
|
||||
if ( count($valueEx)>0 ) {
|
||||
/*
|
||||
if (empty($req)) {
|
||||
//Get all NAFs and remove excluded
|
||||
$nafM = new Application_Model_Naf();
|
||||
$sql = $nafM->select()->from($nafM, array('code'))->where('niveau = 5');
|
||||
$allnaf = $nafM->fetchAll($sql)->toArray();
|
||||
$tmp = array();
|
||||
foreach($allnaf as $code => $naf) {
|
||||
$tmp[] = $naf['code'];
|
||||
}
|
||||
Zend_Registry::get('firebug')->info($tmp);
|
||||
$value = array_diff($tmp, $valueEx);
|
||||
$req.= '('.implode('|', $value).')';
|
||||
|
||||
|
||||
} else {
|
||||
//only exclude
|
||||
$req.= ' -('.implode('|', $valueEx).')';
|
||||
}*/
|
||||
if (empty($req)) {
|
||||
$req = 'EX ';
|
||||
}
|
||||
|
@ -815,7 +815,7 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
//Do some operation on value
|
||||
$types = array_keys($this->fields[$key]['fields']);
|
||||
|
||||
if ( !is_array($value) && !in_array($types[0], array('select', 'checkbox', 'interval')) ) {
|
||||
if ( !is_array($value) && !in_array($types[0], array('select', 'checkbox', 'interval', 'intervalDate')) ) {
|
||||
//Remove all space in string value
|
||||
$value = str_replace(' ', '', $value);
|
||||
//Try to detect separator and transform as array
|
||||
@ -834,10 +834,10 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
}
|
||||
}
|
||||
|
||||
if ( in_array($types[0], array('interval')) ) {
|
||||
if ( in_array($types[0], array('interval', 'intervalDate')) ) {
|
||||
$value = explode(',', $value);
|
||||
}
|
||||
|
||||
|
||||
//Remove duplicate values
|
||||
if (is_array($value) ) {
|
||||
$value = array_unique($value);
|
||||
@ -845,6 +845,9 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
|
||||
//Before to save the value
|
||||
switch ( $types[0] ) {
|
||||
case 'intervalDate':
|
||||
unset($this->ciblage[$sessionKey]['in']);
|
||||
break;
|
||||
case 'interval':
|
||||
//@todo : Check Min Max
|
||||
//@todo : Check Number => A préciser dans Fields
|
||||
@ -869,9 +872,9 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
Zend_Registry::get('firebug')->info($value);
|
||||
$this->ciblage[$sessionKey]['ex'] = $value;
|
||||
} else {
|
||||
Zend_Registry::get('firebug')->info('Include: ');
|
||||
Zend_Registry::get('firebug')->info($value);
|
||||
$this->ciblage[$sessionKey]['in'] = $value;
|
||||
Zend_Registry::get('firebug')->info('Include: ');
|
||||
Zend_Registry::get('firebug')->info($value);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user