This commit is contained in:
KONE SOREL 2026-04-17 13:25:56 +00:00
parent f9aafa85ab
commit eb9f414038
4 changed files with 72 additions and 43 deletions

View File

@ -1,11 +1,13 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Mouvementassure.php';
require_once 'Modele/Ouinon.php';
class ControleurAjaxmouvementassurevalider extends Controleur {
public function __construct() {
$this->mouvementassure = new Mouvementassure();
$this->ouinoncorrection = (new Ouinon())->getListe();
}
public function index()
@ -56,15 +58,20 @@ class ControleurAjaxmouvementassurevalider extends Controleur {
$mouvementassure = $this->mouvementassure->getMouvementassureID($idMvtTemp);
$this->genererVueAjax(array('idMvtTemp' => $idMvtTemp, 'mouvementassure' => $mouvementassure));
$this->genererVueAjax(array(
'idMvtTemp' => $idMvtTemp,
'mouvementassure' => $mouvementassure,
'ouinoncorrection' => $this->ouinoncorrection
));
}
public function savemotif()
{
$idMvtTemp = $this->requete->getParametreFormulaire("idMvtTemp");
$motif = $this->requete->getParametreFormulaire("motif");
$aCorriger = $this->requete->getParametreFormulaire("aCorriger");
$this->mouvementassure->enregistrer_motif_rejet_rh($idMvtTemp, $motif);
$this->mouvementassure->enregistrer_motif_rejet_rh($idMvtTemp, $motif, $aCorriger);
}
}

View File

