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