Skip to content
Snippets Groups Projects
Verified Commit 59366938 authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #7888 next step ixbus (getMessageModel, sendDossier)

parent b46c2929
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ class IxbusController ...@@ -26,6 +26,7 @@ class IxbusController
$html .= $value->Identifiant; $html .= $value->Identifiant;
$html .= '">'; $html .= '">';
$html .= $value->Libelle; $html .= $value->Libelle;
$html .= '</option>';
} }
} }
$html .= '</select><br /><br />'; $html .= '</select><br /><br />';
...@@ -33,12 +34,13 @@ class IxbusController ...@@ -33,12 +34,13 @@ class IxbusController
// $initializeDatas['messagesModel'] = ['12' => 'modele courrier', '34' => 'DRH']; // $initializeDatas['messagesModel'] = ['12' => 'modele courrier', '34' => 'DRH'];
$html .= '<label for="messageModel">' . _WORKFLOW_MODEL_IXBUS . '</label><select name="messageModel" id="messageModel">'; $html .= '<label for="messageModel">' . _WORKFLOW_MODEL_IXBUS . '</label><select name="messageModel" id="messageModel">';
// foreach ($initializeDatas['messagesModel'] as $key => $value) { foreach ($initializeDatas['messagesModel'] as $key => $value) {
// $html .= '<option value="'; $html .= '<option value="';
// $html .= $key; $html .= $key;
// $html .= '">'; $html .= '">';
// $html .= $value; $html .= $value;
// } $html .= '</option>';
}
$html .= '</select><br /><br />'; $html .= '</select><br /><br />';
$html .= '<label for="loginIxbus">'._ID_IXBUS.'</label><input name="loginIxbus" id="loginIxbus"/><br /><br />'; $html .= '<label for="loginIxbus">'._ID_IXBUS.'</label><input name="loginIxbus" id="loginIxbus"/><br /><br />';
$html .= '<label for="passwordIxbus">'._PASSWORD_IXBUS.'</label><input name="passwordIxbus" id="passwordIxbus"/><br /><br />'; $html .= '<label for="passwordIxbus">'._PASSWORD_IXBUS.'</label><input name="passwordIxbus" id="passwordIxbus"/><br /><br />';
...@@ -85,10 +87,10 @@ class IxbusController ...@@ -85,10 +87,10 @@ class IxbusController
if (!empty($rawResponse['natures']->Classeur)) { if (!empty($rawResponse['natures']->Classeur)) {
foreach ($rawResponse['natures']->Classeur as $nature) { foreach ($rawResponse['natures']->Classeur as $nature) {
foreach ($messagesModels->Message as $message) { foreach ($messagesModels->Message as $message) {
if ($message->Nature == $nature->Libelle) { if ($message->Identifiant == 392213) {
$messageModel = IxbusController::getMessageNature(['messageId' => $message->Identifiant, 'sessionId' => $sessionId]); $messageModel = IxbusController::getMessageNature(['config' => $config, 'messageId' => $message->Identifiant, 'sessionId' => $sessionId]);
if ($messageModel->IdentifiantClasseur == $nature->Identifiant) { if ((string)$messageModel->IdentifiantClasseur == (string)$nature->Identifiant) {
$rawResponse['messagesModel'][$nature->Identifiant][] = $messageModel; $rawResponse['messagesModel'][(string)$messageModel->IdentifiantMessage] = (string)$message->IdentifiantSpecifique;
} }
} }
} }
...@@ -135,7 +137,7 @@ class IxbusController ...@@ -135,7 +137,7 @@ class IxbusController
return $response; return $response;
} }
public static function getUsersList($aArgs) /*public static function getUsersList($aArgs)
{ {
$xmlPostString = '<?xml version="1.0" encoding="utf-8"?> $xmlPostString = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
...@@ -170,7 +172,7 @@ class IxbusController ...@@ -170,7 +172,7 @@ class IxbusController
$response = $data->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children()->GetListeUtilisateursDroitCreerResponse->GetListeUtilisateursDroitCreerResult; $response = $data->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children()->GetListeUtilisateursDroitCreerResponse->GetListeUtilisateursDroitCreerResult;
return $response; return $response;
} }*/
public static function getMessagesModel($aArgs) public static function getMessagesModel($aArgs)
{ {
...@@ -303,7 +305,7 @@ class IxbusController ...@@ -303,7 +305,7 @@ class IxbusController
$attachmentToFreeze = []; $attachmentToFreeze = [];
$opts = [ $opts = [
CURLOPT_URL => $aArgs['config']['data']['url'] . '/parapheurws/3.21/MessagerieImprimante.asmx', CURLOPT_URL => $aArgs['config']['data']['url'] . '/parapheurws/service.asmx',
CURLOPT_HTTPHEADER => [ CURLOPT_HTTPHEADER => [
'content-type:text/xml;charset=\"utf-8\"', 'content-type:text/xml;charset=\"utf-8\"',
'accept:text/xml', 'accept:text/xml',
...@@ -311,7 +313,7 @@ class IxbusController ...@@ -311,7 +313,7 @@ class IxbusController
"Pragma: no-cache", "Pragma: no-cache",
"Content-length: ".strlen($xmlPostString), "Content-length: ".strlen($xmlPostString),
"Cookie:".$aArgs['sessionId'], "Cookie:".$aArgs['sessionId'],
"SOAPAction: \"http://www.srci.fr/Transmettre\"" "SOAPAction: \"http://www.srci.fr/SendDossier\""
], ],
CURLOPT_RETURNTRANSFER => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true, CURLOPT_POST => true,
...@@ -321,31 +323,19 @@ class IxbusController ...@@ -321,31 +323,19 @@ class IxbusController
$xmlPostString = '<?xml version="1.0" encoding="utf-8"?> $xmlPostString = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body> <soap:Body>
<Transmettre xmlns="http://www.srci.fr"> <SendDossier xmlns="http://www.srci.fr">
<NomUtilisateur>'.$aArgs['config']['data']['userId'].'</NomUtilisateur> <ContenuDocumentZip>base64Binary</ContenuDocumentZip>
<MotdePasse>'.$aArgs['config']['data']['password'].'</MotdePasse> <NomDocumentPrincipal>string</NomDocumentPrincipal>
<IdentifiantOrganisation>'.$aArgs['config']['data']['organizationId'].'</IdentifiantOrganisation>
<attach>
<Document>
<Attachment>
<Name>string</Name>
<Content>base64Binary</Content>
<Size>int</Size>
</Attachment>
<Attachment>
<Name>string</Name>
<Content>base64Binary</Content>
<Size>int</Size>
</Attachment>
</Document>
<Description>xml</Description>
</attach>
<NomDossier>'. $value['title'] .'</NomDossier> <NomDossier>'. $value['title'] .'</NomDossier>
<NomModele>'. $aArgs['messageModel'] .'</NomModele>
<NomNature>'. $aArgs['idClasseur'] .'</NomNature>
<DateLimite>dateTime</DateLimite> <DateLimite>dateTime</DateLimite>
<MessageModele>'. $aArgs['messageModel'] .'</MessageModele> <LoginResponsable>'. $userInfo->Identifiant .'</LoginResponsable>
<IdClasseur>'. $aArgs['idClasseur'] .'</IdClasseur> <Confidentiel>false</Confidentiel>
<Responsable>'. $userInfo->Identifiant .'</Responsable> <DocumentModifiable>true</DocumentModifiable>
</Transmettre> <AnnexesSignables>false</AnnexesSignables>
<SignatureManuscrite>true</SignatureManuscrite>
</SendDossier>
</soap:Body> </soap:Body>
</soap:Envelope>'; </soap:Envelope>';
...@@ -353,10 +343,10 @@ class IxbusController ...@@ -353,10 +343,10 @@ class IxbusController
curl_setopt_array($curl, $opts); curl_setopt_array($curl, $opts);
$rawResponse = curl_exec($curl); $rawResponse = curl_exec($curl);
// $data = simplexml_load_string($rawResponse); $data = simplexml_load_string($rawResponse);
// $response = $data->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children()->TransmettreResponse; $response = $data->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children()->SendDossierResponse->SendDossierResult;
$attachmentToFreeze[] = $value['res_id']; $attachmentToFreeze[] = $response;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment