Pouvoir modifier les profils
This commit is contained in:
parent
689566d34c
commit
86cfe1e141
@ -19,8 +19,6 @@ class ProfilController extends Zend_Controller_Action
|
|||||||
|
|
||||||
require_once 'Scores/Enrichissement.php';
|
require_once 'Scores/Enrichissement.php';
|
||||||
$data = new Enrichissement();
|
$data = new Enrichissement();
|
||||||
$this->view->assign('elements', $data->getDico());
|
|
||||||
|
|
||||||
if ( $id != null ) {
|
if ( $id != null ) {
|
||||||
$profilM = new Application_Model_Profil();
|
$profilM = new Application_Model_Profil();
|
||||||
$profil = $profilM->find($id);
|
$profil = $profilM->find($id);
|
||||||
@ -30,6 +28,7 @@ class ProfilController extends Zend_Controller_Action
|
|||||||
$tmp[] = $data->getDicoLib($critere);
|
$tmp[] = $data->getDicoLib($critere);
|
||||||
}
|
}
|
||||||
$this->view->assign('profil', $tmp);
|
$this->view->assign('profil', $tmp);
|
||||||
|
$this->view->assign('reference', $profil->current()->reference);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -38,10 +37,34 @@ class ProfilController extends Zend_Controller_Action
|
|||||||
{
|
{
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$id = $request->getParam('id', null);
|
$id = $request->getParam('id', null);
|
||||||
|
|
||||||
require_once 'Scores/Enrichissement.php';
|
require_once 'Scores/Enrichissement.php';
|
||||||
$data = new Enrichissement();
|
$data = new Enrichissement();
|
||||||
$this->view->assign('elements', $data->getDico());
|
if ( $id != null ) {
|
||||||
|
|
||||||
|
$profilM = new Application_Model_Profil();
|
||||||
|
$profil = $profilM->find($id);
|
||||||
|
$criteres = json_decode($profil->current()->criteres, true);
|
||||||
|
$tmp = array();
|
||||||
|
foreach ($criteres as $critere) {
|
||||||
|
$values = false;
|
||||||
|
if (preg_match('/(.*)\((.*)\)/', $critere, $matches))
|
||||||
|
{
|
||||||
|
$values = $matches[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
$tmp[$critere] = array(
|
||||||
|
'lib' => $data->getDicoLib($critere),
|
||||||
|
'values' => $values,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$this->view->assign('criteres', $tmp);
|
||||||
|
$this->view->assign('reference', $profil->current()->reference);
|
||||||
|
}
|
||||||
|
$this->view->assign('id', $id);
|
||||||
|
$this->view->assign('edit', true);
|
||||||
|
$this->view->assign('elements', $data->getDico());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveAction()
|
public function saveAction()
|
||||||
@ -58,11 +81,21 @@ class ProfilController extends Zend_Controller_Action
|
|||||||
$data = array(
|
$data = array(
|
||||||
'reference' => $reference,
|
'reference' => $reference,
|
||||||
'criteres' => json_encode($criteres),
|
'criteres' => json_encode($criteres),
|
||||||
);
|
);
|
||||||
if ( $profilM->insert($data) ){
|
|
||||||
echo '';
|
$id = $request->getParam('id', null);
|
||||||
|
if ( $id != null ) {
|
||||||
|
if ( $profilM->update($data, 'id='.$id) ){
|
||||||
|
echo '';
|
||||||
|
} else {
|
||||||
|
echo 'Erreur';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
echo 'Erreur';
|
if ( $profilM->insert($data) ){
|
||||||
|
echo '';
|
||||||
|
} else {
|
||||||
|
echo 'Erreur';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ div#entete {
|
|||||||
width:45%;
|
width:45%;
|
||||||
float:left;
|
float:left;
|
||||||
border:1px solid #bebebe;
|
border:1px solid #bebebe;
|
||||||
height:400px;
|
height:500px;
|
||||||
overflow:auto;
|
overflow:auto;
|
||||||
margin:5px 0;
|
margin:5px 0;
|
||||||
}
|
}
|
||||||
@ -16,12 +16,12 @@ div#entete li {
|
|||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
color:#000000;
|
color:#000000;
|
||||||
margin-left:30px;
|
margin-left:30px;
|
||||||
padding-left:10px;
|
padding:5px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#dico {
|
div#dico {
|
||||||
width:45%;
|
width:45%;
|
||||||
height:400px;
|
height:500px;
|
||||||
float:right;
|
float:right;
|
||||||
border:1px solid #bebebe;
|
border:1px solid #bebebe;
|
||||||
overflow:auto;
|
overflow:auto;
|
||||||
@ -30,7 +30,7 @@ div#dico {
|
|||||||
|
|
||||||
div#dico li {
|
div#dico li {
|
||||||
list-style-type:none;
|
list-style-type:none;
|
||||||
padding-left:10px;
|
padding:5px 10px;
|
||||||
background-color:#4D90FE;
|
background-color:#4D90FE;
|
||||||
border-top:2px solid #ffffff;
|
border-top:2px solid #ffffff;
|
||||||
border-bottom:2px solid #ffffff;
|
border-bottom:2px solid #ffffff;
|
||||||
@ -39,15 +39,28 @@ div#dico li {
|
|||||||
color:#000000;
|
color:#000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input[type="text"] {
|
||||||
|
border:1px solid;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="entete">
|
<div id="entete">
|
||||||
<h1 class="ui-widget-header">Entete</h1>
|
<h1 class="ui-widget-header">Entete</h1>
|
||||||
<div class="ui-widget-content">
|
<div class="ui-widget-content">
|
||||||
<ol>
|
<ol>
|
||||||
<span class="placeholder">Placer les elements ici</span>
|
<?php if (count($this->criteres)==0) {?>
|
||||||
</ol>
|
<span class="placeholder">Placer les elements ici</span>
|
||||||
</div>
|
<?php } else {?>
|
||||||
|
<?php foreach($this->criteres as $key => $element) {?>
|
||||||
|
<li id="<?=$key?>">
|
||||||
|
<?php if (isset($element['lib'])) { echo $element['lib']; } else { echo $key; }?>
|
||||||
|
<?php if (isset($element['values']) && $element['values']!==false ) {
|
||||||
|
echo "<input type=\"text\" name=\"".$key."\" value=\"".$element['values']."\"/>"; }?>
|
||||||
|
</li>
|
||||||
|
<?php }?>
|
||||||
|
<?php }?>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="dico">
|
<div id="dico">
|
||||||
@ -64,7 +77,12 @@ div#dico li {
|
|||||||
|
|
||||||
<div style="clear:both;">
|
<div style="clear:both;">
|
||||||
Référence <input type="text" name="profil" value="" />
|
Référence <input type="text" name="profil" value="" />
|
||||||
|
|
||||||
|
<?php if ($this->edit) { ?>
|
||||||
|
<a id="save" href="<?=$this->url(array('controller'=>'profil', 'action'=>'save', 'id'=>$this->id))?>">Modifier</a>
|
||||||
|
<?php } else {?>
|
||||||
<a id="save" href="<?=$this->url(array('controller'=>'profil', 'action'=>'save'))?>">Sauvegarder</a>
|
<a id="save" href="<?=$this->url(array('controller'=>'profil', 'action'=>'save'))?>">Sauvegarder</a>
|
||||||
|
<?php }?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -77,7 +95,8 @@ $(function() {
|
|||||||
activeClass: "ui-state-default",
|
activeClass: "ui-state-default",
|
||||||
hoverClass: "ui-state-hover",
|
hoverClass: "ui-state-hover",
|
||||||
accept: ":not(.ui-sortable-helper)",
|
accept: ":not(.ui-sortable-helper)",
|
||||||
drop: function( event, ui ) {
|
drop: function( e, ui ) {
|
||||||
|
e.preventDefault();
|
||||||
$( this ).find( ".placeholder" ).remove();
|
$( this ).find( ".placeholder" ).remove();
|
||||||
var id = ui.draggable.attr('id');
|
var id = ui.draggable.attr('id');
|
||||||
$('<li id="'+id+'"></li>').html( ui.draggable.html() ).appendTo( this );
|
$('<li id="'+id+'"></li>').html( ui.draggable.html() ).appendTo( this );
|
||||||
@ -90,13 +109,15 @@ $(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#entete").delegate("a.delete","click", function(){
|
$("#entete").delegate("a.delete","click", function(){
|
||||||
|
e.preventDefault();
|
||||||
$(this).parent().remove();
|
$(this).parent().remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#entete ol").delegate("li" , "hover", function(e) {
|
$("#entete ol").delegate("li" , "hover", function(e) {
|
||||||
|
e.preventDefault();
|
||||||
if (e.type === 'mouseenter') {
|
if (e.type === 'mouseenter') {
|
||||||
var html = $(this).html();
|
var html = $(this).html();
|
||||||
$(this).html(html+'<a href="#" class="delete">Supprimer</a>');
|
$(this).html(html+'<a href="#" style="float:right;" class="delete">Supprimer</a>');
|
||||||
} else {
|
} else {
|
||||||
$( this ).find( ".delete" ).remove();
|
$( this ).find( ".delete" ).remove();
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<div>
|
<div>
|
||||||
|
<h2>Profil : <?=$this->reference?></h2>
|
||||||
<ol>
|
<ol>
|
||||||
<?php foreach ($this->profil as $item) {?>
|
<?php foreach ($this->profil as $item) {?>
|
||||||
<li><?=$item?></li>
|
<li><?=$item?></li>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div>
|
<div>
|
||||||
|
<h2>Gestion des profils</h2>
|
||||||
<?php if (count($this->profils)>0) {?>
|
<?php if (count($this->profils)>0) {?>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -12,7 +12,7 @@
|
|||||||
<?php foreach($this->profils as $profil) {?>
|
<?php foreach($this->profils as $profil) {?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="<?=$this->url(array('controller'=>'profil', 'action'=>'detail', 'id'=>$profil->id))?>"><?=$profil->reference?></a></td>
|
<td><a href="<?=$this->url(array('controller'=>'profil', 'action'=>'detail', 'id'=>$profil->id))?>"><?=$profil->reference?></a></td>
|
||||||
<td></td>
|
<td><a href="<?=$this->url(array('controller'=>'profil', 'action'=>'create', 'id'=>$profil->id))?>">Edition</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -205,157 +205,157 @@ class Enrichissement
|
|||||||
'lib' => "Insee : Date de la dernière mise à jour"
|
'lib' => "Insee : Date de la dernière mise à jour"
|
||||||
),
|
),
|
||||||
'insRPET' => array(
|
'insRPET' => array(
|
||||||
'lib' => "Insee : RPET"
|
'lib' => "Insee : RPET"
|
||||||
),
|
),
|
||||||
'insDEPCOMEN' => array(
|
'insDEPCOMEN' => array(
|
||||||
'lib' => "Insee : Code commune siège"
|
'lib' => "Insee : Code commune siège"
|
||||||
),
|
),
|
||||||
'insRPEN' => array(
|
'insRPEN' => array(
|
||||||
'lib' => "Insee : RPEN"
|
'lib' => "Insee : RPEN"
|
||||||
),
|
),
|
||||||
'insARRONET' => array(
|
'insARRONET' => array(
|
||||||
'lib' => "Insee : Arrondissement de l'établissement"
|
'lib' => "Insee : Arrondissement de l'établissement"
|
||||||
),
|
),
|
||||||
'insCTONET' => array(
|
'insCTONET' => array(
|
||||||
'lib' => "Insee : Canton de l'établissement"
|
'lib' => "Insee : Canton de l'établissement"
|
||||||
),
|
),
|
||||||
'insTCD' => array(
|
'insTCD' => array(
|
||||||
'lib' => "Insee : Tranche de commune détaillé"
|
'lib' => "Insee : Tranche de commune détaillé"
|
||||||
),
|
),
|
||||||
'insZEMET' => array(
|
'insZEMET' => array(
|
||||||
'lib' => "Insee : ZEMET"
|
'lib' => "Insee : ZEMET"
|
||||||
),
|
),
|
||||||
'insDU' => array(
|
'insDU' => array(
|
||||||
'lib' => "Insee : DU"
|
'lib' => "Insee : DU"
|
||||||
),
|
),
|
||||||
'insTU' => array(
|
'insTU' => array(
|
||||||
'lib' => "Insee : TU"
|
'lib' => "Insee : TU"
|
||||||
),
|
),
|
||||||
'insUU' => array(
|
'insUU' => array(
|
||||||
'lib' => "Insee : UU"
|
'lib' => "Insee : UU"
|
||||||
),
|
),
|
||||||
'insRECME' => array(
|
'insRECME' => array(
|
||||||
'lib' => "Insee : RCEM"
|
'lib' => "Insee : RCEM"
|
||||||
),
|
),
|
||||||
'insEAEANT' => array(
|
'insEAEANT' => array(
|
||||||
'lib' => "Insee : EAEANT"
|
'lib' => "Insee : EAEANT"
|
||||||
),
|
),
|
||||||
'insEAEAPET' => array(
|
'insEAEAPET' => array(
|
||||||
'lib' => "Insee : EAEAPET"
|
'lib' => "Insee : EAEAPET"
|
||||||
),
|
),
|
||||||
'insEAESEC1T' => array(
|
'insEAESEC1T' => array(
|
||||||
'lib' => "Insee : EAESEC1T"
|
'lib' => "Insee : EAESEC1T"
|
||||||
),
|
),
|
||||||
'insEAESEC2T' => array(
|
'insEAESEC2T' => array(
|
||||||
'lib' => "Insee : EAESEC2T"
|
'lib' => "Insee : EAESEC2T"
|
||||||
),
|
),
|
||||||
'insEAEANN' => array(
|
'insEAEANN' => array(
|
||||||
'lib' => "Insee : EAEANN"
|
'lib' => "Insee : EAEANN"
|
||||||
),
|
),
|
||||||
'insEAEAPEN' => array(
|
'insEAEAPEN' => array(
|
||||||
'lib' => "Insee : EAEAPEN"
|
'lib' => "Insee : EAEAPEN"
|
||||||
),
|
),
|
||||||
'insEAESEC1N' => array(
|
'insEAESEC1N' => array(
|
||||||
'lib' => "Insee : EAESEC1N"
|
'lib' => "Insee : EAESEC1N"
|
||||||
),
|
),
|
||||||
'insEAESEC2N' => array(
|
'insEAESEC2N' => array(
|
||||||
'lib' => "Insee : EAESEC2N"
|
'lib' => "Insee : EAESEC2N"
|
||||||
),
|
),
|
||||||
'insEAESEC3N' => array(
|
'insEAESEC3N' => array(
|
||||||
'lib' => "Insee : EAESEC3N"
|
'lib' => "Insee : EAESEC3N"
|
||||||
),
|
),
|
||||||
'insEAESEC4N' => array(
|
'insEAESEC4N' => array(
|
||||||
'lib' => "Insee : EAESEC4N"
|
'lib' => "Insee : EAESEC4N"
|
||||||
),
|
),
|
||||||
'dateMajNotice' => array(
|
'dateMajNotice' => array(
|
||||||
'lib' => "Insee : Date de la dernière MAJ notice"
|
'lib' => "Insee : Date de la dernière MAJ notice"
|
||||||
),
|
),
|
||||||
'entActiveRncs' => array(
|
'entActiveRncs' => array(
|
||||||
'lib' => "RNCS : Active"
|
'lib' => "RNCS : Active"
|
||||||
),
|
),
|
||||||
'numRC2' => array(
|
'numRC2' => array(
|
||||||
'lib' => "RNCS : Numéro RC"
|
'lib' => "RNCS : Numéro RC"
|
||||||
),
|
),
|
||||||
'raisonSocialeRncs' => array(
|
'raisonSocialeRncs' => array(
|
||||||
'lib' => "RNCS : Raison Sociale"
|
'lib' => "RNCS : Raison Sociale"
|
||||||
),
|
),
|
||||||
'sigleRncs' => array(
|
'sigleRncs' => array(
|
||||||
'lib' => "RNCS : Sigle"
|
'lib' => "RNCS : Sigle"
|
||||||
),
|
),
|
||||||
'dateNaiss' => array(
|
'dateNaiss' => array(
|
||||||
'lib' => "RNCS : Date Naissance PP"
|
'lib' => "RNCS : Date Naissance PP"
|
||||||
),
|
),
|
||||||
'lieuNaiss' => array(
|
'lieuNaiss' => array(
|
||||||
'lib' => "RNCS : Lieu Naissance PP"
|
'lib' => "RNCS : Lieu Naissance PP"
|
||||||
),
|
),
|
||||||
'nationalite' => array(
|
'nationalite' => array(
|
||||||
'lib' => "RNCS : Nationalité PP"
|
'lib' => "RNCS : Nationalité PP"
|
||||||
),
|
),
|
||||||
'pays' => array(
|
'pays' => array(
|
||||||
'lib' => "RNCS : Pays"
|
'lib' => "RNCS : Pays"
|
||||||
),
|
),
|
||||||
'nafEnRncs' => array(
|
'nafEnRncs' => array(
|
||||||
'lib' => "RNCS : NAF Entrepise"
|
'lib' => "RNCS : NAF Entrepise"
|
||||||
),
|
),
|
||||||
'cjRncs' => array(
|
'cjRncs' => array(
|
||||||
'lib' => "RNCS : Forme juridique"
|
'lib' => "RNCS : Forme juridique"
|
||||||
),
|
),
|
||||||
'dateImma' => array(
|
'dateImma' => array(
|
||||||
'lib' => "RNCS : Date Immatriculation"
|
'lib' => "RNCS : Date Immatriculation"
|
||||||
),
|
),
|
||||||
'dateRad' => array(
|
'dateRad' => array(
|
||||||
'lib' => "RNCS : Date de radiation"
|
'lib' => "RNCS : Date de radiation"
|
||||||
),
|
),
|
||||||
'capitalType' => array(
|
'capitalType' => array(
|
||||||
'lib' => "RNCS : Type de capital"
|
'lib' => "RNCS : Type de capital"
|
||||||
),
|
),
|
||||||
'dateMajEnRncs' => array(
|
'dateMajEnRncs' => array(
|
||||||
'lib' => "RNCS : Date MAJ Entreprise"
|
'lib' => "RNCS : Date MAJ Entreprise"
|
||||||
),
|
),
|
||||||
'etActifRncs' => array(
|
'etActifRncs' => array(
|
||||||
'lib' => "RNCS : Actif"
|
'lib' => "RNCS : Actif"
|
||||||
),
|
),
|
||||||
'siegeRncs' => array(
|
'siegeRncs' => array(
|
||||||
'lib' => "RNCS : Siège"
|
'lib' => "RNCS : Siège"
|
||||||
),
|
),
|
||||||
'enseigneRncs' => array(
|
'enseigneRncs' => array(
|
||||||
'lib' => "RNCS : Enseigne"
|
'lib' => "RNCS : Enseigne"
|
||||||
),
|
),
|
||||||
'nomCommercialRncs' => array(
|
'nomCommercialRncs' => array(
|
||||||
'lib' => "RNCS : Nom Commercial"
|
'lib' => "RNCS : Nom Commercial"
|
||||||
),
|
),
|
||||||
'adrNumVoieRncs' => array(
|
'adrNumVoieRncs' => array(
|
||||||
'lib' => "RNCS : Numéro"
|
'lib' => "RNCS : Numéro"
|
||||||
),
|
),
|
||||||
'adrIndRepRncs' => array(
|
'adrIndRepRncs' => array(
|
||||||
'lib' => "RNCS : Adresse - Numéro"
|
'lib' => "RNCS : Adresse - Numéro"
|
||||||
),
|
),
|
||||||
'adrLibVoieRncs' => array(
|
'adrLibVoieRncs' => array(
|
||||||
'lib' => "RNCS : Adresse - Bis/Ter/etc"
|
'lib' => "RNCS : Adresse - Bis/Ter/etc"
|
||||||
),
|
),
|
||||||
'adrTypeVoieRncs' => array(
|
'adrTypeVoieRncs' => array(
|
||||||
'lib' => "RNCS : Adresse - Type de la voie"
|
'lib' => "RNCS : Adresse - Type de la voie"
|
||||||
),
|
),
|
||||||
'adrVoieRncs' => array(
|
'adrVoieRncs' => array(
|
||||||
'lib' => "RNCS : Adresse - Libellé de la voie"
|
'lib' => "RNCS : Adresse - Libellé de la voie"
|
||||||
),
|
),
|
||||||
'cpRncs' => array(
|
'cpRncs' => array(
|
||||||
'lib' => "RNCS : Adresse - Code postal"
|
'lib' => "RNCS : Adresse - Code postal"
|
||||||
),
|
),
|
||||||
'villeRncs' => array(
|
'villeRncs' => array(
|
||||||
'lib' => "RNCS : Adresse - Ville"
|
'lib' => "RNCS : Adresse - Ville"
|
||||||
),
|
),
|
||||||
'adrCompRncs' => array(
|
'adrCompRncs' => array(
|
||||||
'lib' => "RNCS : Adresse - Complément"
|
'lib' => "RNCS : Adresse - Complément"
|
||||||
),
|
),
|
||||||
'nafEtRncs' => array(
|
'nafEtRncs' => array(
|
||||||
'lib' => "RNCS : NAF Etablissement"
|
'lib' => "RNCS : NAF Etablissement"
|
||||||
),
|
),
|
||||||
'dateMajEtRncs' => array(
|
'dateMajEtRncs' => array(
|
||||||
'lib' => "RNCS : Date MAJ établissement"
|
'lib' => "RNCS : Date MAJ établissement"
|
||||||
),
|
),
|
||||||
'isin' => array(
|
'isin' => array(
|
||||||
'lib' => "Code ISIN (société en bourse)"
|
'lib' => "Code ISIN (société en bourse)"
|
||||||
),
|
),
|
||||||
'tel' => array(
|
'tel' => array(
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#header {
|
#header {
|
||||||
height: 100px;
|
height: 10px;
|
||||||
padding: 0 40px;
|
padding: 0 40px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user