From 77c590f927a80af4a826906268529c4495bf0ba6 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 24 Oct 2012 16:10:48 +0000 Subject: [PATCH] issue #0001372 : Delete and id forms --- application/controllers/SaisieController.php | 72 +++++++++++++++---- .../default/scripts/identite/liens.phtml | 2 +- .../views/default/scripts/saisie/lien.phtml | 42 +++++++++-- .../default/scripts/saisie/lienfiche.phtml | 2 +- 4 files changed, 97 insertions(+), 21 deletions(-) diff --git a/application/controllers/SaisieController.php b/application/controllers/SaisieController.php index ee5abc9dd..ef564c8f1 100644 --- a/application/controllers/SaisieController.php +++ b/application/controllers/SaisieController.php @@ -1513,17 +1513,29 @@ class SaisieController extends Zend_Controller_Action $result = $ws->getSaisieLien($idLien); $infos = json_decode($result, true); - + Zend_Registry::get('firebug')->info($infos); if ($type=='actionnaire') { $this->view->assign('id1', $infos['idPar']); $this->view->assign('id2', $infos['idAct']); - } elseif (type=='participation') { + $idFiche = $infos['idAct']; + } elseif ($type=='participation') { $this->view->assign('id2', $infos['idPar']); $this->view->assign('id1', $infos['idAct']); + $idFiche = $infos['idPar']; } - + + if ($idFiche) { + $result = $ws->getLienRef($idFiche); + if ($result->raisonSociale!='') { + $this->view->assign('rs2', $result->raisonSociale); + } else { + $this->view->assign('rs2', $result->nom); + } + $this->view->assign('siren2', $result->siren); + } + $this->view->assign('PDetention', $infos['PDetention']); $this->view->assign('Pvote', $infos['Pvote']); $this->view->assign('MajMin', $infos['MajMin']); @@ -1546,7 +1558,7 @@ class SaisieController extends Zend_Controller_Action if ($type=='actionnaire') { $this->view->assign('id1', $infos['idPar']); $this->view->assign('id2', $infos['idAct']); - } elseif (type=='participation') { + } elseif ($type=='participation') { $this->view->assign('id2', $infos['idPar']); $this->view->assign('id1', $infos['idAct']); } @@ -1765,17 +1777,28 @@ class SaisieController extends Zend_Controller_Action $idAct = $params['id1']; } - $infos = array( - 'idAct' => $idAct, - 'PDetention' => $params['PDetention'], - 'Pvote' => $params['Pvote'], - 'MajMin' => $params['MajMin'], - 'idPar' => $idPar, - 'dateEffetLien' => empty($params['dateEffetLien']) ? date('Ymd') : $params['dateEffetLien'], - 'docRef' => empty($params['docRef']) ? '' : $params['docRef'], - 'dateDocRef' => empty($params['dateDocRef']) ? '' : $params['dateDocRef'], - ); - + if ($params['mode']=='delete') { + $infos = array( + 'actif' => 0, + 'dateEffetLien' => empty($params['dateEffetLien']) ? date('Ymd') : $params['dateEffetLien'], + 'docRef' => empty($params['docRef']) ? '' : $params['docRef'], + 'dateDocRef' => empty($params['dateDocRef']) ? '' : $params['dateDocRef'], + 'motifUpdate' => empty($params['motifUpdate']) ? '' : $params['motifUpdate'], + ); + } else { + $infos = array( + 'idAct' => $idAct, + 'actif' => 1, + 'PDetention' => $params['PDetention'], + 'Pvote' => $params['Pvote'], + 'MajMin' => $params['MajMin'], + 'idPar' => $idPar, + 'dateEffetLien' => empty($params['dateEffetLien']) ? date('Ymd') : $params['dateEffetLien'], + 'docRef' => empty($params['docRef']) ? '' : $params['docRef'], + 'dateDocRef' => empty($params['dateDocRef']) ? '' : $params['dateDocRef'], + 'motifUpdate' => empty($params['motifUpdate']) ? '' : $params['motifUpdate'], + ); + } Zend_Registry::get('firebug')->info($infos); $ws = new WsScores(); @@ -1797,4 +1820,23 @@ class SaisieController extends Zend_Controller_Action $this->view->assign('identifiant', $result->item); } + public function bourseAction() + { + $request = $this->getRequest(); + $siret = $request->getParam('siret'); + $id = $request->getParam('id', 0); + + $this->view->headTitle()->append('Saisie - '.$siret); + + $ws = new WsScores(); + $infos = $ws->getIdentite($siret, $id); + $this->view->assign('etab', $infos); + + } + + public function boursesaveAction() + { + + + } } \ 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 47874bc7f..e36077567 100644 --- a/application/views/default/scripts/identite/liens.phtml +++ b/application/views/default/scripts/identite/liens.phtml @@ -81,7 +81,7 @@ - + diff --git a/application/views/default/scripts/saisie/lien.phtml b/application/views/default/scripts/saisie/lien.phtml index 3e6c2617b..38159a9db 100644 --- a/application/views/default/scripts/saisie/lien.phtml +++ b/application/views/default/scripts/saisie/lien.phtml @@ -36,7 +36,7 @@ div#etranger { display:none; }
Etes-vous certain de vouloir supprimer le lien entre rs?> (siren?>) - de la société rs2?> (siren2?>) ? + et rs2?> (siren2?>) ?
@@ -54,7 +54,7 @@ div#etranger { display:none; }
- +
(JJ/MM/AAAAA)
@@ -132,17 +132,51 @@ div#etranger { display:none; }
Etes-vous certain de vouloir supprimer le lien entre rs?> (siren?>) - de la société rs2?> (siren2?>) ? + et rs2?> (siren2?>) ?
- mode=='add' || $this->mode=='edit') {?>
+ + mode=='edit' || $this->mode=='delete') {?> +
+ +
+ +
+
+ +
+ +
+ (JJ/MM/AAAAA) +
+
+ +
+ +
+ +
+
+ + + + mode=='add' || $this->mode=='edit') {?>
Liens diff --git a/application/views/default/scripts/saisie/lienfiche.phtml b/application/views/default/scripts/saisie/lienfiche.phtml index 28dcb3f2d..f46f845da 100644 --- a/application/views/default/scripts/saisie/lienfiche.phtml +++ b/application/views/default/scripts/saisie/lienfiche.phtml @@ -113,7 +113,7 @@ $('input.autocomplete').autocomplete({ }, select: function(event, ui) { $('form[name=lien]').prepend(''); - $('div#searchFiche').replaceWith('Fiche créée id = '+ui.item.value+''); + $('div#searchFiche').replaceWith('Fiche sélectionnée id = '+ui.item.value+''); } });