Pārlūkot izejas kodu

onflet sms, superadmin et absences

Maha Bouchiba 2 gadi atpakaļ
vecāks
revīzija
5f6fff3d11

+ 45 - 0
components/Layout/Parameters/Attendances.vue

@@ -0,0 +1,45 @@
+<template>
+  <LayoutContainer>
+    <UiLoadingPanel v-if="pending" />
+    <UiForm v-else :model="Parameters" :entity="parameters">
+      <v-row>
+        <v-col cols="6">
+          <UiInputCheckbox
+            v-model="parameters.sendAttendanceEmail"
+            field="sendAttendanceEmail"
+            label="Prévenir automatiquement la famille par mail en cas d'absence non justifiée"
+          />
+
+          <UiInputCheckbox
+            v-model="parameters.sendAttendanceSms"
+            field="sendAttendanceSms"
+          />
+
+          <UiInputCheckbox
+            v-model="parameters.notifyAdminOnConsecutiveAbsences"
+            field="notifyAdminOnConsecutiveAbsences"
+          />
+        </v-col>
+      </v-row>
+    </UiForm>
+  </LayoutContainer>
+</template>
+<script setup lang="ts">
+import Parameters from '~/models/Organization/Parameters'
+import { useEntityFetch } from '~/composables/data/useEntityFetch'
+import { useOrganizationProfileStore } from '~/stores/organizationProfile'
+import { AsyncData } from '#app'
+
+const { fetch } = useEntityFetch()
+
+const organizationProfile = useOrganizationProfileStore()
+
+if (organizationProfile.parametersId === null) {
+  throw new Error('Missing organization parameters id')
+}
+
+const { data: parameters, pending } = fetch(
+  Parameters,
+  organizationProfile.parametersId
+) as AsyncData<Parameters, Parameters | true>
+</script>

+ 47 - 0
components/Layout/Parameters/Sms.vue

@@ -0,0 +1,47 @@
+<template>
+  <div>
+    <UiForm :model="Parameters" :entity="parameters">
+      <v-row>
+        <v-col cols="12">
+          <UiInputText
+            v-model="parameters.smsSenderName"
+            field="smsSenderName"
+          />
+        </v-col>
+        <v-col cols="12">
+          <UiInputText
+            v-model="parameters.usernameSMS"
+            field="usernameSMS"
+            label="Nom d'utilisateur SMS"
+          />
+        </v-col>
+        <v-col cols="12">
+          <UiInputText
+              v-model="parameters.passwordSMS"
+              field="passwordSMS"
+              type="password"
+          />
+        </v-col>
+      </v-row>
+    </UiForm>
+  </div>
+</template>
+<script setup lang="ts">
+import Parameters from '~/models/Organization/Parameters'
+import { useEntityFetch } from '~/composables/data/useEntityFetch'
+import { useOrganizationProfileStore } from '~/stores/organizationProfile'
+import { AsyncData } from '#app'
+
+const { fetch } = useEntityFetch()
+
+const organizationProfile = useOrganizationProfileStore()
+
+if (organizationProfile.parametersId === null) {
+  throw new Error('Missing organization parameters id')
+}
+
+const { data: parameters, pending } = fetch(
+  Parameters,
+  organizationProfile.parametersId
+) as AsyncData<Parameters, Parameters | true>
+</script>

+ 42 - 0
components/Layout/Parameters/SuperAdmin.vue

@@ -0,0 +1,42 @@
+<template>
+  <div>
+    <div class="mb-4">
+      Le compte super-admin possède tous les droits de gestion sur votre
+      logiciel. On l’utilise surtout pour la gestion de votre site internet et,
+      à la première connexion au logiciel, afin de créer des comptes pour tous
+      membres de votre structure. Enfin, il peut également être utile en cas de
+      dépannage dans certaines situations particulières.
+    </div>
+
+    <UiForm :model="parameters" :entity="Parameters">
+      <v-row>
+        <v-col cols="12">
+          <UiInputText
+            v-model="parameters.superAdminEmail"
+            field="superAdminEmail"
+          />
+        </v-col>
+      </v-row>
+    </UiForm>
+  </div>
+</template>
+
+<script setup lang="ts">
+import Parameters from '~/models/Organization/Parameters'
+import { useEntityFetch } from '~/composables/data/useEntityFetch'
+import { useOrganizationProfileStore } from '~/stores/organizationProfile'
+import { AsyncData } from '#app'
+
+const { fetch } = useEntityFetch()
+
+const organizationProfile = useOrganizationProfileStore()
+
+if (organizationProfile.parametersId === null) {
+  throw new Error('Missing organization parameters id')
+}
+
+const { data: parameters, pending } = fetch(
+  Parameters,
+  organizationProfile.parametersId
+) as AsyncData<Parameters, Parameters | true>
+</script>

+ 2 - 0
lang/fr.json

@@ -182,6 +182,7 @@
   "usernameSMS": "Nom d'utilisateur SMS",
   "smsSenderName": "Personnaliser le nom de l'expéditeur SMS",
   "attendance": "Absences",
+  "notifyAdminOnConsecutiveAbsences": "Prévenir l'administrateur en cas d'absences consécutives",
   "sendAttendanceEmail": "Prévenir automatiquement la famille par mail en cas d'absence non justifiée",
   "sendAttendanceSms": "Prévenir automatiquement la famille par sms en cas d'absence non justifiée",
   "bulletinReceiver": "Adresser le bulletin à",
