Changement suite à intégration forfait
This commit is contained in:
parent
ae2178ec7a
commit
c6725dd0af
@ -68,12 +68,17 @@ class ComptageController extends Zend_Controller_Action
|
||||
public function savedialogAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Récupération de la session pour le profil et les valeurs du comptage
|
||||
$fields = new Scores_Fields();
|
||||
$criteres = $fields->getCriteres();
|
||||
if (count($criteres) == 0) {
|
||||
$this->view->noSelection = true;
|
||||
}
|
||||
$this->view->reference = $user->username.'-'.date('YmdHis');
|
||||
}
|
||||
|
||||
public function saveAction()
|
||||
@ -90,7 +95,7 @@ class ComptageController extends Zend_Controller_Action
|
||||
require_once 'i18n/cleanchar.php';
|
||||
$ref = str_replace(' ', '_', $ref);
|
||||
$ref = cleanutf8($ref);
|
||||
$pattern = '/[^a-zA-Z0-9_]+/';
|
||||
$pattern = '/[^a-zA-Z0-9_-]+/';
|
||||
$ref = preg_replace($pattern, '', $ref);
|
||||
|
||||
if (empty($ref)) {
|
||||
@ -111,12 +116,12 @@ class ComptageController extends Zend_Controller_Action
|
||||
//Enregistrement des critères
|
||||
$criteresM = new Application_Model_Criteres();
|
||||
$data = array(
|
||||
'idClient' => $user->idClient,
|
||||
'login' => $user->username,
|
||||
'reference' => $ref,
|
||||
'criteres' => json_encode($criteres),
|
||||
'parent' => 0,
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
'idClient' => $user->idClient,
|
||||
'login' => $user->username,
|
||||
'reference' => $ref,
|
||||
'criteres' => json_encode($criteres),
|
||||
'parent' => 0,
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
$id = $criteresM->insert($data);
|
||||
|
||||
@ -220,11 +225,14 @@ class ComptageController extends Zend_Controller_Action
|
||||
exit ( $e->getMessage() );
|
||||
}
|
||||
|
||||
//Make SQL request with the user profil for columns
|
||||
/**
|
||||
* Make SQL request with the client profil for columns
|
||||
*/
|
||||
$profilsM = new Application_Model_EnrichissementProfils();
|
||||
$sql = $profilsM->select()
|
||||
->where('login = ?', $user->username)
|
||||
->where('idClient = ?', $user->idClient);
|
||||
$sql = $profilsM->select()
|
||||
->from($profilsM, array('criteres'))
|
||||
->where('reference=?','default')
|
||||
->where('login = ?', $user->username);
|
||||
$result = $profilsM->fetchRow($sql);
|
||||
|
||||
$profil = json_decode($result['criteres'], true);
|
||||
|
@ -59,7 +59,7 @@ class DashboardController extends Zend_Controller_Action
|
||||
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
|
||||
)
|
||||
->join(
|
||||
array('c' => 'criteres'), 'i.idCriteres = c.id',
|
||||
array('c' => 'ciblage_criteres'), 'i.idCriteres = c.id',
|
||||
array('')
|
||||
)
|
||||
->where('c.idClient = ?', $user->idClient)
|
||||
|
@ -69,7 +69,6 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
*/
|
||||
public function commandeAction()
|
||||
{
|
||||
set_time_limit(60);
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
@ -77,23 +76,10 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
$idProfil = $request->getParam('profil', null);
|
||||
$ref = $request->getParam('ref');
|
||||
|
||||
//Vérifier les profils du client
|
||||
if ( $idProfil===null ) {
|
||||
|
||||
//Selection du profil du client
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$profilsM = new Application_Model_EnrichissementProfils();
|
||||
$sql = $profilsM->select()
|
||||
->from($profilsM, array('id'))
|
||||
->where('idClient=?', $user->idClient)
|
||||
->where('login=?', $user->username)
|
||||
->where('actif=?', 1);
|
||||
$profil = $profilsM->fetchRow($sql);
|
||||
$idProfil = $profil->id;
|
||||
}
|
||||
|
||||
//Si forfait check si le montant restant est suffisant
|
||||
|
||||
|
||||
//Identifiant comptage
|
||||
$comptage = new Application_Model_Comptages();
|
||||
$sql = $comptage->select()->where('idDefinition = ?', $idCriteres);
|
||||
$result = $comptage->fetchRow($sql);
|
||||
@ -138,6 +124,8 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
$identifiantsM = new Application_Model_EnrichissementIdentifiants();
|
||||
$idIdentifiant = $identifiantsM->insert($data);
|
||||
|
||||
//@todo : ajouter la valeur (prix) du fichier au compteur global afin de décompter du forfait
|
||||
|
||||
$this->view->assign('ref', $ref);
|
||||
}
|
||||
|
||||
@ -149,21 +137,37 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$request = $this->getRequest();
|
||||
|
||||
$selectprofil = $request->getParam('profil', 'default');
|
||||
|
||||
//Récupération du profil de l'utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$priceLine = $user->priceLine;
|
||||
|
||||
//Other profil for this login ?
|
||||
$profilsM = new Application_Model_EnrichissementProfils();
|
||||
$sql = $profilsM->select()
|
||||
->from($profilsM, array('id', 'reference', 'tarifLigne', 'dataInsee'))
|
||||
->where('idClient=?', $user->idClient)
|
||||
->where('login=?', $user->username)
|
||||
->where('actif=?', 1);
|
||||
$profil = $profilsM->fetchRow($sql);
|
||||
//
|
||||
if ($profil!==null)
|
||||
{
|
||||
$this->view->assign('profil', true);
|
||||
->from($profilsM, array('id', 'reference', 'criteres'))
|
||||
->where('actif=1')
|
||||
->where('login=?', $user->username);
|
||||
$profils = $profilsM->fetchAll($sql)->toArray();
|
||||
|
||||
$profilId = 0;
|
||||
foreach($profils as $item) {
|
||||
if ($selectprofil == $item['']) {
|
||||
$profilId = $item['id'];
|
||||
}
|
||||
if ($item['reference']=='default') {
|
||||
$defaultProfilId = $item['id'];
|
||||
}
|
||||
}
|
||||
if ($profilId = 0) {
|
||||
$profilId = $defaultProfilId;
|
||||
}
|
||||
|
||||
if ( count($profils)>0 ) {
|
||||
|
||||
$this->view->assign('profil', $profilId);
|
||||
$idCritere = $request->getParam('id', null);
|
||||
|
||||
$comptagesM = new Application_Model_Comptages();
|
||||
@ -182,30 +186,55 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
$date = explode(' ', $item->dateAjout);
|
||||
$date = $date[0];
|
||||
|
||||
|
||||
if($date != '0000-00-00' && $date != date('Y-m-d')) {
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$count = new Ciblage($criteresValue);
|
||||
$item['resultat'] = $count->execute();
|
||||
$item['uniteInsee'] = $count->calculRedevanceInsee();
|
||||
}
|
||||
|
||||
|
||||
$this->view->assign('resultat', $item['resultat']);
|
||||
$this->view->assign('uniteInsee', $item['uniteInsee']);
|
||||
|
||||
//Calcul du prix
|
||||
//@todo : Put it somewhere we can modify it
|
||||
$redevanceInsee = 3.295/100; //Seuil de facturation 52 734 euros
|
||||
|
||||
//@todo : Si le client a déjà payé la redevance INSEE
|
||||
$prixInsee = $item['uniteInsee']*$redevanceInsee;
|
||||
$infoInsee = '';
|
||||
if ($profil->dataInsee){
|
||||
$prixInsee = $item['resultat']*$redevanceInsee;
|
||||
$infoInsee = "Votre profil inclus au moins une donnée Insee, la redevance sera applicable sur chaque ligne.";
|
||||
}
|
||||
$prix = $item['resultat'] * $profil->tarifLigne + $prixInsee;
|
||||
|
||||
$this->view->prix = round($prix, 2);
|
||||
$this->view->prixInsee = round($prixInsee, 2);
|
||||
$this->view->prixInsee = round($prixInsee, 2);
|
||||
$this->view->infoInsee = $infoInsee;
|
||||
|
||||
$prix = round($item['resultat'] * $priceLine + $prixInsee, 2);
|
||||
|
||||
//Forfait - Liste des commandes et calcul
|
||||
if ($user->forfait>0) {
|
||||
$dateBegin = $user->dateContrat;
|
||||
$dateEnd = date('YmdHis', mktime(0,0,0,substr($user->dateContrat,5,2)+$user->periodContrat, substr($user->dateContrat,8,2), substr($user->dateContrat,0,4)));
|
||||
|
||||
$commandesM = new Application_Model_EnrichissementIdentifiants();
|
||||
$sql = $commandesM->select()->setIntegrityCheck(false)
|
||||
->from( array('commande' => 'enrichissement_identifiants'), array('SUM(nbLigneTotales) as total', 'SUM(uniteInsee) as insee'))
|
||||
->join( array('critere' => 'ciblage_criteres'), 'critere.id = commande.idCriteres', array())
|
||||
->where("dateAdded BETWEEN '".$dateBegin."' AND '".$dateEnd."'")
|
||||
->where('idClient = ?', $user->idClient);
|
||||
|
||||
$result = $commandesM->fetchRow($sql);
|
||||
if ($result) {
|
||||
$total = $result['total'];
|
||||
$insee = $result['insee'];
|
||||
$conso = round($total * $priceLine + $insee * $redevanceInsee, 2);
|
||||
}
|
||||
|
||||
$this->view->forfaitRemain = $user->forfait - $conso;
|
||||
}
|
||||
|
||||
$this->view->prix = $prix;
|
||||
$this->view->id = $item['id'];
|
||||
$this->view->ref = $criteres->reference.'-'.uniqid();
|
||||
}
|
||||
|
@ -32,7 +32,6 @@ class GestionController extends Zend_Controller_Action
|
||||
$login = $request->getParam('login', '');
|
||||
$idClient = $request->getParam('idClient', null);
|
||||
|
||||
|
||||
$profilsM = new Application_Model_EnrichissementProfils();
|
||||
|
||||
$sql = $profilsM->select()
|
||||
@ -57,49 +56,49 @@ class GestionController extends Zend_Controller_Action
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Get default profil
|
||||
$profilClientM = new Application_Model_CustomerParams();
|
||||
$profilClient = $profilClientM->find($request->getParam('idClient'));
|
||||
|
||||
//Sauvegarde du formulaire
|
||||
if ( $request->isPost() && $request->getParam('submit')=='Enregistrer' ){
|
||||
if ( $request->isPost() ){
|
||||
$params = $request->getParams();
|
||||
|
||||
//Vérifier le formulaire
|
||||
$errForm = 0;
|
||||
foreach ( $params as $key => $value ) {
|
||||
if (empty($value)) {
|
||||
$errForm++;
|
||||
if ($params['reference']=='default') {
|
||||
$params['criteres'] = json_decode($profilClient->current()->criteres,true);
|
||||
}
|
||||
|
||||
$dataInsee = 0;
|
||||
// Est ce qu'il existe une donnée insee
|
||||
require_once 'Scores/Enrichissement.php';
|
||||
$fieldsM = new Enrichissement();
|
||||
$fields = $fieldsM->getFields();
|
||||
foreach ( $fields as $key => $val) {
|
||||
if ( array_key_exists('insee', $val) && $val['insee']===true) {
|
||||
$dateInsee = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$errForm) {
|
||||
|
||||
$dataInsee = 0;
|
||||
// Est ce qu'il existe une donnée insee
|
||||
require_once 'Scores/Enrichissement.php';
|
||||
$fieldsM = new Enrichissement();
|
||||
$fields = $fieldsM->getFields();
|
||||
foreach ( $fields as $key => $val) {
|
||||
if ( array_key_exists('insee', $val) && $val['insee']===true) {
|
||||
$dateInsee = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'idClient' => $params['idClient'],
|
||||
'login' => $params['login'],
|
||||
'reference' => $params['reference'],
|
||||
'criteres' => json_encode($params['criteres']),
|
||||
'tarifLigne' => $params['tarifLigne'],
|
||||
'dataInsee' => $dataInsee,
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
'actif' => 1,
|
||||
);
|
||||
$profilM = new Application_Model_EnrichissementProfils();
|
||||
if ( $profilM->insert($data) ){
|
||||
$this->view->assign('message', "Profil enregistré");
|
||||
} else {
|
||||
$this->view->assign('message', "Erreur lors de la sauvegarde");
|
||||
}
|
||||
$data = array(
|
||||
'idClient' => $params['idClient'],
|
||||
'service' => $params['service'],
|
||||
'login' => $params['login'],
|
||||
'reference' => $params['reference'],
|
||||
'criteres' => json_encode($params['criteres']),
|
||||
'dataInsee' => $dataInsee,
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
'actif' => 1,
|
||||
);
|
||||
$profilM = new Application_Model_EnrichissementProfils();
|
||||
if ( $profilM->insert($data) ){
|
||||
$this->view->assign('message', "Profil enregistré");
|
||||
$this->view->assign('disableForm', true);
|
||||
} else {
|
||||
$this->view->assign('message', "Erreur lors de la saisie");
|
||||
$this->view->assign('message', "Erreur lors de la sauvegarde");
|
||||
}
|
||||
|
||||
}
|
||||
@ -238,11 +237,36 @@ class GestionController extends Zend_Controller_Action
|
||||
*/
|
||||
public function customerparamsAction()
|
||||
{
|
||||
//@todo : Get customer list from webservice
|
||||
|
||||
//@todo : what's in database
|
||||
$customersM = new Application_Model_CustomerParams();
|
||||
$sql = $customersM->select()
|
||||
->from($customersM,array('idClient', 'service' , 'dateContrat', 'periodContrat'))
|
||||
->order('dateAdded DESC')
|
||||
->group('idClient');
|
||||
$customers = $customersM->fetchAll($sql)->toArray();
|
||||
|
||||
//List login
|
||||
$customerlist = array();
|
||||
$profilsM = new Application_Model_EnrichissementProfils();
|
||||
foreach($customers as $item) {
|
||||
$sql = $profilsM->select()
|
||||
->from($profilsM, array('login'))
|
||||
->where('idClient=?',$item['idClient']);
|
||||
$result = $profilsM->fetchAll($sql)->toArray();
|
||||
|
||||
$logins = array();
|
||||
if (count($result)>0) {
|
||||
foreach($result as $login) {
|
||||
$logins[] = $login['login'];
|
||||
}
|
||||
}
|
||||
|
||||
$item['logins'] = $logins;
|
||||
$customerlist[] = $item;
|
||||
}
|
||||
$this->view->assign('customerlist', $customerlist);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* List customer's params
|
||||
*/
|
||||
@ -259,7 +283,88 @@ class GestionController extends Zend_Controller_Action
|
||||
if ($params->count()>0){
|
||||
$infos = $params->toArray();
|
||||
}
|
||||
$this->view->assign('infos',$infos);
|
||||
$this->view->assign('infos',$infos[0]);
|
||||
|
||||
$loginsM = new Application_Model_EnrichissementProfils();
|
||||
$sql = $loginsM->select()->where('idClient = ?', $idClient);
|
||||
$logins = $loginsM->fetchAll($sql)->toArray();
|
||||
$this->view->assign('logins', $logins);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function customerparamaddAction()
|
||||
{
|
||||
//Fields
|
||||
require_once 'Scores/Enrichissement.php';
|
||||
$fieldsM = new Enrichissement();
|
||||
$allFields = $fieldsM->getFields();
|
||||
$this->view->assign('fields', $allFields);
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
//Sauvegarde du formulaire
|
||||
if ( $request->isPost() && $request->getParam('submit')=='Enregistrer' ) {
|
||||
$params = $request->getParams();
|
||||
|
||||
//Vérifier le formulaire
|
||||
$errForm = 0;
|
||||
foreach ( $params as $key => $value ) {
|
||||
if ($value=='' && $key!='service') {
|
||||
$errForm++;
|
||||
}
|
||||
}
|
||||
if (!$errForm) {
|
||||
|
||||
$dataInsee = 0;
|
||||
// Est ce qu'il existe une donnée insee
|
||||
require_once 'Scores/Enrichissement.php';
|
||||
$fieldsM = new Enrichissement();
|
||||
$fields = $fieldsM->getFields();
|
||||
foreach ( $fields as $key => $val) {
|
||||
if ( array_key_exists('insee', $val) && $val['insee']===true) {
|
||||
$dateInsee = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$checkValues = array(
|
||||
'filterRNCS' => 0,
|
||||
'licenceINSEE' => 0,
|
||||
'immediatExtract' => 0,
|
||||
);
|
||||
foreach ($checkValues as $key => $value) {
|
||||
if (!array_key_exists($key, $params)) {
|
||||
$params[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'idClient' => $params['idClient'],
|
||||
'service' => $params['service'],
|
||||
'filterRNCS' => $params['filterRNCS'],
|
||||
'licenceINSEE' => $params['licenceINSEE'],
|
||||
'immediatExtract' => $params['immediatExtract'],
|
||||
'dateContrat' => $params['dateContrat'],
|
||||
'periodContrat' => $params['periodContrat'],
|
||||
'periodPaiement' => $params['periodPaiement'],
|
||||
'priceLine' => $params['priceLine'],
|
||||
'forfait' => $params['forfait'],
|
||||
'limitLines' => $params['limitLines'],
|
||||
'limitFiles' => $params['limitFiles'],
|
||||
'criteres' => json_encode($params['criteres']),
|
||||
'dataInsee' => $dataInsee,
|
||||
'dateAdded' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
$customerParamsM = new Application_Model_CustomerParams();
|
||||
if ( $customerParamsM->insert($data) ){
|
||||
$this->view->assign('message', "Profil enregistré");
|
||||
} else {
|
||||
$this->view->assign('message', "Erreur lors de la sauvegarde");
|
||||
}
|
||||
} else {
|
||||
$this->view->assign('message', "Erreur lors de la saisie");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Application_Model_CodePostaux extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'codepostaux';
|
||||
protected $_name = 'fields_codepostaux';
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Application_Model_Comptages extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'comptages';
|
||||
protected $_name = 'ciblage_comptages';
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Application_Model_Criteres extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'criteres';
|
||||
protected $_name = 'ciblage_criteres';
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Application_Model_Departements extends Zend_Db_Table_Abstract
|
||||
{
|
||||
public $_name = 'departements';
|
||||
public $_name = 'fields_departements';
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
class Application_Model_FormeJuridique extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'formejuridique';
|
||||
protected $_name = 'fields_formejuridique';
|
||||
protected $_primary = 'fjCode';
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Application_Model_MinMax extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'minmax';
|
||||
protected $_name = 'fields_minmax';
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Application_Model_Naf extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'naf';
|
||||
protected $_name = 'fields_naf';
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Application_Model_Prefs extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'prefs';
|
||||
protected $_name = 'customer_prefs';
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_Regions extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'regions';
|
||||
protected $_name = 'fields_regions';
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,16 @@
|
||||
<div id="help">
|
||||
|
||||
<h2>Préambule</h2>
|
||||
<p>
|
||||
L'application se décompose en deux parties : <br/>
|
||||
- La partie ciblage<br/>
|
||||
|
||||
<br/><br/>
|
||||
- La partie enrichissement<br/>
|
||||
|
||||
<br/>
|
||||
</p>
|
||||
|
||||
<h2>Description de l'interface</h2>
|
||||
<p>
|
||||
Menu
|
||||
|
@ -9,7 +9,7 @@ span.message {
|
||||
</style>
|
||||
<div id="result">
|
||||
<form method="post" id="save" name="save" action="<?=$this->url(array('controller'=>'comptage', 'action'=>'save'))?>">
|
||||
<label>Votre référence : </label><input type="text" name="ref" value="" />
|
||||
<label>Votre référence : </label><input type="text" name="ref" value="<?=$this->reference?>" />
|
||||
</form>
|
||||
<span class="message" style="color:#ff0000;"></span>
|
||||
<span class="message">
|
||||
|
@ -87,7 +87,7 @@
|
||||
<th><?=number_format($item['nbLigneTotales'], 0, '', ' ')?></th>
|
||||
<td>
|
||||
<?php if($item['dateStart']>0): ?>
|
||||
<a href="/enrichissement/download/id/<?php echo $item['id'];?>"><?php echo $item['fichier']; ?></a>
|
||||
<a href="/enrichissement/download/id/<?=$item['id']?>"><?=$item['fichier']?></a>
|
||||
<?php else: ?>
|
||||
En attente de traitement
|
||||
<?php endif; ?>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php if ( !$this->profil ) {?>
|
||||
Aucun profil d'enrichissement, Merci de prendre contact avec le service commercial.
|
||||
<?php }elseif ( empty($this->id) ) {?>
|
||||
<?php } elseif ( empty($this->id) ) {?>
|
||||
Erreur
|
||||
<?php } elseif ($this->resultat>50000) {?>
|
||||
<p>Le nombre de lignes à enrichir est trop important.
|
||||
@ -31,38 +31,41 @@ Vos critères seront enregistrées et une référence vous sera fourni.</p>
|
||||
}
|
||||
</style>
|
||||
<p style="text-align:center;color:green">Votre ciblage a été actualisé</p>
|
||||
|
||||
<div style="font-size:10px;padding:5px; border:1px dashed green">
|
||||
Les tarifs sont données à titre indicatif et peuvent variées suivant les spécificités de votre compte.
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
<table id="enrichissement">
|
||||
<tr>
|
||||
<th>Référence de commande</th><th><?=$this->ref?></th>
|
||||
</tr>
|
||||
<tr><td>Nombre d'unités</td><td><?=number_format($this->resultat, 0, ',', ' ')?></td></tr>
|
||||
<tr><td>Nombre d'unités Insee</td><td><?=number_format($this->uniteInsee, 0, ',', ' ')?></td></tr>
|
||||
<tr><td>Prix du fichier</td><td><?=number_format($this->prix, 2, ',', ' ')?> €</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Redevance Insee</td>
|
||||
<td><?=number_format($this->prixInsee, 2, ',', ' ')?> €</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div id="progress"></div></td>
|
||||
<td>Prix du fichier</td><td><?=number_format($this->prix, 2, ',', ' ')?> €</td>
|
||||
</tr>
|
||||
<tr><td colspan="2"></td></tr>
|
||||
<?php if ($this->forfaitRemain) {?>
|
||||
<tr><td>Forfait Restant</td><td><?=number_format($this->forfaitRemain, 2, ',', ' ')?> €</td></tr>
|
||||
<?php }?>
|
||||
</table>
|
||||
<?php if (!empty($this->infoInsee)) {?>
|
||||
<br/>
|
||||
<p><?=$this->infoInsee?></p>
|
||||
<?php }?>
|
||||
<br/>
|
||||
<div style="font-size:10px;padding:5px; border:1px dashed green">
|
||||
Les tarifs sont données à titre indicatif et peuvent variées suivant les spécificités de votre compte.
|
||||
</div>
|
||||
<br/>
|
||||
<div style="font-size:10px;padding:5px; border:1px dashed green">
|
||||
Les informations permettant l'enrichissement seront enregistrées, après la saisie de votre référence.
|
||||
</div>
|
||||
|
||||
|
||||
<form name="commande" method="post" action="<?=$this->url(array('controller'=>'enrichissement', 'action'=>'commande'))?>">
|
||||
<input type="hidden" name="id" value="<?=$this->id?>" />
|
||||
<input type="hidden" type="text" value="<?=$this->ref?>" name="ref">
|
||||
<input type="hidden" type="text" value="<?=$this->profil?>" name="profil">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
|
@ -1,6 +1,3 @@
|
||||
<!-- <div class="erreur" id="entreprise">
|
||||
|
||||
</div> -->
|
||||
<div id="entreprise">
|
||||
<div id="s_entreprise">
|
||||
<ul id="fieldsblock">
|
||||
|
@ -1,6 +1,53 @@
|
||||
<div id="dashboard">
|
||||
<h2>Paramètres client</h2>
|
||||
|
||||
<?=print_r($this->infos)?>
|
||||
<table>
|
||||
<tr><td>idClient</td><td><?=$this->infos['idClient']?></td></tr>
|
||||
<tr><td>service</td><td><?=$this->infos['service']?></td></tr>
|
||||
<tr><td>filterRNCS</td><td><?=$this->infos['filterRNCS']?></td></tr>
|
||||
<tr><td>licenceINSEE</td><td><?=$this->infos['licenceINSEE']?></td></tr>
|
||||
<tr><td>immediatExtract</td><td><?=$this->infos['immediatExtract']?></td></tr>
|
||||
<tr><td>dateContrat</td><td><?=$this->infos['dateContrat']?></td></tr>
|
||||
<tr><td>periodContrat</td><td><?=$this->infos['periodContrat']?></td></tr>
|
||||
<tr><td>periodPaiement</td><td><?=$this->infos['periodPaiement']?></td></tr>
|
||||
<tr><td>priceLine</td><td><?=$this->infos['priceLine']?></td></tr>
|
||||
<tr><td>forfait</td><td><?=$this->infos['forfait']?></td></tr>
|
||||
<tr><td>limitLines</td><td><?=$this->infos['limitLines']?></td></tr>
|
||||
<tr><td>limitFiles</td><td><?=$this->infos['limitFiles']?></td></tr>
|
||||
<tr><td>criteres</td><td><pre><?php print_r(json_decode($this->infos['criteres'],true))?></td></tr>
|
||||
<tr><td>dataInsee</td><td><?=$this->infos['dataInsee']?></td></tr>
|
||||
<tr><td>dateAdded</td><td><?=$this->infos['dateAdded']?></td></tr>
|
||||
</table>
|
||||
|
||||
<h2>Logins autorisés</h2>
|
||||
<div class="paragraph">
|
||||
<form method="post" action="<?=$this->url(array('controller'=>'gestion', 'action'=>'profiladd'), null, true)?>">
|
||||
<input type="hidden" name="idClient" value="<?=$this->infos['idClient']?>" />
|
||||
<input type="hidden" name="service" value="<?=$this->infos['service']?>" />
|
||||
<input type="hidden" name="reference" value="default" />
|
||||
<label>Login : </label><input type="text" name="login" value="" />
|
||||
<input type="submit" value="Ajouter un login avec le profil du client" />
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="paragraph">
|
||||
<table>
|
||||
<tr><td>Login</td><td>Service</td><td>Profil</td><td>Action</td></tr>
|
||||
<?php foreach ($this->logins as $login) {?>
|
||||
<tr>
|
||||
<td><?=$login['login']?></td>
|
||||
<td><?=$login['service']?></td>
|
||||
<td><?=$login['reference']?></td>
|
||||
<td>
|
||||
<?php if ($login['reference']=='default') {?>
|
||||
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'profiladd'))?>">Ajouter un profil</a>
|
||||
<a href="">Désactiver</a>
|
||||
<?php }?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -0,0 +1,78 @@
|
||||
<div id="dashboard">
|
||||
|
||||
<?=$this->message?>
|
||||
|
||||
<form name="profil" method="post" action="<?=$this->url(array('controller'=>'gestion', 'action'=>'customerparamadd'))?>">
|
||||
<label>idClient</label>
|
||||
<input type="text" name="idClient" />
|
||||
<br/>
|
||||
|
||||
<label>service</label>
|
||||
<input type="text" name="service" />
|
||||
<br/>
|
||||
|
||||
<label>filterRNCS</label>
|
||||
<input type="checkbox" name="filterRNCS" value="1" />
|
||||
Filtrer au RNCS
|
||||
<br/>
|
||||
|
||||
<label>licenceINSEE</label>
|
||||
<input type="checkbox" name="licenceINSEE" value="1" />
|
||||
Le client possède la licence INSEE
|
||||
<br/>
|
||||
|
||||
<label>immediatExtract</label>
|
||||
<input type="text" name="immediatExtract" value="0" />
|
||||
Nombre de ligne maximum pour une extraction immédiate
|
||||
<br/>
|
||||
|
||||
<label>dateContrat</label>
|
||||
<input type="text" name="dateContrat" />
|
||||
Date de début du contract (AAAA-MM-JJ)
|
||||
<br/>
|
||||
|
||||
<label>periodContrat</label>
|
||||
<input type="text" name="periodContrat" />
|
||||
Durée du contrat (1,3,6,12 mois)
|
||||
<br/>
|
||||
|
||||
<label>periodPaiement</label>
|
||||
<input type="text" name="periodPaiement" />
|
||||
Emission des factures (tous les 1,3,6,12 mois)
|
||||
<br/>
|
||||
|
||||
<label>priceLine</label>
|
||||
<input type="text" name="priceLine" /> €
|
||||
Prix à la ligne (obligatoire même en forfait pour pouvoir décompter)
|
||||
<br/>
|
||||
|
||||
<label>forfait</label>
|
||||
<input type="text" name="forfait" value="0" />
|
||||
Montant du forfait pour l'extraction de fichier
|
||||
<br/>
|
||||
|
||||
<label>limitLines</label>
|
||||
<input type="text" name="limitLines" value="50000" />
|
||||
Nombre maximal de lignes dans un fichier
|
||||
<br/>
|
||||
|
||||
<label>limitFiles</label>
|
||||
<input type="text" name="limitFiles" value="0" />
|
||||
Nombre maximal de fichier pouvant être extrait
|
||||
<br/>
|
||||
|
||||
<div>
|
||||
<label>Enrichissement</label>
|
||||
<select style="padding:5px;" name="criteres[]" multiple size="20">
|
||||
<?php if ( count($this->fields)>0 ) {?>
|
||||
<?php foreach ( $this->fields as $value => $item ) {?>
|
||||
<option value="<?=$value?>"><?=$item['label']?></option>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input type="submit" name="submit" value="Enregistrer"/>
|
||||
</form>
|
||||
|
||||
</div>
|
@ -1,5 +1,35 @@
|
||||
<div id="dashboard">
|
||||
|
||||
<h2>Liste des paramètres clients</h2>
|
||||
<div class="paragraph">
|
||||
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'customerparamadd'))?>">Ajouter un client</a>
|
||||
</div>
|
||||
|
||||
<div class="paragraph">
|
||||
<table>
|
||||
<tr>
|
||||
<th>idClient</th>
|
||||
<th>Début du contrat</th>
|
||||
<th>Durée contrat</th>
|
||||
<th>Logins ouvert</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
<?php foreach($this->customerlist as $item) {?>
|
||||
<tr>
|
||||
<td><?=$item['idClient']?></td>
|
||||
<td><?=$item['dateContrat']?></td>
|
||||
<td><?=$item['periodContrat']?></td>
|
||||
<td>
|
||||
<?php foreach ($item['logins'] as $login) {?>
|
||||
<?=$login?><br/>
|
||||
<?php }?>
|
||||
</td>
|
||||
<td><a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'customerparam', 'id'=>$item['idClient']))?>">Détail</a></td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -1,9 +1,5 @@
|
||||
<div id="dashboard">
|
||||
|
||||
<h2>Gestion des profils</h2>
|
||||
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'profils'))?>">Lister les profils</a><br/>
|
||||
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'profiladd'))?>">Créer un profil d'enrichissement pour un client (idClient, login)</a>
|
||||
|
||||
<h2>Gestion des commandes</h2>
|
||||
<a href="<?=$this->url(array('controller' => 'gestion', 'action' => 'commandes'))?>">Liste des commandes</a><br />
|
||||
<a href="<?=$this->url(array('controller' => 'gestion', 'action' => 'enrichissements'))?>">Liste des commandes terminées</a><br/>
|
||||
|
@ -2,19 +2,18 @@
|
||||
|
||||
<?=$this->message?>
|
||||
|
||||
<?php if (!$this->disableForm) {?>
|
||||
<form name="profil" method="post" action="<?=$this->url(array('controller'=>'gestion', 'action'=>'profiladd'))?>">
|
||||
<label>idClient</label>
|
||||
<input type="text" name="idClient" />
|
||||
<br/>
|
||||
<input type="hidden" name="idClient" value="<?=$this->idClient?>"/>
|
||||
<label>login</label>
|
||||
<input type="text" name="login" />
|
||||
<br/>
|
||||
<label>service</label>
|
||||
<input type="text" name="service" />
|
||||
<br/>
|
||||
<label>Reference</label>
|
||||
<input type="text" name="reference" />
|
||||
<br/>
|
||||
|
||||
<label>tarifLigne</label>
|
||||
<input type="text" name="tarifLigne" /> €
|
||||
(Pour appliquer les paramètres du client mettre "default")
|
||||
<br/>
|
||||
|
||||
<div>
|
||||
@ -30,5 +29,6 @@
|
||||
|
||||
<input type="submit" name="submit" value="Enregistrer"/>
|
||||
</form>
|
||||
<?php }?>
|
||||
|
||||
</div>
|
@ -79,8 +79,8 @@ if ($opts->id)
|
||||
$identifiants = json_decode($commande->identifiants, true);
|
||||
|
||||
//Read profil for data extract
|
||||
$profilM = new Application_Model_EnrichissementProfils($db);
|
||||
$profil = $profilM->find(intval($commande->idProfil))->current();
|
||||
$profilM = new Application_Model_EnrichissementProfils($db);
|
||||
$profil = $profilM->find(intval($commande->idProfil))->current();
|
||||
$dataProfil = json_decode($profil->criteres, true);
|
||||
}
|
||||
else if ($opts->file)
|
||||
|
@ -1,4 +1,4 @@
|
||||
CREATE TABLE IF NOT EXISTS `comptages` (
|
||||
CREATE TABLE IF NOT EXISTS `ciblage_comptages` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`idDefinition` int(11) NOT NULL,
|
||||
`resultat` int(11) NOT NULL,
|
@ -1,4 +1,4 @@
|
||||
CREATE TABLE IF NOT EXISTS `criteres` (
|
||||
CREATE TABLE IF NOT EXISTS `ciblage_criteres` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`idClient` int(11) NOT NULL,
|
||||
`login` varchar(20) NOT NULL,
|
@ -1,15 +1,18 @@
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `customer_params` (
|
||||
CREATE TABLE `customer_params` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`idClient` int(11) NOT NULL,
|
||||
`service` varchar(100) NOT NULL,
|
||||
`filterRNCS` tinyint(1) NOT NULL COMMENT 'Filtrer sur le perimetre RNCS ',
|
||||
`licenceINSEE` tinyint(1) NOT NULL COMMENT 'Le client possede une licence INSEE',
|
||||
`licenceINSEE` tinyint(1) NOT NULL COMMENT 'Le client possède une licence INSEE',
|
||||
`immediatExtract` int(11) NOT NULL DEFAULT '0' COMMENT 'Nombre de ligne maximum pour une extraction immédiate',
|
||||
`dateContrat` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Date de debut du contrat',
|
||||
`periodContrat` int(2) NOT NULL COMMENT 'Dur<EFBFBD>e du contrat en mois',
|
||||
`periodPaiement` int(2) NOT NULL COMMENT 'Dur<EFBFBD>e en mois pour l''emission de la facture (1,3,6,12)',
|
||||
`limitLines` int(11) NOT NULL DEFAULT '0' COMMENT 'Limiter a un nombre de ligne sur la periode du contrat',
|
||||
`limitFiles` int(11) NOT NULL DEFAULT '0' COMMENT 'Limiter a un nombre de fichier sur la duree du contrat',
|
||||
`periodContrat` int(2) NOT NULL COMMENT 'Durée du contrat en mois',
|
||||
`periodPaiement` int(2) NOT NULL COMMENT 'Durée en mois pour l''emission de la facture (1,3,6,12)',
|
||||
`priceLine` float NOT NULL DEFAULT '0',
|
||||
`forfait` int(11) NOT NULL DEFAULT '0' COMMENT 'Montant du forfait pour décompte',
|
||||
`limitLines` int(11) NOT NULL DEFAULT '0' COMMENT 'Limiter à un nombre de ligne sur la période du contrat',
|
||||
`limitFiles` int(11) NOT NULL DEFAULT '0' COMMENT 'Limiter à un nombre de fichier sur la durée du contrat',
|
||||
`criteres` text NOT NULL,
|
||||
`dateAdded` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Parametres de facturation' AUTO_INCREMENT=1 ;
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Paramètres de facturation';
|
||||
|
@ -1,4 +1,4 @@
|
||||
CREATE TABLE IF NOT EXISTS `prefs` (
|
||||
CREATE TABLE IF NOT EXISTS `customer_prefs` (
|
||||
`login` varchar(255) NOT NULL,
|
||||
`json` text NOT NULL,
|
||||
PRIMARY KEY (`login`)
|
@ -1,14 +1,14 @@
|
||||
CREATE TABLE IF NOT EXISTS `enrichissement_profils` (
|
||||
CREATE TABLE `enrichissement_profils` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`idClient` int(11) NOT NULL,
|
||||
`login` VARCHAR( 50 ) NOT NULL,
|
||||
`service` varchar(25) NOT NULL,
|
||||
`login` varchar(50) NOT NULL,
|
||||
`reference` varchar(50) NOT NULL,
|
||||
`criteres` text NOT NULL,
|
||||
`tarifLigne` float NOT NULL,
|
||||
`dataInsee` tinyint(4) NOT NULL,
|
||||
`dateAjout` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`dateSuppr` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`actif` tinyint(4) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idClient` (`idClient`)
|
||||
) DEFAULT CHARSET=utf8 COMMENT='Profil d''extraction';
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Profil d''extraction';
|
||||
|
@ -2,7 +2,7 @@
|
||||
-- Structure de la table `codepostaux`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `codepostaux` (
|
||||
CREATE TABLE IF NOT EXISTS `fields_codepostaux` (
|
||||
`Commune` varchar(26) DEFAULT NULL,
|
||||
`Codepos` varchar(5) DEFAULT NULL,
|
||||
`Departement` varchar(23) DEFAULT NULL,
|
||||
@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS `codepostaux` (
|
||||
-- Contenu de la table `codepostaux`
|
||||
--
|
||||
|
||||
INSERT INTO `codepostaux` (`Commune`, `Codepos`, `Departement`, `INSEE`) VALUES
|
||||
INSERT INTO `fields_codepostaux` (`Commune`, `Codepos`, `Departement`, `INSEE`) VALUES
|
||||
('L ABERGEMENT CLEMENCIAT', '01400', 'AIN', '01001'),
|
||||
('L ABERGEMENT DE VAREY', '01640', 'AIN', '01002'),
|
||||
('AMAREINS', '01090', 'AIN', '01003'),
|
@ -2,7 +2,7 @@
|
||||
-- Structure de la table `departements`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `departements` (
|
||||
CREATE TABLE IF NOT EXISTS `fields_departements` (
|
||||
`numdep` char(3) NOT NULL DEFAULT '0',
|
||||
`libdep` varchar(30) NOT NULL DEFAULT '',
|
||||
`numreg` tinyint(4) NOT NULL DEFAULT '0',
|
||||
@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS `departements` (
|
||||
-- Contenu de la table `departements`
|
||||
--
|
||||
|
||||
INSERT INTO `departements` (`numdep`, `libdep`, `numreg`, `codeRegionInsee`) VALUES
|
||||
INSERT INTO `fields_departements` (`numdep`, `libdep`, `numreg`, `codeRegionInsee`) VALUES
|
||||
('03', 'Allier', 3, 83),
|
||||
('04', 'Alpes-de-Haute-Provence', 21, 93),
|
||||
('02', 'Aisne', 19, 26),
|
@ -1,14 +1,8 @@
|
||||
--
|
||||
-- Base de données: `ciblage`
|
||||
-- Structure de la table `fields_formejuridique`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Structure de la table `formejuridique`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `formejuridique` (
|
||||
CREATE TABLE IF NOT EXISTS `fields_formejuridique` (
|
||||
`fjCode` int(4) NOT NULL,
|
||||
`fjLibelle` varchar(100) NOT NULL,
|
||||
`fjInsee` tinyint(1) NOT NULL,
|
||||
@ -19,7 +13,7 @@ CREATE TABLE IF NOT EXISTS `formejuridique` (
|
||||
-- Contenu de la table `formejuridique`
|
||||
--
|
||||
|
||||
INSERT INTO `formejuridique` (`fjCode`, `fjLibelle`, `fjInsee`) VALUES
|
||||
INSERT INTO `fields_formejuridique` (`fjCode`, `fjLibelle`, `fjInsee`) VALUES
|
||||
(0, 'Indéterminée', 0),
|
||||
(1, 'Personne physique', 1),
|
||||
(2, 'Groupement de droit privé non doté de la personnalité morale', 1),
|
@ -1,4 +1,4 @@
|
||||
CREATE TABLE `minmax` (
|
||||
CREATE TABLE `fields_minmax` (
|
||||
`cle` VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||
`min` INTEGER NOT NULL,
|
||||
`max` BIGINT NOT NULL
|
@ -1,8 +1,8 @@
|
||||
--
|
||||
-- Structure de la table `naf`
|
||||
-- Structure de la table `fields_naf`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `naf` (
|
||||
CREATE TABLE IF NOT EXISTS `fields_naf` (
|
||||
`code` varchar(6) NOT NULL,
|
||||
`lib` varchar(200) NOT NULL,
|
||||
`niveau` tinyint(1) NOT NULL,
|
||||
@ -11,10 +11,10 @@ CREATE TABLE IF NOT EXISTS `naf` (
|
||||
) DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Contenu de la table `naf`
|
||||
-- Contenu de la table `fields_naf`
|
||||
--
|
||||
|
||||
INSERT INTO `naf` (`code`, `lib`, `niveau`, `parent`) VALUES
|
||||
INSERT INTO `fields_naf` (`code`, `lib`, `niveau`, `parent`) VALUES
|
||||
('01', 'Culture et production animale, chasse et services annexes', 2, 'A'),
|
||||
('011', 'Cultures non permanentes', 3, ''),
|
||||
('0111', 'Culture de céréales (à l''exception du riz), de légumineuses et de graines oléagineuses', 4, ''),
|
@ -2,7 +2,7 @@
|
||||
-- Structure de la table `regions`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `regions` (
|
||||
CREATE TABLE IF NOT EXISTS `fields_regions` (
|
||||
`REGION` tinyint(2) unsigned zerofill NOT NULL,
|
||||
`CHEFLIEU` char(5) NOT NULL,
|
||||
`TNCC` char(1) NOT NULL,
|
||||
@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS `regions` (
|
||||
-- Contenu de la table `regions`
|
||||
--
|
||||
|
||||
INSERT INTO `regions` (`REGION`, `CHEFLIEU`, `TNCC`, `NC`, `NCCENR`) VALUES
|
||||
INSERT INTO `fields_regions` (`REGION`, `CHEFLIEU`, `TNCC`, `NC`, `NCCENR`) VALUES
|
||||
(01, '97105', '3', 'GUADELOUPE', 'Guadeloupe'),
|
||||
(02, '97209', '3', 'MARTINIQUE', 'Martinique'),
|
||||
(03, '97302', '3', 'GUYANE', 'Guyane'),
|
@ -78,27 +78,50 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
|
||||
if ($layout->isEnabled()) {
|
||||
///Get customer's params
|
||||
|
||||
//Get customer's params
|
||||
$paramsM = new Application_Model_CustomerParams();
|
||||
$sql = $paramsM->select()
|
||||
->where('idClient = ?', $identity->idClient)
|
||||
->order('dateContrat DESC')->limit(1);
|
||||
->where('idClient = ?', $identity->idClient)
|
||||
//@todo : add service from WebService
|
||||
->order('dateContrat DESC')->limit(1);
|
||||
|
||||
$params = $paramsM->fetchAll($sql)->toArray();
|
||||
if (count($params)>0) {
|
||||
$identity->filterRNCS = $params[0]['filterRNCS'];
|
||||
$identity->licenceINSEE = $params[0]['licenceINSEE'];
|
||||
$identity->limitLines = $params[0]['limitLines'];
|
||||
$identity->limitFiles = $params[0]['limitFiles'];
|
||||
//@todo : Check dateContrat and calculate end of contrat
|
||||
$identity->limitFiles = $params[0]['limitFiles'];
|
||||
$identity->immediatExtract = $params[0]['immediatExtract'];
|
||||
$identity->dateContrat = $params[0]['dateContrat'];
|
||||
$identity->periodContrat = $params[0]['periodContrat'];
|
||||
$identity->priceLine = $params[0]['priceLine'];
|
||||
$identity->forfait = $params[0]['forfait'];
|
||||
}
|
||||
|
||||
//If no params is detected, display a message to contact support
|
||||
//If no params are detected, display a message to contact support
|
||||
if (count($params)==0) {
|
||||
$request->setModuleName('default')
|
||||
->setControllerName('aide')
|
||||
->setActionName('message')
|
||||
->setParam('typeMsg', 'support');
|
||||
->setControllerName('aide')
|
||||
->setActionName('message')
|
||||
->setParam('typeMsg', 'support');
|
||||
}
|
||||
|
||||
//@todo : Check dateContrat and calculate end of contrat
|
||||
|
||||
|
||||
//Is user declare in app's profils
|
||||
$profilM = new Application_Model_EnrichissementProfils();
|
||||
$sql = $profilM->select()
|
||||
->where("actif=1")
|
||||
->where('login=?', $identity->username);
|
||||
$params = $profilM->fetchAll($sql)->toArray();
|
||||
|
||||
if (count($params)==0) {
|
||||
$request->setModuleName('default')
|
||||
->setControllerName('aide')
|
||||
->setActionName('message')
|
||||
->setParam('typeMsg', 'support');
|
||||
}
|
||||
|
||||
//Get user's preference
|
||||
@ -108,7 +131,7 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
$identity->preferences = json_decode($pref->json, true);
|
||||
}
|
||||
|
||||
//Add a global value to assemble filterRNCS and preferences RNCS
|
||||
//Add a global value to join filterRNCS and preferences RNCS
|
||||
if ($identity->filterRNCS) {
|
||||
$identity->globalRNCS = 1;
|
||||
}
|
||||
|
@ -151,10 +151,6 @@ class Enrichissement
|
||||
* @var unknown_type
|
||||
*/
|
||||
protected $fields = array(
|
||||
'actif' => array(
|
||||
'label' => "Actif",
|
||||
'column' => 'actif',
|
||||
),
|
||||
'siege' => array(
|
||||
'label' => "Type d'établissement",
|
||||
'column' => 'siege'
|
||||
|
@ -55,6 +55,10 @@ $(document).ready(function(){
|
||||
|
||||
$('.mode').click(function(){
|
||||
var id = $(this).attr('id');
|
||||
|
||||
|
||||
|
||||
|
||||
if($('#'+id).css('display') == 'none') {
|
||||
$('#'+id).show('blind');
|
||||
$(this).html('<img src="/themes/default/images/fleche-haut.gif" />');
|
||||
|
Loading…
Reference in New Issue
Block a user