diff --git a/application/controllers/ComptageController.php b/application/controllers/ComptageController.php index 2c9bf66c..559fdfa8 100644 --- a/application/controllers/ComptageController.php +++ b/application/controllers/ComptageController.php @@ -234,19 +234,7 @@ class ComptageController extends Zend_Controller_Action //Comptage require_once 'Scores/Ciblage.php'; $ciblage = new Ciblage($fields->getValues(), $user->globalRNCS); - $sirets = $ciblage->execute(true, 10); - - $c = Zend_Registry::get('config'); - try { - $dbMetier = Zend_Db::factory($c->profil->db->jo); - } catch ( Exception $e ) { - if ( $user->idClient ) { - exit ( $e->getMessage() ); - } else { - echo "Prévisualisation indisponible"; - exit; - } - } + $sirets = $ciblage->execute(true, 10); /** * Make SQL request with the client profil for columns @@ -283,7 +271,8 @@ class ComptageController extends Zend_Controller_Action } } - $sql = $dbMetier->select()->from('etablissements_act', $extractSql); + $db = Zend_Db_Table::getDefaultAdapter(); + $sql = $db->select()->from('jo.etablissements_act', $extractSql); $i = 0; $where = ''; @@ -296,7 +285,7 @@ class ComptageController extends Zend_Controller_Action } $sql->where($where); - $result = $dbMetier->fetchAll($sql); + $result = $db->fetchAll($sql); $liste = array(); foreach ($result as $l => $line) { $tmp = array();