diff --git a/Controleur/ControleurAjaxavenant.php b/Controleur/ControleurAjaxavenant.php index ef2be01..673cb4b 100644 --- a/Controleur/ControleurAjaxavenant.php +++ b/Controleur/ControleurAjaxavenant.php @@ -35,5 +35,12 @@ class ControleurAjaxavenant extends Controleur { $this->genererVueAjax(array('dateAvenant' => $dateAvenant)); } + + public function notifier() + { + $idAvenant = $this->requete->getParametre("idAvenant"); + + $this->avenant->notifieravenant($idAvenant); + } } \ No newline at end of file diff --git a/Js/fonctions.js b/Js/fonctions.js index b040bef..1bcf8a5 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -7258,4 +7258,30 @@ function requetes_detail_sinistres() appliquerDataTable('.tabliste', {}, titre); } }); +} + +function envoyer_notification_avenant(idAvenant) +{ + donnees = 'idAvenant='+idAvenant; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxavenant/notifier/", + type : 'post', + data: donnees, + error: function(errorData) { + + }, + success: function(data) { + const msg = "Votre notification a été transmise avec succès."; + const msgEng = "Your notification has been successfully sent."; + + alert_ebene(v_msg, v_msgEng); + return; + }, + complete: function() + { + liste_avenant(); + } + }); + } \ No newline at end of file diff --git a/Modele/Avenant.php b/Modele/Avenant.php index cf300c1..3bc096a 100644 --- a/Modele/Avenant.php +++ b/Modele/Avenant.php @@ -104,5 +104,13 @@ class Avenant extends Modele { return $resultat->fetchAll(PDO::FETCH_ASSOC); } + public function notifieravenant($idAvenant) + { + $user = $_SESSION['codeUtilisateur']; + + $sql = 'call sp_rh_notifier_avenant(?, ?)'; + + $this->executerRequete($sql, array($idAvenant, $user)); + } } diff --git a/Vue/Listeavenant/index.php b/Vue/Listeavenant/index.php index 7fb8c54..07107af 100644 --- a/Vue/Listeavenant/index.php +++ b/Vue/Listeavenant/index.php @@ -33,6 +33,7 @@ $libelleAvenant = est_anglophone() ? $avenant['libelleAvenantEng'] : $avenant['libelleAvenant']; $isFacture = ($avenant['facture'] == '1'); $isRH = ($avenant['ajoutClient'] == '1'); + $idAvenant = $avenant['idAvenant']; ?> @@ -74,7 +75,7 @@ @@ -97,9 +98,9 @@ // Préparation du bloc d'informations (Le \n sert pour le retour à la ligne dans Excel/PDF) const infosComplementaires = - "\n" + + "\n\n" + "\n" + - " "; + " \n"; // Appel de la fonction appliquerDataTable('.tabliste', {}, titre, infosComplementaires); diff --git a/Vue/gabarit.php b/Vue/gabarit.php index 4ce047c..497ecb7 100755 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -710,7 +710,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte']; - +