Merge from branch 1.3
This commit is contained in:
commit
f0f8abfc9f
@ -86,9 +86,9 @@ class DashboardController extends Zend_Controller_Action
|
||||
|
||||
//Compter le nombre de page
|
||||
$sql = $criteresM->select()
|
||||
->from($criteresM, array('nb' => 'COUNT(*)'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username);
|
||||
->from($criteresM, array('nb' => 'COUNT(*)'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username);
|
||||
$count = $criteresM->fetchRow($sql);
|
||||
$nbCiblage = $count->nb;
|
||||
|
||||
@ -148,11 +148,11 @@ class DashboardController extends Zend_Controller_Action
|
||||
->where('login = ?', $user->username)
|
||||
->where('id = ?', $comptageId);
|
||||
$criteres = $criteresM->fetchRow($sql)->toArray();
|
||||
|
||||
|
||||
$infosCriteres = array();
|
||||
if ($criteres != null) {
|
||||
$comptageRef = $criteres['reference'];
|
||||
|
||||
|
||||
$decodeCriteres = json_decode($criteres['criteres'], true);
|
||||
|
||||
//Construction affichage des critères
|
||||
@ -180,9 +180,9 @@ class DashboardController extends Zend_Controller_Action
|
||||
$enrichissementsM = new Application_Model_EnrichissementIdentifiants();
|
||||
$sql = $enrichissementsM->select()
|
||||
->where('idCriteres = ?', $comptageId);
|
||||
|
||||
|
||||
$enrichissements = $enrichissementsM->fetchAll($sql);
|
||||
|
||||
|
||||
//Affichage
|
||||
$this->view->comptageId = $comptageId;
|
||||
$this->view->comptageRef = $comptageRef;
|
||||
@ -308,21 +308,21 @@ 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) {
|
||||
@ -331,7 +331,7 @@ class DashboardController extends Zend_Controller_Action
|
||||
} 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.';
|
||||
|
@ -77,8 +77,8 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
$ref = $request->getParam('ref');
|
||||
|
||||
//Si forfait check si le montant restant est suffisant
|
||||
|
||||
|
||||
|
||||
|
||||
//Identifiant comptage
|
||||
$comptage = new Application_Model_Comptages();
|
||||
$sql = $comptage->select()->where('idDefinition = ?', $idCriteres);
|
||||
@ -92,6 +92,10 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
|
||||
$structure = json_decode($criteres->criteres, true);
|
||||
|
||||
//Informations utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Récupération des SIRET
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$ciblage = new Ciblage($structure, $user->globalRNCS);
|
||||
@ -125,7 +129,7 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
$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);
|
||||
}
|
||||
|
||||
@ -138,12 +142,12 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
$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()
|
||||
@ -151,7 +155,7 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
->where('actif=1')
|
||||
->where('login=?', $user->username);
|
||||
$profils = $profilsM->fetchAll($sql)->toArray();
|
||||
|
||||
|
||||
$profilId = 0;
|
||||
foreach($profils as $item) {
|
||||
if ($selectprofil == $item['id']) {
|
||||
@ -164,11 +168,11 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
if ($profilId == 0) {
|
||||
$profilId = $defaultProfilId;
|
||||
}
|
||||
|
||||
|
||||
Zend_Registry::get('firebug')->info($profilId);
|
||||
|
||||
|
||||
if ( count($profils)>0 ) {
|
||||
|
||||
|
||||
$this->view->assign('profil', $profilId);
|
||||
$idCritere = $request->getParam('id', null);
|
||||
|
||||
@ -194,14 +198,14 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
$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 = '';
|
||||
@ -211,29 +215,29 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
}
|
||||
$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 - $prix;
|
||||
}
|
||||
//Limite lignes totales
|
||||
@ -242,9 +246,9 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
}
|
||||
//Illimité
|
||||
elseif ($user->forfait==0 && $user->limitFiles==0) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$this->view->prix = $prix;
|
||||
$this->view->id = $item['id'];
|
||||
$this->view->ref = $criteres->reference.'-'.uniqid();
|
||||
@ -260,9 +264,9 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$identity = $auth->getIdentity();
|
||||
|
||||
|
||||
$id = $this->getRequest()->getParam('id');
|
||||
|
||||
|
||||
/*
|
||||
* Do not download file that not own by the user
|
||||
* List profil
|
||||
@ -271,7 +275,7 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
$sql = $profilM->select()
|
||||
->from($profilM, array('id'))
|
||||
->where('login=?',$identity->username);
|
||||
|
||||
|
||||
$profils = $profilM->fetchAll($sql);
|
||||
if ( $profils->count()>0 ) {
|
||||
$profilList = array();
|
||||
@ -279,7 +283,7 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
$profilList[] = $item['id'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* List finish file
|
||||
*/
|
||||
|
@ -9,11 +9,11 @@ class FieldsController extends Zend_Controller_Action
|
||||
$this->view->headScript()
|
||||
->appendFile('/libs/tree/jquery.jstree.js', 'text/javascript')
|
||||
->appendFile('/themes/default/scripts/fields.js', 'text/javascript');
|
||||
|
||||
|
||||
$field = new Scores_Fields();
|
||||
$this->view->fields = $field;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reset criteres by family
|
||||
*/
|
||||
@ -21,7 +21,7 @@ class FieldsController extends Zend_Controller_Action
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
|
||||
$request = $this->getRequest();
|
||||
$family = $request->getParam('family');
|
||||
if ( !empty($family) )
|
||||
@ -30,7 +30,7 @@ class FieldsController extends Zend_Controller_Action
|
||||
$fields->resetFamille($family);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Manage autocomplete
|
||||
*/
|
||||
@ -40,9 +40,9 @@ class FieldsController extends Zend_Controller_Action
|
||||
$request = $this->getRequest();
|
||||
$name = $request->getParam('name');
|
||||
$q = strtolower($request->getParam('q'));
|
||||
|
||||
|
||||
$output = array();
|
||||
|
||||
|
||||
switch ($name) {
|
||||
case 'ape_etab':
|
||||
case 'ape_entrep':
|
||||
@ -70,7 +70,7 @@ class FieldsController extends Zend_Controller_Action
|
||||
$sql->where("LOWER(lib) ".$where);
|
||||
}
|
||||
$sql->where('niveau = 5');
|
||||
|
||||
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
@ -80,13 +80,13 @@ class FieldsController extends Zend_Controller_Action
|
||||
}
|
||||
break;
|
||||
case 'geo':
|
||||
|
||||
|
||||
//Replace characters ' and - in space
|
||||
$q = preg_replace("/['-]/", ' ', $q);
|
||||
|
||||
|
||||
//Remove characters
|
||||
$q = preg_replace("/^[a-z]\s/i", '', $q);
|
||||
|
||||
|
||||
//Detect if we have string
|
||||
if ( preg_match("/[a-zA-Z]+/", $q) )
|
||||
{
|
||||
@ -118,7 +118,7 @@ class FieldsController extends Zend_Controller_Action
|
||||
'value' => 'R'.$item->REGION
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//Département
|
||||
$table = new Application_Model_Departements();
|
||||
$sql = $table->select();
|
||||
@ -145,7 +145,7 @@ class FieldsController extends Zend_Controller_Action
|
||||
'value' => 'D'.$item->numdep
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//Ville
|
||||
$table = new Application_Model_CodePostaux();
|
||||
$sql = $table->select();
|
||||
@ -172,9 +172,22 @@ class FieldsController extends Zend_Controller_Action
|
||||
'value' => 'C'.$item->INSEE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
} elseif ( preg_match('/[0-9]{1,5}/', $q) ) {
|
||||
|
||||
|
||||
//Code Département
|
||||
if (strlen($q)==2) {
|
||||
$table = new Application_Model_Departements();
|
||||
$sql = $table->select()->where('numdep=?', $q);
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->libdep . ' (Département)',
|
||||
'value' => 'D'.$item->numdep
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//Code Postal
|
||||
$table = new Application_Model_CodePostaux();
|
||||
$sql = $table->select()->where('Codepos LIKE "'.$q.'%"');
|
||||
@ -185,15 +198,15 @@ class FieldsController extends Zend_Controller_Action
|
||||
'value' => 'C'.$item->INSEE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case 'cj':
|
||||
$table = new Application_Model_FormeJuridique();
|
||||
$separator = ' , ';
|
||||
$sql = $table->select();
|
||||
|
||||
|
||||
$queries = explode(' ', $q);
|
||||
if (count($queries)>0) {
|
||||
$where = '';
|
||||
@ -227,7 +240,7 @@ class FieldsController extends Zend_Controller_Action
|
||||
}
|
||||
$this->view->assign('output', $output);
|
||||
}
|
||||
|
||||
|
||||
public function checkvalue(){}
|
||||
|
||||
|
||||
}
|
@ -226,7 +226,15 @@ class GestionController extends Zend_Controller_Action
|
||||
*/
|
||||
public function ciblagesAction()
|
||||
{
|
||||
$comptagesM = new Application_Model_Comptages();
|
||||
$request = $this->getRequest();
|
||||
|
||||
$month = $request->getParam('month', date('m'));
|
||||
$year = $request->getParam('year', date('Y'));
|
||||
|
||||
$this->view->assign('month', $month);
|
||||
$this->view->assign('year', $year);
|
||||
|
||||
$comptagesM = new Application_Model_Comptages();
|
||||
|
||||
$sql = $comptagesM->select()->setIntegrityCheck(false)
|
||||
->from('ciblage_comptages', array(
|
||||
@ -237,7 +245,9 @@ class GestionController extends Zend_Controller_Action
|
||||
))
|
||||
->join('ciblage_criteres', 'ciblage_comptages.idDefinition = ciblage_criteres.id', array('ciblage_criteres.reference'))
|
||||
->order('ciblage_comptages.dateAjout DESC')
|
||||
->group('ciblage_criteres.id');
|
||||
->group('ciblage_criteres.id')
|
||||
->where("ciblage_comptages.dateAjout LIKE '".$year."-".$month."%'")
|
||||
->order('ciblage_comptages.dateAjout DESC');
|
||||
|
||||
$comptages = $comptagesM->fetchAll($sql)->toArray();
|
||||
Zend_Registry::get('firebug')->info($comptages);
|
||||
@ -245,6 +255,43 @@ class GestionController extends Zend_Controller_Action
|
||||
$this->view->comptages = $comptages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Affichage des critères du ciblage
|
||||
*/
|
||||
public function ciblagecriteresAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$id = $request->getParam('id');
|
||||
|
||||
//Lecture des paramètres du ciblage
|
||||
$criteresM = new Application_Model_Criteres();
|
||||
$sql = $criteresM->select()
|
||||
->where('id = ?', $id);
|
||||
$criteres = $criteresM->fetchRow($sql)->toArray();
|
||||
|
||||
$decodeCriteres = json_decode($criteres['criteres'], true);
|
||||
|
||||
$fields = new Scores_Fields();
|
||||
|
||||
//Construction affichage des critères
|
||||
foreach ( $decodeCriteres as $key => $item ) {
|
||||
|
||||
$inValue = $fields->getValueLabel($key, $item['in']);
|
||||
$exValue = $fields->getValueLabel($key, $item['ex']);
|
||||
|
||||
//Add label to struct for display
|
||||
$infosCriteres[] = array(
|
||||
'label' => $fields->getLabel($key),
|
||||
'in' => $inValue,
|
||||
'ex' => $exValue,
|
||||
);
|
||||
}
|
||||
|
||||
$this->view->criteres = $infosCriteres;
|
||||
}
|
||||
|
||||
/**
|
||||
* List customers
|
||||
*/
|
||||
|
@ -10,7 +10,7 @@ class UserController extends Zend_Controller_Action
|
||||
$this->view->inlineScript()
|
||||
->appendFile('/libs/jquery/jquery.js')
|
||||
->appendFile('/libs/jquery/jquery.infieldlabel.min.js');
|
||||
|
||||
|
||||
//@todo : gestion des affichages particuliers pour les clients
|
||||
$this->view->headTitle()->append('Connexion');
|
||||
$form = new Form_Login();
|
||||
@ -52,16 +52,16 @@ class UserController extends Zend_Controller_Action
|
||||
|
||||
$ajax = $request->getParam('ajax', 0);
|
||||
$this->view->assign('ajax', $ajax);
|
||||
|
||||
|
||||
$refresh = 5;
|
||||
|
||||
$url = 'http://'.$_SERVER['SERVER_NAME'].$this->view->url(array(
|
||||
|
||||
$url = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$this->view->url(array(
|
||||
'controller' => 'user',
|
||||
'action' => 'login',
|
||||
), null, true);
|
||||
|
||||
$this->view->assign('url', $url);
|
||||
|
||||
|
||||
if (!$ajax) {
|
||||
$this->view->assign('refresh', $refresh);
|
||||
$this->view->headMeta()->appendHttpEquiv('refresh', $refresh.'; url='.$url);
|
||||
|
@ -26,7 +26,7 @@ class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
|
||||
$display = true;
|
||||
$out = '';
|
||||
|
||||
|
||||
//If more than one field exist we need to make a special display
|
||||
if ( $nbFields > 1) {
|
||||
$out.= '<div class="fieldgrp clearfix">';
|
||||
@ -108,12 +108,12 @@ class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
$html = $this->structureHTML($name, '');
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$label = $labelG;
|
||||
if ( array_key_exists('label', $options) ) {
|
||||
$label = $options['label'];
|
||||
}
|
||||
|
||||
|
||||
$style = '';
|
||||
$class = ' class="fieldgrp"';
|
||||
if ( $display===false ) {
|
||||
@ -122,17 +122,17 @@ class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
if ( !empty($title) ) {
|
||||
$title = ' title="'.$title.'"';
|
||||
}
|
||||
|
||||
|
||||
$out.= '<div id="field_'.$type.'_'.$this->name.'" '.$class.''.$style.''.$title.'>';
|
||||
$out.= $this->structureLabel($label);
|
||||
$out.= '<div class="field">'.$html.'</div>';
|
||||
$out.= '</div>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Définition du label
|
||||
* @param unknown_type $label
|
||||
@ -346,7 +346,7 @@ class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
protected function textHTML($name, $options)
|
||||
{
|
||||
$return = '<input type="text" class="criteres autocomplete" name="'.$name.'" />';
|
||||
$return.= '<ul id="selectqueries"></ul>';
|
||||
$return.= '<ul id="'.$name.'" class="selectqueries"></ul>';
|
||||
$return.= '<a href="#" class="autocomplete">Sélectionner</a>';
|
||||
$return.= ' <a href="#" class="autocompleteEx">Exclure</a>';
|
||||
return $return;
|
||||
|
@ -101,5 +101,4 @@
|
||||
<?php }?>
|
||||
</fieldset>
|
||||
|
||||
|
||||
</div>
|
@ -38,21 +38,26 @@ Activer le mode personnalisation
|
||||
<div>
|
||||
<label>Filtrer au seul périmètre RNCS </label><br/>
|
||||
<span>Les éléments soumis à redevance INSEE sont automatiquement retirer du ciblage</span><br/>
|
||||
<input type="checkbox" name="rncs" value="1" <?php if ($this->prefFilterRncs==1) echo ' checked="checked"';?>
|
||||
<?php if ($this->filterRNCS==1) echo ' disabled="disable"';?> />
|
||||
</div>
|
||||
<?php if ($this->filterRNCS==1) {?>
|
||||
<i>Votre compte est paramétré pour ne sélectionner que les entités provenant du RNCS</i>
|
||||
<?php } else {?>
|
||||
<input type="checkbox" name="rncs" value="1" <?php if ($this->prefFilterRncs==1) echo ' checked="checked"';?>
|
||||
<?php if ($this->filterRNCS==1) echo ' disabled="disable"';?> />
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div>
|
||||
<label>Afficher le nombre d'unité INSEE</label><br/>
|
||||
<?php if ($this->filterRNCS==1) {?>
|
||||
<i>Votre compte est paramétré pour ne sélectionner que les entités provenant du RNCS</i>
|
||||
<?php } else {?>
|
||||
<span><i>Pour permettre une estimation du cout de la redevance INSEE, en activant cette option,
|
||||
le nombre d'unité insee est affiché à chaque comptage</i></span><br/>
|
||||
<input type="checkbox" name="insee" value="1" <?php if ($this->prefInterfaceInsee==1) echo ' checked="checked"';?>
|
||||
<?php if ($this->filterRNCS==1) echo ' disabled="disable"';?>/>
|
||||
<?php }?>
|
||||
</div>
|
||||
<script>
|
||||
$('input[type=checkbox]').click(function(){
|
||||
|
@ -6,7 +6,7 @@ Erreur
|
||||
<p>Le nombre de lignes à enrichir est trop important.
|
||||
Vous pouvez prendre contact avec le service commercial en cliquant ici.
|
||||
Vos critères seront enregistrées et une référence vous sera fourni.</p>
|
||||
<?php } elseif ($this->forfaitRemain<=0) { ?>
|
||||
<?php } elseif ($this->forfaitRemain && $this->forfaitRemain<=0) { ?>
|
||||
<p>Le montant de votre forfait est insuffisant
|
||||
Vous pouvez prendre contact avec le service commercial en cliquant ici.
|
||||
Vos critères seront enregistrées et une référence vous sera fourni.</p>
|
||||
|
@ -60,6 +60,7 @@
|
||||
<?=$this->Field('geo_etranger')?>
|
||||
<?=$this->Field('geo_corse')?>
|
||||
</li>
|
||||
<li class="advanced"><?=$this->Field('codesdepts')?></li>
|
||||
<li class="advanced"><?=$this->Field('codespostaux')?></li>
|
||||
<li class="advanced"><?=$this->Field('codesinsee')?></li>
|
||||
<li><?=$this->Field('zus')?></li>
|
||||
|
@ -0,0 +1,32 @@
|
||||
<fieldset>
|
||||
<legend>Critères</legend>
|
||||
|
||||
<?php foreach ( $this->criteres as $criteres ) { ?>
|
||||
<div>
|
||||
<h3><?=$criteres['label']?></h3>
|
||||
<?php if (is_string($criteres['in'])) {?>
|
||||
<div><?=$criteres['in']?></div>
|
||||
<?php } else {?>
|
||||
|
||||
<?php if ( is_array($criteres['in']) && count($criteres['in'])>0 ) { ?>
|
||||
<div>
|
||||
<p>Inclus :</p>
|
||||
<?php foreach( $criteres['in'] as $item ) {?>
|
||||
<p><?=$item?></p>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php if ( is_array($criteres['ex']) && count($criteres['ex'])>0 ) { ?>
|
||||
<div>
|
||||
<p>Exclus :</p>
|
||||
<?php foreach( $criteres['ex'] as $item ) {?>
|
||||
<p><?=$item?></p>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
</fieldset>
|
@ -1,27 +1,71 @@
|
||||
<?php
|
||||
$YearBegin = 2012;
|
||||
$Years = date('Y') - $YearBegin;
|
||||
?>
|
||||
<div id="dashboard">
|
||||
<h2>Liste des ciblages</h2>
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
<th><b>Id</b></th>
|
||||
<th><b>Date de création</b></th>
|
||||
<th><b>Référence</b></th>
|
||||
<th><b>Résultat</b></th>
|
||||
<th><b>Insee</b></th>
|
||||
<th><b>Actions</b></th>
|
||||
</tr>
|
||||
<?php foreach($this->comptages as $comptage): ?>
|
||||
<tr>
|
||||
<td><?=$comptage['idDefinition']?></td>
|
||||
<td><?=$comptage['dateAjout']?></td>
|
||||
<td><?=$comptage['reference']?></td>
|
||||
<td><?=$comptage['resultat']?></td>
|
||||
<td><?=$comptage['uniteInsee']?></td>
|
||||
<td>
|
||||
<a href="">Actualiser</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<form method="post" action="">
|
||||
<select name="year">
|
||||
<?php for ($i=0 ; $i<=$Years ; $i++ ) {?>
|
||||
<?php $select=''; if ($YearBegin+$Years-$i==$this->year) $select = ' selected';?>
|
||||
<option value="<?=$YearBegin+$Years-$i?>"<?=$select?>><?=$YearBegin+$Years-$i?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<select name="month">
|
||||
<?php for ( $i=1 ; $i<=12 ; $i++ ) {?>
|
||||
<?php $select=''; if ($i==$this->month) $select = ' selected';?>
|
||||
<option value="<?=$i?>"<?=$select?>><?=str_pad($i, 2, '0', STR_PAD_LEFT)?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<input type="submit" name="submit" value="Ok"/>
|
||||
</form>
|
||||
<h2>Liste des ciblages</h2>
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
<th><b>Id</b></th>
|
||||
<th><b>Date de création</b></th>
|
||||
<th><b>Référence</b></th>
|
||||
<th><b>Résultat</b></th>
|
||||
<th><b>Insee</b></th>
|
||||
<th><b>Actions</b></th>
|
||||
</tr>
|
||||
<?php foreach($this->comptages as $comptage): ?>
|
||||
<tr id="<?=$comptage['idDefinition']?>">
|
||||
<td><?=$comptage['idDefinition']?></td>
|
||||
<td><?=$comptage['dateAjout']?></td>
|
||||
<td><?=$comptage['reference']?></td>
|
||||
<td><?=$comptage['resultat']?></td>
|
||||
<td><?=$comptage['uniteInsee']?></td>
|
||||
<td>
|
||||
<a href="">Actualiser</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('table tr').on('click', function(){
|
||||
var href = '/gestion/ciblagecriteres/id/'+$(this).attr('id');
|
||||
if (href!='#' || href!='') {
|
||||
var title = $(this).attr('title');
|
||||
var dialogOpts = {
|
||||
bgiframe: true,
|
||||
title: title,
|
||||
width: 650,
|
||||
height: 600,
|
||||
modal: true,
|
||||
open: function(event, ui) {
|
||||
$(this).html('Chargement...');
|
||||
$(this).load(href);
|
||||
},
|
||||
buttons: {
|
||||
Quitter: function() { $(this).dialog('close'); }
|
||||
},
|
||||
close: function() { $('#dialog').remove(); }
|
||||
};
|
||||
$('<div id="dialog"></div>').dialog(dialogOpts);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
$YearBegin = 2012;
|
||||
$Years = date('Y') - $YearsBegin;
|
||||
$Years = date('Y') - $YearBegin;
|
||||
?>
|
||||
<div id="dashboard">
|
||||
<div>
|
||||
<form method="post" action="">
|
||||
<select name="year">
|
||||
<?php for ($i=0 ; $i<$Years ; $i++ ) {?>
|
||||
<?php $select=''; if ($i==$this->year) $select = ' selected';?>
|
||||
<option value="<?=$YearBegin+$i?>"<?=$slect?>><?=$YearBegin+$i?></option>
|
||||
<?php for ($i=0 ; $i<=$Years ; $i++ ) {?>
|
||||
<?php $select=''; if ($YearBegin+$Years-$i==$this->year) $select = ' selected';?>
|
||||
<option value="<?=$YearBegin+$Years-$i?>"<?=$select?>><?=$YearBegin+$Years-$i?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<select name="month">
|
||||
@ -32,7 +32,7 @@ $Years = date('Y') - $YearsBegin;
|
||||
<th><b>Reférence ciblage</b></th>
|
||||
<th><b>Actions</b></th>
|
||||
</tr>
|
||||
<?php foreach($this->commandes as $item): ?>
|
||||
<?php foreach($this->commandes as $item): ?>
|
||||
<tr>
|
||||
<td><?=$item['dateAdded']?></td>
|
||||
<td><?=$item['commandeReference']?></td>
|
||||
@ -45,7 +45,7 @@ $Years = date('Y') - $YearsBegin;
|
||||
<a href="<?=$this->url(array('controller'=> 'gestion','action'=>'extract', 'id'=>$item['id']))?>">Extraire les sirets</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
$YearBegin = 2012;
|
||||
$Years = date('Y') - $YearsBegin;
|
||||
$Years = date('Y') - $YearBegin;
|
||||
?>
|
||||
<div id="dashboard">
|
||||
<form method="post" action="">
|
||||
<select name="year">
|
||||
<?php for ($i=0 ; $i<$Years ; $i++ ) {?>
|
||||
<?php $select=''; if ($i==$this->year) $select = ' selected';?>
|
||||
<option value="<?=$YearBegin+$i?>"<?=$slect?>><?=$YearBegin+$i?></option>
|
||||
<?php for ($i=0 ; $i<=$Years ; $i++ ) {?>
|
||||
<?php $select=''; if ($YearBegin+$Years-$i==$this->year) $select = ' selected';?>
|
||||
<option value="<?=$YearBegin+$Years-$i?>"<?=$select?>><?=$YearBegin+$Years-$i?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<select name="month">
|
||||
|
@ -29,7 +29,7 @@
|
||||
<?php if ( is_string($item['in']) && !empty($item['in']) ) { ?>
|
||||
<br/> <?=$item['in']?>
|
||||
<?php } elseif ( is_array($item['in']) || is_array($item['ex']) ) {?>
|
||||
<br/> <a class="criterelist" href="<?=$this->url(array('controller'=>'index', 'action'=>'criterelist', 'key'=>$critere), null, true)?>">Liste</a>
|
||||
<br/> <a class="criterelist" title="<?=$item['label']?>" href="<?=$this->url(array('controller'=>'index', 'action'=>'criterelist', 'key'=>$critere), null, true)?>">Liste</a>
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
|
@ -148,7 +148,7 @@ class Enrichissement
|
||||
|
||||
/**
|
||||
* Déclaration des champs exportable
|
||||
* @var unknown_type
|
||||
* @var array
|
||||
*/
|
||||
protected $fields = array(
|
||||
'siege' => array(
|
||||
|
@ -371,7 +371,7 @@ class Scores_Fields
|
||||
'codesinsee' => array(
|
||||
'label' => 'Liste de codes Insee',
|
||||
'fields' => array(
|
||||
'list' => array(),
|
||||
'list' => array('title' => "Liste de codes Insee"),
|
||||
),
|
||||
'famille' => 'geographique',
|
||||
'activated' => true,
|
||||
@ -380,11 +380,20 @@ class Scores_Fields
|
||||
'codespostaux' => array(
|
||||
'label' => 'Liste de codes postaux',
|
||||
'fields' => array(
|
||||
'list' => array(),
|
||||
'list' => array('title' => "Liste de codes postaux"),
|
||||
),
|
||||
'famille' => 'geographique',
|
||||
'activated' => true,
|
||||
'title' => 'Liste de codes postaux séparés des virgules ou des points-virgules',
|
||||
'title' => 'Liste de codes postaux séparés par des virgules ou des points-virgules',
|
||||
),
|
||||
'codesdepts' => array(
|
||||
'label' => 'Liste de départements',
|
||||
'fields' => array(
|
||||
'list' => array('title' => "Liste de départements"),
|
||||
),
|
||||
'famille' => 'geographique',
|
||||
'activated' => true,
|
||||
'title' => 'Liste de code départements séparés par des virgules ou des points-virgules',
|
||||
),
|
||||
'adr_reg' => array(
|
||||
'label' => 'Liste code région',
|
||||
@ -798,7 +807,7 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
$this->ciblage['NB']['insee'] = $this->insee;
|
||||
$session->ciblage = $this->ciblage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* After define criteres and no error return, set the session externaly
|
||||
* @return void
|
||||
@ -826,18 +835,18 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
Zend_Registry::get('firebug')->info('CLE INCORRECT');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$sessionKey = $key;
|
||||
if (array_key_exists('sessionKey', $this->fields[$key])) {
|
||||
$sessionKey = $this->fields[$key]['sessionKey'];
|
||||
}
|
||||
|
||||
|
||||
//Remove critere for these values on all type of fields
|
||||
if ( in_array($value, array('', '-', null)) ) {
|
||||
unset($this->ciblage[$sessionKey]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* single
|
||||
* interval
|
||||
@ -874,7 +883,7 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
if ( in_array($types[0], array('interval', 'intervalDate')) ) {
|
||||
$value = explode(',', $value);
|
||||
}
|
||||
|
||||
|
||||
//Remove duplicate values
|
||||
if (is_array($value) ) {
|
||||
$value = array_unique($value);
|
||||
@ -892,7 +901,7 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
if ($minmax!==false) {
|
||||
$valMin = $minmax->min;
|
||||
$valMax = $minmax->max;
|
||||
|
||||
|
||||
if ($value[0]<$valMin) {
|
||||
$value[0] = $valMin;
|
||||
}
|
||||
@ -905,7 +914,7 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
if ($value[1]<$valMin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case 'checkbox':
|
||||
@ -917,7 +926,7 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
//@todo : Check if values exist
|
||||
break;
|
||||
case 'list':
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -931,10 +940,10 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
Zend_Registry::get('firebug')->info($value);
|
||||
$this->ciblage[$sessionKey]['in'] = $value;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Définir les critères en une fois
|
||||
* @param array $criteres Criteres as array with key => val
|
||||
@ -1102,10 +1111,10 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
|
||||
$out = array();
|
||||
$nafM = new Application_Model_Naf();
|
||||
$sql = $nafM->select()->from($nafM, array('lib'))->where('code IN ('.join(',',$values).')');
|
||||
$sql = $nafM->select()->from($nafM, array('lib', 'code'))->where('code IN ('.join(',',$values).')');
|
||||
$result = $nafM->fetchAll($sql)->toArray();
|
||||
foreach ( $result as $elem ) {
|
||||
$out[] = $elem['lib'];
|
||||
$out[] = $elem['lib'].' ('.$elem['code'].')';
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
@ -1120,15 +1129,18 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
switch( substr($item,0,1) ) {
|
||||
case 'C':
|
||||
$communeM = new Application_Model_CodePostaux();
|
||||
$sql = $communeM->select()->from($communeM, array('Commune'))->where('INSEE = ?', substr($item, 1));
|
||||
$sql = $communeM->select()->from($communeM, array('Commune', 'Codepos'))
|
||||
->where('INSEE = ?', substr($item, 1));
|
||||
$result = $communeM->fetchAll($sql)->toArray();
|
||||
$out[] = $result[0]['Commune'];
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$out[] = $result[0]['Commune'].' ('.$result[0]['Codepos'].')';
|
||||
break;
|
||||
case 'D':
|
||||
$departementsM = new Application_Model_Departements();
|
||||
$sql = $departementsM->select()->from($departementsM, array('libdep'))->where('numdep = ?', substr($item, 1));
|
||||
$sql = $departementsM->select()->from($departementsM, array('libdep', 'numdep'))
|
||||
->where('numdep = ?', substr($item, 1));
|
||||
$result = $departementsM->fetchAll($sql)->toArray();
|
||||
$out[] = $result[0]['libdep'];
|
||||
$out[] = $result[0]['libdep'].' ('.$result[0]['numdep'].')';
|
||||
break;
|
||||
case 'R':
|
||||
$regionsM = new Application_Model_Regions();
|
||||
@ -1141,16 +1153,54 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
return $out;
|
||||
}
|
||||
|
||||
public function getValueLabelCodespostaux($values)
|
||||
{
|
||||
foreach ( $values as $item ) {
|
||||
$communeM = new Application_Model_CodePostaux();
|
||||
$sql = $communeM->select()->from($communeM, array('Commune'))->where('Codepos = ?', $item);
|
||||
$result = $communeM->fetchAll($sql)->toArray();
|
||||
$strCommunes = '';
|
||||
foreach ( $result as $c ) {
|
||||
if (!empty($strCommunes)) $strCommunes.= ', ';
|
||||
$strCommunes.= $c['Commune'];
|
||||
}
|
||||
$out[] = $item.' ('.$strCommunes.')';
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
public function getValueLabelCodesdepts($values)
|
||||
{
|
||||
foreach ( $values as $item ) {
|
||||
$departementsM = new Application_Model_Departements();
|
||||
$sql = $departementsM->select()->from($departementsM, array('libdep'))->where('numdep = ?', $item);
|
||||
$result = $departementsM->fetchAll($sql)->toArray();
|
||||
$out[] = $item.' ('.$result[0]['libdep'].')';
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
public function getValueLabelCodeinsee($values)
|
||||
{
|
||||
foreach ( $values as $item ) {
|
||||
$communeM = new Application_Model_CodePostaux();
|
||||
$sql = $communeM->select()->from($communeM, array('Commune'))->where('INSEE = ?', $item);
|
||||
$result = $communeM->fetchAll($sql)->toArray();
|
||||
$out[] = $item.' ('.$result[0]['Commune'].')';
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
public function getValueLabelJuridique($values)
|
||||
{
|
||||
$values = array_map(function($value){ return '"'.$value.'"'; }, $values);
|
||||
|
||||
$out = array();
|
||||
$fjM = new Application_Model_FormeJuridique();
|
||||
$sql = $fjM->select()->from($fjM, array('fjLibelle'))->where('fjCode IN ('.join(',',$values).')');
|
||||
$sql = $fjM->select()->from($fjM, array('fjLibelle', 'fjCode'))->where('fjCode IN ('.join(',',$values).')');
|
||||
$result = $fjM->fetchAll($sql)->toArray();
|
||||
foreach ( $result as $elem ) {
|
||||
$out[] = $elem['fjLibelle'];
|
||||
$out[] = $elem['fjLibelle'].' ('.$elem['fjCode'].')';
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
@ -1212,6 +1262,10 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
return $this->{'getValueLabel'.$action}($values);
|
||||
//Recherche des valeurs
|
||||
break;
|
||||
case 'list':
|
||||
$action = ucfirst($name);
|
||||
return $this->{'getValueLabel'.$action}($values);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,10 +1,10 @@
|
||||
$(document).ready(function()
|
||||
{
|
||||
$( "#tabs" ).tabs({
|
||||
$('#tabs').tabs({
|
||||
cookie: { expires: 1 }
|
||||
});
|
||||
|
||||
$("div.fieldgrp").each(function(){
|
||||
$('div.fieldgrp').each(function(){
|
||||
var title = $(this).attr('title');
|
||||
if (title) {
|
||||
$(this).qtip({
|
||||
@ -68,25 +68,29 @@ $(document).ready(function()
|
||||
|
||||
$('input[type=text].autocomplete')
|
||||
.bind( "keydown", function( event ) {
|
||||
if ( event.keyCode === $.ui.keyCode.TAB &&
|
||||
$( this ).data( "autocomplete" ).menu.active ) {
|
||||
if ( event.keyCode === $.ui.keyCode.TAB && $(this).data("autocomplete").menu.active ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
})
|
||||
.autocomplete({
|
||||
minLength:3,
|
||||
minLength:2,
|
||||
source: function(request, response) {
|
||||
var val = extractLast( request.term );
|
||||
$.getJSON( '/fields/autocomplete', { q: val, name: this.element.attr('name') }, function(data) {
|
||||
$.getJSON('/fields/autocomplete', { q: val, name: this.element.attr('name') }, function(data) {
|
||||
response(data);
|
||||
});
|
||||
},
|
||||
focus: function() { return false; },
|
||||
select: function( event, ui ) {
|
||||
if (ui.item.value != '') {
|
||||
var oldhtml = $('ul#selectqueries').html();
|
||||
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>';
|
||||
$('ul#selectqueries').html(oldhtml + newhtml);
|
||||
selectObject.html(oldhtml + newhtml);
|
||||
|
||||
|
||||
}
|
||||
this.value = '';
|
||||
return false;
|
||||
@ -97,7 +101,7 @@ $(document).ready(function()
|
||||
$('#tabs').delegate('a.autocomplete', 'click', function(e){
|
||||
e.stopPropagation();
|
||||
var name = $(this).parent().find('input.criteres').attr('name');
|
||||
var ul = $(this).parent().find('ul#selectqueries');
|
||||
var ul = $(this).parent().find('ul.selectqueries');
|
||||
var values = new Array();
|
||||
if ($('li', ul).length>0) {
|
||||
$('li', ul).each(function(){
|
||||
@ -111,7 +115,7 @@ $(document).ready(function()
|
||||
$('#tabs').delegate('a.autocompleteEx', 'click', function(e){
|
||||
e.stopPropagation();
|
||||
var name = $(this).parent().find('input.criteres').attr('name');
|
||||
var ul = $(this).parent().find('ul#selectqueries');
|
||||
var ul = $(this).parent().find('ul.selectqueries');
|
||||
var values = new Array();
|
||||
if ($('li', ul).length>0) {
|
||||
$('li', ul).each(function(){
|
||||
|
@ -30,7 +30,7 @@ profil.mail.email.support = supportdev@scores-decisions.com
|
||||
profil.mail.email.supportdev = supportdev@scores-decisions.com
|
||||
profil.mail.email.contact = supportdev@scores-decisions.com
|
||||
profil.mail.email.production = supportdev@scores-decisions.com
|
||||
profil.path.data = "d:\www\dataciblage"
|
||||
profil.path.data = "/home/vhosts/data"
|
||||
profil.db.ciblage.adapter=mysqli
|
||||
profil.db.ciblage.params.host=127.0.0.1
|
||||
profil.db.ciblage.params.username=ciblage
|
||||
|
Loading…
Reference in New Issue
Block a user