diff --git a/Front-End/src/app/[locale]/admin/structure/page.js b/Front-End/src/app/[locale]/admin/structure/page.js
index df127f4..92e1049 100644
--- a/Front-End/src/app/[locale]/admin/structure/page.js
+++ b/Front-End/src/app/[locale]/admin/structure/page.js
@@ -52,7 +52,7 @@ export default function Page() {
);
const csrfToken = useCsrfToken();
- const { selectedEstablishmentId } = useEstablishment();
+ const { selectedEstablishmentId, profileRole } = useEstablishment();
useEffect(() => {
if (selectedEstablishmentId) {
@@ -316,35 +316,39 @@ export default function Page() {
),
},
- {
- id: 'Fees',
- label: 'Tarifs',
- content: (
-
diff --git a/Front-End/src/components/Structure/Competencies/TreeView.js b/Front-End/src/components/Structure/Competencies/TreeView.js
index eac0268..f22939d 100644
--- a/Front-End/src/components/Structure/Competencies/TreeView.js
+++ b/Front-End/src/components/Structure/Competencies/TreeView.js
@@ -5,6 +5,7 @@ import React, {
useImperativeHandle,
} from 'react';
import { CheckCircle, Circle } from 'lucide-react';
+import { useEstablishment } from '@/context/EstablishmentContext';
const TreeView = forwardRef(function TreeView(
{ data, expandAll, onSelectionChange },
@@ -72,6 +73,8 @@ const TreeView = forwardRef(function TreeView(
clearSelection: () => setSelectedCompetencies({}),
}));
+ const { profileRole } = useEstablishment();
+
return (
{data.map((domaine) => (
@@ -112,12 +115,18 @@ const TreeView = forwardRef(function TreeView(
? 'text-emerald-600 font-semibold cursor-pointer'
: 'text-gray-500 cursor-pointer hover:text-emerald-600'
}`}
- onClick={() => handleCompetenceClick(competence)}
+ onClick={
+ profileRole !== 0
+ ? () => handleCompetenceClick(competence)
+ : undefined
+ }
style={{
cursor:
competence.state === 'required'
? 'default'
- : 'pointer',
+ : profileRole !== 0
+ ? 'pointer'
+ : 'default',
userSelect: 'none',
}}
>
diff --git a/Front-End/src/components/Structure/Configuration/ClassesSection.js b/Front-End/src/components/Structure/Configuration/ClassesSection.js
index 86d65b7..80d1688 100644
--- a/Front-End/src/components/Structure/Configuration/ClassesSection.js
+++ b/Front-End/src/components/Structure/Configuration/ClassesSection.js
@@ -130,9 +130,7 @@ const ClassesSection = ({
const [removePopupVisible, setRemovePopupVisible] = useState(false);
const [removePopupMessage, setRemovePopupMessage] = useState('');
const [removePopupOnConfirm, setRemovePopupOnConfirm] = useState(() => {});
- const [detailsModalVisible, setDetailsModalVisible] = useState(false);
- const [selectedClass, setSelectedClass] = useState(null);
- const { selectedEstablishmentId } = useEstablishment();
+ const { selectedEstablishmentId, profileRole } = useEstablishment();
const { addSchedule, reloadPlanning, reloadEvents } = usePlanning();
const { getNiveauxLabels, allNiveaux } = useClasses();
const router = useRouter();
@@ -449,6 +447,25 @@ const ClassesSection = ({
case 'MISE A JOUR':
return classe.updated_date_formatted;
case 'ACTIONS':
+ // Affichage des actions en mode affichage (hors édition/création)
+ if (profileRole === 0) {
+ // Si professeur, uniquement le bouton ZoomIn
+ return (
+
+
+
+ );
+ }
+ // Sinon, toutes les actions (admin)
return (
{});
- const { selectedEstablishmentId } = useEstablishment();
+ const { selectedEstablishmentId, profileRole } = useEstablishment();
// Récupération des messages d'erreur
const getError = (field) => {
@@ -239,7 +239,7 @@ const SpecialitiesSection = ({
const columns = [
{ name: 'LIBELLE', label: 'Libellé' },
{ name: 'MISE A JOUR', label: 'Date mise à jour' },
- { name: 'ACTIONS', label: 'Actions' },
+ ...(profileRole !== 0 ? [{ name: 'ACTIONS', label: 'Actions' }] : []),
];
return (
@@ -249,7 +249,7 @@ const SpecialitiesSection = ({
icon={BookOpen}
title="Liste des spécialités"
description="Gérez les spécialités de votre école"
- button={true}
+ button={profileRole !== 0}
onClick={handleAddSpeciality}
/>
{
- const csrfToken = useCsrfToken();
const [editingTeacher, setEditingTeacher] = useState(null);
const [newTeacher, setNewTeacher] = useState(null);
const [formData, setFormData] = useState({});
@@ -140,7 +138,7 @@ const TeachersSection = ({
const [removePopupMessage, setRemovePopupMessage] = useState('');
const [removePopupOnConfirm, setRemovePopupOnConfirm] = useState(() => {});
- const { selectedEstablishmentId } = useEstablishment();
+ const { selectedEstablishmentId, profileRole } = useEstablishment();
// --- UTILS ---
@@ -520,7 +518,7 @@ const TeachersSection = ({
{ name: 'SPECIALITES', label: 'Spécialités' },
{ name: 'ADMINISTRATEUR', label: 'Profil' },
{ name: 'MISE A JOUR', label: 'Mise à jour' },
- { name: 'ACTIONS', label: 'Actions' },
+ ...(profileRole !== 0 ? [{ name: 'ACTIONS', label: 'Actions' }] : []),
];
return (
@@ -530,7 +528,7 @@ const TeachersSection = ({
icon={GraduationCap}
title="Liste des enseignants.es"
description="Gérez les enseignants.es de votre école"
- button={true}
+ button={profileRole !== 0}
onClick={handleAddTeacher}
/>
-
+ {profileRole !== 0 && (
+
+ )}
-
-
-
-
-
- }
- items={[
- {
- type: 'item',
- label: (
+
+ {profileRole !== 0 && (
+
-
- Formulaire personnalisé
+
+
- ),
- onClick: () => handleDocDropdownSelect('formulaire'),
- },
- {
- type: 'item',
- label: (
-
-
- Formulaire existant
-
- ),
- onClick: () => handleDocDropdownSelect('formulaire_existant'),
- },
- {
- type: 'item',
- label: (
-
-
- Pièce à fournir
-
- ),
- onClick: () => handleDocDropdownSelect('parent'),
- },
- ]}
- buttonClassName="flex items-center justify-center bg-emerald-500 hover:bg-emerald-600 text-white px-3 py-2 rounded-lg shadow transition text-base font-semibold"
- menuClassName="absolute right-0 mt-2 w-56 bg-white border border-gray-200 rounded shadow-lg z-20"
- dropdownOpen={isDocDropdownOpen}
- setDropdownOpen={setIsDocDropdownOpen}
- />
-
+ }
+ items={[
+ {
+ type: 'item',
+ label: (
+
+
+ Formulaire personnalisé
+
+ ),
+ onClick: () => handleDocDropdownSelect('formulaire'),
+ },
+ {
+ type: 'item',
+ label: (
+
+
+ Formulaire existant
+
+ ),
+ onClick: () => handleDocDropdownSelect('formulaire_existant'),
+ },
+ {
+ type: 'item',
+ label: (
+
+
+ Pièce à fournir
+
+ ),
+ onClick: () => handleDocDropdownSelect('parent'),
+ },
+ ]}
+ buttonClassName="flex items-center justify-center bg-emerald-500 hover:bg-emerald-600 text-white px-3 py-2 rounded-lg shadow transition text-base font-semibold"
+ menuClassName="absolute right-0 mt-2 w-56 bg-white border border-gray-200 rounded shadow-lg z-20"
+ dropdownOpen={isDocDropdownOpen}
+ setDropdownOpen={setIsDocDropdownOpen}
+ />
+ )}
+
{!selectedGroupId ? (
Sélectionner un dossier d'inscription