View script for controller Comptage and script/action name index
-
\ No newline at end of file
+=json_encode($this->result)?>
\ No newline at end of file
diff --git a/application/views/default/scripts/dashboard/configuration.phtml b/application/views/default/scripts/dashboard/configuration.phtml
index c4a8d7c6..7bd80923 100644
--- a/application/views/default/scripts/dashboard/configuration.phtml
+++ b/application/views/default/scripts/dashboard/configuration.phtml
@@ -21,7 +21,7 @@ disponible.
-
Cas profil défini pas S&D
+
Cas profil défini par S&D
- Aucun profil d'enrichissement (Contacter le support)
- Liste des profils avec référence, tarifs à la ligne
@@ -46,11 +46,31 @@ utilisation correspondant à vos besoins.
Des préférences d'affichage ont été définies pour votre profil utilisateur.
-
-
Limiter le ciblage au seul périmètre RNCS
-
Afficher le nombre d'unité INSEE à chaque comptage
-
+
+
+Pour permettre une estimation du cout de la redevance INSEE, en activant cette option,
+le nombre d'unité insee est affiché à chaque comptage
+prefInterfaceINSEE?>
+
+
+
+
+Les éléments soumis à redevance INSEE sont automatiquement retirer du ciblage
+prefFilterRNCS?>
+
+
+
+
Afin de choisir les critères à masquer :
diff --git a/application/views/default/scripts/dashboard/pref.phtml b/application/views/default/scripts/dashboard/pref.phtml
new file mode 100644
index 00000000..3e780a2e
--- /dev/null
+++ b/application/views/default/scripts/dashboard/pref.phtml
@@ -0,0 +1,5 @@
+nbRow>0) { ?>
+Préférence enregistrée.
+
+Erreur lors de l'enregistrement de la préférence.
+
\ No newline at end of file
diff --git a/application/views/default/scripts/header.phtml b/application/views/default/scripts/header.phtml
index e05d47e8..f1958397 100644
--- a/application/views/default/scripts/header.phtml
+++ b/application/views/default/scripts/header.phtml
@@ -18,8 +18,8 @@
total!==null ) {?>
Nombre sélectionnées :
- =$this->total?>
- (dont =$this->insee?> unité(s) insee)
+ =number_format($this->total, 0, '', ' ')?>
+ (dont =number_format($this->insee, 0, '', ' ')?> unité(s) insee)
Aucune sélection.
diff --git a/library/Application/Controller/Plugin/Comptage.php b/library/Application/Controller/Plugin/Comptage.php
index 6599723d..b7e20a41 100644
--- a/library/Application/Controller/Plugin/Comptage.php
+++ b/library/Application/Controller/Plugin/Comptage.php
@@ -52,8 +52,8 @@ class Application_Controller_Plugin_Comptage extends Zend_Controller_Plugin_Abst
}
}
- $view->total = number_format($session->getNb('total'), 0, '', ' ');
- $view->insee = number_format($session->getNb('insee'), 0, '', ' ');
+ $view->total = $session->getNb('total');
+ $view->insee = $session->getNb('insee');
$view->msgComptage = true;
}
}
From 5ab91eb8c7adc83f2d7f4a67a20ad03a70192de8 Mon Sep 17 00:00:00 2001
From: Michael RICOIS
Date: Mon, 28 May 2012 12:49:45 +0000
Subject: [PATCH 2/3] Delete SIRETs column during preview
---
application/controllers/ComptageController.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/application/controllers/ComptageController.php b/application/controllers/ComptageController.php
index 22e4b537..95501ebf 100644
--- a/application/controllers/ComptageController.php
+++ b/application/controllers/ComptageController.php
@@ -203,8 +203,8 @@ class ComptageController extends Zend_Controller_Action
$profil = json_decode($result['criteres'], true);
$extractSql = $extractLabel = array();
- $extractSql[] = "CONCAT(LPAD(siren, 9, '000000000'), LPAD(nic, 5, '00000')) AS siret";
- $extractLabel[] = 'SIRET';
+ //$extractSql[] = "CONCAT(LPAD(siren, 9, '000000000'), LPAD(nic, 5, '00000')) AS siret";
+ //$extractLabel[] = 'SIRET';
require_once 'Scores/Enrichissement.php';
$enrichissement = new Enrichissement();
From 1cd65fb0ab391b8243e8a6c707c0efccae0e2d9d Mon Sep 17 00:00:00 2001
From: Michael RICOIS
Date: Mon, 28 May 2012 15:17:18 +0000
Subject: [PATCH 3/3] Preferences
---
.../controllers/ComptageController.php | 30 ++++++++++++++-----
.../controllers/DashboardController.php | 20 +++++++++++--
.../scripts/dashboard/configuration.phtml | 13 ++++----
.../views/default/scripts/header.phtml | 2 ++
.../Controller/Plugin/Comptage.php | 6 +++-
library/Scores/AuthAdapter.php | 6 ++++
public/themes/default/scripts/fields.js | 8 ++---
7 files changed, 63 insertions(+), 22 deletions(-)
diff --git a/application/controllers/ComptageController.php b/application/controllers/ComptageController.php
index 95501ebf..fce668a2 100644
--- a/application/controllers/ComptageController.php
+++ b/application/controllers/ComptageController.php
@@ -31,17 +31,24 @@ class ComptageController extends Zend_Controller_Action
//@todo : if $total = false then an error occured ?
$total = $ciblage->execute();
- $insee = $ciblage->calculRedevanceInsee();
-
- $fields->setNb('total', $total);
- $fields->setNb('insee', $insee);
+ $fields->setNb('total', $total);
+
+ $auth = Zend_Auth::getInstance();
+ $user = $auth->getIdentity();
+ Zend_Registry::get('firebug')->info($user);
+ if ($user->preferences['interface']['insee']==1) {
+ $insee = null;
+ } else {
+ $insee = $ciblage->calculRedevanceInsee();
+ }
+ $fields->setNb('insee', $insee);
//@todo : Ajouter les critères sous forme json_encode
//Retour comptage, unité Insee
$result = array(
'count' => number_format($total, 0, '', ' '),
- 'insee' => number_format($insee, 0, '', ' ')
+ 'insee' => ($insee!==null) ? number_format($insee, 0, '', ' ') : null,
);
$this->view->assign('result', $result);
}
@@ -62,7 +69,7 @@ class ComptageController extends Zend_Controller_Action
$this->_helper->layout()->disableLayout();
//Récupération de la session pour le profil et les valeurs du comptage
$fields = new Scores_Fields();
- $criteres = $fields->getCriteres();
+ $criteres = $fields->getCriteres();
if (count($criteres) == 0) {
$this->view->noSelection = true;
}
@@ -72,6 +79,7 @@ class ComptageController extends Zend_Controller_Action
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
+
$request = $this->getRequest();
$ref = $request->getParam('ref', '');
@@ -102,8 +110,14 @@ class ComptageController extends Zend_Controller_Action
);
$id = $criteresM->insert($data);
- if ($id){
- //Enregistrement des valeurs du comptage
+ if ($id) {
+ //If nbInsee == null, need to count again
+ if ($nbInsee===null) {
+ $ciblage = new Ciblage($criteres);
+ $nbInsee = $ciblage->calculRedevanceInsee();
+ }
+
+ //Enregistrement des valeurs du comptage
$comptageM = new Application_Model_Comptages();
$data = array(
'idDefinition' => $id,
diff --git a/application/controllers/DashboardController.php b/application/controllers/DashboardController.php
index d8063713..22fe00b6 100644
--- a/application/controllers/DashboardController.php
+++ b/application/controllers/DashboardController.php
@@ -286,6 +286,22 @@ class DashboardController extends Zend_Controller_Action
*/
public function configurationAction()
{
+ $auth = Zend_Auth::getInstance();
+ $user = $auth->getIdentity();
+
+ if (array_key_exists('filter', $user->preferences) && count($user->preferences['filter'])>0) {
+ $liste = $user->preferences['filter'];
+ foreach ( $liste as $name => $value ){
+ $this->view->assign('prefFilter'.ucfirst($name), $value);
+ }
+ }
+
+ if (array_key_exists('interface', $user->preferences) && count($user->preferences['interface'])>0) {
+ $liste = $user->preferences['interface'];
+ foreach ( $liste as $name => $value ){
+ $this->view->assign('prefInterface'.ucfirst($name), $value);
+ }
+ }
}
@@ -319,7 +335,7 @@ class DashboardController extends Zend_Controller_Action
$filter = array();
foreach ( $prefsFilter as $item ){
if (array_key_exists($item, $sendParam)) {
- $filter = array($item, $sendParam[$item]);
+ $filter = array($item => $sendParam[$item]);
}
}
if (array_key_exists('filter', $data)) {
@@ -330,7 +346,7 @@ class DashboardController extends Zend_Controller_Action
$interface = array();
foreach ( $prefsInterface as $item ){
if (array_key_exists($item, $sendParam)) {
- $interface = array($item, $sendParam[$item]);
+ $interface = array($item => $sendParam[$item]);
}
}
if (array_key_exists('interface', $data)) {
diff --git a/application/views/default/scripts/dashboard/configuration.phtml b/application/views/default/scripts/dashboard/configuration.phtml
index 7bd80923..527dda33 100644
--- a/application/views/default/scripts/dashboard/configuration.phtml
+++ b/application/views/default/scripts/dashboard/configuration.phtml
@@ -50,22 +50,21 @@ utilisation correspondant à vos besoins.
Pour permettre une estimation du cout de la redevance INSEE, en activant cette option,
le nombre d'unité insee est affiché à chaque comptage
-prefInterfaceINSEE?>
+prefInterfaceInsee==1) echo ' checked="checked"';?> />
-
+
Les éléments soumis à redevance INSEE sont automatiquement retirer du ciblage
-prefFilterRNCS?>
+prefFilterRncs==1) echo ' checked="checked"';?> />