@ -45444,7 +45444,8 @@ function ouvre_motif_rejet_rh(idMvtTemp)
function enregistrer_motif_rejet(idMvtTemp)
{
motif = $("#motif").val();
motif = $("#motif").val();
aCorriger = $("#aCorriger").val();
if (motif<=" ")
{
@ -45457,7 +45458,7 @@ function enregistrer_motif_rejet(idMvtTemp)
return;
}
donnees = 'idMvtTemp='+idMvtTemp+'&motif='+motif;
donnees = 'idMvtTemp='+idMvtTemp+'&motif='+motif+'&aCorriger='+aCorriger;
$.ajax({
url: $("#racineWeb").val()+"Ajaxmouvementassurevalider/savemotif/",

View File

@ -114,11 +114,11 @@ class Mouvementassure extends Modele {
$this->executerRequete($sql, array($idMvtTemp, $rejet));
}
public function enregistrer_motif_rejet_rh($idMvtTemp, $motif)
public function enregistrer_motif_rejet_rh($idMvtTemp, $motif, $aCorriger)
{
$sql = 'call sp_r_enregistrer_motif_rejet_rh(?, ?)';
$sql = 'call sp_r_enregistrer_motif_rejet_rh(?, ?, ?)';
$this->executerRequete($sql, array($idMvtTemp, $motif));
$this->executerRequete($sql, array($idMvtTemp, $motif, $aCorriger));
}
public function getMouvementassureID($idMvtTemp)

View File

@ -1,7 +1,9 @@
<?php
$motif = $mouvementassure['motif'];
$traite = $mouvementassure['traite'];
$motif = $mouvementassure['motif'];
$traite = $mouvementassure['traite'];
$aCorriger = $mouvementassure['aCorriger'];
?>
<div class="modal-dialog" style="width: 70%;" role="document">
<div class="modal-content" style="border-radius: 4px; box-shadow: 0 5px 15px rgba(0,0,0,.5);">
@ -10,54 +12,72 @@
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="user" style="text-align:center; font-weight: bold; color: #a94442;">
<span class="glyphicon glyphicon-edit" style="margin-right: 10px;"></span>
<span class="glyphicon glyphicon-warning-sign" style="margin-right: 10px;"></span>
<?= _('Motif de Rejet')?>
</h4>
</div>
<div class="modal-body">
<div id="div_motif" style="margin-bottom:20px;">
<table class="table table-condensed" style="border: none;">
<div class="modal-body" style="padding: 20px;">
<div id="div_motif" style="margin-bottom:10px;">
<table class="table table-condensed" style="border: none; margin-bottom: 0;">
<tbody>
<tr>
<td style="text-align:center; vertical-align: middle; border-top: none; font-weight: bold; width: 15%;">
<label class="control-label required"><?= _("Entrer le motif");?></label>
<td style="text-align:center; vertical-align: top; border-top: none; font-weight: bold; width: 20%; padding-top: 15px;">
<label class="control-label <?= ($traite == '0') ? 'required' : '' ?>"><?= _("Commentaire");?></label>
</td>
<td style="border-top: none;">
<div class="form-group" style="margin-bottom: 0;">
<?php if($traite == "0"):?>
<textarea class="form-control"
placeholder="<?= _("Saisie obligatoire...");?>"
name="motif"
id="motif"
rows="7"
required
AUTOCOMPLETE="OFF"
style="width:100%; border-radius: 4px; resize: vertical;"><?= $motif; ?></textarea>
<?php else:?>
<textarea class="form-control"
rows="7"
required
disabled
style="width:100%; border-radius: 4px; resize: vertical;"><?= $motif; ?></textarea>
<?php endif;?>
<div class="form-group" style="margin-bottom: 15px;">
<?php if($traite == "0"): ?>
<textarea class="form-control"
placeholder="<?= _("Saisissez ici le motif du rejet (obligatoire)...");?>"
name="motif"
id="motif"
rows="6"
required
AUTOCOMPLETE="OFF"
style="width:100%; border-radius: 4px; resize: vertical;"><?= $motif; ?></textarea>
<?php else: ?>
<div class="well well-sm" style="min-height: 120px; background-color: #fcfcfc; margin-bottom: 0;">
<?= nl2br($motif); ?>
</div>
<?php endif; ?>
</div>
</td>
</tr>
<?php if($traite == "0"):?>
<tr>
<td style="text-align:center; vertical-align: middle; border-top: none; font-weight: bold;">
<?= _("À corriger ?") ?>
</td>
<td style="border-top: none;">
<div style="width: 150px;">
<?php if($traite == "0"): ?>
<select class="form-control input-sm" id="aCorriger" name="aCorriger">
<?php liste_options_consultation($ouinoncorrection, $aCorriger); ?>
</select>
<?php else: ?>
<select class="form-control input-sm" id="aCorriger" name="aCorriger" disabled>
<?php liste_options_consultation($ouinoncorrection, $aCorriger); ?>
</select>
<?php endif; ?>
</div>
</td>
</tr>
<?php if($traite == "0"): ?>
<tr>
<td style="border-top: none;"> </td>
<td style="border-top: none; padding-top: 15px;">
<td style="border-top: none; padding-top: 20px;">
<button type="button"
class="btn btn-primary"
style="font-weight: bold; padding: 10px 30px;"
style="font-weight: bold; padding: 10px 40px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);"
onClick="javascript:enregistrer_motif_rejet(<?= $idMvtTemp ?>);">
<span class="glyphicon glyphicon-save" style="margin-right: 8px;"></span>
<?= _("Enregistrer") ?>
<span class="glyphicon glyphicon-floppy-disk" style="margin-right: 8px;"></span>
<?= _("Enregistrer la décision") ?>
</button>
</td>
</tr>
<?php endif;?>
<?php endif; ?>
</tbody>
</table>
</div>
@ -73,26 +93,27 @@
</div>
<style>
/* Style pour l'astérisque de champ obligatoire */
/* Marquage des champs requis */
.required:after {
content: " *";
color: #a94442;
font-weight: bold;
}
/* Animation d'apparition simple */
/* Animation modale standard */
.modal-content {
animation: modalFadeIn 0.3s ease-out;
animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
from { opacity: 0; transform: translateY(-20px); }
from { opacity: 0; transform: translateY(-30px); }
to { opacity: 1; transform: translateY(0); }
}
/* Focus sur le textarea version Bootstrap 3 */
/* Amélioration visuelle des champs BS3 */
.form-control:focus {
border-color: #66afe9;
outline: 0;
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
}
</style>