diff --git a/declarationtva_view.php b/declarationtva_view.php index f390ac8..ec15d50 100644 --- a/declarationtva_view.php +++ b/declarationtva_view.php @@ -560,30 +560,69 @@ function loadLineDetails(line) { } function confirmValidation(declarationId) { - // Create confirmation dialog + // Create a proper Dolibarr-style modal dialog var dialog = document.createElement("div"); - dialog.style.cssText = "position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 10000; display: flex; align-items: center; justify-content: center;"; + dialog.id = "validationModal"; + dialog.style.cssText = "position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 10000; display: flex; align-items: center; justify-content: center; font-family: Arial, sans-serif;"; var dialogContent = document.createElement("div"); - dialogContent.style.cssText = "background: white; padding: 20px; border-radius: 5px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); max-width: 500px; text-align: center;"; + dialogContent.style.cssText = "background: white; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); max-width: 500px; width: 90%; max-height: 90%; overflow: hidden;"; - dialogContent.innerHTML = ` -

' . $langs->trans("ConfirmValidation") . '

-

' . $langs->trans("ValidationConfirmationMessage") . '

-
- - + // Header + var header = document.createElement("div"); + header.style.cssText = "background: #f8f9fa; padding: 20px; border-bottom: 1px solid #dee2e6; display: flex; align-items: center;"; + header.innerHTML = ` +
+

' . $langs->trans("ConfirmValidation") . '

+
+ + `; + + // Body + var body = document.createElement("div"); + body.style.cssText = "padding: 20px;"; + body.innerHTML = ` +
+
+ ! +
+
+

' . $langs->trans("ValidationConfirmationMessage") . '

+
`; + // Footer + var footer = document.createElement("div"); + footer.style.cssText = "background: #f8f9fa; padding: 15px 20px; border-top: 1px solid #dee2e6; display: flex; justify-content: flex-end; gap: 10px;"; + footer.innerHTML = ` + + + `; + + dialogContent.appendChild(header); + dialogContent.appendChild(body); + dialogContent.appendChild(footer); dialog.appendChild(dialogContent); document.body.appendChild(dialog); + + // Add escape key handler + document.addEventListener("keydown", function(e) { + if (e.key === "Escape") { + closeValidationModal(); + } + }); +} + +function closeValidationModal() { + var modal = document.getElementById("validationModal"); + if (modal) { + modal.remove(); + } } function proceedValidation(declarationId) {