Loading front/Application/UI/UConfirmDialog.vue +76 Changes for front/Application/UI/UConfirmDialog.vue: 76 added lines, 0 removed lines. Original line number Diff line number Diff line <template> <div class="modal fade" tabindex="-1" ref="modalEl" aria-hidden="true" > <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">{{ title }}</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body">{{ message }}</div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Annuler</button> <button type="button" class="btn btn-danger" @click="confirmAction">Confirmer</button> </div> </div> </div> </div> </template> <script> import { Modal } from "bootstrap"; export default { data() { return { modal: null, // Instance Bootstrap Modal resolveFn: null, // Fonction pour résoudre la promesse message: "", // Message affiché title: "Confirmation", // Titre modal }; }, mounted() { // Crée l'instance Bootstrap Modal this.modal = new Modal(this.$refs.modalEl, { backdrop: "static", keyboard: true, }); // Si la modal est fermée manuellement → annuler la promesse this.$refs.modalEl.addEventListener("hidden.bs.modal", () => { if (this.resolveFn) { this.resolveFn(false); this.resolveFn = null; } }); }, methods: { /** * Ouvre la modal et retourne une Promise */ open(message, title = "Confirmation") { this.message = message; this.title = title; this.modal.show(); return new Promise((resolve) => { this.resolveFn = resolve; }); }, /** * Confirme l'action et résout la Promise */ confirmAction() { if (this.resolveFn) this.resolveFn(true); this.resolveFn = null; this.modal.hide(); }, }, }; </script> front/Mission/Mission.vue +122 −21 Changes for front/Mission/Mission.vue: 122 added lines, 21 removed lines. Original line number Diff line number Diff line Loading @@ -95,6 +95,8 @@ data-content="Êtes-vous sur de vouloir supprimer la mission ?" data-title="Suppression de la mission" @click.prevent="supprimer">Supprimer</a> </div> </div> </div> Loading Loading @@ -188,6 +190,8 @@ data-content="Êtes-vous sur de vouloir supprimer le volume horaire ?" data-title="Suppression du volume horaire" @click.prevent="volumeHoraireSupprimer">Supprimer</a> </td> </tr> </tbody> Loading @@ -197,19 +201,24 @@ </template> </u-modal> <u-confirm-dialog ref="confirmDialog"/> </template> <script> export default { name: 'Mission', props: { mission: {required: true} }, data() { return { boxOne: '', boxTwo: '', validationText: this.calcValidation(this.mission.validation), saisieUrl: unicaenVue.url('mission/saisie/:mission', {mission: this.mission.id}), Loading Loading @@ -254,44 +263,136 @@ export default { this.refresh(); }); }, supprimer(event) async supprimer(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.href; const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; const confirmed = await this.$refs.confirmDialog.open( content, title ); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('supprimer', this.mission); }); } } }, valider(event) async valider(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.href; const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( content, title ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, devalider(event) async devalider(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.href; const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( content, title ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, volumeHoraireSupprimer(event) async volumeHoraireSupprimer(event) { event.currentTarget.href = unicaenVue.url('mission/volume-horaire/supprimer/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); popConfirm(event.currentTarget, (response) => { const url = unicaenVue.url('mission/volume-horaire/supprimer/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( content, title ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, volumeHoraireValider(event) async volumeHoraireValider(event) { event.currentTarget.href = unicaenVue.url('mission/volume-horaire/valider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); popConfirm(event.currentTarget, (response) => { const url = unicaenVue.url('mission/volume-horaire/valider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( content, title ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, volumeHoraireDevalider(event) async volumeHoraireDevalider(event) { event.currentTarget.href = unicaenVue.url('mission/volume-horaire/devalider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); popConfirm(event.currentTarget, (response) => { const url = unicaenVue.url('mission/volume-horaire/devalider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( content, title ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, refresh() { Loading front/Mission/SuiviEvent.vue +46 −10 Changes for front/Mission/SuiviEvent.vue: 46 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -9,22 +9,29 @@ </div> <div class="event-actions"> <div class="btn-group btn-group-sm"> <button v-if="event.canEdit" class="btn btn-light" @click="modifier" title="Modifier le suivi" :data-url="modifierUrl"> <button v-if="event.canEdit" class="btn btn-light" @click="modifier" data-title="Modifier le suivi" title="Modifier le suivi" :data-url="modifierUrl"> <u-icon name="pen-to-square"/> </button> <button v-if="event.canValider" class="btn btn-light" @click="valider" title="Valider le suivi" :data-url="validerUrl"> <button v-if="event.canValider" class="btn btn-light" @click="valider" data-title="Valider le suivi" title="Valider le suivi" :data-url="validerUrl"> <u-icon name="check" class="text-success"/> </button> <button v-if="event.canDevalider" class="btn btn-light" @click="devalider" title="Dévalider le suivi" :data-url="devaliderUrl" <button v-if="event.canDevalider" class="btn btn-light" @click="devalider" data-title="Dévalider le suivi" title="Dévalider le suivi" :data-url="devaliderUrl" data-content="Voulez-vous vraiment dévalider ce suivi ?"> <u-icon name="xmark" class="text-danger"/> </button> <button v-if="event.canSupprimer" class="btn btn-light" @click="supprimer" title="Supprimer le suivi" :data-url="supprimerUrl" <button v-if="event.canSupprimer" class="btn btn-light" @click="supprimer" data-title="Supprimer le suivi" title="Supprimer le suivi" :data-url="supprimerUrl" data-content="Voulez-vous vraiment supprimer ce suivi ?"> <u-icon name="trash-can" class="text-danger"/> </button> </div> </div> <u-confirm-dialog ref="confirmDialog"/> </template> <script> Loading Loading @@ -65,11 +72,26 @@ export default { }); }, supprimer(event) async supprimer(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.dataset.url; const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; const confirmed = await this.$refs.confirmDialog.open( content, title ); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.suivi.refresh(); }); } } }, valider(event) Loading @@ -79,11 +101,25 @@ export default { }); }, devalider(event) async devalider(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.dataset.url; const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; const confirmed = await this.$refs.confirmDialog.open( content, title ); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.suivi.refresh(); }); } } }, }, Loading front/autoload.js +1 Changes for front/autoload.js: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ export default { /* UI components */ UHeures: 'Application/UI/UHeures', UInputFloat: 'Application/UI/UInputFloat', UConfirmDialog: 'Application/UI/UConfirmDialog', /* App common components */ Utilisateur: 'Application/Utilisateur', Loading module/Administration/src/Migration/V24ServiceHorsEtablissement.php +34 Changes for module/Administration/src/Migration/V24ServiceHorsEtablissement.php: 34 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Administration\Migration; use Unicaen\BddAdmin\Migration\MigrationAction; class V24ServiceHorsEtablissement extends MigrationAction { public function description(): string { return "Suppression des etape_id de la table service pour les services hors établissement..."; } public function utile(): bool { return true; } public function before() { $bdd = $this->getBdd(); $this->logMsg('Suppression des etape_id de la table service pour les services hors établissement...'); $this->manager()->sauvegarderTable('SERVICE', 'SAVE_SERVICE'); $bdd->exec('UPDATE service SET etape_id = NULL WHERE element_pedagogique_id IS null AND etape_id IS NOT null '); } } No newline at end of file Loading
front/Application/UI/UConfirmDialog.vue +76 Changes for front/Application/UI/UConfirmDialog.vue: 76 added lines, 0 removed lines. Original line number Diff line number Diff line <template> <div class="modal fade" tabindex="-1" ref="modalEl" aria-hidden="true" > <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">{{ title }}</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body">{{ message }}</div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Annuler</button> <button type="button" class="btn btn-danger" @click="confirmAction">Confirmer</button> </div> </div> </div> </div> </template> <script> import { Modal } from "bootstrap"; export default { data() { return { modal: null, // Instance Bootstrap Modal resolveFn: null, // Fonction pour résoudre la promesse message: "", // Message affiché title: "Confirmation", // Titre modal }; }, mounted() { // Crée l'instance Bootstrap Modal this.modal = new Modal(this.$refs.modalEl, { backdrop: "static", keyboard: true, }); // Si la modal est fermée manuellement → annuler la promesse this.$refs.modalEl.addEventListener("hidden.bs.modal", () => { if (this.resolveFn) { this.resolveFn(false); this.resolveFn = null; } }); }, methods: { /** * Ouvre la modal et retourne une Promise */ open(message, title = "Confirmation") { this.message = message; this.title = title; this.modal.show(); return new Promise((resolve) => { this.resolveFn = resolve; }); }, /** * Confirme l'action et résout la Promise */ confirmAction() { if (this.resolveFn) this.resolveFn(true); this.resolveFn = null; this.modal.hide(); }, }, }; </script>
front/Mission/Mission.vue +122 −21 Changes for front/Mission/Mission.vue: 122 added lines, 21 removed lines. Original line number Diff line number Diff line Loading @@ -95,6 +95,8 @@ data-content="Êtes-vous sur de vouloir supprimer la mission ?" data-title="Suppression de la mission" @click.prevent="supprimer">Supprimer</a> </div> </div> </div> Loading Loading @@ -188,6 +190,8 @@ data-content="Êtes-vous sur de vouloir supprimer le volume horaire ?" data-title="Suppression du volume horaire" @click.prevent="volumeHoraireSupprimer">Supprimer</a> </td> </tr> </tbody> Loading @@ -197,19 +201,24 @@ </template> </u-modal> <u-confirm-dialog ref="confirmDialog"/> </template> <script> export default { name: 'Mission', props: { mission: {required: true} }, data() { return { boxOne: '', boxTwo: '', validationText: this.calcValidation(this.mission.validation), saisieUrl: unicaenVue.url('mission/saisie/:mission', {mission: this.mission.id}), Loading Loading @@ -254,44 +263,136 @@ export default { this.refresh(); }); }, supprimer(event) async supprimer(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.href; const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; const confirmed = await this.$refs.confirmDialog.open( content, title ); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('supprimer', this.mission); }); } } }, valider(event) async valider(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.href; const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( content, title ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, devalider(event) async devalider(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.href; const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( content, title ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, volumeHoraireSupprimer(event) async volumeHoraireSupprimer(event) { event.currentTarget.href = unicaenVue.url('mission/volume-horaire/supprimer/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); popConfirm(event.currentTarget, (response) => { const url = unicaenVue.url('mission/volume-horaire/supprimer/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( content, title ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, volumeHoraireValider(event) async volumeHoraireValider(event) { event.currentTarget.href = unicaenVue.url('mission/volume-horaire/valider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); popConfirm(event.currentTarget, (response) => { const url = unicaenVue.url('mission/volume-horaire/valider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( content, title ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, volumeHoraireDevalider(event) async volumeHoraireDevalider(event) { event.currentTarget.href = unicaenVue.url('mission/volume-horaire/devalider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); popConfirm(event.currentTarget, (response) => { const url = unicaenVue.url('mission/volume-horaire/devalider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( content, title ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, refresh() { Loading
front/Mission/SuiviEvent.vue +46 −10 Changes for front/Mission/SuiviEvent.vue: 46 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -9,22 +9,29 @@ </div> <div class="event-actions"> <div class="btn-group btn-group-sm"> <button v-if="event.canEdit" class="btn btn-light" @click="modifier" title="Modifier le suivi" :data-url="modifierUrl"> <button v-if="event.canEdit" class="btn btn-light" @click="modifier" data-title="Modifier le suivi" title="Modifier le suivi" :data-url="modifierUrl"> <u-icon name="pen-to-square"/> </button> <button v-if="event.canValider" class="btn btn-light" @click="valider" title="Valider le suivi" :data-url="validerUrl"> <button v-if="event.canValider" class="btn btn-light" @click="valider" data-title="Valider le suivi" title="Valider le suivi" :data-url="validerUrl"> <u-icon name="check" class="text-success"/> </button> <button v-if="event.canDevalider" class="btn btn-light" @click="devalider" title="Dévalider le suivi" :data-url="devaliderUrl" <button v-if="event.canDevalider" class="btn btn-light" @click="devalider" data-title="Dévalider le suivi" title="Dévalider le suivi" :data-url="devaliderUrl" data-content="Voulez-vous vraiment dévalider ce suivi ?"> <u-icon name="xmark" class="text-danger"/> </button> <button v-if="event.canSupprimer" class="btn btn-light" @click="supprimer" title="Supprimer le suivi" :data-url="supprimerUrl" <button v-if="event.canSupprimer" class="btn btn-light" @click="supprimer" data-title="Supprimer le suivi" title="Supprimer le suivi" :data-url="supprimerUrl" data-content="Voulez-vous vraiment supprimer ce suivi ?"> <u-icon name="trash-can" class="text-danger"/> </button> </div> </div> <u-confirm-dialog ref="confirmDialog"/> </template> <script> Loading Loading @@ -65,11 +72,26 @@ export default { }); }, supprimer(event) async supprimer(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.dataset.url; const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; const confirmed = await this.$refs.confirmDialog.open( content, title ); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.suivi.refresh(); }); } } }, valider(event) Loading @@ -79,11 +101,25 @@ export default { }); }, devalider(event) async devalider(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.dataset.url; const title = event.currentTarget.dataset.title; const content = event.currentTarget.dataset.content; const confirmed = await this.$refs.confirmDialog.open( content, title ); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.suivi.refresh(); }); } } }, }, Loading
front/autoload.js +1 Changes for front/autoload.js: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ export default { /* UI components */ UHeures: 'Application/UI/UHeures', UInputFloat: 'Application/UI/UInputFloat', UConfirmDialog: 'Application/UI/UConfirmDialog', /* App common components */ Utilisateur: 'Application/Utilisateur', Loading
module/Administration/src/Migration/V24ServiceHorsEtablissement.php +34 Changes for module/Administration/src/Migration/V24ServiceHorsEtablissement.php: 34 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Administration\Migration; use Unicaen\BddAdmin\Migration\MigrationAction; class V24ServiceHorsEtablissement extends MigrationAction { public function description(): string { return "Suppression des etape_id de la table service pour les services hors établissement..."; } public function utile(): bool { return true; } public function before() { $bdd = $this->getBdd(); $this->logMsg('Suppression des etape_id de la table service pour les services hors établissement...'); $this->manager()->sauvegarderTable('SERVICE', 'SAVE_SERVICE'); $bdd->exec('UPDATE service SET etape_id = NULL WHERE element_pedagogique_id IS null AND etape_id IS NOT null '); } } No newline at end of file