diff --git a/apps/maarch_entreprise/actions/sendToExternalSignatureBook.php b/apps/maarch_entreprise/actions/sendToExternalSignatureBook.php index 622cb196a389c1cedd3cd374751ec79f39114d26..0d80224275fcb3fcc2b492984d5494c5dc604ad5 100755 --- a/apps/maarch_entreprise/actions/sendToExternalSignatureBook.php +++ b/apps/maarch_entreprise/actions/sendToExternalSignatureBook.php @@ -61,9 +61,7 @@ function get_form_txt($values, $path_manage_action, $id_action, $table, $module, $htmlModal = IxbusController::getModal($config); } elseif ($config['id'] == 'iParapheur') { - include_once 'modules/visa/class/IParapheurController.php'; - - $htmlModal = IParapheurController::getModal($config); + // Already In V2 } elseif ($config['id'] == 'fastParapheur') { // Already In V2 } elseif ($config['id'] == 'maarchParapheur') { @@ -157,8 +155,7 @@ function manage_form($arr_id, $history, $id_action, $label_action, $status, $col 'manSignature' => $manSignature ]); } elseif ($config['id'] == 'iParapheur') { - include_once 'modules/visa/class/IParapheurController.php'; - $attachmentToFreeze = IParapheurController::sendDatas(['config' => $config, 'resIdMaster' => $res_id]); + // Already In V2 } elseif ($config['id'] == 'fastParapheur') { // Already In V2 } elseif ($config['id'] == 'maarchParapheur') { diff --git a/modules/visa/batch/process_mailsFromSignatoryBook.php b/modules/visa/batch/process_mailsFromSignatoryBook.php index bfd02794f5a4652338a03f076077c8de335b1d6b..032c2ddb8c7a0bdbee940ebc497e54a025ce4d61 100755 --- a/modules/visa/batch/process_mailsFromSignatoryBook.php +++ b/modules/visa/batch/process_mailsFromSignatoryBook.php @@ -187,8 +187,6 @@ try { if (!empty($configRemoteSignatoryBook)) { if ($configRemoteSignatoryBook['id'] == 'ixbus') { $signatoryBook = "/modules/visa/class/IxbusController.php"; - } elseif ($configRemoteSignatoryBook['id'] == 'iParapheur') { - $signatoryBook = "/modules/visa/class/IParapheurController.php"; } } else { $GLOBALS['logger']->write('no signatory book enabled', 'ERROR', 102); @@ -203,7 +201,7 @@ try { } elseif (is_file($GLOBALS['MaarchDirectory'] . $signatoryBook)) { $classToInclude = $GLOBALS['MaarchDirectory'] . $signatoryBook; Bt_myInclude($classToInclude); - } elseif (!in_array($configRemoteSignatoryBook['id'], ['maarchParapheur', 'xParaph', 'fastParapheur'])) { + } elseif (!in_array($configRemoteSignatoryBook['id'], ['maarchParapheur', 'xParaph', 'fastParapheur', 'iParapheur'])) { $GLOBALS['logger']->write('No class detected', 'ERROR', 102); echo "\nNo class detected ! \nThe batch cannot be launched !\n\n"; exit(102); @@ -249,7 +247,7 @@ $GLOBALS['logger']->write('Retrieve signed/annotated documents from remote signa if ($configRemoteSignatoryBook['id'] == 'ixbus') { $retrievedMails = IxbusController::retrieveSignedMails(['config' => $configRemoteSignatoryBook, 'idsToRetrieve' => $idsToRetrieve]); } elseif ($configRemoteSignatoryBook['id'] == 'iParapheur') { - $retrievedMails = IParapheurController::retrieveSignedMails(['config' => $configRemoteSignatoryBook, 'idsToRetrieve' => $idsToRetrieve]); + $retrievedMails = \ExternalSignatoryBook\controllers\IParapheurController::retrieveSignedMails(['config' => $configRemoteSignatoryBook, 'idsToRetrieve' => $idsToRetrieve]); } elseif ($configRemoteSignatoryBook['id'] == 'fastParapheur') { $retrievedMails = \ExternalSignatoryBook\controllers\FastParapheurController::retrieveSignedMails(['config' => $configRemoteSignatoryBook, 'idsToRetrieve' => $idsToRetrieve]); } elseif ($configRemoteSignatoryBook['id'] == 'maarchParapheur') { @@ -271,6 +269,8 @@ if (!empty($idsToRetrieve['resLetterbox'])) { $retrievedLetterboxMails = \ExternalSignatoryBook\controllers\MaarchParapheurController::retrieveSignedMails(['config' => $configRemoteNoteBook, 'idsToRetrieve' => $idsToRetrieve]); } elseif ($configRemoteSignatoryBook['id'] == 'fastParapheur') { $retrievedLetterboxMails = \ExternalSignatoryBook\controllers\FastParapheurController::retrieveSignedMails(['config' => $configRemoteSignatoryBook, 'idsToRetrieve' => $idsToRetrieve]); + } elseif ($configRemoteSignatoryBook['id'] == 'iParapheur') { + $retrievedLetterboxMails = \ExternalSignatoryBook\controllers\IParapheurController::retrieveSignedMails(['config' => $configRemoteSignatoryBook, 'idsToRetrieve' => $idsToRetrieve]); } $retrievedMails['resLetterbox'] = $retrievedLetterboxMails['resLetterbox']; } diff --git a/modules/visa/class/IParapheurController.php b/modules/visa/class/IParapheurController.php deleted file mode 100755 index 3b338fa1284d741333052d16a9322919a59aebdc..0000000000000000000000000000000000000000 --- a/modules/visa/class/IParapheurController.php +++ /dev/null @@ -1,341 +0,0 @@ -<?php - -/** - * Copyright Maarch since 2008 under licence GPLv3. - * See LICENCE.txt file at the root folder for more details. - * This file is part of Maarch software. - * - */ - -/** - * @brief IParapheur Controller - * @author nathan.cheval@edissyum.com - */ - - -class IParapheurController -{ - public static function returnCurl($xmlPostString, $config) - { - $curlReturn = \SrcCore\models\CurlModel::execSOAP([ - 'xmlPostString' => $xmlPostString, - 'url' => $config['data']['url'], - 'options' => [ - CURLOPT_SSLCERT => $config['data']['certPath'], - CURLOPT_SSLCERTTYPE => $config['data']['certType'], - CURLOPT_SSL_VERIFYPEER => 'false', - CURLOPT_USERPWD => $config['data']['userId'] . ':' . $config['data']['password'], - ], - 'delete_header' => true - ]); - - return $curlReturn; - } - - public static function getModal($config) - { - $html ='<center style="font-size:15px;">' . _ACTION_CONFIRM . '<br/><br/><b>' . _SEND_TO_IPARAPHEUR . '</b></center><br/>'; - return $html; - } - - public static function sendDatas($aArgs) - { - $config = $aArgs['config']; - $signatory = \SrcCore\models\DatabaseModel::select([ - 'select' => ['item_id'], - 'table' => ['listinstance', ], - 'where' => ['res_id = ?', 'item_mode = ?'], - 'data' => [$aArgs['resIdMaster'], 'sign'] - ])[0]; - $sousType = self::getSousType(['config' => $config, 'sousType' => $signatory['item_id']]); - $type = self::getType(['config' => $config]); - - if (!$type) { - // TODO gestion erreurs - return false; - } - return self::upload(['config' => $config, 'resIdMaster' => $aArgs['resIdMaster'], 'sousType' => $sousType ]); - } - - public static function upload($aArgs) - { - $typeTechnique = $aArgs['config']['data']['defaultType']; - $sousType = $aArgs['sousType']; - - // Retrieve the annexes of the attachment to sign (other attachments and the original document) - $annexes = []; - $annexes['letterbox'] = \Resource\models\ResModel::get([ - 'select' => ['res_id', 'path', 'filename', 'docserver_id'], - 'where' => ['res_id = ?'], - 'data' => [$aArgs['resIdMaster']] - ])[0]; - $letterboxPath = \Docserver\models\DocserverModel::getByDocserverId(['docserverId' => $annexes['letterbox']['docserver_id'], 'select' => ['path_template']]); - $annexes['letterbox']['filePath'] = $letterboxPath['path_template'] . str_replace('#', DIRECTORY_SEPARATOR, $annexes['letterbox']['path']) . $annexes['letterbox']['filename']; - - $annexes['attachments'] = \Attachment\models\AttachmentModel::get([ - 'select' => ['res_id', 'path', 'filename' ], - 'where' => ['res_id_master = ?', 'attachment_type not in (?)', "status NOT IN ('DEL','OBS')", 'in_signature_book = FALSE', "format = 'pdf'"], - 'data' => [$aArgs['resIdMaster'], 'print_folder'] - ]); - - if (!empty($annexes['attachments'])) { - for ($i =0; $i < count($annexes['attachments']); $i++) { - $annexAttachmentInfo = \Attachment\models\AttachmentModel::getById(['id' => $annexes['attachments'][$i]['res_id']]); - $annexAttachmentPath = \Docserver\models\DocserverModel::getByDocserverId(['docserverId' => $annexAttachmentInfo['docserver_id'], 'select' => ['path_template']]); - $annexes['attachments'][$i]['filePath'] = $annexAttachmentPath['path_template'] . str_replace('#', DIRECTORY_SEPARATOR, $annexes['attachments'][$i]['path']) . $annexes['attachments'][$i]['filename']; - } - } - // END annexes - - $attachments = \Attachment\models\AttachmentModel::get([ - 'select' => ['res_id', 'title', 'attachment_type','path'], - 'where' => ['res_id_master = ?', 'attachment_type not in (?)', "status not in ('DEL', 'OBS', 'FRZ', 'TMP')", 'in_signature_book = TRUE'], - 'data' => [$aArgs['resIdMaster'], ['converted_pdf', 'incoming_mail_attachment', 'print_folder', 'signed_response']] - ]); - - for ($i = 0; $i < count($attachments); $i++) { - $resId = $attachments[$i]['res_id']; - $collId = 'attachments_coll'; - $is_version = false; - - $attachmentInfo = \Convert\controllers\ConvertPdfController::getConvertedPdfById(['resId' => $resId, 'collId' => $collId]); - - $attachmentPath = \Docserver\models\DocserverModel::getByDocserverId(['docserverId' => $attachmentInfo['docserver_id'], 'select' => ['path_template']]); - $attachmentFilePath = $attachmentPath['path_template'] . str_replace('#', DIRECTORY_SEPARATOR, $attachmentInfo['path']) . $attachmentInfo['filename']; - $dossierId = $attachments[$i]['res_id'] . '_' . rand(0001, 9999); - $dossierTitre = _PROJECT_NUMBER . $attachments[$i]['res_id']; - - $mainResource = \Resource\models\ResModel::getById(['resId' => $aArgs['resIdMaster'], 'select' => ['process_limit_date']]); - if (empty($mainResource['process_limit_date'])) { - $processLimitDate = $mainResource['process_limit_date'] = date('Y-m-d', strtotime(date("Y-m-d"). ' + 14 days')); - } else { - $processLimitDateTmp = explode(" ", $mainResource['process_limit_date']); - $processLimitDate = $processLimitDateTmp[0]; - } - - $b64Attachment = base64_encode(file_get_contents($attachmentFilePath)); - $b64AnnexesLetterbox = base64_encode(file_get_contents($annexes['letterbox']['filePath'])); - - $annexLetterboxMimeType = mime_content_type($annexes['letterbox']['filePath']); - if ($annexLetterboxMimeType) { - $annexesXmlPostString = '<ns:DocAnnexe> - <ns:nom>Fichier original</ns:nom> - <ns:fichier xm:contentType="' . $annexLetterboxMimeType . '">' . $b64AnnexesLetterbox . '</ns:fichier> - <ns:mimetype>' . $annexLetterboxMimeType . '</ns:mimetype> - <ns:encoding>utf-8</ns:encoding> - </ns:DocAnnexe>'; - } - if (!empty($annexes['attachments'])) { - for ($j = 0; $j < count($annexes['attachments']); $j++) { - $b64AnnexesAttachment = base64_encode(file_get_contents($annexes['attachments'][$j]['filePath'])); - $annexesXmlPostString .= '<ns:DocAnnexe> - <ns:nom>PJ_' . ($j + 1) . '</ns:nom> - <ns:fichier xm:contentType="application/pdf">' . $b64AnnexesAttachment . '</ns:fichier> - <ns:mimetype>application/pdf</ns:mimetype> - <ns:encoding>utf-8</ns:encoding> - </ns:DocAnnexe>'; - } - } - $xmlPostString = '<?xml version="1.0" encoding="utf-8"?> - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.adullact.org/spring-ws/iparapheur/1.0" xmlns:xm="http://www.w3.org/2005/05/xmlmime"> - <soapenv:Header/> - <soapenv:Body> - <ns:CreerDossierRequest> - <ns:TypeTechnique>' . $typeTechnique . '</ns:TypeTechnique> - <ns:SousType>' . $sousType . '</ns:SousType> - <ns:DossierID>' . $dossierId . '</ns:DossierID> - <ns:DossierTitre>' . $dossierTitre . '_' . $dossierId . '</ns:DossierTitre> - <ns:DocumentPrincipal xm:contentType="application/pdf">' . $b64Attachment . '</ns:DocumentPrincipal> - <ns:DocumentsSupplementaires></ns:DocumentsSupplementaires> - <ns:DocumentsAnnexes>' . $annexesXmlPostString . '</ns:DocumentsAnnexes> - <ns:MetaData> - - </ns:MetaData> - <ns:AnnotationPublique></ns:AnnotationPublique> - <ns:AnnotationPrivee></ns:AnnotationPrivee> - <ns:Visibilite>CONFIDENTIEL</ns:Visibilite> - <ns:DateLimite>' . $processLimitDate . '</ns:DateLimite> - </ns:CreerDossierRequest> - </soapenv:Body> - </soapenv:Envelope>'; - - $curlReturn = self::returnCurl($xmlPostString, $aArgs['config']); - - if (!empty($curlReturn['error'])) { - // TODO gestin d'une erreur - echo $curlReturn['error']; - return false; - } - $response = $curlReturn['response']->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children('http://www.adullact.org/spring-ws/iparapheur/1.0')->CreerDossierResponse[0]; - - if ($response->MessageRetour->codeRetour == $aArgs['config']['data']['errorCode'] || $curlReturn['infos']['http_code'] >= 500) { - // TODO gestion d'une potentielle erreur - echo '[' . $response->MessageRetour->severite . ']' . $response->MessageRetour->message; - return false; - } else { - $attachmentToFreeze[$collId][$resId] = $dossierId; - } - } - return $attachmentToFreeze; - } - - public static function download($aArgs) - { - $xmlPostString = '<?xml version="1.0" encoding="utf-8"?> - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.adullact.org/spring-ws/iparapheur/1.0"> - <soapenv:Header/> - <soapenv:Body> - <ns:GetDossierRequest>' . $aArgs['documentId'] . '</ns:GetDossierRequest> - </soapenv:Body> - </soapenv:Envelope>'; - - $curlReturn = $curlReturn = self::returnCurl($xmlPostString, $aArgs['config']); - - $response = $curlReturn['response']->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children('http://www.adullact.org/spring-ws/iparapheur/1.0')->GetDossierResponse[0]; - if ($response->MessageRetour->codeRetour == $aArgs['config']['data']['errorCode']) { - // TODO gestion d'une potentielle erreur - echo '[' . $response->MessageRetour->severite . ']' . $response->MessageRetour->message; - return false; - } else { - $returnedDocumentId = (string) $response->DossierID; - if ($aArgs['documentId'] !== $returnedDocumentId) { - // TODO gestion d'une potentielle erreur - return false; - } else { - $b64FileContent = (string)$response->DocPrincipal; - return ['b64FileContent' => $b64FileContent, 'documentId' => $returnedDocumentId]; - } - } - } - - public static function retrieveSignedMails($aArgs) - { - foreach ($aArgs['idsToRetrieve']['noVersion'] as $noVersion) { - if (!empty($noVersion->external_id)) { - $xmlPostString = '<?xml version="1.0" encoding="utf-8"?> - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.adullact.org/spring-ws/iparapheur/1.0"> - <soapenv:Header/> - <soapenv:Body> - <ns:GetHistoDossierRequest>' . $noVersion->external_id . '</ns:GetHistoDossierRequest> - </soapenv:Body> - </soapenv:Envelope>'; - - $curlReturn = self::returnCurl($xmlPostString, $aArgs['config']); - - if (!empty($curlReturn['response'])) { - // TODO gestin d'une erreur - echo $curlReturn['error']; - return false; - } - - $response = $curlReturn['response']->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children('http://www.adullact.org/spring-ws/iparapheur/1.0')->GetHistoDossierResponse[0]; - - if ($response->MessageRetour->codeRetour == $aArgs['config']['data']['errorCode']) { - // TODO gestion d'une potentielle erreur - echo 'retrieveSignedMails noVersion : [' . $response->MessageRetour->severite . ']' . $response->MessageRetour->message; - return false; - } else { - $noteContent = ''; - foreach ($response->LogDossier as $res) { // Loop on all steps of the documents (prepared, send to signature, signed etc...) - $status = $res->status; - if ($status == $aArgs['config']['data']['visaState'] || $status == $aArgs['config']['data']['signState']) { - $noteContent .= $res->nom . ' : ' . $res->annotation . PHP_EOL; - - $response = self::download([ - 'config' => $aArgs['config'], - 'documentId' => $noVersion->external_id - ]); - $aArgs['idsToRetrieve']['noVersion'][$noVersion->res_id]->status = 'validated'; - $aArgs['idsToRetrieve']['noVersion'][$noVersion->res_id]->format = 'pdf'; - $aArgs['idsToRetrieve']['noVersion'][$noVersion->res_id]->encodedFile = $response['b64FileContent']; - $aArgs['idsToRetrieve']['noVersion'][$noVersion->res_id]->noteContent = $noteContent; - if ($status == $aArgs['config']['data']['signState']) { - break; - } - } elseif ($status == $aArgs['config']['data']['refusedVisa'] || $status == $aArgs['config']['data']['refusedSign']) { - $noteContent .= $res->nom . ' : ' . $res->annotation . PHP_EOL; - $aArgs['idsToRetrieve']['noVersion'][$noVersion->res_id]->status = 'refused'; - $aArgs['idsToRetrieve']['noVersion'][$noVersion->res_id]->noteContent = $noteContent; - break; - } else { - $aArgs['idsToRetrieve']['noVersion'][$noVersion->res_id]->status = 'waiting'; - } - } - } - } else { - echo _EXTERNAL_ID_EMPTY; - } - } - return $aArgs['idsToRetrieve']; - } - - public static function getType($aArgs) - { - $xmlPostString = '<?xml version="1.0" encoding="utf-8"?> - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.adullact.org/spring-ws/iparapheur/1.0"> - <soapenv:Header/> - <soapenv:Body> - <ns:GetListeTypesRequest></ns:GetListeTypesRequest> - </soapenv:Body> - </soapenv:Envelope>'; - - $curlReturn = $curlReturn = self::returnCurl($xmlPostString, $aArgs['config']); - - if (!empty($curlReturn['error'])) { - // TODO gestin d'une erreur - echo $curlReturn['error']; - return false; - } - - $response = $curlReturn['response']->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children('http://www.adullact.org/spring-ws/iparapheur/1.0')->GetListeTypesResponse[0]; - - $typeExist = false; - foreach ($response->TypeTechnique as $res) { - if ($res == $aArgs['config']['data']['defaultType']) { - $typeExist = true; - break; - } - } - if (!$typeExist) { - // TODO Gestion erreur - return false; - } else { - return true; - } - } - - public static function getSousType($aArgs) - { - $xmlPostString = '<?xml version="1.0" encoding="utf-8"?> - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.adullact.org/spring-ws/iparapheur/1.0"> - <soapenv:Header/> - <soapenv:Body> - <ns:GetListeSousTypesRequest>' . $aArgs['config']['data']['defaultType'] . '</ns:GetListeSousTypesRequest> - </soapenv:Body> - </soapenv:Envelope>'; - - $curlReturn = $curlReturn = self::returnCurl($xmlPostString, $aArgs['config']); - - if (!empty($curlReturn['error'])) { - // TODO gestin d'une erreur - echo $curlReturn['error']; - return false; - } - - $response = $curlReturn['response']->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children('http://www.adullact.org/spring-ws/iparapheur/1.0')->GetListeSousTypesResponse[0]; - - $subTypeExist = false; - foreach ($response->SousType as $res) { - if ($res == $aArgs['sousType']) { - $subTypeExist = true; - break; - } - } - - if (!$subTypeExist) { - return $aArgs['config']['data']['defaultSousType']; - } else { - return $aArgs['sousType']; - } - } -} diff --git a/src/app/action/controllers/ExternalSignatoryBookTrait.php b/src/app/action/controllers/ExternalSignatoryBookTrait.php index 988a7f46ed6e4bcc851e9765912574400f4255bf..684f717d91e56f70fb5973a020bfe5ee16e09907 100644 --- a/src/app/action/controllers/ExternalSignatoryBookTrait.php +++ b/src/app/action/controllers/ExternalSignatoryBookTrait.php @@ -14,6 +14,7 @@ namespace Action\controllers; use Attachment\controllers\AttachmentController; use Attachment\models\AttachmentModel; +use ExternalSignatoryBook\controllers\IParapheurController; use ExternalSignatoryBook\controllers\FastParapheurController; use ExternalSignatoryBook\controllers\MaarchParapheurController; use ExternalSignatoryBook\controllers\XParaphController; @@ -62,9 +63,7 @@ trait ExternalSignatoryBookTrait if ($config['id'] == 'ixbus') { // TODO - } elseif ($config['id'] == 'iParapheur') { - // TODO - } elseif (in_array($config['id'], ['maarchParapheur', 'fastParapheur'])) { + } elseif (in_array($config['id'], ['maarchParapheur', 'fastParapheur', 'iParapheur'])) { $integratedResource = ResModel::get([ 'select' => [1], 'where' => ['integrations->>\'inSignatureBook\' = \'true\'', 'external_id->>\'signatureBookId\' is null', 'res_id = ?'], @@ -85,11 +84,16 @@ trait ExternalSignatoryBookTrait 'steps' => $args['data']['steps'], 'note' => $args['note']['content'] ?? null ]); - } else { + } elseif ($config['id'] == 'fastParapheur') { $sentInfo = FastParapheurController::sendDatas([ 'config' => $config, 'resIdMaster' => $args['resId'] ]); + } elseif ($config['id'] == 'iParapheur') { + $sentInfo = IParapheurController::sendDatas([ + 'config' => $config, + 'resIdMaster' => $args['resId'] + ]); } if (!empty($sentInfo['error'])) { return ['errors' => [$sentInfo['error']]]; @@ -121,7 +125,7 @@ trait ExternalSignatoryBookTrait if (!empty($attachmentToFreeze)) { if (!empty($attachmentToFreeze['letterbox_coll'])) { ResModel::update([ - 'postSet' => ['external_id' => "jsonb_set(external_id, '{signatureBookId}', '{$attachmentToFreeze['letterbox_coll'][$args['resId']]}'::text::jsonb)"], + 'postSet' => ['external_id' => "jsonb_set(external_id, '{signatureBookId}', '\"{$attachmentToFreeze['letterbox_coll'][$args['resId']]}\"'::text::jsonb)"], 'where' => ['res_id = ?'], 'data' => [$args['resId']] ]); diff --git a/src/app/action/controllers/PreProcessActionController.php b/src/app/action/controllers/PreProcessActionController.php index 04f5cf6fa6ba97a52fcc9ded47704bbf71ca07dc..1d0f7189537e3819a767121b422faa09c4c894ba 100755 --- a/src/app/action/controllers/PreProcessActionController.php +++ b/src/app/action/controllers/PreProcessActionController.php @@ -415,9 +415,7 @@ class PreProcessActionController ]; if ($signatureBookEnabled == 'ixbus') { // TODO - } elseif ($signatureBookEnabled == 'iParapheur') { - // TODO - } elseif (in_array($signatureBookEnabled, ['maarchParapheur', 'fastParapheur'])) { + } elseif (in_array($signatureBookEnabled, ['maarchParapheur', 'fastParapheur', 'iParapheur'])) { if (is_array($data['resources']) && count($data['resources']) == 1) { $resDestination = ResModel::getById([ 'select' => ['destination'], diff --git a/src/app/external/externalSignatoryBook/controllers/FastParapheurController.php b/src/app/external/externalSignatoryBook/controllers/FastParapheurController.php index 8c807e581232e2fecc9703dda29f5e48b65a941a..2963a305fe24cdba9d35fe6d1f0eee7d883665e0 100755 --- a/src/app/external/externalSignatoryBook/controllers/FastParapheurController.php +++ b/src/app/external/externalSignatoryBook/controllers/FastParapheurController.php @@ -103,7 +103,7 @@ class FastParapheurController // Retrieve the annexes of the attachemnt to sign (other attachment and the original document) $annexes = []; $annexes['letterbox'] = ResModel::get([ - 'select' => ['res_id', 'path', 'filename', 'docserver_id','format', 'category_id', 'external_id', 'integrations'], + 'select' => ['res_id', 'path', 'filename', 'docserver_id', 'format', 'category_id', 'external_id', 'integrations'], 'where' => ['res_id = ?'], 'data' => [$aArgs['resIdMaster']] ]); diff --git a/src/app/external/externalSignatoryBook/controllers/IParapheurController.php b/src/app/external/externalSignatoryBook/controllers/IParapheurController.php new file mode 100755 index 0000000000000000000000000000000000000000..804bd4c3349d200bf185bac9b764449a4fa2caa6 --- /dev/null +++ b/src/app/external/externalSignatoryBook/controllers/IParapheurController.php @@ -0,0 +1,392 @@ +<?php + +/** + * Copyright Maarch since 2008 under licence GPLv3. + * See LICENCE.txt file at the root folder for more details. + * This file is part of Maarch software. + * + */ + +/** + * @brief iParapheur Controller + * @author nathan.cheval@edissyum.com + * @author dev@maarch.org + */ + +namespace ExternalSignatoryBook\controllers; + +use Attachment\models\AttachmentModel; +use Convert\models\AdrModel; +use Docserver\models\DocserverModel; +use Resource\models\ResModel; +use SrcCore\models\CurlModel; +use SrcCore\models\DatabaseModel; + +class IParapheurController +{ + public static function returnCurl($xmlPostString, $config) + { + $option = [ + CURLOPT_SSLCERT => $config['data']['certPath'], + CURLOPT_SSLCERTTYPE => $config['data']['certType'], + CURLOPT_SSL_VERIFYPEER => 'false', + CURLOPT_USERPWD => $config['data']['userId'] . ':' . $config['data']['password'], + ]; + if (!empty($config['data']['certPass'])) { + unset($option[CURLOPT_SSL_VERIFYPEER]); + $option[CURLOPT_SSLCERTPASSWD] = $config['data']['certPass']; + } + + $curlReturn = CurlModel::execSOAP([ + 'xmlPostString' => $xmlPostString, + 'url' => $config['data']['url'], + 'options' => $option, + 'delete_header' => true + ]); + + return $curlReturn; + } + + public static function sendDatas($aArgs) + { + $config = $aArgs['config']; + $signatory = DatabaseModel::select([ + 'select' => ['item_id'], + 'table' => ['listinstance', ], + 'where' => ['res_id = ?', 'item_mode = ?'], + 'data' => [$aArgs['resIdMaster'], 'sign'] + ])[0]; + $sousType = IParapheurController::getSousType(['config' => $config, 'sousType' => $signatory['item_id']]); + if (!empty($sousType['error'])) { + return ['error' => $sousType['error']]; + } + + $type = IParapheurController::getType(['config' => $config]); + if (!empty($type['error'])) { + return ['error' => $type['error']]; + } + return IParapheurController::upload(['config' => $config, 'resIdMaster' => $aArgs['resIdMaster'], 'sousType' => $sousType ]); + } + + public static function upload($aArgs) + { + $sousType = $aArgs['sousType']; + + // Retrieve the annexes of the attachment to sign (other attachments and the original document) + $annexes = []; + $annexes['letterbox'] = ResModel::get([ + 'select' => ['res_id', 'path', 'filename', 'docserver_id', 'format', 'category_id', 'external_id', 'integrations'], + 'where' => ['res_id = ?'], + 'data' => [$aArgs['resIdMaster']] + ]); + + if (!empty($annexes['letterbox'][0]['docserver_id'])) { + $adrInfo = AdrModel::getConvertedDocumentById(['resId' => $annexes['letterbox'][0]['res_id'], 'collId' => 'letterbox_coll', 'type' => 'PDF']); + $letterboxPath = DocserverModel::getByDocserverId(['docserverId' => $adrInfo['docserver_id'], 'select' => ['path_template']]); + $annexes['letterbox'][0]['filePath'] = $letterboxPath['path_template'] . str_replace('#', DIRECTORY_SEPARATOR, $adrInfo['path']) . $adrInfo['filename']; + } + + $attachments = AttachmentModel::get([ + 'select' => ['res_id', 'docserver_id', 'path', 'filename', 'format', 'attachment_type'], + 'where' => ['res_id_master = ?', 'attachment_type not in (?)', "status NOT IN ('DEL','OBS', 'FRZ', 'TMP', 'SEND_MASS')", "in_signature_book = 'true'"], + 'data' => [$aArgs['resIdMaster'], ['converted_pdf', 'print_folder', 'signed_response']] + ]); + + $attachmentTypes = AttachmentModel::getAttachmentsTypesByXML(); + foreach ($attachments as $key => $value) { + if (!$attachmentTypes[$value['attachment_type']]['sign']) { + $adrInfo = AdrModel::getConvertedDocumentById(['resId' => $value['res_id'], 'collId' => 'attachments_coll', 'type' => 'PDF']); + $annexeAttachmentPath = DocserverModel::getByDocserverId(['docserverId' => $adrInfo['docserver_id'], 'select' => ['path_template']]); + $value['filePath'] = $annexeAttachmentPath['path_template'] . str_replace('#', DIRECTORY_SEPARATOR, $adrInfo['path']) . $adrInfo['filename']; + unset($attachments[$key]); + $annexes['attachments'][] = $value; + } + } + // END annexes + + $attachmentToFreeze = []; + foreach ($attachments as $attachment) { + $resId = $attachment['res_id']; + $collId = 'attachments_coll'; + $dossierId = $resId . '_' . rand(0001, 9999); + + $curlReturn = IParapheurController::uploadFile([ + 'resId' => $resId, + 'collId' => $collId, + 'resIdMaster' => $aArgs['resIdMaster'], + 'annexes' => $annexes, + 'sousType' => $sousType, + 'config' => $aArgs['config'], + 'dossierId' => $dossierId + ]); + + if (!empty($curlReturn['error'])) { + return ['error' => $curlReturn['error']]; + } + $response = $curlReturn['response']->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children('http://www.adullact.org/spring-ws/iparapheur/1.0')->CreerDossierResponse[0]; + + if ($response->MessageRetour->codeRetour == $aArgs['config']['data']['errorCode'] || $curlReturn['infos']['http_code'] >= 500) { + return ['error' => '[' . $response->MessageRetour->severite . ']' . $response->MessageRetour->message]; + } else { + $attachmentToFreeze[$collId][$resId] = $dossierId; + } + } + + // Send main document if in signature book + if (!empty($annexes['letterbox'][0])) { + $mainDocumentIntegration = json_decode($annexes['letterbox'][0]['integrations'], true); + $externalId = json_decode($annexes['letterbox'][0]['external_id'], true); + if ($mainDocumentIntegration['inSignatureBook'] && empty($externalId['signatureBookId'])) { + $resId = $annexes['letterbox'][0]['res_id']; + $collId = 'letterbox_coll'; + $dossierId = $resId . '_' . rand(0001, 9999); + unset($annexes['letterbox']); + + $curlReturn = IParapheurController::uploadFile([ + 'resId' => $resId, + 'collId' => $collId, + 'resIdMaster' => $aArgs['resIdMaster'], + 'annexes' => $annexes, + 'sousType' => $sousType, + 'config' => $aArgs['config'], + 'dossierId' => $dossierId + ]); + + if (!empty($curlReturn['error'])) { + return ['error' => $curlReturn['error']]; + } + $response = $curlReturn['response']->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children('http://www.adullact.org/spring-ws/iparapheur/1.0')->CreerDossierResponse[0]; + + if ($response->MessageRetour->codeRetour == $aArgs['config']['data']['errorCode'] || $curlReturn['infos']['http_code'] >= 500) { + return ['error' => '[' . $response->MessageRetour->severite . ']' . $response->MessageRetour->message]; + } else { + $attachmentToFreeze[$collId][$resId] = $dossierId; + } + } + } + return ['sended' => $attachmentToFreeze]; + } + + public static function uploadFile($aArgs) + { + $dossierId = $aArgs['dossierId']; + $adrInfo = AdrModel::getConvertedDocumentById(['resId' => $aArgs['resId'], 'collId' => $aArgs['collId'], 'type' => 'PDF']); + + $attachmentPath = DocserverModel::getByDocserverId(['docserverId' => $adrInfo['docserver_id'], 'select' => ['path_template']]); + $attachmentFilePath = $attachmentPath['path_template'] . str_replace('#', DIRECTORY_SEPARATOR, $adrInfo['path']) . $adrInfo['filename']; + $dossierTitre = 'Projet courrier numéro ' . $aArgs['resId']; + + $mainResource = ResModel::getById(['resId' => $aArgs['resIdMaster'], 'select' => ['process_limit_date']]); + if (empty($mainResource['process_limit_date'])) { + $processLimitDate = $mainResource['process_limit_date'] = date('Y-m-d', strtotime(date("Y-m-d"). ' + 14 days')); + } else { + $processLimitDateTmp = explode(" ", $mainResource['process_limit_date']); + $processLimitDate = $processLimitDateTmp[0]; + } + + $b64Attachment = base64_encode(file_get_contents($attachmentFilePath)); + + if (!empty($aArgs['annexes']['letterbox'][0]['filePath'])) { + $annexLetterboxMimeType = mime_content_type($aArgs['annexes']['letterbox'][0]['filePath']); + if ($annexLetterboxMimeType) { + $b64AnnexesLetterbox = base64_encode(file_get_contents($aArgs['annexes']['letterbox'][0]['filePath'])); + $annexesXmlPostString = '<ns:DocAnnexe> + <ns:nom>Fichier original</ns:nom> + <ns:fichier xm:contentType="' . $annexLetterboxMimeType . '">' . $b64AnnexesLetterbox . '</ns:fichier> + <ns:mimetype>' . $annexLetterboxMimeType . '</ns:mimetype> + <ns:encoding>utf-8</ns:encoding> + </ns:DocAnnexe>'; + } + } + if (!empty($aArgs['annexes']['attachments'])) { + for ($j = 0; $j < count($aArgs['annexes']['attachments']); $j++) { + $b64AnnexesAttachment = base64_encode(file_get_contents($aArgs['annexes']['attachments'][$j]['filePath'])); + $annexesXmlPostString .= '<ns:DocAnnexe> + <ns:nom>PJ_' . ($j + 1) . '</ns:nom> + <ns:fichier xm:contentType="application/pdf">' . $b64AnnexesAttachment . '</ns:fichier> + <ns:mimetype>application/pdf</ns:mimetype> + <ns:encoding>utf-8</ns:encoding> + </ns:DocAnnexe>'; + } + } + $xmlPostString = '<?xml version="1.0" encoding="utf-8"?> + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.adullact.org/spring-ws/iparapheur/1.0" xmlns:xm="http://www.w3.org/2005/05/xmlmime"> + <soapenv:Header/> + <soapenv:Body> + <ns:CreerDossierRequest> + <ns:TypeTechnique>' . $aArgs['config']['data']['defaultType'] . '</ns:TypeTechnique> + <ns:SousType>' . $aArgs['sousType'] . '</ns:SousType> + <ns:DossierID>' . $dossierId . '</ns:DossierID> + <ns:DossierTitre>' . $dossierTitre . '_' . $dossierId . '</ns:DossierTitre> + <ns:DocumentPrincipal xm:contentType="application/pdf">' . $b64Attachment . '</ns:DocumentPrincipal> + <ns:DocumentsSupplementaires></ns:DocumentsSupplementaires> + <ns:DocumentsAnnexes>' . $annexesXmlPostString . '</ns:DocumentsAnnexes> + <ns:MetaData> + + </ns:MetaData> + <ns:AnnotationPublique></ns:AnnotationPublique> + <ns:AnnotationPrivee></ns:AnnotationPrivee> + <ns:Visibilite>CONFIDENTIEL</ns:Visibilite> + <ns:DateLimite>' . $processLimitDate . '</ns:DateLimite> + </ns:CreerDossierRequest> + </soapenv:Body> + </soapenv:Envelope>'; + + $curlReturn = IParapheurController::returnCurl($xmlPostString, $aArgs['config']); + + return $curlReturn; + } + + public static function download($aArgs) + { + $xmlPostString = '<?xml version="1.0" encoding="utf-8"?> + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.adullact.org/spring-ws/iparapheur/1.0"> + <soapenv:Header/> + <soapenv:Body> + <ns:GetDossierRequest>' . $aArgs['documentId'] . '</ns:GetDossierRequest> + </soapenv:Body> + </soapenv:Envelope>'; + + $curlReturn = IParapheurController::returnCurl($xmlPostString, $aArgs['config']); + + $response = $curlReturn['response']->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children('http://www.adullact.org/spring-ws/iparapheur/1.0')->GetDossierResponse[0]; + if ($response->MessageRetour->codeRetour == $aArgs['config']['data']['errorCode']) { + return ['error' => 'Error : [' . $response->MessageRetour->severite . ']' . $response->MessageRetour->message]; + } else { + $returnedDocumentId = (string) $response->DossierID; + if ($aArgs['documentId'] !== $returnedDocumentId) { + return ['error' => 'documentId returned is incorrect']; + } else { + $b64FileContent = (string)$response->DocPrincipal; + return ['b64FileContent' => $b64FileContent, 'documentId' => $returnedDocumentId]; + } + } + } + + public static function retrieveSignedMails($aArgs) + { + foreach (['noVersion', 'resLetterbox'] as $version) { + foreach ($aArgs['idsToRetrieve'][$version] as $resId => $value) { + if (!empty($value->external_id)) { + $xmlPostString = '<?xml version="1.0" encoding="utf-8"?> + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.adullact.org/spring-ws/iparapheur/1.0"> + <soapenv:Header/> + <soapenv:Body> + <ns:GetHistoDossierRequest>' . $value->external_id . '</ns:GetHistoDossierRequest> + </soapenv:Body> + </soapenv:Envelope>'; + + $curlReturn = IParapheurController::returnCurl($xmlPostString, $aArgs['config']); + + if (!empty($curlReturn['error'])) { + return ['error' => $curlReturn['error']]; + } + + $response = $curlReturn['response']->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children('http://www.adullact.org/spring-ws/iparapheur/1.0')->GetHistoDossierResponse[0]; + + if ($response->MessageRetour->codeRetour == $aArgs['config']['data']['errorCode']) { + return ['error' => 'Error : [' . $response->MessageRetour->severite . ']' . $response->MessageRetour->message]; + } else { + $noteContent = ''; + foreach ($response->LogDossier as $res) { // Loop on all steps of the documents (prepared, send to signature, signed etc...) + $status = $res->status; + if ($status == $aArgs['config']['data']['visaState'] || $status == $aArgs['config']['data']['signState']) { + $noteContent .= $res->nom . ' : ' . $res->annotation . PHP_EOL; + + $response = IParapheurController::download([ + 'config' => $aArgs['config'], + 'documentId' => $value->external_id + ]); + if (!empty($response['error'])) { + return ['error' => $response['error']]; + } + $aArgs['idsToRetrieve'][$version][$resId]->status = 'validated'; + $aArgs['idsToRetrieve'][$version][$resId]->format = 'pdf'; + $aArgs['idsToRetrieve'][$version][$resId]->encodedFile = $response['b64FileContent']; + $aArgs['idsToRetrieve'][$version][$resId]->noteContent = $noteContent; + if ($status == $aArgs['config']['data']['signState']) { + break; + } + } elseif ($status == $aArgs['config']['data']['refusedVisa'] || $status == $aArgs['config']['data']['refusedSign']) { + $noteContent .= $res->nom . ' : ' . $res->annotation . PHP_EOL; + $aArgs['idsToRetrieve'][$version][$resId]->status = 'refused'; + $aArgs['idsToRetrieve'][$version][$resId]->noteContent = $noteContent; + break; + } else { + $aArgs['idsToRetrieve'][$version][$resId]->status = 'waiting'; + } + } + } + } else { + echo 'ExternalId is empty'; + } + } + } + return $aArgs['idsToRetrieve']; + } + + public static function getType($aArgs) + { + $xmlPostString = '<?xml version="1.0" encoding="utf-8"?> + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.adullact.org/spring-ws/iparapheur/1.0"> + <soapenv:Header/> + <soapenv:Body> + <ns:GetListeTypesRequest></ns:GetListeTypesRequest> + </soapenv:Body> + </soapenv:Envelope>'; + + $curlReturn = $curlReturn = IParapheurController::returnCurl($xmlPostString, $aArgs['config']); + + if (!empty($curlReturn['error'])) { + return ['error' => $curlReturn['error']]; + } + + $response = $curlReturn['response']->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children('http://www.adullact.org/spring-ws/iparapheur/1.0')->GetListeTypesResponse[0]; + + $typeExist = false; + foreach ($response->TypeTechnique as $res) { + if ($res == $aArgs['config']['data']['defaultType']) { + $typeExist = true; + break; + } + } + if (!$typeExist) { + return ['error' => 'Default Type does not exists']; + } else { + return true; + } + } + + public static function getSousType($aArgs) + { + $xmlPostString = '<?xml version="1.0" encoding="utf-8"?> + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.adullact.org/spring-ws/iparapheur/1.0"> + <soapenv:Header/> + <soapenv:Body> + <ns:GetListeSousTypesRequest>' . $aArgs['config']['data']['defaultType'] . '</ns:GetListeSousTypesRequest> + </soapenv:Body> + </soapenv:Envelope>'; + + $curlReturn = $curlReturn = IParapheurController::returnCurl($xmlPostString, $aArgs['config']); + + if (!empty($curlReturn['error'])) { + return ['error' => $curlReturn['error']]; + } + + $response = $curlReturn['response']->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children('http://www.adullact.org/spring-ws/iparapheur/1.0')->GetListeSousTypesResponse[0]; + + $subTypeExist = false; + foreach ($response->SousType as $res) { + if ($res == $aArgs['sousType']) { + $subTypeExist = true; + break; + } + } + + if (!$subTypeExist) { + return $aArgs['config']['data']['defaultSousType']; + } else { + return $aArgs['sousType']; + } + } +} diff --git a/src/frontend/app/actions/send-external-signatory-book-action/i-paraph/i-paraph.component.html b/src/frontend/app/actions/send-external-signatory-book-action/i-paraph/i-paraph.component.html new file mode 100644 index 0000000000000000000000000000000000000000..72a4696a919d905f3ba09fe6601704accb4350a7 --- /dev/null +++ b/src/frontend/app/actions/send-external-signatory-book-action/i-paraph/i-paraph.component.html @@ -0,0 +1,7 @@ +<div class="col-md-12"> + <div> + <div class="alert-message alert-message-info" role="alert"> + <p>{{lang.sentToIParapheur}}</p> + </div> + </div> +</div> diff --git a/src/frontend/app/actions/send-external-signatory-book-action/i-paraph/i-paraph.component.scss b/src/frontend/app/actions/send-external-signatory-book-action/i-paraph/i-paraph.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..8cb98f7a66b2b52270690af0e63659aeab062241 --- /dev/null +++ b/src/frontend/app/actions/send-external-signatory-book-action/i-paraph/i-paraph.component.scss @@ -0,0 +1,3 @@ +.alert-message { + margin: 0 ; +} \ No newline at end of file diff --git a/src/frontend/app/actions/send-external-signatory-book-action/i-paraph/i-paraph.component.ts b/src/frontend/app/actions/send-external-signatory-book-action/i-paraph/i-paraph.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..39b65067e917a345fabb8258a736924a7219923b --- /dev/null +++ b/src/frontend/app/actions/send-external-signatory-book-action/i-paraph/i-paraph.component.ts @@ -0,0 +1,49 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { LANG } from '../../../translate.component'; +import { NotificationService } from '../../../notification.service'; +import { HttpClient } from '@angular/common/http'; + +declare function $j(selector: any): any; + +@Component({ + selector: 'app-i-paraph', + templateUrl: "i-paraph.component.html", + styleUrls: ['i-paraph.component.scss'], +}) +export class IParaphComponent implements OnInit { + + lang: any = LANG; + loading: boolean = false; + + currentAccount: any = null; + usersWorkflowList: any[] = []; + + injectDatasParam = { + resId: 0, + editable: true + }; + + @Input('additionalsInfos') additionalsInfos: any; + @Input('externalSignatoryBookDatas') externalSignatoryBookDatas: any; + + constructor(public http: HttpClient, private notify: NotificationService) { } + + ngOnInit(): void { + } + + isValidParaph() { + if (this.additionalsInfos.attachments.length == 0) { + return false; + } else { + return true; + } + } + + getRessources() { + return this.additionalsInfos.attachments.map((e: any) => { return e.res_id; }); + } + + getDatas() { + return this.externalSignatoryBookDatas; + } +} diff --git a/src/frontend/app/actions/send-external-signatory-book-action/send-external-signatory-book-action.component.html b/src/frontend/app/actions/send-external-signatory-book-action/send-external-signatory-book-action.component.html index 71e8a5f5e2ad14a0dbe06225549d622211d4e9a3..e55c0c9f534baf2ce00f5cdd378f2c36f0c6ca08 100644 --- a/src/frontend/app/actions/send-external-signatory-book-action/send-external-signatory-book-action.component.html +++ b/src/frontend/app/actions/send-external-signatory-book-action/send-external-signatory-book-action.component.html @@ -31,6 +31,10 @@ </ul> </div> <div> + <app-i-paraph #iParapheur *ngIf="signatoryBookEnabled=='iParapheur'" + [additionalsInfos]="additionalsInfos" + [externalSignatoryBookDatas]="externalSignatoryBookDatas"> + </app-i-paraph> <app-fast-paraph #fastParapheur *ngIf="signatoryBookEnabled=='fastParapheur'" [additionalsInfos]="additionalsInfos" [externalSignatoryBookDatas]="externalSignatoryBookDatas"> diff --git a/src/frontend/app/actions/send-external-signatory-book-action/send-external-signatory-book-action.component.ts b/src/frontend/app/actions/send-external-signatory-book-action/send-external-signatory-book-action.component.ts index 259e5d832906ab54d7edccfc30538b12cef144b6..b07d59640e39eb4808c6b804a29cf55809f1c8d0 100644 --- a/src/frontend/app/actions/send-external-signatory-book-action/send-external-signatory-book-action.component.ts +++ b/src/frontend/app/actions/send-external-signatory-book-action/send-external-signatory-book-action.component.ts @@ -7,6 +7,7 @@ import { NoteEditorComponent } from '../../notes/note-editor.component'; import { XParaphComponent } from './x-paraph/x-paraph.component'; import { MaarchParaphComponent } from './maarch-paraph/maarch-paraph.component'; import { FastParaphComponent } from './fast-paraph/fast-paraph.component'; +import { IParaphComponent } from './i-paraph/i-paraph.component'; import { tap, finalize, catchError } from 'rxjs/operators'; import { of } from 'rxjs'; @@ -46,6 +47,7 @@ export class SendExternalSignatoryBookActionComponent implements OnInit { @ViewChild('xParaph', { static: false }) xParaph: XParaphComponent; @ViewChild('maarchParapheur', { static: false }) maarchParapheur: MaarchParaphComponent; @ViewChild('fastParapheur', { static: false }) fastParapheur: FastParaphComponent; + @ViewChild('iParapheur', { static: false }) iParapheur: IParaphComponent; constructor( public http: HttpClient, diff --git a/src/frontend/app/app.module.ts b/src/frontend/app/app.module.ts index 0ab8026e5c30fc572fe1336c0c8a1d13f2b508c0..9bebbc74eaa6c6f723212e5c4b705a4b0ea5f5dc 100755 --- a/src/frontend/app/app.module.ts +++ b/src/frontend/app/app.module.ts @@ -52,6 +52,7 @@ import { SendExternalSignatoryBookActionComponent } from './actions/send-exter import { SendExternalNoteBookActionComponent } from './actions/send-external-note-book-action/send-external-note-book-action.component'; import { XParaphComponent } from './actions/send-external-signatory-book-action/x-paraph/x-paraph.component'; import { MaarchParaphComponent } from './actions/send-external-signatory-book-action/maarch-paraph/maarch-paraph.component'; +import { IParaphComponent } from './actions/send-external-signatory-book-action/i-paraph/i-paraph.component'; import { FastParaphComponent } from './actions/send-external-signatory-book-action/fast-paraph/fast-paraph.component'; import { ViewDocActionComponent } from './actions/view-doc-action/view-doc-action.component'; import { RedirectActionComponent } from './actions/redirect-action/redirect-action.component'; @@ -158,6 +159,7 @@ import { FolderCreateModalComponent } from './folder/folder-create-modal/folder- XParaphComponent, MaarchParaphComponent, FastParaphComponent, + IParaphComponent, ViewDocActionComponent, RedirectActionComponent, SendShippingActionComponent, diff --git a/src/frontend/lang/lang-en.ts b/src/frontend/lang/lang-en.ts index f665a2ea974cb5ee884992d5acd7d706e7c56379..198c61e22f5542287d56063a8619840b91fdb385 100755 --- a/src/frontend/lang/lang-en.ts +++ b/src/frontend/lang/lang-en.ts @@ -1563,6 +1563,7 @@ export const LANG_EN = { "emailSent" : "Email sent", "emailCannotSent" : "Error during sending email", "sentToFastParapheur" : "Send to FAST-Parapheur", + "sentToIParapheur" : "Send to IParapheur", "editAcknowledgementReceipt" : "Edit the acknowledgement receipt", "insufficientPrivilege" : "Privilege insuffisant", "cannotMergeTags" : "This tag has a parent or children : impossible to merge tags", diff --git a/src/frontend/lang/lang-fr.ts b/src/frontend/lang/lang-fr.ts index 3d5841a7459559a2233fb467c8b01e6fef71946e..0d989e9713ea59ee15456f804ebdeeb94a560bec 100755 --- a/src/frontend/lang/lang-fr.ts +++ b/src/frontend/lang/lang-fr.ts @@ -1603,6 +1603,7 @@ export const LANG_FR = { "emailSent" : "Courriel envoyé", "emailCannotSent" : "Erreur lors de l'envoi du courriel", "sentToFastParapheur" : "Envoyer à FAST-Parapheur", + "sentToIParapheur" : "Envoyer à IParapheur", "editAcknowledgementReceipt" : "Editer l'accusé de réception", "insufficientPrivilege" : "Privilège insuffisant", "cannotMergeTags" : "Ce mot-clé possède un parent ou des enfants : impossible de le fusionner avec un autre mot-clé.", diff --git a/src/frontend/lang/lang-nl.ts b/src/frontend/lang/lang-nl.ts index c0091e1dadac21cdea5a13c348f249cd18ce1793..e50d6134a7ae9167124087098dccea7bca1db848 100755 --- a/src/frontend/lang/lang-nl.ts +++ b/src/frontend/lang/lang-nl.ts @@ -1588,6 +1588,7 @@ export const LANG_NL = { "emailSent" : "Email sent", //_TO_TRANSLATE "emailCannotSent" : "Error during sending email", //_TO_TRANSLATE "sentToFastParapheur" : "Send to FAST-Parapheur", //_TO_TRANSLATE + "sentToIParapheur" : "Send to IParapheur", //_TO_TRANSLATE "editAcknowledgementReceipt" : "Edit the acknowledgement receipt", //_TO_TRANSLATE "insufficientPrivilege" : "Privilege insuffisant", //TRANSLATE "cannotMergeTags" : "This tag has a parent or children : impossible to merge tags",//_TO_TRANSLATE