Skip to content
Snippets Groups Projects
Commit 085f5c6a authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FEAT #22435 TIME 1:30 send externalSignatoryBook url + resId

parent 56238a88
No related branches found
No related tags found
No related merge requests found
......@@ -1021,6 +1021,7 @@ class FastParapheurController
'subject' => $doc['subject'],
'creationDate' => $doc['creation_date'],
'correspondents' => $correspondents,
'resId' => (int)$doc['signatureBookId'],
'url' => $fastParapheurUrl . '/parapheur/showDoc.action?documentid=' . $doc['signatureBookId']
];
}, $documentsInFastParapheur));
......
......@@ -104,15 +104,24 @@ class HomeController
$externalId = json_decode($user['external_id'], true);
$isMaarchParapheurConnected = false;
$maarchParapheurUrl = null;
$isExternalSignatoryBookConnected = false;
$externalSignatoryBookUrl = null;
$loadedXml = CoreConfigModel::getXmlLoaded(['path' => 'modules/visa/xml/remoteSignatoryBooks.xml']);
if (!empty($loadedXml)) {
$signatoryBookEnabled = (string)$loadedXml->signatoryBookEnabled;
foreach ($loadedXml->signatoryBook as $value) {
if ($value->id == "maarchParapheur") {
if ($value->id == "maarchParapheur" && $value->id == $signatoryBookEnabled) {
if (!empty($value->url) && !empty($value->userId) && !empty($value->password) && !empty($externalId['maarchParapheur'])) {
$isMaarchParapheurConnected = true;
$maarchParapheurUrl = rtrim((string)$value->url, "/");
$isExternalSignatoryBookConnected = true;
$externalSignatoryBookUrl = rtrim((string)$value->url, "/");
}
break;
} else if ($value->id == "fastParapheur" && $value->id == $signatoryBookEnabled) {
if (!empty($value->url) && !empty($value->subscriberId) && !empty($externalId['fastParapheur'])) {
$isExternalSignatoryBookConnected = true;
$fastParapheurUrl = (string)$value->url;
$fastParapheurUrl = str_replace('/parapheur-ws/rest/v1', '', $fastParapheurUrl);
$externalSignatoryBookUrl = rtrim($fastParapheurUrl, "/");
}
break;
}
......@@ -123,11 +132,12 @@ class HomeController
$homeMessage = trim($homeMessage['param_value_string']);
return $response->withJson([
'regroupedBaskets' => $regroupedBaskets,
'assignedBaskets' => $assignedBaskets,
'homeMessage' => $homeMessage,
'isLinkedToMaarchParapheur' => $isMaarchParapheurConnected,
'maarchParapheurUrl' => $maarchParapheurUrl
'regroupedBaskets' => $regroupedBaskets,
'assignedBaskets' => $assignedBaskets,
'homeMessage' => $homeMessage,
'isLinkedToExternalSignatoryBook' => $isExternalSignatoryBookConnected,
'externalSignatoryBookUrl' => $externalSignatoryBookUrl,
'signatoryBookEnabled' => $signatoryBookEnabled,
]);
}
......
......@@ -325,7 +325,10 @@ class TileController
}
$enabledExternalSignatoryBook = (string)$loadedXml->signatoryBookEnabled;
if ($enabledExternalSignatoryBook == 'maarchParapheur') {
$tile['maarchParapheurUrl'] = rtrim((string)($loadedXml->xpath('//signatoryBook[id=\'maarchParapheur\']/url')[0]), '/');
$tile['externalSignatoryBookUrl'] = rtrim((string)($loadedXml->xpath('//signatoryBook[id=\'maarchParapheur\']/url')[0]), '/');
} else if ($enabledExternalSignatoryBook == 'fastParapheur') {
$fastParapheurUrl = str_replace('/parapheur-ws/rest/v1', '', (string)($loadedXml->xpath('//signatoryBook[id=\'fastParapheur\']/url')[0]));
$tile['externalSignatoryBookUrl'] = rtrim($fastParapheurUrl, "/");
}
} elseif ($tile['type'] == 'searchTemplate') {
$searchTemplate = SearchTemplateModel::get(['select' => ['label'], 'where' => ['id = ?', 'user_id = ?'], 'data' => [$tile['parameters']['searchTemplateId'], $GLOBALS['id']]]);
......
......@@ -156,25 +156,25 @@ export class DashboardService {
// Maarch Parapheur views
{
id: 'list',
route: ':maarchParapheurUrl/dist/#/documents/:resId',
route: ':externalSignatoryBookUrl/dist/#/documents/:resId',
target: 'maarchParapheur',
viewDocRoute: null
},
{
id: 'summary',
route: ':maarchParapheurUrl/dist/#/home',
route: ':externalSignatoryBookUrl/dist/#/home',
target: 'maarchParapheur',
},
// Fast Parapheur views
{
id: 'list',
route: '',
route: ':externalSignatoryBookUrl/parapheur/showDoc.action?documentid=:resId',
target: 'fastParapheur',
viewDocRoute: null
},
{
id: 'summary',
route: '',
route: ':externalSignatoryBookUrl/parapheur/showDoc.action',
target: 'fastParapheur',
}
]
......
......@@ -136,7 +136,7 @@ export class TileCreateComponent implements OnInit {
const data: any = await this.externalSignatoryBook.isLinkedToExternalSignatoryBook();
if (!this.functionsService.empty(data)) {
this.tileOtherInfos = {
maarchParapheurUrl: data.maarchParapheurUrl
maarchParapheurUrl: data.externalSignatoryBookUrl
};
}
} else {
......
......@@ -56,15 +56,11 @@ export class TileViewListComponent implements OnInit, AfterViewInit {
const data = { ...resource, ...this.tile.parameters, ...this.tile };
delete data.parameters;
const link = this.dashboardService.getFormatedRoute(this.route, data);
if (this.tile.type === 'externalSignatoryBook' && link.route === '') {
window.open(resource.url, '_blank');
} else if (link) {
const regex = /http[.]*/g;
if (link.route.match(regex) === null) {
this.router.navigate([link.route], { queryParams: link.params });
} else {
window.open(link.route, '_blank');
}
const regex = /http[.]*/g;
if (link.route.match(regex) === null) {
this.router.navigate([link.route], { queryParams: link.params });
} else {
window.open(link.route, '_blank');
}
}
......
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