diff --git a/application/modules/default/controllers/SaisieController.php b/application/modules/default/controllers/SaisieController.php index 24255551e..a2dfab503 100644 --- a/application/modules/default/controllers/SaisieController.php +++ b/application/modules/default/controllers/SaisieController.php @@ -2908,6 +2908,9 @@ class SaisieController extends Zend_Controller_Action $this->_helper->layout()->disableLayout(); $request = $this->getRequest(); $siren = $request->getParam('siren', null); + if(empty($siren)){ + throw(new Exception('Parametres errones')); + } $mode = $request->getParam('mode'); $guichetMod = $request->getParam('guichetMod'); $banqueMod = $request->getParam('banqueMod'); @@ -2923,7 +2926,11 @@ class SaisieController extends Zend_Controller_Action $ws = new Scores_Ws_Client('saisie', '0.2'); $result = $ws->getRib($params); } - $this->view->assign('oldvals', json_encode($result)); + $tab=(array)json_decode($result); + $oldvals=implode('####',$tab); + //$olddvals->siren=$siren; + //var_dump($oldvals);die; + $this->view->assign('oldvals', urlencode($result)); $this->view->assign('siren', $siren); $this->view->assign('mode', $mode); $this->view->assign('banques', $result); @@ -2937,6 +2944,7 @@ class SaisieController extends Zend_Controller_Action public function ribansaveAction(){ $this->_helper->layout()->disableLayout(); $request = $this->getRequest(); + //var_dump($request->getParams());die; $params= new stdClass(); $values=array( 'siren' => str_replace(' ', '',$request->getParam('siren')), @@ -2945,17 +2953,18 @@ class SaisieController extends Zend_Controller_Action 'numCompte' => str_replace(' ', '',$request->getParam('num_compte')), 'bic' => str_replace(' ', '',$request->getParam('bic_swift')), 'iban' => str_replace(' ', '',$request->getParam('iban')), - 'oldvals' => $request->getParam('oldvals'), + 'oldvals' => urldecode($request->getParam('oldvals')), 'mode' => $request->getParam('mode'), ); $params->infos=json_encode($values); + //echo $values['oldvals'];die; $ws = new Scores_Ws_Client('saisie', '0.2'); $result = $ws->setRib($params); - if($result){ + if($result==true or $result==1){ echo 'Opération enregistrée'; }else { - echo 'Opération échouée '; + echo 'Opération non enregistrée '.$result; } die; } diff --git a/application/modules/default/views/default/scripts/saisie/ribiban.phtml b/application/modules/default/views/default/scripts/saisie/ribiban.phtml index 5add05845..bfa8bde17 100644 --- a/application/modules/default/views/default/scripts/saisie/ribiban.phtml +++ b/application/modules/default/views/default/scripts/saisie/ribiban.phtml @@ -16,7 +16,7 @@ $lbanque = (array)json_decode($this->banques);
-oldvals?>" /> + mode == 'add' || $this->mode == 'edit'){?>