Passage webservice en version 2 + correction affichage du dialogue
This commit is contained in:
parent
5f27da2646
commit
f59827e869
@ -728,18 +728,21 @@ class SaisieController extends Zend_Controller_Action
|
||||
if ($sourceNum === false) {
|
||||
echo "Source inconnu"; exit;
|
||||
}
|
||||
$ws = new WsScores();
|
||||
$reponse = $ws->dupliqueAnnonce($sourceNum, $idan, $siretIn, $siretOut);
|
||||
$error = $reponse->error;
|
||||
if ( isset($error) && $error->errnum == 0 ){
|
||||
$output = 'Annonce '.$idan.' dupliqué sur '.$siretOut.'!';
|
||||
} elseif ( isset($error) && $error->errnum != 0 ) {
|
||||
$output = 'Erreur lors de la duplication.';
|
||||
} else {
|
||||
$output = "Une erreur est survenue...";
|
||||
}
|
||||
echo $output;
|
||||
// Version new
|
||||
$ws = new Scores_Ws_Client('saisie', '0.2');
|
||||
$params = new stdClass();
|
||||
$params->source = $sourceNum;
|
||||
$params->idAnn = $idan;
|
||||
$params->siretIn = $siretIn;
|
||||
$params->siretOut = $siretOut;
|
||||
$devp=array('sourceNum' => $sourceNum,'idan' => $idan,'siretIn' => $siretIn, 'siretOut' => $siretOut);
|
||||
$infos = $ws->dupliqueAnnonce($params);
|
||||
|
||||
if ($infos === false) {
|
||||
echo 'Erreur du Webservice';
|
||||
$this->forward('soap', 'error');
|
||||
}
|
||||
echo $infos->error->errmsg;
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
|
@ -87,13 +87,21 @@ $('select[name="even[]"]').change(function(){
|
||||
|
||||
<script type="text/javascript" src="/libs/form/jquery.form.min.js"></script>
|
||||
<script>
|
||||
$('form#saisie').bind('submit', function(){
|
||||
var options = {
|
||||
$('form#saisie').submit(function(){
|
||||
event.preventDefault(); // Prevent the form from submitting via the browser
|
||||
var form = $(this);
|
||||
$.ajax({
|
||||
target: '#result',
|
||||
beforeSubmit: function(data){},
|
||||
success: function(data){ $('#result').html(data); }
|
||||
};
|
||||
$(this).ajaxSubmit(options);
|
||||
type: "POST",
|
||||
url: form.attr('action'),
|
||||
data: form.serialize()
|
||||
}).success(function(data) {
|
||||
$('#result').html(data);
|
||||
// Optionally alert the user of success here...
|
||||
}).error(function(data) {
|
||||
$('#result').html('Copie impossible');
|
||||
// Optionally alert the user of an error here...
|
||||
});
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
|
@ -166,7 +166,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
|
||||
Zend_Registry::get('firebug')->info($arguments);
|
||||
}
|
||||
|
||||
try {
|
||||
//try {
|
||||
|
||||
$response = parent::__call($name, $arguments);
|
||||
|
||||
@ -182,7 +182,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
|
||||
|
||||
return $response->{$name.'Result'};
|
||||
|
||||
} catch ( SoapFault $fault ) {
|
||||
/*} catch ( SoapFault $fault ) {
|
||||
|
||||
// --- Debug
|
||||
if ( array_key_exists('debug', $methodConfig) ) {
|
||||
@ -228,7 +228,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -5,5 +5,9 @@ return array(
|
||||
'debug' => true,
|
||||
'log' => 'mail',
|
||||
),
|
||||
'dupliqueAnnonce' => array(
|
||||
'debug' => true,
|
||||
'log' => 'mail',
|
||||
),
|
||||
)
|
||||
);
|
Loading…
Reference in New Issue
Block a user