Correction

This commit is contained in:
Michael RICOIS 2013-01-14 16:52:10 +00:00
parent dbfaad4eea
commit 5383139da4
4 changed files with 72 additions and 71 deletions

View File

@ -140,6 +140,8 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
$view->admin = true;
}
Zend_Registry::get('firebug')->info($identity);
if (Zend_Session::namespaceIsset('login')){
Zend_Session::namespaceUnset('login');
}

View File

@ -35,7 +35,7 @@ class Ciblage
*/
public function __construct($structure = null, $filterRNCS = 0)
{
if ($filterRNCS===true) {
if ($filterRNCS==1) {
$this->filterRNCS();
}
@ -193,15 +193,15 @@ class Ciblage
$maxMatches = $nbReturn;
$this->sphinx->SetSortMode( SPH_SORT_EXTENDED, '@random' );
}
$this->sphinx->SetLimits(0, $limit, $maxMatches);
$resSphinx = $this->sphinx->Query($this->alpha, $this->index);
//Make an array with only the data needed
$return = $this->getSiret($resSphinx);
$total = $resSphinx['total_found'];
if ( $nbReturn == 0 && $limit<$total ) {
$max = ceil($total/$limit);
//Get siret by $limit units for each request
@ -229,7 +229,7 @@ class Ciblage
return $resSphinx['total_found'];
}
}
/**
*
* @param unknown $key
@ -242,21 +242,21 @@ class Ciblage
//Read min max
$minmaxM = new Application_Model_MinMax();
$minmax = $minmaxM->find($key)->current();
if ($minmax!==false) {
$valMin = $minmax->min;
$valMax = $minmax->max;
}
$min = ($min=='' || $min===null) ? $valMin : $min;
$max = ($max=='' || $min===null) ? $valMax : $max;
return array(
'min' => $min,
'max' => $max,
);
}
/**
*
* @param unknown_type $value
@ -370,7 +370,7 @@ class Ciblage
$result = $this->minmax('nbActio', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
@ -381,11 +381,11 @@ class Ciblage
protected function nbPart($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('nbPart', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
@ -396,11 +396,11 @@ class Ciblage
protected function nbMPubli($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('nbMPubli', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
@ -411,11 +411,11 @@ class Ciblage
protected function capital($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('capital', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
@ -426,11 +426,11 @@ class Ciblage
protected function age_entrep($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('age_entrep', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
@ -441,11 +441,11 @@ class Ciblage
protected function age_etab($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('age_etab', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
@ -477,11 +477,11 @@ class Ciblage
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('eff_etab', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
@ -493,11 +493,11 @@ class Ciblage
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('eff_entrep', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
@ -508,11 +508,11 @@ class Ciblage
protected function nbEtab($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('nbEtab', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
@ -638,7 +638,7 @@ class Ciblage
$this->setFilter('avisCs', $value['ex'], true);
}
}
protected function bilDuree($value)
{
if ( array_key_exists('in', $value) ) {
@ -662,14 +662,14 @@ class Ciblage
protected function bilEE($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('bilEE', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
$this->setFilterRange('bilEE', $min, $max);
}
}
@ -677,14 +677,14 @@ class Ciblage
protected function bilFL($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('bilFL', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
$this->setFilterRange('bilFL', $min, $max);
}
}
@ -692,14 +692,14 @@ class Ciblage
protected function bilFK($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('bilFK', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
$this->setFilterRange('bilFK', $min, $max);
}
}
@ -707,11 +707,11 @@ class Ciblage
protected function bilFR($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('bilFR', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
@ -722,14 +722,14 @@ class Ciblage
protected function bilGF($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('bilGF', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
$this->setFilterRange('bilGF', $min, $max);
}
}
@ -737,14 +737,14 @@ class Ciblage
protected function bilGP($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('bilGP', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
$this->setFilterRange('bilGP', $min, $max);
}
}
@ -752,14 +752,14 @@ class Ciblage
protected function bilGW($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('bilGW', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
$this->setFilterRange('bilGW', $min, $max);
}
}
@ -767,14 +767,14 @@ class Ciblage
protected function bilHD($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('bilHD', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
$this->setFilterRange('bilHD', $min, $max);
}
}
@ -782,14 +782,14 @@ class Ciblage
protected function bilHH($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('bilHH', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
$this->setFilterRange('bilHH', $min, $max);
}
}
@ -797,14 +797,14 @@ class Ciblage
protected function bilHL($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('bilHL', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
$this->setFilterRange('bilHL', $min, $max);
}
}
@ -812,14 +812,14 @@ class Ciblage
protected function bilHM($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('bilHM', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
$this->setFilterRange('bilHM', $min, $max);
}
}
@ -827,14 +827,14 @@ class Ciblage
protected function bilHN($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('bilHN', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
$this->setFilterRange('bilHN', $min, $max);
}
}
@ -842,14 +842,14 @@ class Ciblage
protected function bilYP($value)
{
if ( array_key_exists('in', $value) ) {
$result = $this->minmax('bilYP', $value['in'][0], $value['in'][1]);
$min = $result['min'];
$max = $result['max'];
if ($min===null || $max===null)
return;
$this->setFilterRange('bilYP', $min, $max);
}
}
@ -1072,24 +1072,24 @@ class Ciblage
}
}
}
protected function codesinsee($value)
{
if ( array_key_exists('in', $value) && is_array($value['in']) && count($value['in'])>0 ) {
$this->setFilter('codeCommune', $value['in']);
}
if ( array_key_exists('ex', $value) && is_array($value['ex']) && count($value['ex'])>0 ) {
$this->setFilter('codeCommune', $value['ex'], true);
}
}
protected function codespostaux($value)
{
if ( array_key_exists('in', $value) && is_array($value['in']) && count($value['in'])>0 ) {
$this->setFilter('adr_cp', $value['in']);
}
if ( array_key_exists('ex', $value) && is_array($value['ex']) && count($value['ex'])>0 ) {
$this->setFilter('adr_cp', $value['ex']);
}

View File

@ -84,7 +84,6 @@ $(document).ready(function()
select: function( event, ui ) {
if (ui.item.value != '') {
var name = $(this).parent().find('input.criteres').attr('name');
alert(name);
var selectObject = $('ul.selectqueries#'+name);
var oldhtml = selectObject.html();
var newhtml = '<li name="' + ui.item.value + '">' + ui.item.label + '</li>';

View File

@ -66,5 +66,5 @@ $result = $commandesM->fetchAll($sql);
if (count($result)>0) {
$info = $result->current();
echo "Lancement enrichissement $info->id\n";
exec('php '.realpath(dirname(__FILE__))."/enrichissement.php --id ".$info->id." &");
exec('php '.realpath(dirname(__FILE__))."/scripts/jobs/enrichissement.php --id ".$info->id." &");
}