diff --git a/application/controllers/SaisieController.php b/application/controllers/SaisieController.php
index 298f11c60..7b3554bda 100644
--- a/application/controllers/SaisieController.php
+++ b/application/controllers/SaisieController.php
@@ -1488,6 +1488,62 @@ class SaisieController extends Zend_Controller_Action
$mode = $request->getParam('mode');
$type = $request->getParam('type');
+ $session = new SessionEntreprise($siren);
+ $rs = $session->getRaisonSociale();
+
+ //Création de la première référence lien
+ $ws = new WsScores();
+
+ $infos = array(
+ 'siren' => $siren,
+ 'actif' => 1,
+ 'PpPm' => 'PM',
+ 'RS' => $rs,
+ 'civilite' => '',
+ 'nom' => '',
+ 'prenom' => '',
+ 'naissance_nom' => '',
+ 'naissance_date' => '',
+ 'naissance_dept_pays' => '',
+ 'naissance_lieu' => '',
+ 'nat' => '',
+ 'adresse_num' => '',
+ 'adresse_btq' => '',
+ 'adresse_codvoie' => '',
+ 'adresse_libvoie' => '',
+ 'adresse_comp' => '',
+ 'adresse_cp' => '',
+ 'adresse_ville' => '',
+ 'adresse_pays' => '',
+ 'refDoc' => '',
+ 'dateSaisie' => date('YmdHis'),
+ 'capital' => '',
+ 'deviseCapital' => 'EUR',
+ 'nbActions' => '',
+ 'idLoc1Type' => '',
+ 'idLoc1Num' => '',
+ 'idLoc2Type' => '',
+ 'idLoc2Num' => '',
+ 'idLoc3Type' => '',
+ 'idLoc3Num' => '',
+ );
+
+ $idNewLien = $ws->setLienRef(json_encode($infos));
+ if (is_int($idNewLien)) {
+ $this->view->assign('id1', $idNewLien);
+ }
+
+ //Affichage
+ $this->view->assign('rs', $rs);
+ $this->view->assign('siren', $siren);
+ $this->view->assign('mode', $mode);
+ $this->view->assign('type', $type);
+
+ $idLien = $request->getParam('id', null);
+ $this->view->assign('idLien', $idLien);
+
+
+
//Mode = delete
/*
id du lien pour récupérer les informations
@@ -1502,12 +1558,31 @@ class SaisieController extends Zend_Controller_Action
- Liste des documents de référence
- Liste des types d'identifiant par pays sdv1.tabIdLocal
*/
-
- $this->view->assign('mode', $mode);
- $this->view->assign('type', $type);
+
}
+ public function liensearchAction()
+ {
+ $this->_helper->layout()->disableLayout();
+ $query = $this->getRequest()->getParam('q');
+
+ $ws = new WsScores();
+ $result = $ws->searchLienRef($query);
+ Zend_Registry::get('firebug')->info($result);
+ $output = array();
+ if (count($result->item)>0) {
+ foreach ($result->item as $item) {
+ $output[] = array(
+ 'value' => $item->id,
+ 'label' => $item->lib,
+ );
+ }
+ }
+ $this->view->assign('output', $output);
+ }
+
+
/**
* Gestion des liens étrangers
*/
@@ -1518,6 +1593,107 @@ class SaisieController extends Zend_Controller_Action
$this->view->assign('countries', $this->selectPays);
}
+ /**
+ * Gestion des liens étrangers
+ */
+ public function lienppAction()
+ {
+ $this->_helper->layout()->disableLayout();
+ $this->view->assign('countries', $this->selectPays);
+ }
+
+
+ public function lienrefsaveAction()
+ {
+ $this->_helper->layout()->disableLayout();
+ $params = $this->getRequest()->getParams();
+
+ Zend_Registry::get('firebug')->info($params);
+
+ //Construct reference informations
+
+ $params['PpPm'] = 'PM';
+
+ //Personne physique
+ if ($params['pp']==1) {
+ $params['PpPm'] = 'PP';
+ $params['RS'] = '';
+ } elseif (!empty($params['siren'])) {
+ $params['RS'] = $params['nom'];
+ $params['civilite'] = '';
+ $params['nom'] = '';
+ $params['prenom'] = '';
+ $params['naissance_nom'] = '';
+ $params['naissance_date'] = '';
+ $params['naissance_dept_pays'] = '';
+ $params['naissance_lieu'] = '';
+ $params['nat'] = '';
+ $params['adresse_num'] = '';
+ $params['adresse_btq'] = '';
+ $params['adresse_codvoie'] = '';
+ $params['adresse_libvoie'] = '';
+ $params['adresse_comp'] = '';
+ $params['adresse_cp'] = '';
+ $params['adresse_ville'] = '';
+ $params['adresse_pays'] = '';
+ } else {
+ $params['siren'] = '000000000';
+ $params['RS'] = $params['nom'];
+ $params['civilite'] = '';
+ $params['nom'] = '';
+ $params['prenom'] = '';
+ $params['naissance_nom'] = '';
+ $params['naissance_date'] = '';
+ $params['naissance_dept_pays'] = '';
+ $params['naissance_lieu'] = '';
+ $params['nat'] = '';
+ }
+
+ $infos = array(
+ 'siren' => $params['siren'],
+ 'actif' => 1,
+ 'PpPm' => $params['PpPm'],
+ 'RS' => $params['RS'],
+ 'civilite' => $params['civilite'],
+ 'nom' => $params['nom'],
+ 'prenom' => $params['prenom'],
+ 'naissance_nom' => $params['naissance_nom'],
+ 'naissance_date' => $params['naissance_date'],
+ 'naissance_dept_pays' => $params['naissance_dept_pays'],
+ 'naissance_lieu' => $params['naissance_lieu'],
+ 'nat' => $params['nat'],
+ 'adresse_num' => $params['adresse_num'],
+ 'adresse_btq' => $params['adresse_btq'],
+ 'adresse_codvoie' => $params['adresse_codvoie'],
+ 'adresse_libvoie' => $params['adresse_libvoie'],
+ 'adresse_comp' => $params['adresse_comp'],
+ 'adresse_cp' => $params['adresse_cp'],
+ 'adresse_ville' => $params['adresse_ville'],
+ 'adresse_pays' => $params['adresse_pays'],
+ 'refDoc' => $params['refDoc'],
+ 'dateSaisie' => date('YmdHis'),
+ 'capital' => $params['capital'],
+ 'deviseCapital' => 'EUR',
+ 'nbActions' => $params['nbActions'],
+ 'idLoc1Type' => $params['idLoc1Type'],
+ 'idLoc1Num' => $params['idLoc1Num'],
+ 'idLoc2Type' => $params['idLoc2Type'],
+ 'idLoc2Num' => $params['idLoc2Num'],
+ 'idLoc3Type' => $params['idLoc3Type'],
+ 'idLoc3Num' => $params['idLoc3Num'],
+ );
+
+ $ws = new WsScores();
+ $idNewLien = $ws->setLienRef(json_encode($infos), $params['idLien']);
+
+ if (is_int($idNewLien)){
+ $this->view->assign('result', array('id'=>$idNewLien, 'error'=>''));
+ } else {
+ $this->view->assign('result', array('id'=>0, 'error'=>$idNewLien));
+ }
+
+ }
+
/**
* Sauvegarde
@@ -1526,6 +1702,29 @@ class SaisieController extends Zend_Controller_Action
{
$this->_helper->layout()->disableLayout();
+ $params = $this->getRequest()->getParams();
+
+ $infos = array(
+ 'id1' => '',
+ 'id2' => '',
+ 'actif' => 1,
+ 'ActionPart' => $params['ActionPart'],
+ 'Pmin' => '',
+ 'Pmax' => '',
+ 'MajMin' => '',
+ 'id2' => '',
+ 'dateLien' => '',
+ 'dateInsert' => '',
+ );
+
+ $ws = new WsScores();
+ //$idNewLien = $ws->setLien(json_encode($infos), $params['idLien']);
+ if (is_int($idNewLien)){
+ $this->view->assign('result', array('id'=>$idNewLien, 'error'=>''));
+ } else {
+ $this->view->assign('result', array('id'=>0, 'error'=>$idNewLien));
+ }
+
}
}
\ No newline at end of file
diff --git a/application/views/default/scripts/identite/liens.phtml b/application/views/default/scripts/identite/liens.phtml
index 6f97dedee..c672fe905 100644
--- a/application/views/default/scripts/identite/liens.phtml
+++ b/application/views/default/scripts/identite/liens.phtml
@@ -82,8 +82,8 @@ if ( count($this->actionnaires)>0 ){
edition) {?>
-
-
+
+
@@ -101,7 +101,7 @@ if ( count($this->actionnaires)>0 ){
edition) {?>
@@ -156,8 +156,8 @@ if (count($this->participations)>0)
edition) {?>
-
-
+
+
@@ -174,7 +174,7 @@ if (count($this->participations)>0)
edition) {?>
@@ -239,7 +239,16 @@ $('a.dialog').on('click', function(){
$(this).load(href);
},
buttons: {
- Valider: function() {},
+ Valider: function() {
+ if ($('input[name=id1]').length>0 || $('input[name=id2]').length>0) {
+ var form = $('form[name=lien]');
+ $.post(form.attr('action'), form.serialize(), function(data){
+
+ });
+ } else {
+ alert("Quelque chose manque !");
+ }
+ },
Annuler: function() { $(this).dialog('close'); }
},
close: function() { $('#dialogcmd').remove(); }
diff --git a/application/views/default/scripts/saisie/lien.phtml b/application/views/default/scripts/saisie/lien.phtml
index 89897dc6c..8de4b1fc0 100644
--- a/application/views/default/scripts/saisie/lien.phtml
+++ b/application/views/default/scripts/saisie/lien.phtml
@@ -1,3 +1,5 @@
+id1){ ?>
+
-mode == 'delete' ) { ?>
-
-
-
-
- type=='actionnaire') {?>
-
- Saisie d'un actionnaire pour la société =$this->rs1?> (=$this->siren1?>)
+ mode == 'add' ) { ?>
+
+ Saisie d'un actionnaire pour la société =$this->rs?> (=$this->siren?>)
+ =$this->render('saisie/lienfiche.phtml')?>
+
+
+ mode == 'edit') {?>
+ Modification d'un actionnaire pour la société =$this->rs?> (=$this->siren?>)
+
-
-
-
+
+
+
+
Date du document ou date de cloture l'exercice :
+
+ (JJ/MM/AAAAA)
+
+
+
+
+
Date du changement :
+
+ (JJ/MM/AAAAA)
+
+
+
+
+
+
Motif du changement :
+
+
+ -
+ Fusion
+ Cession de parts
+ Acte SSP
+ TUP
+ Donation/Partage
+ Vente/Cession
+ Statuts
+
+
+
+
+
+
+ mode=='add' || $this->mode=='edit') {?>
+
- Informations
+ Liens
-
-
-
-
Raison sociale / Nom
-
-
-
-
-
-
-
- =$this->render('saisie/lienpp.phtml')?>
-
- =$this->action('lienetranger', 'saisie')?>
-
-
-
+
+
@@ -163,158 +130,83 @@ de la société =$this->rs2?> (=$this->siren2?>) ?
euros
-
-
-
- type=='participation') {?>
-
- Saisie d'une participation pour la société =$this->rs1?> (=$this->siren1?>)
-
-
-
Document de référence :
-
- - en date du
-
-
-
-
- Informations
-
-
-
-
-
Raison sociale / nom
-
-
-
-
-
- =$this->action('lienetranger', 'saisie')?>
-
-
+
+
+
+type=='participation') {?>
+
+ mode == 'add' ) { ?>
+
+ Saisie d'une participation pour la société =$this->rs?> (=$this->siren?>)
+
+ =$this->render('saisie/lienfiche.phtml')?>
+
+
+
+ mode == 'edit') {?>
+ Modification d'une participation pour la société =$this->rs?> (=$this->siren?>)
+
+
+
+
+
+ mode=='add' || $this->mode=='edit') {?>
+
+ Liens
+
+
+
+
+
+
-
-
-
-
-
Méthode d'intégration
-
-
- -
- Non défini
- Intégration Globale
- Intégration partielle
- Mise en équivalence
- Non consolidé
-
-
-
-
-
- Si disponible (holding, etc) saisir quelques éléments du bilan :
-
-
-
Chiffre d'affaires
-
euros
-
-
-
Résultat Net
-
- euros
-
-
-
-
-
Fonds Propres
-
- euros
-
-
-
-
-
Total Bilan
-
- euros
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+Erreur.
+
+
+
+
diff --git a/application/views/default/scripts/saisie/lienetranger.phtml b/application/views/default/scripts/saisie/lienetranger.phtml
index b456d8201..10f3a9120 100644
--- a/application/views/default/scripts/saisie/lienetranger.phtml
+++ b/application/views/default/scripts/saisie/lienetranger.phtml
@@ -2,6 +2,7 @@
Pays
+-
countries as $code => $lib) {?>
=$lib?>
@@ -16,10 +17,22 @@
+
+
+
+
diff --git a/application/views/default/scripts/saisie/lienfiche.phtml b/application/views/default/scripts/saisie/lienfiche.phtml
new file mode 100644
index 000000000..9d9e597f3
--- /dev/null
+++ b/application/views/default/scripts/saisie/lienfiche.phtml
@@ -0,0 +1,151 @@
+
\ No newline at end of file
diff --git a/application/views/default/scripts/saisie/lienpp.phtml b/application/views/default/scripts/saisie/lienpp.phtml
index 97932bb8d..c636f23f0 100644
--- a/application/views/default/scripts/saisie/lienpp.phtml
+++ b/application/views/default/scripts/saisie/lienpp.phtml
@@ -1,29 +1,37 @@
+
+
\ No newline at end of file
diff --git a/application/views/default/scripts/saisie/lienrefsave.phtml b/application/views/default/scripts/saisie/lienrefsave.phtml
new file mode 100644
index 000000000..46634d4fd
--- /dev/null
+++ b/application/views/default/scripts/saisie/lienrefsave.phtml
@@ -0,0 +1 @@
+=json_encode($this->result)?>
diff --git a/application/views/default/scripts/saisie/liensearch.phtml b/application/views/default/scripts/saisie/liensearch.phtml
new file mode 100644
index 000000000..8d9394c8f
--- /dev/null
+++ b/application/views/default/scripts/saisie/liensearch.phtml
@@ -0,0 +1 @@
+=json_encode($this->output)?>
diff --git a/library/Scores/WsScores.php b/library/Scores/WsScores.php
index e9fe07c28..6dd018d01 100644
--- a/library/Scores/WsScores.php
+++ b/library/Scores/WsScores.php
@@ -33,6 +33,66 @@ class WsScores
}
}
+ public function setLien($infos, $id = null)
+ {
+ $params = new stdClass();
+ $params->infos = $infos;
+ $params->id = $id;
+ $client = $this->loadClient('saisie');
+ try {
+ $reponse = $client->setLien($params);
+ return $reponse->setLienResult;
+ } catch (SoapFault $fault) {
+ Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
+ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
+ return $fault->faultstring;
+ } else {
+ $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
+ return false;
+ }
+ }
+
+ }
+
+ public function setLienRef($infos, $id = null)
+ {
+ $params = new stdClass();
+ $params->infos = $infos;
+ $params->id = $id;
+ $client = $this->loadClient('saisie');
+ try {
+ $reponse = $client->setLienRef($params);
+ return $reponse->setLienRefResult;
+ } catch (SoapFault $fault) {
+ Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
+ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
+ return $fault->faultstring;
+ } else {
+ $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
+ return false;
+ }
+ }
+ }
+
+ public function searchLienRef($query)
+ {
+ $params = new stdClass();
+ $params->query = $query;
+ $client = $this->loadClient('saisie');
+ try {
+ $reponse = $client->searchLienRef($params);
+ return $reponse->searchLienRefResult;
+ } catch (SoapFault $fault) {
+ Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
+ if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
+ return $fault->faultstring;
+ } else {
+ $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
+ return false;
+ }
+ }
+ }
+
public function setActeAsso($siren, $waldec, $type, $libelle, $date)
{
$params = new stdClass();