@@ -194,6 +195,7 @@
   "bulletinSignatureDirector": "Un cadre « Tampon / Signature » pour l'administration",
   "bulletinPrintAddress": "L'adresse postale de l'élève ou son tuteur",
   "bulletinWithTeacher": "Le nom du professeur",
+  "superAdminEmail" : "Adresse mail associée",
   "bulletin_parameters": "Bulletins",
   "sms": "Sms",
   "web_parameters": "Site internet",

+ 24 - 18
models/Organization/Parameters.ts

@@ -1,5 +1,5 @@
-import ApiModel from "~/models/ApiModel";
-import {Bool, Num, Str, Uid, Attr} from "pinia-orm/dist/decorators";
+import ApiModel from '~/models/ApiModel'
+import { Bool, Num, Str, Uid, Attr } from 'pinia-orm/dist/decorators'
 
 /**
  * AP2i Model : Parameters
@@ -13,16 +13,16 @@ export default class Parameters extends ApiModel {
   declare id: number | string | null
 
   @Str(null)
-  declare financialDate: string|null
+  declare financialDate: string | null
 
   @Str(null)
-  declare musicalDate: string|null
+  declare musicalDate: string | null
 
   @Str(null)
-  declare startCourseDate: string|null
+  declare startCourseDate: string | null
 
   @Str(null)
-  declare endCourseDate: string|null
+  declare endCourseDate: string | null
 
   @Bool(false, { notNullable: true })
   declare trackingValidation: boolean
@@ -34,16 +34,16 @@ export default class Parameters extends ApiModel {
   declare editCriteriaNotationByAdminOnly: boolean
 
   @Str(null)
-  declare smsSenderName: string|null
+  declare smsSenderName: string | null
 
   @Bool(true, { notNullable: true })
   declare logoDonorsMove: boolean
 
   @Str(null)
-  declare otherWebsite: string|null
+  declare otherWebsite: string | null
 
   @Str(null)
-  declare customDomain: string|null
+  declare customDomain: string | null
 
   @Bool(false, { notNullable: true })
   declare desactivateOpentalentSiteWeb: boolean
@@ -52,7 +52,7 @@ export default class Parameters extends ApiModel {
   declare publicationDirectors: number[]
 
   @Str(null)
-  declare bulletinPeriod: string|null
+  declare bulletinPeriod: string | null
 
   @Bool(false, { notNullable: true })
   declare bulletinWithTeacher: boolean
@@ -79,19 +79,19 @@ export default class Parameters extends ApiModel {
   declare bulletinShowAverages: boolean
 
   @Str(null)
-  declare bulletinOutput: string|null
+  declare bulletinOutput: string | null
 
   @Bool(true, { notNullable: true })
   declare bulletinEditWithoutEvaluation: boolean
 
   @Str('STUDENTS_AND_THEIR_GUARDIANS')
-  declare bulletinReceiver: string|null
+  declare bulletinReceiver: string | null
 
   @Str(null)
-  declare usernameSMS: string|null
+  declare usernameSMS: string | null
 
   @Str(null)
-  declare passwordSMS: string|null
+  declare passwordSMS: string | null
 
   @Bool(true, { notNullable: true })
   declare showAdherentList: boolean
@@ -100,16 +100,16 @@ export default class Parameters extends ApiModel {
   declare studentsAreAdherents: boolean
 
   @Str(null)
-  declare qrCode: string|null
+  declare qrCode: string | null
 
   @Str('Europe/Paris')
-  declare timezone: string|null
+  declare timezone: string | null
 
   @Str('ANNUAL')
-  declare educationPeriodicity: string|null
+  declare educationPeriodicity: string | null
 
   @Str('BY_EDUCATION')
-  declare advancedEducationNotationType: string|null
+  declare advancedEducationNotationType: string | null
 
   @Bool(false, { notNullable: true })
   declare sendAttendanceEmail: boolean
@@ -119,4 +119,10 @@ export default class Parameters extends ApiModel {
 
   @Attr([])
   declare subdomains: []
+
+  @Str(null)
+  declare superAdminEmail: string | null
+
+  @Bool(false, { notNullable: true })
+  declare notifyAdminOnConsecutiveAbsences: boolean
 }

+ 4 - 0
pages/parameters/index.vue

@@ -47,15 +47,18 @@ Page Paramètres
           </v-window-item>
 
           <v-window-item v-if="organizationProfile.isSchool" value="attendances">
+            <LayoutParametersAttendances />
           </v-window-item>
 
           <v-window-item v-if="organizationProfile.isSchool" value="residenceAreas">
           </v-window-item>
 
           <v-window-item v-if="organizationProfile.hasModule('Sms')" value="sms_option">
+            <LayoutParametersSms />
           </v-window-item>
 
           <v-window-item value="super_admin">
+            <LayoutParametersSuperAdmin/>
           </v-window-item>
         </v-window>
       </v-card-text>
@@ -82,6 +85,7 @@ Page Paramètres
     organizationProfile.isSchool ? 'residenceAreas' : null,
     organizationProfile.hasModule('Sms') ? 'sms_option' : null,
     'super_admin',
+
   ].filter((v) => v !== null)
 
   const router = useRouter()