This commit is contained in:
KONE SOREL 2026-03-18 13:30:33 +00:00
parent 92fbfcd770
commit 54d52b85b5
3 changed files with 145 additions and 125 deletions

View File

@ -47143,77 +47143,82 @@ function retirer_un_prestataire_reseau(codePrestataire) {
}
function dupliquer_reseau(id){
v_msg='Confirmez-vous la duplication de ce réseau de soins?';
v_msgEng="Do you confirm the duplication of this healthcare network?";
confirm_ebene(v_msg, v_msgEng)
.then((isConfirmed) => {
if (isConfirmed) {
// L'utilisateur a confirmé
donnees = 'id='+id;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdupliquerreseausoins/",
type : 'post',
data: donnees,
error: function(errorData){
alert("Erreur : "+errorData);
},
success: function(data) {
//alert("Success : "+data);
$('#div_dupliquer_reseau').html(data);
$('#div_dupliquer_reseau').modal("show");
$('#div_dupliquer_reseau').on('shown.bs.modal', function(){
stylechampsRequis();
$('#libelle').focus();
});
},
complete: function() {
}
});
} else {
// L'utilisateur a annulé
console.log("Confirmation refusée");
}
});
}
function dupliquer_reseau(id) {
const v_msg = 'Confirmez-vous la duplication de ce réseau de soins ?';
const v_msgEng = "Do you confirm the duplication of this healthcare network?";
function duplicationreseausoins(){
var codeold = $('#codeold').val(),
codeReseau = "",
libelle = $('#libelle').val();
if(libelle <= " "){
v_msg="Veuillez renseigner le nom du réseau de soins!";
v_msgEng="Please enter the name of the healthcare network!";
alert_ebene(v_msg, v_msgEng);
confirm_ebene(v_msg, v_msgEng).then((isConfirmed) => {
if (isConfirmed) {
const donnees = { id: id };
$.ajax({
url: $("#racineWeb").val() + "Ajaxdupliquerreseausoins/",
type: 'POST',
data: donnees,
success: function(data) {
const $modal = $('#div_dupliquer_reseau');
$modal.html(data);
// Initialisation Bootstrap 5 Modal
const myModal = new bootstrap.Modal(document.getElementById('div_dupliquer_reseau'));
myModal.show();
return;
}
// Focus sur le champ libellé après affichage
$modal[0].addEventListener('shown.bs.modal', function () {
if (typeof stylechampsRequis === 'function') stylechampsRequis();
$("#libelle").focus();
});
},
error: function(xhr) {
alert_ebene("Erreur lors de la récupération des données.", "Error while fetching data.");
}
});
}
});
}
donnees = 'codeold='+codeold+'&codeReseau='+codeReseau+'&libelle='+libelle;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdupliquerreseausoins/dupliquer/",
type : 'post',
data: donnees,
error: function(errorData){
alert("Erreur : "+errorData);
},
success: function(data) {
$("#div_dupliquer_reseau .close").click();
retour_liste_reseaus();
},
complete: function() {
}
});
function duplicationreseausoins() {
const codeold = $('#codeold').val();
const libelle = $('#libelle').val().trim();
if (!libelle) {
const v_msg = "Veuillez renseigner le nom du réseau de soins !";
const v_msgEng = "Please enter the name of the healthcare network !";
alert_ebene(v_msg, v_msgEng);
return;
}
const donnees = {
codeold: codeold,
codeReseau: "", // Laissé vide car généré par le serveur
libelle: libelle
};
// Changement d'état du bouton pour éviter le double clic
const $btn = $("#btn-dupliquer-reseau");
const originalText = $btn.html();
$btn.prop('disabled', true).html('<i class="fas fa-spinner fa-spin"></i> Traitement...');
$.ajax({
url: $("#racineWeb").val() + "Ajaxdupliquerreseausoins/dupliquer/",
type: 'POST',
data: donnees,
success: function(data) {
// Fermer la modale proprement
const myModalEl = document.getElementById('div_dupliquer_reseau');
const modal = bootstrap.Modal.getInstance(myModalEl);
modal.hide();
// Rafraîchir la liste
if (typeof retour_liste_reseaus === 'function') {
retour_liste_reseaus();
}
},
error: function() {
$btn.prop('disabled', false).html(originalText);
alert_ebene("Erreur lors de la duplication.", "Error during duplication.");
}
});
}
// 19/08/2020

View File

@ -1,59 +1,74 @@
<?php
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content border-0 shadow-lg">
<div class="modal-header bg-primary text-white border-0">
<h5 class="modal-title fw-bold text-uppercase small">
<i class="fas fa-copy me-2"></i><?= _("Dupliquer le réseau de soins") ?>
</h5>
<button type="button" class="btn p-2 border-0 shadow-none d-flex align-items-center justify-content-center"
data-bs-dismiss="modal" aria-label="Close"
style="background: transparent; transition: transform 0.2s ease;">
<i class="fas fa-times text-white fs-4"></i>
</button>
</div>
<div class="modal-body p-4">
<div class="card border-0 bg-light mb-4">
<div class="card-body p-3">
<h6 class="text-success fw-bold text-uppercase small mb-3 border-bottom pb-2">
<i class="fas fa-history me-2"></i><?= _("Réseau source (À dupliquer)") ?>
</h6>
<div class="row g-2">
<div class="col-md-4">
<label class="form-label smaller text-muted fw-bold">Code</label>
<input type="text" id="codeold" name="codeold"
value="<?= $this->nettoyer($reseausoins['codeReseau']) ?>"
class="form-control form-control-sm border-0 bg-white fw-bold" readonly>
</div>
<div class="col-md-8">
<label class="form-label smaller text-muted fw-bold"><?= _("Libellé actuel") ?></label>
<input type="text" id="libelleold" name="libelleold"
value="<?= $this->nettoyer($reseausoins['libelle']) ?>"
class="form-control form-control-sm border-0 bg-white fw-bold" readonly>
</div>
</div>
</div>
</div>
?>
<div class="card border-primary-ghost shadow-sm">
<div class="card-body p-3">
<h6 class="text-primary fw-bold text-uppercase small mb-3 border-bottom pb-2">
<i class="fas fa-plus-circle me-2"></i><?= _("Nouveau réseau (Destination)") ?>
</h6>
<div class="mb-3">
<label class="form-label small fw-bold text-dark required"><?= _("Nom du nouveau réseau") ?></label>
<div class="input-group">
<span class="input-group-text bg-white border-2 border-end-0 text-primary">
<i class="fas fa-edit"></i>
</span>
<input type="text" id="libelle" name="libelle"
class="form-control border-2 border-start-0 shadow-none fw-bold majuscule"
placeholder="<?= _("Saisir le libellé...") ?>" required autofocus>
</div>
</div>
<button type="button" id="btn-dupliquer-reseau"
class="btn btn-primary w-100 fw-bold py-2 shadow-sm rounded-pill mt-2"
onclick="duplicationreseausoins();">
<i class="fas fa-check-circle me-1"></i> <?= _("Valider la duplication") ?>
</button>
</div>
</div>
</div>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-bs-dismiss="modal">&times;</button>
<legend class="modal-title" id="user" style="text-align:center;"> <?= _("Dupliquer le réseau de soins") ?></legend>
</div>
<div class="modal-body">
<table width="100%" cellpadding="0" cellspacing="0" class="table table-responsive table-condensed">
<tbody>
<tr>
<td align="center" colspan="4" style="font-size:12pt; background-color: green; color: white; font-weight: bold;">
<?= _("RESEAU DE SOINS A DUPLIQUER") ?>
</td>
</tr>
<tr>
<td width="6%" > Code </td>
<td width="15%" ><INPUT font style="text-transform: uppercase;" value="<?= $this->nettoyer($reseausoins['codeReseau']) ?>" class="form-control" TYPE="text" id="codeold" NAME="codeold" readonly ></td>
<td width="12%" align="center" > <?= _("Libellé") ?> </td>
<td ><INPUT style="font-size:10pt;" class="form-control majuscule" TYPE="text" id="libelleold" NAME="libelleold" value="<?= $this->nettoyer($reseausoins['libelle']) ?>" readonly></td>
</tr>
</tbody>
</table>
<table width="100%" cellpadding="0" cellspacing="0" class="table table-responsive table-condensed">
<tbody>
<tr>
<td align="center" colspan="4" style="font-size:12pt; background-color: green; color: white; font-weight: bold;">
<?= _("NOUVEAU RESEAU DE SOINS") ?>
</td>
</tr>
<tr>
<td width="12%" class="required"> <?= _("Libellé") ?> </td>
<td ><INPUT style="font-size:10pt;" class="form-control majuscule" TYPE="text" id="libelle" NAME="libelle" required AUTOFOCUS></td>
</tr>
<tr>
<td colspan="4" height="20px"> </td>
</tr>
<tr>
<td colspan="4">
<input style='text-align:center; font-size:10pt;' type="button" name="btn-dupliquer-reseau" id="btn-dupliquer-reseau" class="btn btn-primary form-control" value="<?= _("Valider")?>"
onclick="JAVASCRIPT:duplicationreseausoins();">
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" id="" class="btn btn-default" data-bs-dismiss="modal"><?= _("Fermer")?></button>
</div>
</div>
<div class="modal-footer border-0 bg-light">
<button type="button" class="btn btn-link text-muted fw-bold text-decoration-none" data-bs-dismiss="modal">
<?= _("Annuler") ?>
</button>
</div>
</div>
</div>
<style>
.border-primary-ghost { border: 2px dashed rgba(33, 46, 83, 0.2); }
.smaller { font-size: 0.75rem; }
</style>

View File

@ -66,7 +66,7 @@
</div>
<div id="div_dupliquer_reseau" class="modal fade animate__animated animate__fadeInDown">
</div>
</div>
<style>
.bg-primary-ghost { background-color: rgba(33, 46, 83, 0.08) !important; }