Final Schedule - merge
This commit is contained in:
		
							
								
								
									
										215
									
								
								frontend/src/Apps/Forums.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										215
									
								
								frontend/src/Apps/Forums.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,215 @@ | ||||
| <!---------------------------------------------------- | ||||
| 	File: Forums.vue  | ||||
| 	Author: Anthony Debucquoy  | ||||
| 	Scope: Extension messagerie | ||||
| 	Description: Forum des étudiants | ||||
| -----------------------------------------------------> | ||||
|  | ||||
| <script setup> | ||||
| import { ref, reactive } from 'vue' | ||||
| import i18n from '@/i18n.js' | ||||
| import { getCourses, getUserActualCourses } from '@/rest/courses.js' | ||||
| import { ForumsOfCurrentCourse, getForumsOfCourse, createForum } from '@/rest/forum.js' | ||||
| import { PostsOfCurrentForum, getPostsOfForum, createPost } from '@/rest/forum.js' | ||||
| import { fetchedPost, fetchPost, sendAnswer } from '@/rest/forum.js' | ||||
| import { getSelf } from '@/rest/Users.js' | ||||
|  | ||||
| const Role = (await getSelf()).role; | ||||
| const courses = Role === 'Admin' || Role === 'Secretary' ? await reactive(getCourses()) : await reactive(getUserActualCourses()); | ||||
| const selectedCourse = ref(); | ||||
| const selectedForum = ref(); | ||||
|  | ||||
| const addForumName = ref(""); | ||||
| const addPost = ref(false); | ||||
| const addPostSubject = ref(""); | ||||
| const addPostContent = ref(""); | ||||
|  | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
| 	<div id="app"> | ||||
| 		<div id="ForumSelector"> | ||||
| 			<select id="cours" value="" v-model="selectedCourse"  @change="getForumsOfCourse(selectedCourse)"> | ||||
| 				<option v-for="course in courses" :value="course.courseID">{{course.title}}</option> | ||||
| 			</select> | ||||
|  | ||||
| 			<select id="forum" value="" v-model="selectedForum"  @change="getPostsOfForum(selectedForum !== 'create' ? selectedForum : null)" v-if="ForumsOfCurrentCourse != null"> | ||||
| 				<option v-for="forum in ForumsOfCurrentCourse" :value=forum.id>{{forum.name}}</option> | ||||
| 				<option v-if="(Role === 'Admin' || Role === 'Teacher') && ForumsOfCurrentCourse != null" value="create">{{ i18n("forum.create") }}</option> | ||||
| 			</select> | ||||
| 		</div> | ||||
| 		<div id="PostSelector" v-if="PostsOfCurrentForum != null"> | ||||
| 			<div @click="fetchPost(post.id)" class="postItem" v-for="post in PostsOfCurrentForum" :key="post.id">{{ post.subject }}</div> | ||||
| 			<button v-if="Role === 'Admin' || Role === 'Teacher' "  id="createPost" @click="addPost = true">+</button> | ||||
| 		</div> | ||||
| 		<div id="PostViewer" v-if="fetchedPost != null"> | ||||
| 			<div id="Post"> | ||||
| 				<h1>{{ fetchedPost.subject }}</h1> | ||||
| 				{{fetchedPost.content}} | ||||
| 			</div> | ||||
| 			<div id="Messages"> | ||||
| 				<p v-for="msg in fetchedPost.answers">{{msg.author.firtName}} {{msg.author.lastName}} - {{msg.content}}</p> | ||||
| 				<input v-if=!fetchedPost.locked type="text" placeholder="response" @keyup.enter="sendAnswer(fetchedPost.id, $event.target.value); $event.target.value = ''"/> | ||||
| 			</div> | ||||
| 		</div> | ||||
| 	</div> | ||||
| 	<div class=popup v-if="selectedForum === 'create' || addPost" @click.self="selectedForum = ''; addPost = false" > | ||||
|  | ||||
| 		<!-- Popup to add forum --> | ||||
| 		<div id="addForumForm" v-if="selectedForum === 'create'" @keyup.enter="createForum(selectedCourse, addForumName); selectedForum = '';"> | ||||
| 			<label>{{ i18n("forum.create.name") }}</label> | ||||
| 			<input type="text" placeholder="Name" v-model=addForumName  /> | ||||
| 		</div> | ||||
|  | ||||
| 		<!-- Popup to add Post --> | ||||
| 		<div id="addPostForm" v-if=addPost> | ||||
| 			<label>{{ i18n("forum.post.create.name") }}</label> | ||||
| 			<input type="text" placeholder="subject" v-model=addPostSubject @keyup.enter="createPost(selectedForum, addPostSubject, addPostContent); addPost = false;"/> | ||||
| 			<textarea v-model="addPostContent" placeholder=content></textarea> | ||||
| 			<input type="submit" value="send" @click="createPost(selectedForum, addPostSubject, addPostContent); addPost = false;"> | ||||
| 		</div> | ||||
|  | ||||
| 	</div> | ||||
| </template> | ||||
|  | ||||
| <style scoped> | ||||
|  | ||||
| .popup{ | ||||
| 	position: fixed; | ||||
| 	top: 0; | ||||
| 	left: 0; | ||||
| 	width: 100vw; | ||||
| 	height: 100vh; | ||||
| 	background-color: #00000022; | ||||
| 	z-index: 9; | ||||
| } | ||||
|  | ||||
| #addForumForm{ | ||||
| 	position: relative; | ||||
| 	width: 30%; | ||||
| 	left: calc(50% - 30% / 2); | ||||
| 	top: calc(50% - 10% / 2); | ||||
| 	border-radius: 10px; | ||||
| 	height: 10%; | ||||
| 	background-color: white; | ||||
|  | ||||
| 	display: flex; | ||||
| 	justify-content: center; | ||||
| 	align-items: center; | ||||
| 	gap: 10px; | ||||
| } | ||||
|  | ||||
| #addPostForm{ | ||||
| 	position: relative; | ||||
| 	width: 30%; | ||||
| 	left: calc(50% - 30% / 2); | ||||
| 	top: calc(50% - 50% / 2); | ||||
| 	border-radius: 10px; | ||||
| 	height: 50%; | ||||
| 	background-color: white; | ||||
|  | ||||
| 	display: flex; | ||||
| 	justify-content: center; | ||||
| 	align-items: center; | ||||
| 	flex-direction: column; | ||||
| 	gap: 10px; | ||||
| } | ||||
|  | ||||
| #app{ | ||||
| 	display: grid; | ||||
| 	width: 100%; | ||||
| 	height: 100%; | ||||
| 	grid-template: 5em auto / 25% 75%; | ||||
| } | ||||
|  | ||||
| #ForumSelector{ | ||||
| 	background-color: #FFFFFF0E; | ||||
| 	grid-column: 1 / 3; | ||||
| 	border-radius: 100px; | ||||
| 	margin: 10px; | ||||
| 	display: flex; | ||||
| 	justify-content: space-around; | ||||
| } | ||||
|  | ||||
| #ForumSelector select{ | ||||
| 	background-color: #ffa000; | ||||
| 	border: none; | ||||
| 	margin: 10px; | ||||
| 	border-radius: 10px; | ||||
| 	width: 200px; | ||||
| 	text-align: center; | ||||
| } | ||||
|  | ||||
| #PostSelector button{ | ||||
| 	background-color: green; | ||||
| 	color: white; | ||||
| 	border: none; | ||||
| 	height: 4vh; | ||||
| 	margin: 5px; | ||||
| 	border-radius: 0 30px 30px 0; | ||||
| 	align-items: center; | ||||
| 	justify-content: center; | ||||
| } | ||||
|  | ||||
| #PostSelector{ | ||||
| 	background-color: #FFFFFF0E; | ||||
| 	border-radius: 0 25px 25px 0; | ||||
| 	margin: 10px 0 10px 10px; | ||||
| 	overflow: hidden; | ||||
| 	padding: 10px; | ||||
|  | ||||
| 	display: flex; | ||||
| 	flex-direction: column; | ||||
|  | ||||
| } | ||||
|  | ||||
| .postItem{ | ||||
| 	color: darkorange; | ||||
| 	display: flex; | ||||
| 	font-family: sans-serif; | ||||
| 	font-weight: bold; | ||||
| 	height: 4vh; | ||||
| 	margin: 5px; | ||||
| 	border-radius: 0 30px 30px 0; | ||||
| 	align-items: center; | ||||
| 	justify-content: center; | ||||
| 	border: 1px solid darkorange; | ||||
| } | ||||
|  | ||||
| .postItem:hover{ | ||||
| 	background-color: gray; | ||||
| } | ||||
|  | ||||
| #PostViewer{ | ||||
| 	background-color: #FFFFFF0E; | ||||
| 	border-radius: 25px; | ||||
| 	margin: 10px; | ||||
|  | ||||
| 	max-height: 100%; | ||||
|  | ||||
| 	overflow: scroll; | ||||
| } | ||||
|  | ||||
| #Post{ | ||||
| 	padding: 25px; | ||||
| 	color: white; | ||||
| } | ||||
|  | ||||
| #Post > h1{ | ||||
| 	text-align: center; | ||||
| 	text-decoration: underline; | ||||
| } | ||||
|  | ||||
| #Messages{ | ||||
| 	padding: 25px; | ||||
| 	border-top: 3px dotted white; | ||||
|  | ||||
| } | ||||
|  | ||||
| #Messages > p { | ||||
|  | ||||
| 	background-color: orange; | ||||
| } | ||||
|  | ||||
| </style> | ||||
|  | ||||
| @ -39,39 +39,39 @@ async function editChangeCurrReqTeacherApproval(state){ | ||||
|       <div class="globalInfos"> | ||||
|         <div class="infosContainer"> | ||||
|           <div> | ||||
|             Firstname/Name : {{req.user.firstName}} {{req.user.lastName}} | ||||
|             {{i18n("firstname/name")}} : {{req.user.firstName}} {{req.user.lastName}} | ||||
|           </div> | ||||
|           <div> | ||||
|             regNo : {{req.user.regNo}} | ||||
|             {{i18n("regNo")}} : {{req.user.regNo}} | ||||
|           </div> | ||||
|           <div v-if="req.actualCurriculum !== null"> | ||||
|             From : Bac {{req.actualCurriculum.year}} {{req.actualCurriculum.option}} | ||||
|             To : Bac {{req.destinationCurriculum.year}} {{req.destinationCurriculum.option}} | ||||
|             {{i18n("From")}} : Bac {{req.actualCurriculum.year}} {{req.actualCurriculum.option}} | ||||
|             {{i18n("To")}} : Bac {{req.destinationCurriculum.year}} {{req.destinationCurriculum.option}} | ||||
|           </div> | ||||
|           <div v-else> | ||||
|             Wanted cursus : Bac {{req.destinationCurriculum.year}} {{req.destinationCurriculum.option}} | ||||
|             {{i18n("WantedCursus")}} : Bac {{req.destinationCurriculum.year}} {{req.destinationCurriculum.option}} | ||||
|           </div> | ||||
|           <div> | ||||
|             <button @click="localwindowstate++"> See profile </button> | ||||
|             <button @click="localwindowstate++"> {{ i18n("seeprofile") }} </button> | ||||
|           </div> | ||||
|           <div> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Accepted';uploadandrefreshChangeRequest('Accepted')">Accept</button> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Refused';uploadandrefreshChangeRequest('Refused')" style="margin-left: 2%;">Refuse</button> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Accepted';uploadandrefreshChangeRequest('Accepted')">{{ i18n("request.accept") }}</button> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Refused';uploadandrefreshChangeRequest('Refused')" style="margin-left: 2%;">{{i18n("request.refuse")}}</button> | ||||
|           </div> | ||||
|           <div v-if="user.role === 'Teacher' || user.role === 'Admin'"> | ||||
|             <button v-if="req.teacherApprovalState === 'Pending'" @click="req.teacherApprovalState='Accepted';editChangeCurrReqTeacherApproval('Accepted')">Accept equivalence</button> | ||||
|             <button v-if="req.teacherApprovalState === 'Pending'" @click="req.teacherApprovalState='Refused';editChangeCurrReqTeacherApproval('Refused')">Refuse equivalence</button> | ||||
|             <button v-if="req.teacherApprovalState === 'Pending'" @click="req.teacherApprovalState='Accepted';editChangeCurrReqTeacherApproval('Accepted')">{{i18n("acceptequiv")}}</button> | ||||
|             <button v-if="req.teacherApprovalState === 'Pending'" @click="req.teacherApprovalState='Refused';editChangeCurrReqTeacherApproval('Refused')">{{i18n("refuseequiv")}}</button> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
|   <div v-if="localwindowstate === 0"> | ||||
|     <button @click="windowState = 0" style="margin-left: 10%">Back</button> | ||||
|   <div v-if="localwindowstate === 0" style="margin-left: 23%"> | ||||
|     <button @click="windowState = 0" style="margin-left: 10%">{{ i18n("courses.back") }}</button> | ||||
|   </div> | ||||
|   <div v-if="localwindowstate === 1"> | ||||
|     <AboutStudent :target="tag"></AboutStudent> | ||||
|     <button @click="localwindowstate--;">Back</button> | ||||
|     <button @click="localwindowstate--;" style="margin-left: 10%">{{ i18n("courses.back") }}</button> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| @ -125,4 +125,12 @@ async function editChangeCurrReqTeacherApproval(state){ | ||||
|   background-color:rgb(50,50,50); | ||||
|   border-radius:20px; | ||||
| } | ||||
|  | ||||
| button{ | ||||
|   border:none; | ||||
|   background-color:rgb(239, 60, 168); | ||||
|   border-radius:10px; | ||||
|   height:35px; | ||||
|   margin-top:10px; | ||||
| } | ||||
| </style> | ||||
| @ -32,23 +32,23 @@ async function editExemp(newstate){ | ||||
|       <div class="globalInfos"> | ||||
|         <div class="infosContainer"> | ||||
|           <div> | ||||
|             Firstname/Name : {{req.user.firstName}} {{req.user.lastName}} | ||||
|             {{ i18n("firstname/name") }} : {{req.user.firstName}} {{req.user.lastName}} | ||||
|           </div> | ||||
|           <div> | ||||
|             Course: {{req.course.title}} | ||||
|             {{ i18n("course") }}: {{req.course.title}} | ||||
|           </div> | ||||
|           <div> | ||||
|             State : {{req.state}} | ||||
|             {{ i18n("state") }} : {{req.state}} | ||||
|           </div> | ||||
|           <div> | ||||
|             <button @click="profile = !profile">Voir le profil</button> | ||||
|             <button @click="profile = !profile">{{ i18n("seeprofile") }}</button> | ||||
|           </div> | ||||
|           <div> | ||||
|             <button>Download justification document</button> | ||||
|             <button>{{ i18n("dljustifdoc") }}</button> | ||||
|           </div> | ||||
|           <div> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Accepted';editExemp('Accepted')">Accept</button> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Refused';editExemp('Refused')" style="margin-left: 2%;">Refuse</button> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Accepted';editExemp('Accepted')">{{ i18n("request.accept") }}</button> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Refused';editExemp('Refused')" style="margin-left: 2%;">{{ i18n("request.refuse") }}</button> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
| @ -56,10 +56,10 @@ async function editExemp(newstate){ | ||||
|   </div> | ||||
|   <div v-else> | ||||
|     <AboutStudent :target="req.user.regNo"></AboutStudent> | ||||
|     <button @click="profile=!profile">Back</button> | ||||
|     <button @click="profile=!profile" style="margin-left: 17%;margin-top: 3%">{{ i18n("backtoreq") }}</button> | ||||
|   </div> | ||||
|   <div> | ||||
|     <button v-if="profile===false" @click="windowState = 0" style="margin-left: 30%">Back</button> | ||||
|     <button v-if="profile===false" @click="windowState = 0" style="margin-left: 31%">{{ i18n("courses.back") }}</button> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| @ -113,4 +113,12 @@ async function editExemp(newstate){ | ||||
|   background-color:rgb(50,50,50); | ||||
|   border-radius:20px; | ||||
| } | ||||
|  | ||||
| button{ | ||||
|   border:none; | ||||
|   background-color:rgb(239, 60, 168); | ||||
|   border-radius:10px; | ||||
|   height:35px; | ||||
|   margin-top:10px; | ||||
| } | ||||
| </style> | ||||
| @ -1,7 +1,7 @@ | ||||
| <script setup> | ||||
| import i18n from "@/i18n.js" | ||||
| import {getSelf, getUser} from '../../rest/Users.js' | ||||
| import {getcurriculum,getSomeonesCurriculumList} from "@/rest/curriculum.js"; | ||||
| import {getcurriculum} from "@/rest/curriculum.js"; | ||||
| import {getRegisters} from "@/rest/ServiceInscription.js"; | ||||
| import {get} from "jsdom/lib/jsdom/named-properties-tracker.js"; | ||||
| import {getExternalCurriculumByInscrReq} from "@/rest/externalCurriculum.js"; | ||||
| @ -31,7 +31,7 @@ async function editEquivalence(id, newstate){ | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
|   <div class="body" v-if="list == false"> | ||||
|   <div class="body" v-if="list == false" style="margin-top: 10%;"> | ||||
|     <div class="container"> | ||||
|       <div class="profilPic"> | ||||
|         <img class="subContainter" :src=getPP()> | ||||
| @ -39,38 +39,42 @@ async function editEquivalence(id, newstate){ | ||||
|       <div class = "globalInfos"> | ||||
|         <div class="infosContainer"> | ||||
|           <div> | ||||
|             FirstName/Name : {{request.firstName}} {{request.lastName}} | ||||
|             {{ i18n("firstname/name") }} : {{request.firstName}} {{request.lastName}} | ||||
|           </div> | ||||
|           <div> | ||||
|             E-mail: {{request.email}} | ||||
|             {{ i18n("login.guest.email") }}: {{request.email}} | ||||
|           </div> | ||||
|           <div> | ||||
|             Adresse : {{request.address}} | ||||
|             {{ i18n("login.guest.address") }} : {{request.address}} | ||||
|           </div> | ||||
|           <div> | ||||
|             Pays : {{request.country}} | ||||
|             {{ i18n("login.guest.country") }} : {{request.country}} | ||||
|           </div> | ||||
|           <div> | ||||
|             Date de naissance : {{request.birthDate}} | ||||
|             {{ i18n("login.guest.birthday") }} : {{request.birthDate}} | ||||
|           </div> | ||||
|           <div> | ||||
|             Cursus voulu : BAB {{cursus.year}} {{cursus.option}} | ||||
|             {{ i18n("WantedCursus") }} : BAB {{cursus.year}} {{cursus.option}} | ||||
|           </div> | ||||
|           <div style="margin-top: 3%"> | ||||
|             <a :href="request.identityCard">{{ i18n("dlidentitycard") }}</a> | ||||
|             <button v-if="request.admissionDocUrl != null">{{ i18n("dladmissiondoc") }}</button> | ||||
|           </div> | ||||
|           <div v-if="cursus.year > 1"> | ||||
|             <button style="background-color:rgb(105,05,105);margin-left: 5%" @click="list=!list" v-if="(user.role == 'Teacher' || user.role == 'Admin')&& request.equivalenceState == 'Pending'">See external curriculums</button> | ||||
|             <button style="background-color:rgb(105,05,105);margin-top: 3%" @click="list=!list" v-if="(user.role == 'Teacher' || user.role == 'Admin')">{{ i18n("seeextcur") }}</button> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
|   <div v-if="list == false"> | ||||
|     <button @click="windowState = 0">Back</button> | ||||
|   <div v-if="list == false" style="margin-left: 30%; margin-top: 5%"> | ||||
|     <button @click="windowState = 0">{{ i18n("courses.back") }}</button> | ||||
|   </div> | ||||
|   <div v-if="list==true"> | ||||
|     <ExternalCurriculumList :ext-curr-list="externalCurriculum" :mode="0"></ExternalCurriculumList> | ||||
|     <div style="margin-left: 15%;margin-top: 5%;"> | ||||
|       <button style="margin-left: 2%" @click="list = false;editEquivalence(request.id, 'Accepted'); request.equivalenceState='Accepted'">Accept Equivalence</button> | ||||
|       <button style="margin-left: 2%" @click="list = false;editEquivalence(request.id, 'Refused'); request.equivalenceState='Refused'">Refuse Equivalence</button> | ||||
|       <button style="margin-left: 2%" v-if="request.equivalenceState === 'Pending'" @click="list = false;editEquivalence(request.id, 'Accepted'); request.equivalenceState='Accepted'">{{i18n("acceptequiv")}}</button> | ||||
|       <button style="margin-left: 2%" v-if="request.equivalenceState === 'Pending'" @click="list = false;editEquivalence(request.id, 'Refused'); request.equivalenceState='Refused'">{{i18n("refuseequiv")}}</button> | ||||
|       <button style="margin-left: 2%" @click="list=false">Back</button> | ||||
|     </div> | ||||
|   </div> | ||||
| @ -128,10 +132,10 @@ async function editEquivalence(id, newstate){ | ||||
| } | ||||
|  | ||||
| button{ | ||||
|   font-size:15px; | ||||
|   height:50px; | ||||
|   width:100px; | ||||
|   border:none; | ||||
|   border-radius:20px; | ||||
|   background-color:rgb(239, 60, 168); | ||||
|   border-radius:10px; | ||||
|   height:35px; | ||||
|   margin-top:10px; | ||||
| } | ||||
| </style> | ||||
| @ -39,31 +39,31 @@ async function uploadandrefreshScholarshipRequest(){ | ||||
|       <div class="globalInfos"> | ||||
|         <div class="infosContainer"> | ||||
|           <div> | ||||
|             Firstname/Name : {{user.firstName}} {{user.lastName}} | ||||
|             {{ i18n("firstname/name") }} : {{user.firstName}} {{user.lastName}} | ||||
|           </div> | ||||
|           <div> | ||||
|             E-mail: {{user.email}} | ||||
|             {{ i18n("login.guest.email") }}: {{user.email}} | ||||
|           </div> | ||||
|           <div> | ||||
|             Adresse : {{user.address}} | ||||
|             {{ i18n("login.guest.address") }} : {{user.address}} | ||||
|           </div> | ||||
|           <div> | ||||
|             Country : {{user.country}} | ||||
|             {{ i18n("login.guest.country") }} : {{user.country}} | ||||
|           </div> | ||||
|           <div> | ||||
|             Birthdate : {{user.birthDate.slice(0,10)}} | ||||
|             {{ i18n("login.guest.birthday") }} : {{user.birthDate.slice(0,10)}} | ||||
|           </div> | ||||
|           <div> | ||||
|             <button>Download tax justif document</button> | ||||
|             <button style="margin-left: 2%">Download residency justif document</button> | ||||
|             <button @click="">{{ i18n("dltaxdoc") }}</button> | ||||
|             <button style="margin-left: 2%">{{ i18n("dlresidency") }}</button> | ||||
|           </div> | ||||
|           <div v-if="req.state == 'Pending'"> | ||||
|             Please enter the amount to provide : | ||||
|           <div v-if="req.state == 'Pending'" style="margin-top: 2%; margin-bottom: 2%;"> | ||||
|             {{i18n("enteramount")}} | ||||
|             <input type="number" v-model="scholarshipData.amount"> | ||||
|           </div> | ||||
|           <div> | ||||
|             <button v-if="req.state === 'Pending'" @click="scholarshipData.state='Accepted';uploadandrefreshScholarshipRequest()">Accept</button> | ||||
|             <button v-if="req.state === 'Pending'" @click="scholarshipData.state='Refused';uploadandrefreshScholarshipRequest()" style="margin-left: 2%;">Refuse</button> | ||||
|             <button v-if="req.state === 'Pending'" @click="scholarshipData.state='Accepted';uploadandrefreshScholarshipRequest()">{{i18n("request.accept")}}</button> | ||||
|             <button v-if="req.state === 'Pending'" @click="scholarshipData.state='Refused';uploadandrefreshScholarshipRequest()" style="margin-left: 2%;">{{i18n("request.refuse")}}</button> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
| @ -101,7 +101,7 @@ async function uploadandrefreshScholarshipRequest(){ | ||||
|   display:flex; | ||||
|   align-items:center; | ||||
|   justify-content:center; | ||||
|   margin-top:7%; | ||||
|   margin-top:10%; | ||||
| } | ||||
|  | ||||
| .subContainter{ | ||||
| @ -121,4 +121,12 @@ async function uploadandrefreshScholarshipRequest(){ | ||||
|   background-color:rgb(50,50,50); | ||||
|   border-radius:20px; | ||||
| } | ||||
|  | ||||
| button{ | ||||
|   border:none; | ||||
|   background-color:rgb(239, 60, 168); | ||||
|   border-radius:10px; | ||||
|   height:35px; | ||||
|   margin-top:10px; | ||||
| } | ||||
| </style> | ||||
| @ -1,10 +1,11 @@ | ||||
| <script setup> | ||||
|   import i18n from "@/i18n.js" | ||||
|   import {getUser} from '../../rest/Users.js' | ||||
|   import {getSelf, getUser} from '../../rest/Users.js' | ||||
|   import {getSomeonesCurriculumList} from "@/rest/curriculum.js"; | ||||
|   import {ref} from "vue"; | ||||
|   import ExternalCurriculumList from "@/Apps/Inscription/ExternalCurriculumList.vue"; | ||||
|   import {getExternalCurriculumByUser} from "@/rest/externalCurriculum.js"; | ||||
|   import {getUserActualCourses} from "@/rest/courses.js"; | ||||
|  | ||||
|   const props = defineProps(['target']) | ||||
|   const user = await getUser(props.target) | ||||
| @ -12,6 +13,10 @@ | ||||
|   const externalcurrlist = await getExternalCurriculumByUser(user.regNo) | ||||
|   const extercurrlist = ref(false) | ||||
|  | ||||
|   const courselist = await getUserActualCourses(user.regNo) | ||||
|   console.log(courselist) | ||||
|  | ||||
|   const watchingUser = await getSelf() | ||||
|   function getPP(){ | ||||
|     if(user.profilePictureUrl === null){ | ||||
|       return "/Clyde.png" | ||||
| @ -40,47 +45,50 @@ | ||||
|       <div class = "globalInfos"> | ||||
|         <div class="infosContainer"> | ||||
|           <div> | ||||
|             FirstName/Name : {{user.firstName}} {{user.lastName}} | ||||
|             {{ i18n("firstname/name") }} : {{user.firstName}} {{user.lastName}} | ||||
|           </div> | ||||
|           <div> | ||||
|             E-mail: {{user.email}} | ||||
|             {{ i18n("login.guest.email") }}: {{user.email}} | ||||
|           </div> | ||||
|           <div> | ||||
|             Adresse : {{user.address}} | ||||
|             {{ i18n("login.guest.address") }} : {{user.address}} | ||||
|           </div> | ||||
|           <div> | ||||
|             Pays : {{user.country}} | ||||
|             {{ i18n("login.guest.country") }} : {{user.country}} | ||||
|           </div> | ||||
|           <div> | ||||
|             Date de naissance : {{user.birthDate}} | ||||
|             {{ i18n("login.guest.birthday") }} : {{user.birthDate}} | ||||
|           </div> | ||||
|           <div> | ||||
|             <button @click="extercurrlist=!extercurrlist">See external curriculums</button> | ||||
|             <button v-if="watchingUser.role === 'Admin' || watchingUser.role === 'InscriptionService' || watchingUser.role === 'Secretary' || watchingUser.regNo === user.regNo">{{i18n("dlidentitycard")}}</button> | ||||
|           </div> | ||||
|           <div> | ||||
|             <button @click="extercurrlist=!extercurrlist">{{i18n("seeextcur")}}</button> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="moreInfos"> | ||||
|       <div class="moreInfos" style="margin-top: 15%"> | ||||
|         <div class = "oldcursus"> | ||||
|           <div class="listTitle"> | ||||
|             Anciens Cursus | ||||
|             {{ i18n("oldcursus") }} | ||||
|           </div> | ||||
|           <div  class="listElement"> | ||||
|             <div class=" containerElement" v-for="item in UserCurriculum.curriculumList"> | ||||
|               <div class="year" v-if="item.actual === false">Bac {{item.year}}</div> | ||||
|               <div class="option" v-if="item.actual === false">{{item.option}}</div> | ||||
|               <div class="dateyear" v-if="item.actual === false">Année {{item.dateyear}}-{{item.dateyear+1}}</div> | ||||
|               <div class="dateyear" v-if="item.actual === false">{{ i18n("year") }} {{item.dateyear}}-{{item.dateyear+1}}</div> | ||||
|             </div> | ||||
|           </div> | ||||
|         </div> | ||||
|         <div class="newcursus"> | ||||
|           <div class="listTitle"> | ||||
|             Cursus Actuel | ||||
|             {{ i18n("newcursus") }} | ||||
|           </div> | ||||
|           <div  class="listElement"> | ||||
|             <div class=" containerElement" v-for="item in UserCurriculum.curriculumList" > | ||||
|                 <div class="year" v-if="item.actual === true">Bac {{item.year}}</div> | ||||
|                 <div class="option" v-if="item.actual === true">{{item.option}}</div> | ||||
|                 <div class="dateyear" v-if="item.actual === true">Année {{item.dateyear}}-{{item.dateyear+1}}</div> | ||||
|                 <div class="dateyear" v-if="item.actual === true">{{ i18n("year") }} {{item.dateyear}}-{{item.dateyear+1}}</div> | ||||
|             </div> | ||||
|           </div> | ||||
|         </div> | ||||
| @ -94,6 +102,7 @@ | ||||
|  | ||||
|  | ||||
| <style scoped> | ||||
|  | ||||
| .container{ | ||||
|   min-width:675px; | ||||
|   display:grid; | ||||
| @ -102,8 +111,7 @@ | ||||
|   column-gap:2.7%; | ||||
|   row-gap:45px; | ||||
|   grid-template-areas: | ||||
|   "profilPic globalInfos" | ||||
|   "minfos minfos"; | ||||
|   "profilPic globalInfos"; | ||||
| } | ||||
|  | ||||
| .profilPic{ | ||||
| @ -143,12 +151,10 @@ | ||||
| } | ||||
|  | ||||
| .moreInfos { | ||||
|   display:grid; | ||||
|   grid-template-rows:200px auto; | ||||
|   display:inline-grid; | ||||
|   column-gap:50px; | ||||
|   row-gap:45px; | ||||
|   grid-template-areas: | ||||
|   "minfos minfos"; | ||||
|   "oldcursus newcursus"; | ||||
|   grid-template-columns:600px 600px; | ||||
|   align-items:center; | ||||
|   justify-content:center; | ||||
| @ -189,4 +195,12 @@ | ||||
|   column-gap:40px; | ||||
|   padding-left: 25px; | ||||
| } | ||||
|  | ||||
| button{ | ||||
|   border:none; | ||||
|   background-color:rgb(239, 60, 168); | ||||
|   border-radius:10px; | ||||
|   height:35px; | ||||
|   margin-top:10px; | ||||
| } | ||||
| </style> | ||||
| @ -34,21 +34,21 @@ async function uploadandrefreshUnregRequest(state){ | ||||
|       <div class="globalInfos"> | ||||
|         <div class="infosContainer"> | ||||
|           <div> | ||||
|             Firstname/Name : {{req.firstName}} {{req.lastName}} | ||||
|             {{ i18n("firstname/name") }} : {{req.firstName}} {{req.lastName}} | ||||
|           </div> | ||||
|           <div> | ||||
|             E-mail: {{req.email}} | ||||
|             {{ i18n("login.guest.email") }}: {{req.email}} | ||||
|           </div> | ||||
|           <div> | ||||
|             regNo : {{req.regNo}} | ||||
|             {{ i18n("regNo") }} : {{req.regNo}} | ||||
|           </div> | ||||
|           <div> | ||||
|             Reason : | ||||
|             {{ i18n("reason") }} | ||||
|             <input type="text" v-model="req.reason" readonly/> | ||||
|           </div> | ||||
|           <div> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Accepted';uploadandrefreshUnregRequest('Accepted')">Accept</button> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Refused';uploadandrefreshUnregRequest('Refused')" style="margin-left: 2%;">Refuse</button> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Accepted';uploadandrefreshUnregRequest('Accepted')">{{i18n("request.accept")}}</button> | ||||
|             <button v-if="req.state === 'Pending'" @click="req.state='Refused';uploadandrefreshUnregRequest('Refused')" style="margin-left: 2%;">{{i18n("request.refuse")}}</button> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|  | ||||
| @ -5,13 +5,16 @@ import i18n from "@/i18n.js"; | ||||
| import {getCourse} from "@/rest/courses.js"; | ||||
| import {getcurriculum} from "@/rest/curriculum.js"; | ||||
| import {uploadFile, uploadProfilePicture} from "@/rest/uploads.js"; | ||||
| import {createExemptionsRequest} from "@/rest/requests.js"; | ||||
| import {createExemptionsRequest, getExempByUser} from "@/rest/requests.js"; | ||||
| import {getSelf} from "@/rest/Users.js"; | ||||
|  | ||||
| const props = defineProps(["cursuslist"]) | ||||
| const selectedCurriculum = ref(props.cursuslist[0]) | ||||
| const user = await getSelf() | ||||
|  | ||||
| const windowState = defineModel("windowState") | ||||
| const exempList = await getExempByUser(user.regNo) | ||||
|  | ||||
| const courseslist = ref(await getcurriculum(selectedCurriculum.value.curriculumId)) | ||||
| const list = ref(true) | ||||
|  | ||||
| @ -30,11 +33,20 @@ const exemptReq = reactive({ | ||||
|   courseId : null, | ||||
|   justifDocument : "", | ||||
| }) | ||||
|  | ||||
| function isExempted(course){ | ||||
|   for (let i = 0; i < exempList.length; i++){ | ||||
|     if (exempList[i].course.courseID === course.courseId && exempList[i].state === "Accepted"){ | ||||
|       return true | ||||
|     } | ||||
|     return false | ||||
|   } | ||||
| } | ||||
| </script> | ||||
|  | ||||
| <template style="margin-top:5%;"> | ||||
|   <div v-if="list == true"> | ||||
|     <span>Selected Cursus :   </span> | ||||
|     <span>{{i18n("selectedcursus")}} :   </span> | ||||
|     <select v-model="selectedCurriculum" @change="updateCourseList"> | ||||
|       <option v-for="item in props.cursuslist" :value="item">Bac {{item.year}} {{item.option}}</option> | ||||
|     </select> | ||||
| @ -45,20 +57,29 @@ const exemptReq = reactive({ | ||||
|           <div class="firstname">{{item.owner.firstName}}</div> | ||||
|           <div class="lastname">{{item.owner.lastName}}</div> | ||||
|           <div class="credits">credits : {{item.credits}}</div> | ||||
|           <div class="askexemption"><button style="background-color:rgb(105,0,0);" @click="list= !list;exemptReq.courseId=item.courseId">Ask exemption</button></div> | ||||
|           <div class="askexemption" v-if="!isExempted(item)"><button style="background-color:rgb(105,0,0);" @click="list= !list;exemptReq.courseId=item.courseId">{{i18n("askexemp")}}</button></div> | ||||
|           <div v-else class="askexemption" style="font-size: 50%">{{ i18n("exemp") }}</div> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|     <div> | ||||
|       <button @click="windowState = 0">{{ i18n("courses.back")}}</button> | ||||
|     </div> | ||||
|   </div> | ||||
|   <div v-else> | ||||
|       <p>Please upload the justification document for the exemption </p> | ||||
|   <div v-if="list === false" class="infosContainer"> | ||||
|       <p>{{ i18n("uploadjustifdoc") }} </p> | ||||
|     <div> | ||||
|     <label class="browser"> | ||||
|       <input  type="file" @change="ppData.value = $event.target.files" accept="image/*" ref="filepath"> | ||||
|     </label> | ||||
|     <button style="width:15%; margin-top: 5%;" @click="postExemptionRequest(ppData.value, 'JustificationDocument');"> | ||||
|       Submit exemption request | ||||
|     </div> | ||||
|     <button style="margin-top: 3%" @click="postExemptionRequest(ppData.value, 'JustificationDocument');"> | ||||
|       {{ i18n("subexemreq") }} | ||||
|     </button> | ||||
|   </div> | ||||
|   <div v-if="list === false"> | ||||
|     <button @click="list=!list">{{ i18n("courses.back") }}</button> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <style scoped> | ||||
| @ -135,5 +156,15 @@ button{ | ||||
|   margin-top:10px; | ||||
|  | ||||
| } | ||||
|  | ||||
| .infosContainer { | ||||
|   padding-bottom:50px; | ||||
|   border:2px solid black; | ||||
|   font-size:25px; | ||||
|   color:white; | ||||
|   padding:20px; | ||||
|   background-color:rgb(50,50,50); | ||||
|   border-radius:20px; | ||||
| } | ||||
| </style> | ||||
|  | ||||
|  | ||||
| @ -3,6 +3,7 @@ | ||||
|   import {reactive, ref} from "vue"; | ||||
|   import {getSelf} from "@/rest/Users.js"; | ||||
|   import {createExternalCurriculum, getExternalCurriculumByUser} from "@/rest/externalCurriculum.js"; | ||||
|   import {uploadFile} from "@/rest/uploads.js"; | ||||
|  | ||||
|   //mode 0 = externalcurr related to inscrreq, 1 = externalcurr related to user, 2 inscription procedure | ||||
|   const props = defineProps(["extCurrList", "mode"]) | ||||
| @ -51,7 +52,8 @@ | ||||
|  | ||||
|   async function postExternalCurr(){ | ||||
|     if (props.mode === 1){ | ||||
|       await createExternalCurriculum(externalCurr.inscriptionRequestId, externalCurr.school, externalCurr.formation, externalCurr.completion, externalCurr.startYear, externalCurr.endYear, externalCurr.justifdocUrl, externalCurr.userRegNo); | ||||
|       const temp = await uploadFile(externalCurr.justifdocUrl, "JustificationDocument") | ||||
|       await createExternalCurriculum(externalCurr.inscriptionRequestId, externalCurr.school, externalCurr.formation, externalCurr.completion, externalCurr.startYear, externalCurr.endYear, temp.url, externalCurr.userRegNo); | ||||
|       //We refresh the list | ||||
|       extCurrList.value = await getExternalCurriculumByUser(externalCurr.userRegNo); | ||||
|       list.value = !list.value; | ||||
| @ -68,7 +70,6 @@ | ||||
|       }); | ||||
|       extCurrList.value = externalCurrTab.value | ||||
|       list.value = !list.value; | ||||
|       console.log(externalCurrTab.value) | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| @ -76,18 +77,18 @@ | ||||
| <template style="margin-top:5%;"> | ||||
|   <div v-if="list"> | ||||
|     <div v-if="props.mode === 2||User.regNo === externalCurr.userRegNo" style="margin-left: 2%;margin-top: 2%"> | ||||
|       <button @click="list = !list">Add external curriculum</button> | ||||
|       <button @click="list = !list" style="margin-left:15%;">{{ i18n("addextcurr") }}</button> | ||||
|     </div> | ||||
|     <div style="display:flex; justify-content:center; " v-for="(item, index) in extCurrList"> | ||||
|     <div style="display:flex; justify-content:center;" v-for="(item, index) in extCurrList"> | ||||
|       <div class="bodu"> | ||||
|         <div class="container"> | ||||
|           <div class="status"><a style="margin-left:30px">{{item.state}}</a></div> | ||||
|           <div class="school"><a>{{item.school}}</a></div> | ||||
|           <div class="formation"><a>{{item.formation}}</a></div> | ||||
|           <div class="completion"><a>{{item.completion}}</a></div> | ||||
|           <div class="download"><button>Download document</button></div> | ||||
|           <div class="edit" v-if="props.mode === 2"><button @click="list=!list;externalCurr.justifdocUrl=item.justifDocUrl; externalCurr.endYear = item.endYear; externalCurr.startYear = item.startYear; externalCurr.school = item.school;externalCurr.completion = item.completion;externalCurr.formation=item.formation;editmode=!editmode;extNum=index">Edit</button></div> | ||||
|           <div class="delete" v-if="props.mode === 2"><button @click="deleteExtCursus(item)">Delete</button></div> | ||||
|           <div class="download"><button>{{ i18n("dldoc") }}</button></div> | ||||
|           <div class="edit" v-if="props.mode === 2"><button @click="list=!list;externalCurr.justifdocUrl=item.justifDocUrl; externalCurr.endYear = item.endYear; externalCurr.startYear = item.startYear; externalCurr.school = item.school;externalCurr.completion = item.completion;externalCurr.formation=item.formation;editmode=!editmode;extNum=index">{{i18n("edit")}}</button></div> | ||||
|           <div class="delete" v-if="props.mode === 2"><button @click="deleteExtCursus(item)">{{ i18n("delete") }}</button></div> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
| @ -95,7 +96,7 @@ | ||||
|   <div v-else class="loginbox" style="margin-left: 35%; margin-top: 3%"> | ||||
|     <form class="form"> | ||||
|       <div class="inputBox"> | ||||
|         <p>Ecole</p> | ||||
|         <p>{{ i18n("school") }}</p> | ||||
|         <input type="text" v-model="externalCurr.school"> | ||||
|       </div> | ||||
|       <div class="inputBox"> | ||||
| @ -103,24 +104,28 @@ | ||||
|         <input type="text" v-model="externalCurr.formation"> | ||||
|       </div> | ||||
|       <div class="inputBox"> | ||||
|         <p>Cochez la case si vous n'avez terminé cette formation</p> | ||||
|         <p>{{i18n("checkifnotcompleted")}}</p> | ||||
|         <input v-model="notcompletedCheck" type="checkbox" id="checkboxformation"> | ||||
|         <div v-if="notcompletedCheck"> | ||||
|           <p>En quelle année de la formation vous êtes vous arrété (exemple: 3ème) ?</p> | ||||
|           <p>{{i18n("wichyearstop")}}</p> | ||||
|           <input type="text" v-model="externalCurr.completion"> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="inputBox"> | ||||
|         <p>Année de début</p> | ||||
|         <p>{{ i18n("startyear") }}</p> | ||||
|         <input type="number" v-model="externalCurr.startYear"> | ||||
|       </div> | ||||
|       <div class="inputBox"> | ||||
|         <p>Année de fin</p> | ||||
|         <p>{{ i18n("endyear") }}</p> | ||||
|         <input type="number" v-model="externalCurr.endYear"> | ||||
|       </div> | ||||
|       <div class="inputBox"> | ||||
|         <p>{{i18n("giveextcurdoc")}}</p> | ||||
|         <input type="file" @change="externalCurr.justifdocUrl = $event.target.files"> | ||||
|       </div> | ||||
|       <div class="inputBox" style="margin-top: 3%; margin-bottom: 3%"> | ||||
|         <input v-if="!editmode" type="submit" value="Upload curriculum" @click="postExternalCurr()"> | ||||
|         <input v-else type="submit" value="Edit curriculum" @click="externalCurrTab[extNum] = {inscriptionRequestId : externalCurr.inscriptionRequestId,school:externalCurr.school,formation :externalCurr.formation,completion : externalCurr.completion,startYear : externalCurr.startYear,endYear: externalCurr.endYear,justifdocUrl : externalCurr.justifdocUrl,userRegNo : externalCurr.userRegNo};editmode=!editmode;list=!list"> | ||||
|         <input v-if="!editmode" type="submit" value="upload" @click="postExternalCurr()"> | ||||
|         <input v-else type="submit" value="edit" @click="externalCurrTab[extNum] = {inscriptionRequestId : externalCurr.inscriptionRequestId,school:externalCurr.school,formation :externalCurr.formation,completion : externalCurr.completion,startYear : externalCurr.startYear,endYear: externalCurr.endYear,justifdocUrl : externalCurr.justifdocUrl,userRegNo : externalCurr.userRegNo};editmode=!editmode;list=!list"> | ||||
|       </div> | ||||
|     </form> | ||||
|   </div> | ||||
| @ -224,8 +229,14 @@ | ||||
|   z-index: 100; | ||||
|   font-family:sans-serif ; | ||||
|   color:rgb(239,60,168); | ||||
|   transition: 0.5; | ||||
| } | ||||
|  | ||||
| button{ | ||||
|   border:none; | ||||
|   background-color:rgb(239, 60, 168); | ||||
|   border-radius:10px; | ||||
|   height:35px; | ||||
|   margin-top:10px; | ||||
| } | ||||
| </style> | ||||
|  | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| <script setup> | ||||
|   import i18n from "@/i18n.js" | ||||
|   import {ref, vModelSelect} from 'vue' | ||||
|   import {ref, vModelSelect, watch} from 'vue' | ||||
|   import {validateRegister, getAllRegisters } from '@/rest/ServiceInscription.js' | ||||
|   import AboutRequest from "@/Apps/Inscription/AboutRequest.vue"; | ||||
|   import { | ||||
| @ -13,10 +13,11 @@ | ||||
|   import AboutUnregister from "@/Apps/Inscription/AboutUnregister.vue"; | ||||
|   import AboutChangeCurriculum from "@/Apps/Inscription/AboutChangeCurriculum.vue"; | ||||
|   import AboutExemption from "@/Apps/Inscription/AboutExemption.vue"; | ||||
|   import {getSelf} from "@/rest/Users.js"; | ||||
|  | ||||
|   const requests = ref(await getAllRegisters()); | ||||
|   let targetId = ""; | ||||
|  | ||||
|   const user = await getSelf() | ||||
|   const requestType = ref("inscription"); | ||||
|   const filterType = ref("None"); | ||||
|  | ||||
| @ -31,22 +32,29 @@ | ||||
|  | ||||
|   async function loadRequests(){ | ||||
|     switch (requestType.value){ | ||||
|       case "inscription": | ||||
|       case i18n("inscription"): | ||||
|         requests.value = await getAllRegisters(); | ||||
|         break; | ||||
|       case "scholarship": | ||||
|       case i18n("scholarship"): | ||||
|         requests.value = await getAllScholarShipsRequest(); | ||||
|         break; | ||||
|       case "exemption": | ||||
|       case i18n("exemption"): | ||||
|         requests.value = await getAllExemptionsRequest(); | ||||
|         break; | ||||
|       case "unregister": | ||||
|       case i18n("unregister"): | ||||
|         requests.value = await getAllUnregisters(); | ||||
|         break; | ||||
|       case "curriculum change": | ||||
|       case i18n("curriculumch"): | ||||
|         requests.value = await getAllChangeCurrReq(); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   //When we come back to the list we need to reload the list | ||||
|   watch(windowsState, () => { | ||||
|     if (windowsState.value === 0){ | ||||
|       loadRequests(); | ||||
|     } | ||||
|   }) | ||||
| </script> | ||||
|  | ||||
|  | ||||
| @ -57,16 +65,16 @@ | ||||
|   </div> | ||||
|   <div v-if="windowsState === 0"> | ||||
|     <div style="margin-top: 2%;margin-left: 2%"> | ||||
|       <span>Request type :   </span> | ||||
|       <span>{{ i18n("reqtype") }} :   </span> | ||||
|       <select v-model="requestType" @change="loadRequests()"> | ||||
|         <option>inscription</option> | ||||
|         <option>scholarship</option> | ||||
|         <option>exemption</option> | ||||
|         <option>unregister</option> | ||||
|         <option>curriculum change</option> | ||||
|         <option>{{ i18n("inscription") }}</option> | ||||
|         <option v-if="user.role === 'Admin' || user.role === 'InscriptionService'">{{ i18n("scholarship") }}</option> | ||||
|         <option v-if="user.role === 'Admin' || user.role === 'Teacher'">{{ i18n("exemption") }}</option> | ||||
|         <option v-if="user.role === 'Admin' || user.role === 'InscriptionService'">{{ i18n("unregister") }}</option> | ||||
|         <option>{{ i18n("curriculumch") }}</option> | ||||
|       </select> | ||||
|       <span style="margin-left: 5%"> | ||||
|         Filter : | ||||
|         {{ i18n("filter") }} | ||||
|         <select v-model="filterType"> | ||||
|           <option>None</option> | ||||
|           <option>Pending</option> | ||||
| @ -76,70 +84,67 @@ | ||||
|       </span> | ||||
|     </div> | ||||
|     <div style='display:flex; justify-content:center; min-width:1140px;' v-for="item of requests"> | ||||
|       <div class="bodu" style="width: 95%" v-if="filterType == 'None' || filterType == item.state"> | ||||
|         <div class="container" style="grid-template-columns:11% 15% 20% 10% 10% 9% 9%;grid-template-areas:'date state equivalencestate surname firstname accept refuse infos';" v-if="requestType === 'inscription'"> | ||||
|           <!-- | ||||
|             The condition below avoids an error occuring because loadRequests() finishes after the vue refresh | ||||
|             then submissionDate is undefined an it triggers an error in the console despite the fact that it is working | ||||
|             properly at the end. | ||||
|            --> | ||||
|       <div class="bodu" style="width: 95%" v-if="(filterType == 'None' || filterType == item.state) && requestType !== i18n('exemption')"> | ||||
|         <div class="container" style="grid-template-columns:11% 15% 20% 10% 10% 9% 9%;grid-template-areas:'date state equivalencestate surname firstname accept refuse infos';" v-if="requestType === i18n('inscription')"> | ||||
|           <div class="date" v-if="item.submissionDate !== undefined">{{item.submissionDate.slice(0, 10)}}</div> | ||||
|           <div class="state" style="font-size: 80%">Approval : {{item.state}}</div> | ||||
|           <div class="equivalencestate" style="font-size: 80%">Teacher approval : {{item.equivalenceState}}</div> | ||||
|           <div class="state" style="font-size: 80%">{{ i18n("approval") }} {{item.state}}</div> | ||||
|           <div class="equivalencestate" style="font-size: 80%">{{ i18n("teacherapproval") }} {{item.equivalenceState}}</div> | ||||
|           <div class="surname">{{item.lastName}}</div> | ||||
|           <div class="firstname">{{item.firstName}}</div> | ||||
|           <div class="accept" v-if="item.state === 'Pending'"><button @click="windowsState=2;targetId=item.id;" style="background-color:rgb(0,105,50);">{{i18n("request.accept")}}</button></div> | ||||
|           <div class="refuse" v-if="item.state === 'Pending'"><button @click="upPage(item.id,'Refused')" style="background-color:rgb(105,0,0);">{{i18n("request.refuse")}}</button></div> | ||||
|           <div class="infos"><button style="background-color:rgb(105,05,105);" @click="targetId=item.id;windowsState=1;">{{i18n("request.moreInfos")}}</button></div> | ||||
|         </div> | ||||
|         <div class="container" style="grid-template-columns:25% 15% 15% 25% 14.2%;grid-template-areas:'date reqState studentfirstname studentlastname  infos';" v-if="requestType === 'scholarship'"> | ||||
|         <div class="container" style="grid-template-columns:25% 15% 15% 25% 14.2%;grid-template-areas:'date reqState studentfirstname studentlastname  infos';" v-if="requestType === i18n('scholarship')"> | ||||
|           <div class="date" v-if="item.date !== undefined"> {{item.date.slice(0,10)}}</div> | ||||
|           <div class="studentfirstname">{{item.user.firstName}}</div> | ||||
|           <div class="studentlastname">{{item.user.lastName}}</div> | ||||
|           <div class="reqState">{{item.state}}</div> | ||||
|           <div class="infos" @click="windowsState = 3; targetId=item.id;"><button>More infos</button></div> | ||||
|           <div class="infos" @click="windowsState = 3; targetId=item.id;"><button>{{ i18n("request.moreInfos") }}</button></div> | ||||
|         </div> | ||||
|         <div class="container" style="grid-template-columns:17% 15% 12% 15% 25%;grid-template-areas:'date reqState studentfirstname studentlastname course infos';"v-if="requestType === 'exemption'"> | ||||
|           <div class="date" v-if="item.date != undefined">{{item.date.slice(0,10)}}</div> | ||||
|           <div class="studentfirstname">{{item.user.firstName}}</div> | ||||
|           <div class="studentlastname">{{item.user.lastName}}</div> | ||||
|           <div class="course">{{item.course.title}}</div> | ||||
|           <div class="reqState">{{item.state}}</div> | ||||
|           <div class="infos"><button @click="windowsState=6;targetId=item.id">More infos</button></div> | ||||
|         </div> | ||||
|         <div class="container" v-if="requestType === 'unregister'" style="grid-template-columns:17% 15% 12% 15%;grid-template-areas:'date reqState regno studentfirstname studentlastname infos';"> | ||||
|         <div class="container" v-if="requestType === i18n('unregister')" style="grid-template-columns:17% 15% 12% 15%;grid-template-areas:'date reqState regno studentfirstname studentlastname infos';"> | ||||
|           <div class="date" v-if="item.date != undefined">{{item.date.slice(0,10)}}</div> | ||||
|           <div class="studentfirstname">{{item.firstName}}</div> | ||||
|           <div class="studentlastname">{{item.lastName}}</div> | ||||
|           <div class="regno">id : {{item.regNo}}</div> | ||||
|           <div class="reqState">{{item.state}}</div> | ||||
|           <div class="infos"><button @click="windowsState=4;targetId=item.id">More infos</button></div> | ||||
|           <div class="infos"><button @click="windowsState=4;targetId=item.id">{{ i18n("request.moreInfos") }}</button></div> | ||||
|         </div> | ||||
|         <div class="container" v-if="requestType === 'curriculum change'" style="grid-template-columns:17% 20% 15% 5%;grid-template-areas:'date reqState teacherApproval regno studentfirstname studentlastname infos';"> | ||||
|         <div class="container" v-if="requestType === i18n('curriculumch')" style="grid-template-columns:17% 20% 15% 5%;grid-template-areas:'date reqState teacherApproval regno studentfirstname studentlastname infos';"> | ||||
|           <div class="date" v-if="item.date != undefined">{{item.date.slice(0,10)}}</div> | ||||
|           <div class="studentfirstname">{{item.user.firstName}}</div> | ||||
|           <div class="studentlastname">{{item.user.lastName}}</div> | ||||
|           <div class="reqState">IS approval : {{item.state}}</div> | ||||
|           <div class="teacherApproval">Teacher approval : {{item.teacherApprovalState}}</div> | ||||
|           <div class="infos"><button @click="windowsState=5;targetId=item.id">More infos</button></div> | ||||
|           <div class="reqState">{{ i18n("approval")}}{{item.state}}</div> | ||||
|           <div class="teacherApproval">{{ i18n("teacherapproval") }} : {{item.teacherApprovalState}}</div> | ||||
|           <div class="infos"><button @click="windowsState=5;targetId=item.id">{{ i18n("request.moreInfos") }}</button></div> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="bodu" v-if="(filterType == 'None' || filterType == item.state) && requestType === i18n('exemption') && (item.course.owner.regNo === user.regNo || user.role === 'Admin')"> | ||||
|         <div class="container" style="grid-template-columns:17% 15% 12% 15% 25%;grid-template-areas:'date reqState studentfirstname studentlastname course infos';"> | ||||
|           <div class="date" v-if="item.date != undefined">{{item.date.slice(0,10)}}</div> | ||||
|           <div class="studentfirstname">{{item.user.firstName}}</div> | ||||
|           <div class="studentlastname">{{item.user.lastName}}</div> | ||||
|           <div class="course">{{item.course.title}}</div> | ||||
|           <div class="reqState">{{item.state}}</div> | ||||
|           <div class="infos"><button @click="windowsState=6;targetId=item.id">{{ i18n("request.moreInfos") }}</button></div> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
|   <div style='display:flex; justify-content:center; min-width:1140px;margin-top: 10%' v-if="windowsState === 2"> | ||||
|     <p>Etes vous sur de vouloir accepter cette demande ?</p> | ||||
|     <button style="background-color:rgb(105,05,105);" @click="upPage(targetId,'Accepted');windowsState=0;">Valider</button> | ||||
|     <button style="background-color:rgb(105,05,105);" @click="windowsState=0;">Retour</button> | ||||
|     <p>{{ i18n("surreq") }}</p> | ||||
|     <button style="background-color:rgb(105,05,105);" @click="upPage(targetId,'Accepted');windowsState=0;">{{ i18n("validate") }}</button> | ||||
|     <button style="background-color:rgb(105,05,105);" @click="windowsState=0;">{{ i18n("courses.back")}}</button> | ||||
|   </div> | ||||
|   <div v-if="windowsState === 3"> | ||||
|     <AboutScholarship :req-id="targetId"></AboutScholarship> | ||||
|     <div> | ||||
|       <button style="margin-left: 30%" @click="loadRequests();windowsState=0">Back</button> | ||||
|       <button style="margin-left: 31%; margin-top: 5%" @click="windowsState=0">{{ i18n("courses.back")}}</button> | ||||
|     </div> | ||||
|   </div> | ||||
|   <div v-if="windowsState === 4"> | ||||
|     <AboutUnregister :req-id="targetId"></AboutUnregister> | ||||
|     <button @click="windowsState=0">Back</button> | ||||
|     <button @click="windowsState=0" style="margin-left: 31%">{{ i18n("courses.back")}}</button> | ||||
|   </div> | ||||
|   <div v-if="windowsState === 5"> | ||||
|     <AboutChangeCurriculum :req-id="targetId" v-model:window-state="windowsState"></AboutChangeCurriculum> | ||||
| @ -233,12 +238,11 @@ | ||||
|   } | ||||
|  | ||||
|   button{ | ||||
|     font-size:15px; | ||||
|      height:50px; | ||||
|      width:100px; | ||||
|     border:none; | ||||
|     border-radius:20px; | ||||
|  | ||||
|     background-color:rgb(239, 60, 168); | ||||
|     border-radius:10px; | ||||
|     height: 35px; | ||||
|     margin-top:10px; | ||||
|   } | ||||
|  | ||||
|   .bodu { | ||||
|  | ||||
| @ -4,15 +4,16 @@ import {ref} from "vue"; | ||||
| import {getAllPayments} from "@/rest/requests.js"; | ||||
|  | ||||
| const paymentsList = await getAllPayments() | ||||
|  | ||||
| </script> | ||||
|  | ||||
| <template style="margin-top:5%;"> | ||||
|   <div style="display:flex; justify-content:center; " v-for="item in paymentsList"> | ||||
|     <div class="bodu"> | ||||
|       <div class="container"> | ||||
|         <div class="regNo"><a style="margin-left:30px">RegNo : {{item.studentRegNo}}</a></div> | ||||
|         <div class="regNo"><a style="margin-left:30px">{{ i18n("regNo") }} : {{item.studentRegNo}}</a></div> | ||||
|         <div class="client"><a>Client : {{item.client}}</a></div> | ||||
|         <div class="amount"><a>Amount : {{item.amount}}</a></div> | ||||
|         <div class="amount"><a>{{ i18n("amount")}} : {{item.amount}}€</a></div> | ||||
|         <div class="date" style="margin-left: 10%">{{item.date.slice(0,10)}}</div> | ||||
|       </div> | ||||
|     </div> | ||||
|  | ||||
| @ -1,14 +1,19 @@ | ||||
|  | ||||
| <!---------------------------------------------------- | ||||
| 	File:  LessonRequests.vue | ||||
| 	Author: William Karpinski | ||||
| 	Scope: Extension Horaire | ||||
| 	Description: Lesson Requests Management Page | ||||
| -----------------------------------------------------> | ||||
|  | ||||
| <script setup> | ||||
| import i18n from "@/i18n.js" | ||||
| import {ref} from 'vue' | ||||
| import {changeRequestState, getAllRequests} from "@/rest/LessonRequests.js"; | ||||
| import {getLesson} from "@/rest/lessonSchedule.js"; | ||||
| import {getCourse} from "@/rest/courses.js" | ||||
| import {formatDate, getHoursMinutes} from "@/scheduleFunctions.js"; | ||||
|  | ||||
| const requests = ref(await getAllRequests()); | ||||
|  | ||||
| const AcceptMod = ref(false); | ||||
| const moreInfosMod = ref(false); | ||||
| const requestTypes = ["Create", "Modify", "Delete"] | ||||
| @ -16,11 +21,21 @@ const editElementID = ref(''); | ||||
| const chosenLocal = ref(""); | ||||
| const locals = ["A0B1","A1B1","A2B1","A0B2"]; | ||||
| const moreInfos = ref({}); | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Change a request's state and refreshes the requests ' | ||||
|  */ | ||||
|  | ||||
| async function upPage(id,review){ | ||||
|   await changeRequestState(id, review) ; | ||||
|   requests.value = await getAllRequests(); | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * Set correctly the variables after clicking on the ACCEPT button | ||||
|  */ | ||||
|  | ||||
| async function AcceptSetup(id,type){ | ||||
|   if(type !== 2 ){ | ||||
|     editElementID.value = id | ||||
| @ -31,10 +46,9 @@ async function AcceptSetup(id,type){ | ||||
|   } | ||||
| } | ||||
|  | ||||
| function editItem(item){ | ||||
|   editElementID.value = item.id; | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * Set the infos to show when clicking MORE INFOS | ||||
|  */ | ||||
| async function setMoreInfos(item){ | ||||
|      | ||||
|     moreInfos.value = Object.assign({},{}) | ||||
| @ -64,17 +78,17 @@ async function setMoreInfos(item){ | ||||
| <template> | ||||
|  | ||||
|     <div  class="body"> | ||||
|     <div v-for="item of requests" :key="item.id" :style="{width:[moreInfosMod ? 95:70] + '%'}" class="centerer"> | ||||
|     <div v-for="item of requests" :key="item.id" :style="{width:[moreInfosMod ? 95:70] + '%'}" class="center"> | ||||
|  | ||||
|       <button v-if="moreInfosMod && editElementID == item.id" @click="moreInfosMod = false; editElementID = ''; moreInfos='';">back</button> | ||||
|       <button v-if="moreInfosMod && editElementID == item.id" @click="moreInfosMod = false; editElementID = ''; moreInfos='';">{{i18n("courses.back")}}</button> | ||||
|       <div v-if ="item.state === 'Pending'" class="listElement"> | ||||
|       <div class="containerElement" v-if="editElementID !== item.id"> | ||||
|           <div class="id">{{requestTypes[item.requestType]}}</div> | ||||
|           <div class="surname">{{item.state}}</div> | ||||
|           <div class="id">{{i18n(requestTypes[item.requestType].toString())}}</div> | ||||
|           <div class="surname">{{i18n(item.state.toString())}}</div> | ||||
|           <div class="firstname">{{item.user.lastName}}</div> | ||||
|            | ||||
|           <div class="infos"> | ||||
|             <button @click=" setMoreInfos(item); console.log(item);" style="background-color:rgb(105,05,105);" > | ||||
|             <button @click=" setMoreInfos(item);" style="background-color:rgb(105,05,105);" > | ||||
|               {{i18n("request.moreInfos")}} | ||||
|             </button></div> | ||||
|           <div class="accept"><button @click="AcceptSetup(item.id,item.requestType);" style="background-color:rgb(0,105,50);">{{i18n("request.accept")}}</button></div> | ||||
| @ -87,13 +101,13 @@ async function setMoreInfos(item){ | ||||
|             <select v-model="chosenLocal"> | ||||
|               <option v-for="item in locals">{{item}}</option> | ||||
|             </select> | ||||
|             <button @click="AcceptMod = false;upPage(item.id,{local: chosenLocal, state:'Accepted'})">Accept</button> | ||||
|             <button @click="AcceptMod = false;upPage(item.id,{local: chosenLocal, state:'Accepted'})">{{i18n("request.accept")}}</button> | ||||
|           </div> | ||||
|           <template  v-if="moreInfosMod" v-for="(key,value) in moreInfos"> | ||||
|  | ||||
|             <div class="container" v-if="key != null" style="align-self:center;"> | ||||
|               <div style="margin:0 auto 0 auto"> | ||||
|                 {{value}}: | ||||
|                 {{i18n(value.toString())}}: | ||||
|               {{key}} | ||||
|               </div> | ||||
|               </div> | ||||
| @ -105,7 +119,9 @@ async function setMoreInfos(item){ | ||||
| </template> | ||||
|  | ||||
| <style scoped> | ||||
| .centerer{ | ||||
|  | ||||
|  | ||||
| .center{ | ||||
|   margin:0 auto 0 auto; | ||||
| } | ||||
|  | ||||
| @ -193,33 +209,10 @@ button{ | ||||
|   width:100%; | ||||
|   margin-top:3.5%; | ||||
| } | ||||
| button:hover{ | ||||
|   opacity:0.8; | ||||
| } | ||||
|  | ||||
| .buttonGrid{ | ||||
|   display:grid; | ||||
|   grid-template-columns: auto auto; | ||||
|   column-gap:50px; | ||||
|   grid-template-areas: | ||||
|       "create delete"; | ||||
| }.listTitle{ | ||||
|    min-width:380px; | ||||
|    display: flex; | ||||
|    justify-content: center; | ||||
|    align-items: center; | ||||
|    width:25%; | ||||
|    margin-left:auto; | ||||
|    margin-right:auto; | ||||
|    border:2px solid black; | ||||
|    font-size:25px; | ||||
|    color:white; | ||||
|    padding:20px; | ||||
|    background-color:rgb(50,50,50); | ||||
|    border-radius:20px; | ||||
|    margin-bottom:10px; | ||||
|  | ||||
|    button:hover{ | ||||
|      opacity:0.8; | ||||
|    } | ||||
|  } | ||||
|  | ||||
| </style> | ||||
|  | ||||
|  | ||||
| @ -7,7 +7,6 @@ | ||||
|   import {toast} from 'vue3-toastify' | ||||
|   import 'vue3-toastify/dist/index.css'; | ||||
|   import {createExternalCurriculum} from "@/rest/externalCurriculum.js"; | ||||
|   import ManageCourses from "@/Apps/ManageCourses.vue"; | ||||
|   import ExternalCurriculumList from "@/Apps/Inscription/ExternalCurriculumList.vue"; | ||||
|  | ||||
|   const loginPage= ref(true) | ||||
| @ -25,18 +24,6 @@ | ||||
|     equivalenceState: "Unrequired" | ||||
|   }) | ||||
|  | ||||
|   const notcompletedCheck = ref(false); | ||||
|  | ||||
|   const externalCurr = reactive({ | ||||
|     inscriptionRequestId : null, | ||||
|     school:null, | ||||
|     formation :null, | ||||
|     completion : null, | ||||
|     startYear : null, | ||||
|     endYear: null, | ||||
|     justifdocUrl : null | ||||
|   }) | ||||
|  | ||||
|   //Stores some externalCurriculums in order to upload them all at the confirmation of the registration request | ||||
|   const externalCurrTab = ref([]); | ||||
|  | ||||
| @ -45,9 +32,6 @@ | ||||
|   | ||||
|   const imageSaved = ref(false) | ||||
|   let ppData = "" | ||||
|   let requiredCertif = false | ||||
|   //Contains the id of the newly created request (useful to link the student's formations informations to the request) | ||||
|   let requestId = "" | ||||
|  | ||||
|   const idcardfile = ref({}) | ||||
|   const justifcardfile = ref({}) | ||||
| @ -108,13 +92,13 @@ | ||||
|     const val = await register(outputs.firstname, outputs.surname, outputs.birthday, outputs.password, outputs.email, outputs.address, outputs.country, outputs.curriculum, ppData, identityCardFile.url, new Date(), outputs.equivalenceState, justif); | ||||
|  | ||||
|     for (let item in externalCurrTab.value){ | ||||
|       await createExternalCurriculum(val.id, externalCurrTab.value[item].school, externalCurrTab.value[item].formation, externalCurrTab.value[item].completion, externalCurrTab.value[item].startYear, externalCurrTab.value[item].endYear, externalCurrTab.value[item].justifdocUrl); | ||||
|       const temp = await uploadFile(externalCurrTab.value[item].justifdocUrl, "JustificationDocument") | ||||
|       await createExternalCurriculum(val.id, externalCurrTab.value[item].school, externalCurrTab.value[item].formation, externalCurrTab.value[item].completion, externalCurrTab.value[item].startYear, externalCurrTab.value[item].endYear, temp.url); | ||||
|     } | ||||
|   } | ||||
|  | ||||
| </script> | ||||
|  | ||||
|  | ||||
| <template> | ||||
|     <div class="setup" v-if="page !== 4"> | ||||
|       <div v-if="loginPage"> | ||||
| @ -135,7 +119,7 @@ | ||||
|               <a @click="loginPage=!loginPage">{{i18n("login.guest.register")}}</a> | ||||
|             </div> | ||||
|             <div class="inputBox" style="margin-bottom:35px;"> | ||||
|               <input type="submit" v-model="submitValue"> | ||||
|               <input v-model="submitValue" type="submit"> | ||||
|             </div> | ||||
|           </form> | ||||
|         </div> | ||||
| @ -193,11 +177,10 @@ | ||||
|               	<p>{{i18n("profile.picture").toUpperCase()}}</p> | ||||
|               </form> | ||||
|               <label class="browser"> | ||||
|                 Parcourir . . . | ||||
|                 {{i18n("login.guest.browse")}} | ||||
| 				        <input  type="file" :disabled="imageSaved" @change="ppData = uploadProfilePicture($event.target.files); imageSaved = true;" accept="image/*"> | ||||
|               </label> | ||||
|               <form novalidate enctype="multipart/form-data" class="inputBox"> | ||||
|               	<p>{{i18n("profile.picture").toUpperCase()}}</p> | ||||
| 				        <input type="file" @change="uploadPP($event.target.files); imageSaved = true;" accept="image/*"> | ||||
|               </form> | ||||
|               <div class="inputBox"> | ||||
| @ -207,8 +190,7 @@ | ||||
|                   </select> | ||||
|               </div> | ||||
|               <p style="color:rgb(239,60,168);"> | ||||
|                 Si vous êtes déja inscrits dans cette université veuillez vous connecter a votre compte et utilisez les fonctions | ||||
|                 changer de cursus/réinscription sinon continuez ici. | ||||
|                 {{i18n("login.guest.disclaimer")}} | ||||
|               </p> | ||||
|               <div style="align-self:center;" class="inputBox"> | ||||
|                 <button style="margin-top:25px;" @click="page++;"> | ||||
| @ -223,31 +205,30 @@ | ||||
|               </div> | ||||
|             </div> | ||||
|             <div v-if="page === 2"> | ||||
|               <p style="color:rgb(239,60,168);">Carte d'indentité :</p> | ||||
|               <p style="color:rgb(239,60,168);">{{i18n("login.guest.identityCard")}}</p> | ||||
|               <label class="browser"> | ||||
|                 Parcourir . . . | ||||
|                 {{i18n("login.guest.browse")}} | ||||
|                 <input  type="file" @change="idcardfile = $event.target.files"> | ||||
|               </label> | ||||
|               <div v-if="curricula[outputs.curriculum-1].requireCertificate === true" style="margin-top: 3%; margin-bottom: 4%"> | ||||
|                 <p style="color:rgb(239,60,168);">Ce cursus requiert une attestation de réussite d'un examen d'entrée</p> | ||||
|                 <p style="color:rgb(239,60,168);">{{ i18n("login.guest.attestationdisclaimer") }}</p> | ||||
|                 <div style="margin-top: 2%"> | ||||
|                   <p style="color:rgb(239,60,168);">Attestation:</p> | ||||
|                   <label class="browser"> | ||||
|                     Parcourir . . . | ||||
|                     {{i18n("login.guest.browse")}} | ||||
|                     <input  type="file" @change="justifcardfile = $event.target.files"> | ||||
|                   </label> | ||||
|                 </div> | ||||
|               </div> | ||||
|               <button @click="page++;">{{i18n("login.guest.nextpage")}}</button> | ||||
|               <button @click="page++;" style="margin-top: 10%">{{i18n("login.guest.nextpage")}}</button> | ||||
|  | ||||
|             </div> | ||||
|             <div v-if="page === 3"> | ||||
|               <p> | ||||
|                 Vous avez séléctionné un cursus qui possède des prérequis veuillez ajouter vos formations antérieures | ||||
|                 dans l'enseignement supérieur, votre dossier sera vérifié par un membre du service d'inscription. | ||||
|               <p style="color:rgb(239,60,168);margin-bottom: 5%"> | ||||
|                 {{i18n("login.guest.formationdisclaimer")}} | ||||
|               </p> | ||||
|               <button @click="page++">Gèrer mon parcours extérieur</button> | ||||
|               <button @click="postRegisterReq();">Envoyer la demande d'inscription</button> | ||||
|               <button @click="page++">{{i18n("login.guest.managecareer")}}</button> | ||||
|               <button @click="postRegisterReq();">{{ i18n("login.guest.sendRegReq") }}</button> | ||||
|             </div> | ||||
|           </form> | ||||
|          </div> | ||||
| @ -255,7 +236,7 @@ | ||||
|   </div> | ||||
|   <div v-if="page===4"> | ||||
|     <ExternalCurriculumList v-model="externalCurrTab" :mode="2"></ExternalCurriculumList> | ||||
|     <button style="margin-top: 2%;width: 5%; margin-left: 2%" @click="page--">Back</button> | ||||
|     <button style="margin-top: 2%;width: 5%; margin-left: 2%" @click="page--">{{i18n("courses.back")}}</button> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| @ -306,8 +287,6 @@ | ||||
|   z-index: 100; | ||||
|   font-family:sans-serif ;  | ||||
|   color:rgb(239,60,168); | ||||
|   transition: 0.5; | ||||
|  | ||||
| } | ||||
|  | ||||
| .register{ | ||||
| @ -335,8 +314,6 @@ | ||||
|   outline:none; | ||||
|   border-radius: 4px; | ||||
|   font-size:0.8em; | ||||
|   align-self: right; | ||||
|  | ||||
| } | ||||
|  | ||||
| input[type=submit],button,select{ | ||||
|  | ||||
| @ -1,7 +1,14 @@ | ||||
| <!---------------------------------------------------- | ||||
| 	File:  LessonRequests.vue | ||||
| 	Author: William Karpinski | ||||
| 	Scope: Extension Horaire | ||||
| 	Description: Lessons Management Page for the teachers | ||||
| -----------------------------------------------------> | ||||
|  | ||||
| <script setup> | ||||
| import { ref } from 'vue' | ||||
| import i18n from '@/i18n.js' | ||||
| import {formatDate,getHoursMinutes,sortByDate} from '../scheduleFunctions.js' | ||||
| import {formatDate,invertedFormatDate,getHoursMinutes,sortByDate, createLessonEvent} from '../scheduleFunctions.js' | ||||
| import {getOwnedLessons} from "@/rest/lessonSchedule.js"; | ||||
| import {getSelf} from "@/rest/Users.js"; | ||||
| import {createRequest} from "@/rest/LessonRequests.js" | ||||
| @ -21,6 +28,14 @@ const currentDate = new Date(); | ||||
| const types = ["TP","TD","Course","Exam"]; | ||||
| const colors = {"TP":"rgb(36,175,255)","TD":"rgb(255,36,175)","Exam":"rgb(175,255,36)","Course":"rgb(255,36,175)"} | ||||
| const courses = ref(); | ||||
|  | ||||
| const maxDate = ref(invertedFormatDate(new Date([currentDate.getMonth()<7 ? currentDate.getFullYear() : (currentDate.getFullYear())+1],7,31))); | ||||
|  | ||||
| const minDate = ref(invertedFormatDate((new Date()).setDate(currentDate.getDate()+1))) | ||||
|  | ||||
| /* | ||||
|  * Checks if a lesson is in the future or not | ||||
|  */ | ||||
| function inFuture(lesson){ | ||||
|   let toCompare = new Date(lesson.lessonStart); | ||||
|   let current = new Date(); | ||||
| @ -31,28 +46,6 @@ function inFuture(lesson){ | ||||
| async function setCourses(){ | ||||
|   courses.value = (await getcurriculum(curriculum.value.curriculumId)).courses | ||||
| } | ||||
| function invertedFormatDate(date) { | ||||
|   var d = new Date(date), | ||||
|       month = '' + (d.getMonth() + 1), | ||||
|       day = '' + d.getDate(), | ||||
|       year = d.getFullYear(); | ||||
|  | ||||
|   if (month.length < 2) | ||||
|     month = '0' + month; | ||||
|   if (day.length < 2) | ||||
|     day = '0' + day; | ||||
|  | ||||
|   return [year, month, day].join('-'); | ||||
| } | ||||
| function createLessonEvent(date,hour){ | ||||
|   const str = date.concat(' ',hour); | ||||
|   return new Date(str); | ||||
| } | ||||
|  | ||||
| const maxDate = ref(invertedFormatDate(new Date([currentDate.getMonth()<7 ? currentDate.getFullYear() : (currentDate.getFullYear())+1],7,31))); | ||||
|  | ||||
| const minDate = ref(invertedFormatDate((new Date()).setDate(currentDate.getDate()+1))) | ||||
|  | ||||
|  | ||||
| const pattern = { | ||||
|   "lessonId":null, | ||||
| @ -62,8 +55,6 @@ const pattern = { | ||||
|   "lessonEnd": null, | ||||
|   "lessonType": null, | ||||
| } | ||||
|  | ||||
|  | ||||
| const patternRequest ={ | ||||
|   "user": user.regNo, | ||||
|   "state": "Pending", | ||||
| @ -91,6 +82,9 @@ function setCreate(){ | ||||
|   createMod.value = !createMod.value; | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * Constructs a request and posts it | ||||
|  */ | ||||
| async function createLessonRequest(){ | ||||
|   if(requestType.value === 0 || requestType.value === 1){ | ||||
|     //modify | ||||
| @ -121,7 +115,12 @@ async function createLessonRequest(){ | ||||
|   editElementID.value = ''; | ||||
| } | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Creates a request of a certain type | ||||
|  * 0 = CREATE REQUEST | ||||
|  * 1 = MODIFY REQUEST | ||||
|  * 2 = DELETE REQUEST | ||||
|  */ | ||||
| async function askChanges(i){ | ||||
|   requestType.value= i; | ||||
|   await createLessonRequest() | ||||
| @ -135,33 +134,33 @@ async function askChanges(i){ | ||||
|     <div v-if="createMod"> | ||||
|     <form class="listElement" style="width:40%; margin:0 auto 0 auto;"> | ||||
|       <div style="margin-bottom:20px;"> | ||||
|         Schedule : | ||||
|         {{i18n("schedule")}} : | ||||
|         <select @change="setCourses()"v-model="curriculum"> | ||||
|           <option v-for="item in allSchedules" :value='item.curriculum'>{{item.curriculum.option}}</option> | ||||
|         </select> | ||||
|       </div> | ||||
|       <div style="margin-bottom:20px;"> | ||||
|         Lesson : | ||||
|         {{i18n("course")}}: | ||||
|         <select v-if="curriculum != null" v-model="toModify.course"> | ||||
|           <option v-for="item in courses" :value='item.courseId'>{{item.title}}</option> | ||||
|         </select> | ||||
|       </div> | ||||
|       <div style="margin-bottom:20px;"> | ||||
|         Day: | ||||
|         {{i18n("day")}}: | ||||
|         <input type="date" :min="minDate" :max="maxDate" v-model="toModify.day"> | ||||
|       </div> | ||||
|       <div style="margin-bottom:20px;"> | ||||
|         Start: | ||||
|         {{i18n("start")}}: | ||||
|         <input v-model="toModify.lessonStart" type="time" min="08:00" max="18:00" required /> | ||||
|       </div> | ||||
|       <div style="margin-bottom:20px;"> | ||||
|         End: | ||||
|         {{i18n("end")}}: | ||||
|         <input v-model="toModify.lessonEnd" type="time" min="10:00" max="20:00" required /> | ||||
|       </div> | ||||
|       <div style="margin-bottom:20px;"> | ||||
|         Type: | ||||
|         <select v-model="toModify.lessonType"> | ||||
|           <option v-for="item in types" :value='item'>{{item}}</option> | ||||
|           <option v-for="item in types" :value='item'>{{i18n(item)}}</option> | ||||
|         </select> | ||||
|       </div> | ||||
|  | ||||
| @ -174,11 +173,11 @@ async function askChanges(i){ | ||||
|  | ||||
|  | ||||
|      | ||||
|     <button v-if="!createMod" @click="setCreate()" style="display:flex; margin:0 auto 0 auto;">Ask Create Request</button> | ||||
|     <button v-if="!createMod" @click="setCreate()" style="display:flex; margin:0 auto 0 auto;">{{i18n("schedule.askCreate")}}</button> | ||||
|     <div v-if="!createMod"v-for="element in schedule" style="width:50%;margin-left:auto; margin-right:auto;" > | ||||
|       <div  v-if="editElementID !== element.lessonID" style ="padding:15px 15px 15px 15px;"> | ||||
|         <button  v-if="inFuture(element)" @click="editElementID = element.lessonID;setModify(element);"> | ||||
|           Ask Changes | ||||
|           {{i18n("schedule.askChanges")}} | ||||
|         </button> | ||||
|       </div> | ||||
|       <div v-else> | ||||
| @ -194,34 +193,34 @@ async function askChanges(i){ | ||||
|           <div>{{getHoursMinutes(element.lessonStart)}}-{{getHoursMinutes(element.lessonEnd)}} | ||||
|           </div> | ||||
|           <div>{{element.local}}</div> | ||||
|           <div>{{element.lessonType}}</div> | ||||
|           <div>{{i18n(element.lessonType)}}</div> | ||||
|         </div> | ||||
|  | ||||
|         <div v-else> | ||||
|           <div>{{element.course.title}}</div> | ||||
|           <div style="margin-bottom:20px;"> | ||||
|             Day: | ||||
|             {{i18n("day")}}: | ||||
|             <input type="date" :min="minDate" :max="maxDate" v-model="toModify.day"> | ||||
|           </div> | ||||
|           <div style="margin-bottom:20px;"> | ||||
|             Start: | ||||
|             {{i18n("start")}}: | ||||
|             <input v-model="toModify.lessonStart" type="time" min="8:00" max="20:00"/> | ||||
|           </div> | ||||
|           <div style="margin-bottom:20px;"> | ||||
|             End: | ||||
|             {{i18n("end")}}: | ||||
|             <input v-model="toModify.lessonEnd" type="time" min="10:00" max="20:00" required /> | ||||
|           </div> | ||||
|           <div style="margin-bottom:20px;"> | ||||
|             Type: | ||||
|             {{i18n("Type")}}: | ||||
|             <select v-model="toModify.lessonType"> | ||||
|               <option v-for="item in types" :value='item'>{{item}}</option> | ||||
|               <option v-for="item in types" :value='item'>{{i18n(item)}}</option> | ||||
|             </select> | ||||
|           </div> | ||||
|           <div style="margin-bottom:20px;"> | ||||
|             Local: | ||||
|             {{element.local}} | ||||
|             <div  style="float:right;"> | ||||
|               <button @click="askChanges(2)" class="delete"> ask Deletion </button> | ||||
|               <button @click="askChanges(2)" class="delete"> {{i18n("schedule.askDeletion")}} </button> | ||||
|             </div> | ||||
|  | ||||
|           </div> | ||||
| @ -260,7 +259,7 @@ input, select{ | ||||
| } | ||||
| button{ | ||||
|   font-size:15px; | ||||
|   height:50px; | ||||
|   height:auto; | ||||
|   width:100px; | ||||
|   border:none; | ||||
|   border-radius:20px; | ||||
|  | ||||
| @ -1,11 +1,20 @@ | ||||
|  | ||||
| <!---------------------------------------------------- | ||||
| 	File:  LessonRequests.vue | ||||
| 	Author: William Karpinski | ||||
| 	Scope: Extension Horaire | ||||
| 	Description: Lessons Management Page for the secretary | ||||
| -----------------------------------------------------> | ||||
|  | ||||
| <script setup> | ||||
|  | ||||
| import { ref } from 'vue' | ||||
| import i18n from '@/i18n.js' | ||||
|   import {formatDate,getHoursMinutes} from '../scheduleFunctions.js' | ||||
|   import {getAllSchedule, deleteLessonFromSchedule ,getSchedule, getCurriculumSchedule,addLessonToSchedule} from "@/rest/scheduleRest.js"; | ||||
|   import {getLessons , createLesson, alterLesson , deleteLesson} from "@/rest/lessonSchedule.js" | ||||
|   import {getTeachers} from "@/rest/Users.js" | ||||
|   import { getcurriculum} from "@/rest/curriculum.js" | ||||
| import {formatDate,getHoursMinutes, invertedFormatDate, createLessonEvent} from '../scheduleFunctions.js' | ||||
| import {getAllSchedule, deleteLessonFromSchedule ,getSchedule, createSchedule} from "@/rest/scheduleRest.js"; | ||||
| import {getLessons, createLesson, alterLesson, deleteLesson} from "@/rest/lessonSchedule.js" | ||||
| import {getTeachers} from "@/rest/Users.js" | ||||
| import {getcurriculum, getAllCurriculums} from "@/rest/curriculum.js" | ||||
|  | ||||
|   const trueSchedule = ref() | ||||
|   const schedule = ref(); | ||||
| @ -18,41 +27,22 @@ import i18n from '@/i18n.js' | ||||
|   const types = ["TP","TD","Course","Exam"]; | ||||
|   const locals = ["A0B1","A1B1","A2B1","A0B2"] | ||||
|   const teachers = await getTeachers() ; | ||||
|   const allCurriculum = ref(); | ||||
|   const courses = ref(); | ||||
|    | ||||
|  | ||||
|   const createScheduleMod = ref(false); | ||||
|   const createMod = ref(false); | ||||
|   const deleteMod = ref(false); | ||||
|  | ||||
| const colors = {"TP":"rgb(36,175,255)","TD":"rgb(255,36,175)","Exam":"rgb(175,255,36)","Course":"rgb(255,36,175)"} | ||||
| const currentDate = new Date(); | ||||
|  | ||||
| const editElementID = ref() | ||||
|  | ||||
|  | ||||
| function invertedFormatDate(date) { | ||||
|     var d = new Date(date), | ||||
|         month = '' + (d.getMonth() + 1), | ||||
|         day = '' + d.getDate(), | ||||
|         year = d.getFullYear(); | ||||
|  | ||||
|     if (month.length < 2)  | ||||
|         month = '0' + month; | ||||
|     if (day.length < 2)  | ||||
|         day = '0' + day; | ||||
|  | ||||
|     return [year, month, day].join('-'); | ||||
|   } | ||||
| const editElementID = ref(); | ||||
|  | ||||
| const maxDate = ref(invertedFormatDate(new Date([currentDate.getMonth()<7 ? currentDate.getFullYear() : (currentDate.getFullYear())+1],7,31))); | ||||
|  | ||||
| const minDate = ref(invertedFormatDate((new Date()).setDate(currentDate.getDate()+1))) | ||||
|  | ||||
| function createLessonEvent(date,hour){ | ||||
|     const str = date.concat(' ',hour); | ||||
|     return new Date(str); | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
|   const pattern = { | ||||
|     "course": null, | ||||
| @ -80,7 +70,34 @@ function createLessonEvent(date,hour){ | ||||
|     "local":null, | ||||
|     "lessonType":null, | ||||
|   } | ||||
|    | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Sets up allCurriculum to contain only the curriculums that don't have any schedule | ||||
|  */ | ||||
| async function setCurriculum(){ | ||||
|   const temp = await getAllCurriculums(); | ||||
|   let isIn = false; | ||||
|   let toReturn =[] ; | ||||
|   for (let element in temp){ | ||||
|     for (let item in allSchedules.value){ | ||||
|       console.log(allSchedules.value[item]) | ||||
|       console.log(temp[element]) | ||||
|       if((allSchedules.value[item].curriculum.option == temp[element].option) && (allSchedules.value[item].curriculum.year == temp[element].year)){ | ||||
|  | ||||
|             isIn = true; | ||||
|             break; | ||||
|       } | ||||
|     } | ||||
|     if(!isIn){ | ||||
|       toReturn.push(temp[element]) | ||||
|     } | ||||
|     isIn = false; | ||||
|   } | ||||
|   allCurriculum.value = toReturn.slice(); | ||||
| } | ||||
|  | ||||
|  | ||||
| const toModify = ref(Object.assign({}, pattern)); | ||||
|   const lessonBuffer = ref(Object.assign({}, pattern)); | ||||
|   const lessonCreatorBuffer = ref(Object.assign({},lessonCreator)); | ||||
| @ -104,6 +121,9 @@ async function setCourses(){ | ||||
|   courses.value = (await getcurriculum(curriculum.value.curriculumId)).courses | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * Sort the lessons via a criteria | ||||
|  */ | ||||
|   function sortSchedule(){ | ||||
|     schedule.value =trueSchedule.value.lessons; | ||||
|     if(filter.value =="Teacher"){ | ||||
| @ -157,7 +177,9 @@ async function setCourses(){ | ||||
|     return matrix | ||||
|   } | ||||
|  | ||||
|      | ||||
|   /* | ||||
|    * Change the schedule filter | ||||
|    */ | ||||
|   async function changeSchedule(){ | ||||
|       schedule.value =trueSchedule.value.lessons; | ||||
|       curriculum.value = trueSchedule.value.curriculum; | ||||
| @ -203,6 +225,10 @@ async function setCourses(){ | ||||
|  | ||||
|   } | ||||
|  | ||||
|   /* | ||||
|     * Modify a lesson | ||||
|    */ | ||||
|  | ||||
| async function patchLesson(lesson){ | ||||
|    | ||||
|   for (let element in toModify.value){ | ||||
| @ -246,44 +272,53 @@ async function patchLesson(lesson){ | ||||
|       editElementID.value= ''; | ||||
|  | ||||
| } | ||||
| /* | ||||
|  * Create a new Schedule | ||||
|  */ | ||||
|   async function newSchedule(){ | ||||
|     await createSchedule(curriculum.value); | ||||
|     allSchedules.value = await getAllSchedule(); | ||||
|     setCurriculum(); | ||||
|   } | ||||
|  | ||||
|  | ||||
| </script> | ||||
| <template> | ||||
|   <div class="body"> | ||||
|     <div class="listTitle buttonGrid"v-if="!createMod" > | ||||
|       <button class="create" @click="createMod = true;">Create</button> | ||||
|       <button class="delete" @click="deleteMod = !deleteMod;">{{!deleteMod ? "Delete" : "Remove Delete"}}</button> | ||||
|     <div class="listTitle buttonGrid"v-if="!createMod && !createScheduleMod" > | ||||
|       <button class="create" @click="setCurriculum();createScheduleMod = true"> {{i18n("schedule.createSchedule")}}</button> | ||||
|       <button class="create" @click="createMod = true;">{{i18n("schedule.createLesson")}}</button> | ||||
|       <button class="delete" @click="deleteMod = !deleteMod;">{{!deleteMod ? i18n("schedule.deleteMod") : i18n("schedule.noDeleteMod")}}</button> | ||||
|  | ||||
|     </div> | ||||
|     <div v-if="createMod"> | ||||
|       <form class="listElement" style="width:40%; margin:0 auto 0 auto;"> | ||||
|         <div style="margin-bottom:20px;"> | ||||
|          Schedule :  | ||||
|          {{i18n("schedule")}} : | ||||
|           <select @change="setCourses()"v-model="curriculum"> | ||||
|             <option v-for="item in allSchedules" :value='item.curriculum'>{{item.curriculum.option}}</option> | ||||
|             <option v-for="item in allSchedules" :value='item.curriculum'>{{item.curriculum.option}} - {{item.curriculum.year}}</option> | ||||
|           </select> | ||||
|         </div> | ||||
|         <div style="margin-bottom:20px;"> | ||||
|           Lesson :  | ||||
|           {{i18n("Course")}} : | ||||
|          <select v-if="curriculum != null" v-model="lessonBuffer.course"> | ||||
|             <option v-for="item in courses" :value='item'>{{item.title}}</option> | ||||
|           </select> | ||||
|         </div> | ||||
|         <div style="margin-bottom:20px;"> | ||||
|           Day: | ||||
|           {{i18n("day")}}: | ||||
|           <input type="date" :min="minDate" :max="maxDate" v-model="lessonBuffer.day"> | ||||
|         </div> | ||||
|         <div style="margin-bottom:20px;"> | ||||
|           Start:  | ||||
|           {{i18n("start")}}: | ||||
|           <input v-model="lessonBuffer.lessonStart" type="time" min="08:00" max="18:00" required /> | ||||
|         </div> | ||||
|         <div style="margin-bottom:20px;"> | ||||
|           End:  | ||||
|           {{i18n("end")}}: | ||||
|           <input v-model="lessonBuffer.lessonEnd" type="time" min="10:00" max="20:00" required /> | ||||
|         </div> | ||||
|         <div style="margin-bottom:20px;"> | ||||
|           Type:  | ||||
|           Type: | ||||
|           <select v-model="lessonBuffer.lessonType"> | ||||
|            <option v-for="item in types" :value='item'>{{item}}</option> | ||||
|           </select> | ||||
| @ -293,27 +328,35 @@ async function patchLesson(lesson){ | ||||
|           <select v-model="lessonBuffer.local"> | ||||
|            <option v-for="item in locals" :value='item'>{{item}}</option> | ||||
|           </select> | ||||
|  | ||||
|  | ||||
|         </div> | ||||
|         <div></div> | ||||
|  | ||||
|  | ||||
|  | ||||
|       <button class="create" @click="createMod=!createMod; newLesson();"> {{i18n("courses.confirm")}} </button> | ||||
|       <button style="float:right;" @click="createMod=!createMod">{{i18n("courses.back")}}</button> | ||||
|       </form> | ||||
|     </div> | ||||
|  | ||||
|         <div v-if="createScheduleMod"> | ||||
|         <form class="listElement" style="width:40%; margin:0 auto 0 auto;"> | ||||
|           <div style="margin-bottom:20px;"> | ||||
|             {{i18n("schedule")}} : | ||||
|             <select v-model="curriculum"> | ||||
|               <option v-for="item in allCurriculum" :value='item'>{{item.option}} - {{item.year}}</option> | ||||
|             </select> | ||||
|           </div> | ||||
|           <button class="create" @click="createScheduleMod=!createScheduleMod ;newSchedule();"> {{i18n("courses.confirm")}} </button> | ||||
|           <button style="float:right;" @click="createScheduleMod=!createScheduleMod;">{{i18n("courses.back")}}</button> | ||||
|         </form> | ||||
|       </div> | ||||
|  | ||||
|  | ||||
|     <div v-if="!createMod"> | ||||
|  | ||||
|     <div v-if="!createMod && !createScheduleMod"> | ||||
|       <select @change="changeSchedule()" v-model="trueSchedule"> | ||||
|         <option v-for="item in allSchedules" :value='item'>{{item.curriculum.option}}</option> | ||||
|         <option v-for="item in allSchedules" :value='item'>{{item.curriculum.option}} - {{item.curriculum.year}}</option> | ||||
|       </select> | ||||
|       <select v-if="schedule != null" @change="subFilter = 'null'" v-model="filter"> | ||||
|         <option :value ="null">No Filter</option> | ||||
|         <option v-for="item in filters" :value="item">{{item}}</option> | ||||
|         <option v-for="item in filters" :value="item">{{i18n(item.toString())}}</option> | ||||
|       </select> | ||||
|       <select @change="sortSchedule()" v-if="filter == 'Teacher'" v-model="subFilter"> | ||||
|         <option :value ="null">No Filter</option> | ||||
| @ -329,7 +372,7 @@ async function patchLesson(lesson){ | ||||
|       </select> | ||||
|  | ||||
|     </div> | ||||
|     <div v-if="!createMod " :key="element.lessonID" v-for="element in schedule" style="width:50%;margin-left:auto; margin-right:auto;" > | ||||
|     <div v-if="!createMod && !createScheduleMod" :key="element.lessonID" v-for="element in schedule" style="width:50%;margin-left:auto; margin-right:auto;" > | ||||
|         <div  v-if="editElementID !== element.lessonID" style ="padding:15px 15px 15px 15px;"> | ||||
|         <button  v-if="inFuture(element)" @click="editElementID = element.lessonID;setModify(element);"> | ||||
|         {{i18n("courses.modify")}} | ||||
| @ -385,8 +428,6 @@ async function patchLesson(lesson){ | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
|  | ||||
|  | ||||
| </template> | ||||
| <style scoped> | ||||
| .body { | ||||
|  | ||||
| @ -197,8 +197,8 @@ | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
|   <div class="body" v-if="windowState !== 12"> | ||||
|   <div class="container" v-if="windowState!==4"> | ||||
|   <div class="body" v-if="windowState !== 12 && windowState!==4"> | ||||
|   <div class="container"> | ||||
|     <div class="profilPic" v-if="windowState===0"> | ||||
|       <img class="subContainter" :src=getPP()> | ||||
|     </div> | ||||
| @ -208,93 +208,100 @@ | ||||
|             {{user.firstName}} {{user.lastName}}    | ||||
|           </div> | ||||
|           <div> | ||||
|             E-mail: {{user.email}}       | ||||
|             {{ i18n("login.guest.email") }}: {{user.email}} | ||||
|           </div> | ||||
|           <div v-if="user.role==='Student'"> | ||||
|             {{user.option}} {{i18n(user.role)}}  | ||||
|             {{ i18n("regNo") }} :  {{user.regNo}} | ||||
|           </div> | ||||
|           <div v-else> | ||||
|             Role:  {{i18n((user.role))}}  | ||||
|             {{ i18n("role") }}:  {{i18n((user.role))}} | ||||
|           </div> | ||||
|           <div> | ||||
|             <button @click="windowState=1; setModify(user)"> {{i18n("profile.modify.data")}} </button> | ||||
|           </div> | ||||
|           <div v-if="(user.role==='Student')"> | ||||
|             <button @click="windowState=3">{{i18n("profile.reRegister")}}</button> | ||||
|             <button @click="windowState=9" style="float:right;background-color:rgb(150,0,0);">{{i18n("profile.unRegister")}}</button> | ||||
|           </div> | ||||
|           <div v-if="(user.role==='Student')"> | ||||
|             <button @click="windowState=2">{{i18n("profile.change.curriculum")}}</button> | ||||
|             <button @click="windowState=12;refreshExtCurrList() ">Manage external curriculums</button> | ||||
|             <button @click="windowState=12;refreshExtCurrList();" style="margin-left: 2%">{{ i18n("manageextcur") }}</button> | ||||
|           </div> | ||||
|           <div v-if="(user.role==='Student')"> | ||||
|             <button @click="windowState=4">Manage Courses</button> | ||||
|             <button @click="windowState=5" style="margin-left: 2%">Manage minerval</button> | ||||
|             <button @click="windowState=4">{{ i18n("managecourse") }}</button> | ||||
|             <button @click="windowState=5" style="margin-left: 2%">{{ i18n("manageminerval") }}</button> | ||||
|           </div> | ||||
|         </div> | ||||
|         <div v-else-if="windowState === 9" class="infosContainer"> | ||||
|             <div v-if="sure !== 2">Please enter the reason you leave</div> | ||||
|             <div v-if="sure !== 2">{{ i18n("enterreason") }}</div> | ||||
|             <textarea v-if="sure !== 2" v-model="uninscriptionData.reason"></textarea> | ||||
|             <div v-if="sure !== 2"> | ||||
|             I only want to unregister from a specific cursus | ||||
|               {{i18n("onlycursus")}} | ||||
|             <input type="checkbox" v-model="isChecked"> | ||||
|             </div> | ||||
|             <div v-if="sure !== 2 && isChecked"> | ||||
|               Please select that cursus | ||||
|               {{ i18n("plsselectcurs") }} | ||||
|               <select v-model="uninscriptionData.curriculumId"> | ||||
|                 <option v-for="item in getActualCurriculumList()" :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option> | ||||
|               </select> | ||||
|             </div> | ||||
|             <div v-if="sure !== 2"> | ||||
|               <button @click="sure++">Submit</button> | ||||
|               <button @click="sure++">{{ i18n("login.guest.submit") }}</button> | ||||
|             </div> | ||||
|             <div v-if="sure==1"> | ||||
|               Are you sure that you want to unregister ? | ||||
|               <button @click="addUninscReq(uninscriptionData.userId, uninscriptionData.reason, uninscriptionData.curriculumId);sure++">Yes</button> | ||||
|               <button @click="sure=0">No</button> | ||||
|               {{ i18n("sureunreg") }} | ||||
|               <button @click="addUninscReq(uninscriptionData.userId, uninscriptionData.reason, uninscriptionData.curriculumId);sure++">{{i18n("yes")}}</button> | ||||
|               <button @click="sure=0">{{ i18n("no") }}</button> | ||||
|             </div> | ||||
|             <p v-if="sure==2">You request has been send !</p> | ||||
|             <p v-if="sure==2">{{ i18n("reqsend") }}</p> | ||||
|         </div> | ||||
|         <div v-if="windowState === 9"> | ||||
|           <button @click="windowState=0">{{i18n("courses.back")}}</button> | ||||
|         </div> | ||||
|         <div v-else-if="windowState === 5" class="infosContainer"> | ||||
|           <div v-if="minerv.value.toPay !== 0"> | ||||
|             Payment : {{minerv.value.toPay}}€ left to pay | ||||
|             {{ i18n("payment") }} : {{minerv.value.toPay}}€ {{ i18n("lefttopay") }} | ||||
|             <div v-if="minerv.value.paidAmount <= 50"> | ||||
|               <button @click="windowState=6; paymentAmount = 50">Pay deposit (50€)</button> | ||||
|               <button @click="windowState=6; paymentAmount = 50">{{ i18n("paydeposit") }} (50€)</button> | ||||
|             </div> | ||||
|             <div> | ||||
|               <button @click="windowState=6; paymentAmount = minerv.value.toPay">Pay all the rest ({{minerv.value.toPay}}€)</button> | ||||
|               <button @click="windowState=6; paymentAmount = minerv.value.toPay">{{ i18n("payrest") }} ({{minerv.value.toPay}}€)</button> | ||||
|             </div> | ||||
|           </div> | ||||
|           <div v-else> | ||||
|             Payment : School fees have already been paid this year | ||||
|             {{ i18n("alreadypaid") }} | ||||
|           </div> | ||||
|           <div> | ||||
|             <button @click="windowState=7">Ask for a scholarship</button> | ||||
|             <button @click="windowState=7">{{ i18n("askscholarship") }}</button> | ||||
|           </div> | ||||
|         </div> | ||||
|         <div v-if="windowState === 5"> | ||||
|           <button @click="windowState=0">{{ i18n("courses.back") }}</button> | ||||
|         </div> | ||||
|         <div v-else-if="windowState === 7" class="infosContainer"> | ||||
|           <p>Please upload the required documents</p> | ||||
|           <p>{{i18n("uploaddocs")}}</p> | ||||
|           <div> | ||||
|             Tax justification document : | ||||
|             {{ i18n("taxjustdoc") }} | ||||
|             <input type="file" @change="scholarshipData.taxDocUrl = $event.target.files"> | ||||
|           </div> | ||||
|           <div> | ||||
|             Residency justification document : | ||||
|             {{i18n("residencydoc")}} | ||||
|             <input type="file" style="margin-top:2%" @change="scholarshipData.residencyDocUrl = $event.target.files"> | ||||
|           </div> | ||||
|           <button style="margin-top: 5%" @click="windowState=8;postScholarshipRequest(scholarshipData.taxDocUrl, 'JustificationDocument',scholarshipData.residencyDocUrl, 'JustificationDocument');">Submit scholarship request</button> | ||||
|           <button style="margin-top: 5%" @click="windowState=8;postScholarshipRequest(scholarshipData.taxDocUrl, 'JustificationDocument',scholarshipData.residencyDocUrl, 'JustificationDocument');">{{i18n("login.guest.submit")}}</button> | ||||
|         </div> | ||||
|         <div v-if="windowState === 7"> | ||||
|           <button @click="windowState = 5">{{ i18n("courses.back") }}</button> | ||||
|         </div> | ||||
|         <div v-else-if="windowState === 8" class="infosContainer"> | ||||
|           <div> | ||||
|             Your request has been sent to the inscription service you will get notified when | ||||
|             the request is reviewed. | ||||
|             {{i18n("reqsent")}} | ||||
|           </div> | ||||
|           <button @click="windowState = 0"> | ||||
|             Go back to profile | ||||
|             {{ i18n("backprofile") }} | ||||
|           </button> | ||||
|         </div> | ||||
|         <div v-else-if="windowState === 6" class="infosContainer"> | ||||
|           Proceed to payment of {{paymentAmount}}€ | ||||
|           {{ i18n("procpayment") }} {{paymentAmount}}€ | ||||
|           <div style="margin-top: 1%"> | ||||
|             Client: | ||||
|             <input type="text" v-model="paymentData.client"> | ||||
| @ -308,10 +315,10 @@ | ||||
|             <input type="date" v-model="paymentData.expDate"> | ||||
|           </div> | ||||
|           <div style="margin-top: 1%"> | ||||
|             <button @click="windowState=5;paymentData.amount=paymentAmount;paymentData.date=new Date();postPayment(paymentData);minerv.value.toPay -= paymentAmount; minerv.value.paidAmount += paymentAmount; editMinerval(minerv.value)">Process Payment</button> | ||||
|             <button @click="windowState=5;paymentData.amount=paymentAmount;paymentData.date=new Date();postPayment(paymentData);minerv.value.toPay -= paymentAmount; minerv.value.paidAmount += paymentAmount; editMinerval(minerv.value)">{{i18n("procpaybutton")}}</button> | ||||
|           </div> | ||||
|           <div> | ||||
|             <button @click="windowState = 5">Back</button> | ||||
|             <button @click="windowState = 5">{{ i18n("courses.back") }}</button> | ||||
|           </div> | ||||
|         </div> | ||||
|         <div v-else-if="windowState === 1" class="infosContainer"> | ||||
| @ -320,7 +327,7 @@ | ||||
|             <input type="file" @change="user.profilPicture = uploadProfilePicture($event.target.files);" accept="image/*"> | ||||
|           </div> | ||||
|           <div> | ||||
|             E-mail:   | ||||
|             {{ i18n("login.guest.email")}} | ||||
|             <input type="email" v-model="toModify.email" /> | ||||
|           </div> | ||||
|           <div> | ||||
| @ -342,11 +349,11 @@ | ||||
|         </div> | ||||
|         <div v-else-if="windowState === 2" class="infosContainer"> | ||||
|           <div> | ||||
|             I would like to : | ||||
|             {{ i18n("iwouldlike") }} | ||||
|             <select v-model="reRegState"> | ||||
|               <option :value="1">Reregister in the next year of one of my cursus</option> | ||||
|               <option :value="2">Register for a supplementary cursus</option> | ||||
|               <option :value="3">Change from a cursus to another</option> | ||||
|               <option :value="1">{{ i18n("rereg") }}</option> | ||||
|               <option :value="2">{{ i18n("reregsup") }}</option> | ||||
|               <option :value="3">{{ i18n("chcur") }}</option> | ||||
|             </select> | ||||
|           </div> | ||||
|           <div style="height:40px;" v-if="reRegState === 3"> | ||||
| @ -354,90 +361,66 @@ | ||||
|             <select v-model="changecurrdata.actualcursus" style="margin-right: 3%"> | ||||
|               <option v-for="item in getActualCurriculumList()" style="font-size:20px;" :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option> | ||||
|             </select> | ||||
|             New Curriculum : | ||||
|             {{ i18n("newcurr") }} : | ||||
|             <select v-model="changecurrdata.newcursus"> | ||||
|               <option v-for="item in curricula"  :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option> | ||||
|             </select> | ||||
|           </div> | ||||
|           <div style="height:40px;" v-if="reRegState === 2"> | ||||
|             New Curriculum : | ||||
|             {{ i18n("newcurr") }} : | ||||
|             <select v-model="changecurrdata.newcursus"> | ||||
|               <option v-for="item in curricula"  :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option> | ||||
|             </select> | ||||
|           </div> | ||||
|           <div style="height:40px;" v-if="reRegState === 1"> | ||||
|             New Curriculum : | ||||
|             {{ i18n("newcurr") }} : | ||||
|             <select v-model="changecurrdata.newcursus" @change="getActualCurr(changecurrdata.newcursus);"> | ||||
|               <option v-for="item in getCurriculumsNextYear()" :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option> | ||||
|             </select> | ||||
|           </div> | ||||
|           <div v-if="curricula[changecurrdata.newcursus-1].year > 1 && reRegState !== 1"> | ||||
|             The cursus you selected has some prerequisites | ||||
|             {{i18n("cursusprereq")}} | ||||
|           </div> | ||||
|           <div> | ||||
|             <button @click=" windowState = 0;postChangeCurrReq(changecurrdata);changecurrdata.actualcursus=null;changecurrdata.newcursus=1">{{i18n("courses.confirm")}}</button> | ||||
|             <button @click="windowState = 0; resetInputs(personnalInfos,patternInfos);" style="float:right;">{{i18n("courses.back")}}</button> | ||||
|           </div> | ||||
|         </div> | ||||
|         <div v-else-if="windowState === 3" class="infosContainer"> | ||||
|           <div> | ||||
|             E-mail:   | ||||
|             <input type="email" v-model="toModify.email" /> | ||||
|           </div> | ||||
|           <div> | ||||
|             ID : | ||||
|             <input type="text" v-model="toModify.id"> | ||||
|           </div> | ||||
|           <div> | ||||
|             {{i18n("login.password")}}: | ||||
|             <input type="password" v-model="toModify.password"> | ||||
|           </div> | ||||
|           <div> | ||||
|             {{i18n("login.cPassword")}}: | ||||
|             <input type="password" id="confirm"> | ||||
|           </div> | ||||
|  | ||||
|           <div> | ||||
|             <button @click=" windowState=0;">{{i18n("courses.confirm")}}</button> | ||||
|             <button @click=" windowState=0; resetInputs(personnalInfos,patternInfos);" style="float:right;">{{i18n("courses.back")}}</button> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div v-if="windowState === 0" class="moreInfos"> | ||||
|         <div class = "oldcursus"> | ||||
|             <div class="listTitle"> | ||||
|               Anciens Cursus | ||||
|               {{ i18n("oldcursus") }} | ||||
|             </div> | ||||
|             <div  class="listElement"> | ||||
|               <div class=" containerElement" v-for="item in UserCurriculum.curriculumList"> | ||||
|                 <div class="year" v-if="item.actual === false">Bac {{item.year}}</div> | ||||
|                 <div class="option" v-if="item.actual === false">{{item.option}}</div> | ||||
|                 <div class="dateyear" v-if="item.actual === false">Année {{item.dateyear}}-{{item.dateyear+1}}</div> | ||||
|                 <div class="dateyear" v-if="item.actual === false">{{ i18n("year") }} {{item.dateyear}}-{{item.dateyear+1}}</div> | ||||
|               </div> | ||||
|             </div> | ||||
|           </div> | ||||
|           <div class="actualcursus"> | ||||
|             <div class="listTitle"> | ||||
|               Cursus Actuel | ||||
|               {{ i18n("newcurr") }} | ||||
|             </div> | ||||
|             <div  class="listElement"> | ||||
|               <div class=" containerElement" v-for="item in UserCurriculum.curriculumList" > | ||||
|                 <div class="year" v-if="item.actual === true">Bac {{item.year}}</div> | ||||
|                 <div class="option" v-if="item.actual === true">{{item.option}}</div> | ||||
|                 <div class="dateyear" v-if="item.actual === true">Année {{item.dateyear}}-{{item.dateyear+1}}</div> | ||||
|                 <div class="dateyear" v-if="item.actual === true">{{ i18n("year") }} {{item.dateyear}}-{{item.dateyear+1}}</div> | ||||
|               </div> | ||||
|             </div> | ||||
|           </div> | ||||
|       </div> | ||||
|   </div> | ||||
|     <div v-if="windowState===4" style="width: 80%"> | ||||
|       <CourseList :cursuslist="getActualCurriculumList()"/> | ||||
|       <button style="width: 10%; margin-top: 5%" @click="windowState = 0">Return to profile</button> | ||||
|     </div> | ||||
| </div> | ||||
|   <div v-if="windowState===4" style="width: 80%; margin-top: 3%; margin-left: 10%"> | ||||
|     <CourseList :cursuslist="getActualCurriculumList()" v-model:window-state="windowState"/> | ||||
|   </div> | ||||
|   <div v-if="windowState === 12"> | ||||
|     <ExternalCurriculumList :ext-curr-list="extcurrlist" :mode="1"></ExternalCurriculumList> | ||||
|     <button @click="windowState = 0;refreshExtCurrList()">Back to profile</button> | ||||
|     <button @click="windowState = 0;refreshExtCurrList()" style="margin-left: 17%;margin-top: 3%">{{ i18n("backprofile") }}</button> | ||||
|   </div> | ||||
| </template> | ||||
| <style scoped> | ||||
| @ -548,7 +531,6 @@ button{ | ||||
|   border-radius:10px; | ||||
|   height:35px; | ||||
|   margin-top:10px; | ||||
|  | ||||
| } | ||||
|  | ||||
| button:hover{ | ||||
|  | ||||
| @ -1,9 +1,20 @@ | ||||
|  | ||||
| <!---------------------------------------------------- | ||||
| 	File:  Schedule.vue | ||||
| 	Author: William Karpinski | ||||
| 	Scope: Extension Horaire | ||||
| 	Description: Schedules Page accessed by everyone | ||||
| -----------------------------------------------------> | ||||
|  | ||||
| <script setup> | ||||
|   import { ref } from 'vue' | ||||
|   import {getDifferenceTime,lastDateOfMonth,formatDate,getFirstDay,sortByDate,matrixFromList,sundayToTheEnd,getMarginTop,getHoursMinutes, monthFromList} from '../scheduleFunctions.js' | ||||
|   import {getDifferenceTime,lastDateOfMonth,formatDate,getFirstDay,sortByDate,weekFromList,sundayToTheEnd,getMarginTop,getHoursMinutes, monthFromList, durationCourse} from '../scheduleFunctions.js' | ||||
|   import {getAllSchedule} from "@/rest/scheduleRest.js"; | ||||
|   import {getOnesLessons, getOwnedLessons } from "@/rest/lessonSchedule.js" | ||||
|   import {isLogged, getSelf,getTeachers} from "@/rest/Users.js" | ||||
|   import {getUserActualCourses} from "@/rest/courses.js"; | ||||
|   import {getcurriculum} from "@/rest/curriculum.js"; | ||||
|   import i18n from "../i18n.js"; | ||||
|  | ||||
|   const trueSchedule = ref() | ||||
|   const log = await isLogged(); | ||||
| @ -31,42 +42,40 @@ | ||||
|    | ||||
|   if(log){ | ||||
|     user = await getSelf(); | ||||
|     if(user.role == "Admin" || user.role == "Secretary" || user.role == "InscriptionService"){ | ||||
|     } | ||||
|  | ||||
|     else{ | ||||
|     if(user.role == "Teacher" || user.role == "Student"){ | ||||
|  | ||||
|       if(user.role == "Teacher"){ | ||||
|          ownSchedule.value  = await getOwnedLessons();  | ||||
|       } | ||||
|  | ||||
|       if(user.role == "Student"){ | ||||
|         let test =   await getUserActualCourses(); | ||||
|         console.log(test); | ||||
|         ownSchedule.value = await getOnesLessons();} | ||||
|  | ||||
|       schedule.value = ownSchedule.value; | ||||
|  | ||||
|       schedule.value.sort((a,b) => sortByDate(a,b)); | ||||
|       scheduleByWeek.value = sundayToTheEnd(matrixFromList(schedule.value,mondayOfWeek.value)); | ||||
|       scheduleByWeek.value = sundayToTheEnd(weekFromList(schedule.value,mondayOfWeek.value)); | ||||
|       month.value = monthFromList(schedule.value,new Date().getMonth()); | ||||
|        | ||||
|     } | ||||
|  | ||||
|   } | ||||
|  | ||||
|  | ||||
|     | ||||
|   const display =ref("Week"); | ||||
|   const format = ref("Grid"); | ||||
|    | ||||
|   const filters = ["Type","Teacher","Course"]; | ||||
|   const types = ["TP","TD","Course","Exam"]; | ||||
|   const teachers = await getTeachers() ; | ||||
|   const courses = ref(); | ||||
|  | ||||
|  | ||||
|   if(curriculum.value != null){ | ||||
|     courses.value = curriculum.value.courses; | ||||
|   } | ||||
|   const days = ["Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"]; | ||||
|   const months = ["Janvier","Fevrier","Mars","Avril",'Mai',"Juin","Juillet","Aout","Septembre","Octobre","Novembre","Decembre"] | ||||
|   const days = ["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]; | ||||
|   const months = ["january","february","march","april",'may',"june","july","august","september","october","november","december"] | ||||
|   const firstDayOfMonth = ref(getFirstDay(new Date())) | ||||
|   const monthDone = ref(false); | ||||
|   function getMonday(d) { | ||||
| @ -89,19 +98,9 @@ | ||||
|       return (user.role == "Student" || user.role == "Teacher"); | ||||
|     return false | ||||
|   } | ||||
|   function isNotCourse(element){ | ||||
|     return element==null; | ||||
|   } | ||||
|    | ||||
|  | ||||
|   function durationCourse(element){ | ||||
|     const hour = element.lessonEnd.substring(3,5) -element.lessonStart.substring(3,5); | ||||
|     return (element.lessonEnd - element.lessonStart)%2; | ||||
|   } | ||||
|    | ||||
|   function displayOwnSchedule(){ | ||||
|     schedule.value = ownSchedule.value; | ||||
|     scheduleByWeek.value = sundayToTheEnd(matrixFromList(schedule.value,mondayOfWeek.value)); | ||||
|     scheduleByWeek.value = sundayToTheEnd(weekFromList(schedule.value,mondayOfWeek.value)); | ||||
|       month.value = monthFromList(schedule.value,currentDate.value.getMonth()); | ||||
|       value = 1; | ||||
|       counter=0; | ||||
| @ -109,6 +108,9 @@ | ||||
|  | ||||
|   } | ||||
|  | ||||
|   /* | ||||
|    * Create a JSON from a schedule | ||||
|    */ | ||||
|   function createJSON(){ | ||||
|     const json = {"data":[]}; | ||||
|     for(let element in schedule.value){ | ||||
| @ -122,6 +124,10 @@ | ||||
|     return json | ||||
|   } | ||||
|  | ||||
|   /* | ||||
|    * Export a JSON | ||||
|    */ | ||||
|  | ||||
|   function exportJSON(){ | ||||
|     let json = createJSON(); | ||||
|     const data = JSON.stringify(json); | ||||
| @ -132,6 +138,10 @@ | ||||
|           a.click(); | ||||
|  | ||||
|   } | ||||
|  | ||||
|   /* | ||||
|    * Used to convert a JSON imported to an object | ||||
|    */ | ||||
|     function onFileChange(e) { | ||||
|      let files = e.target.files || e.dataTransfer.files; | ||||
|      if (!files.length) return; | ||||
| @ -162,20 +172,25 @@ | ||||
|       toEventList.push(temp); | ||||
|     } | ||||
|     jsonSchedule.value = toEventList; | ||||
|     scheduleByWeek.value = sundayToTheEnd(matrixFromList(jsonSchedule.value,mondayOfWeek.value)); | ||||
|     scheduleByWeek.value = sundayToTheEnd(weekFromList(jsonSchedule.value,mondayOfWeek.value)); | ||||
|     month.value = monthFromList(jsonSchedule.value,new Date().getMonth()); | ||||
|   } | ||||
|  | ||||
|   /* | ||||
|    * Display the JSON on the schedule | ||||
|    */ | ||||
|   function switchToJSON(){ | ||||
|     jsonMod.value = true; | ||||
|     scheduleByWeek.value = sundayToTheEnd(matrixFromList(jsonSchedule.value,mondayOfWeek.value)); | ||||
|     scheduleByWeek.value = sundayToTheEnd(weekFromList(jsonSchedule.value,mondayOfWeek.value)); | ||||
|     month.value = monthFromList(jsonSchedule.value,new Date().getMonth()); | ||||
|  | ||||
|   } | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|   /* | ||||
|    * used to focus on a lesson when we click on it | ||||
|    */ | ||||
|   function lessonFocus(element){ | ||||
|     if(!jsonMod.value){ | ||||
|     focus.value = element; | ||||
| @ -188,7 +203,9 @@ | ||||
|       focusLessons.value = lessonsList;} | ||||
|   } | ||||
|  | ||||
|  | ||||
|   /* | ||||
|    * convert the current date to a DATE object | ||||
|    */ | ||||
|   function dateOfMonth(i){ | ||||
|  | ||||
|     return new Date(currentDate.value.getFullYear(),currentDate.value.getMonth(),i); | ||||
| @ -198,7 +215,7 @@ | ||||
|     schedule.value =trueSchedule.value.lessons; | ||||
|     if(filter.value =="Teacher"){ | ||||
|       schedule.value = sortByTeacher(schedule.value,subFilter.value); | ||||
|       scheduleByWeek.value = sundayToTheEnd(matrixFromList(schedule.value,mondayOfWeek.value)); | ||||
|       scheduleByWeek.value = sundayToTheEnd(weekFromList(schedule.value,mondayOfWeek.value)); | ||||
|       month.value = monthFromList(schedule.value,currentDate.value.getMonth()); | ||||
|       value = 1; | ||||
|       counter=0; | ||||
| @ -207,7 +224,7 @@ | ||||
|     } | ||||
|     else if(filter.value =="Type"){ | ||||
|       schedule.value = sortByType(schedule.value,subFilter.value); | ||||
|       scheduleByWeek.value = sundayToTheEnd(matrixFromList(schedule.value,mondayOfWeek.value)); | ||||
|       scheduleByWeek.value = sundayToTheEnd(weekFromList(schedule.value,mondayOfWeek.value)); | ||||
|       month.value = monthFromList(schedule.value,currentDate.value.getMonth()); | ||||
|       value = 1; | ||||
|       counter=0; | ||||
| @ -217,7 +234,7 @@ | ||||
|     } | ||||
|     else if(filter.value =="Course"){ | ||||
|       schedule.value = sortByCourse(schedule.value,subFilter.value); | ||||
|       scheduleByWeek.value = sundayToTheEnd(matrixFromList(schedule.value,mondayOfWeek.value)); | ||||
|       scheduleByWeek.value = sundayToTheEnd(weekFromList(schedule.value,mondayOfWeek.value)); | ||||
|       month.value = monthFromList(schedule.value,currentDate.value.getMonth()); | ||||
|       value = 1; | ||||
|       counter=0; | ||||
| @ -270,12 +287,14 @@ | ||||
|     return matrix | ||||
|   } | ||||
|  | ||||
|      | ||||
|   /* | ||||
|    * Change the schedule filter | ||||
|    */ | ||||
|   async function changeSchedule(){ | ||||
|       schedule.value =trueSchedule.value.lessons; | ||||
|       curriculum.value = trueSchedule.value.curriculum; | ||||
|            | ||||
|       scheduleByWeek.value = sundayToTheEnd(matrixFromList(schedule.value,mondayOfWeek.value)); | ||||
|       scheduleByWeek.value = sundayToTheEnd(weekFromList(schedule.value,mondayOfWeek.value)); | ||||
|       month.value = monthFromList(schedule.value,currentDate.value.getMonth()); | ||||
|       value = 1; | ||||
|       counter=0; | ||||
| @ -287,18 +306,23 @@ | ||||
|       focusLessons.value = null; | ||||
|       jsonMod.value = false; | ||||
|   } | ||||
|    | ||||
|   /* | ||||
|    * change the week to display | ||||
|    */ | ||||
|   function changeWeek(i){ | ||||
|     const temp = getAnyDays(i); | ||||
|     mondayOfWeek.value = temp; | ||||
|     if(scheduleByWeek.value != null) | ||||
|       if(jsonMod.value){ | ||||
|         scheduleByWeek.value = sundayToTheEnd(matrixFromList(jsonSchedule.value, mondayOfWeek.value))} | ||||
|         scheduleByWeek.value = sundayToTheEnd(weekFromList(jsonSchedule.value, mondayOfWeek.value))} | ||||
|       else{ | ||||
|         scheduleByWeek.value = sundayToTheEnd(matrixFromList(schedule.value, mondayOfWeek.value))} | ||||
|         scheduleByWeek.value = sundayToTheEnd(weekFromList(schedule.value, mondayOfWeek.value))} | ||||
|        | ||||
|   } | ||||
|  | ||||
|   /* | ||||
|    * change the month to display | ||||
|    */ | ||||
|   function changeMonth(i){ | ||||
|     const temp = currentDate.value; | ||||
|     currentDate.value = new Date( ( 0< temp.getMonth()+i < 13 ? temp.getFullYear() : temp.getFullYear()+i), (0< temp.getMonth()+i <13 ? temp.getMonth()+i :  12 ),1); | ||||
| @ -316,6 +340,9 @@ | ||||
|    | ||||
|   } | ||||
|  | ||||
|   /* | ||||
|    * used to display correctly the dates of a month | ||||
|    */ | ||||
|  | ||||
|   function isAValue(){ | ||||
|     if(value-shift.value<0 ){ | ||||
| @ -352,15 +379,15 @@ | ||||
|       <table class="table"> | ||||
|         <tr style="background-color:rgb(24,24,24)"> | ||||
|           <th> | ||||
|             <button @click="changeWeek(-7)">Previous</button> | ||||
|             <button @click="changeWeek(7)">Next</button> | ||||
|             <button @click="changeWeek(-7)">{{i18n("schedule.previous")}}</button> | ||||
|             <button @click="changeWeek(7)">{{i18n("schedule.next")}}</button> | ||||
|             <button @click="mondayOfWeek = getMonday(new Date());  | ||||
|                 scheduleByWeek != null ? scheduleByWeek = sundayToTheEnd(matrixFromList(schedule.value, mondayOfWeek)) : null;">Current</button> | ||||
|                 scheduleByWeek != null ? scheduleByWeek = sundayToTheEnd(weekFromList(schedule.value, mondayOfWeek)) : null;">{{i18n("schedule.current")}}</button> | ||||
|              | ||||
|           </th> | ||||
|           <th class="header" v-for='d,index in 7' > | ||||
|             <p class="childHeader"> | ||||
|             {{days[index]}}              | ||||
|             {{i18n(days[index])}} | ||||
|             </p> | ||||
|             <p class="childHeader"> | ||||
|               {{formatDate(getAnyDays(index))}} | ||||
| @ -404,16 +431,16 @@ | ||||
|         <table class="table"> | ||||
|           <tr style="background-color:rgb(24,24,24); height:8.33%;"> | ||||
|             <th colspan="7" class="header"> | ||||
|               <div>{{months[currentDate.getMonth()]}} {{currentDate.getFullYear()}}</div>             | ||||
|             <button style="position:absolute; top:0; left:0;" @click="changeMonth(-1)">previous</button> | ||||
|             <button  style="position:absolute; bottom:0; left:0;"@click="changeMonth(1)">next</button> | ||||
|               <div>{{i18n(months[currentDate.getMonth()])}} {{currentDate.getFullYear()}}</div> | ||||
|             <button style="position:absolute; top:0; left:0;" @click="changeMonth(-1)">{{i18n("schedule.previous")}}</button> | ||||
|             <button  style="position:absolute; bottom:0; left:0;"@click="changeMonth(1)">{{i18n("schedule.next")}}</button> | ||||
|  | ||||
|             </th> | ||||
|  | ||||
|           </tr> | ||||
|           <tr style="background-color:rgb(24,24,24); height:8.33%;" > | ||||
|           <th class="header"  v-for='d,index in 7' > | ||||
|             {{days[index]}}              | ||||
|             {{i18n(days[index])}} | ||||
|           </th> | ||||
|           </tr> | ||||
|           <tr v-for="n in 5" style="height:16.67%;"> | ||||
| @ -450,11 +477,11 @@ | ||||
|         <button @click="changeWeek(-7)">Previous</button> | ||||
|       <button @click="changeWeek(7)">Next</button> | ||||
|       <button @click="mondayOfWeek = getMonday(new Date());  | ||||
|                 scheduleByWeek != null ? scheduleByWeek = sundayToTheEnd(matrixFromList(schedule.value, mondayOfWeek)) : null;">Current</button> | ||||
|                 scheduleByWeek != null ? scheduleByWeek = sundayToTheEnd(weekFromList(schedule.value, mondayOfWeek)) : null;">Current</button> | ||||
|              | ||||
|  | ||||
|         <template  v-for="i,index in 7"> | ||||
|           <div class="body" style="background-color:#181818;">{{days[index]}} {{formatDate(getAnyDays(index))}} | ||||
|           <div class="body" style="background-color:#181818;">{{i18n(days[index])}} {{formatDate(getAnyDays(index))}} | ||||
| </div> | ||||
|           <template v-if="scheduleByWeek != null"> | ||||
|           <div class="body" style="background-color:#353535;" > | ||||
| @ -476,10 +503,10 @@ | ||||
|       <div v-if="display == 'Month'"> | ||||
|         <button @click="changeMonth(-1)">Previous</button> | ||||
|         <button @click="changeMonth(1)">Next</button> | ||||
|         <div class="body" >{{months[currentDate.getMonth()]}} {{currentDate.getFullYear()}}</div>       | ||||
|         <div class="body" >{{i18n(months[currentDate.getMonth()])}} {{currentDate.getFullYear()}}</div> | ||||
|          | ||||
|         <template   v-for="i,index in lastDateOfMonth(currentDate.getMonth())-1"> | ||||
|           <div class="body" style="background-color:#181818;">{{ dateOfMonth(i).getDay()-1== -1 ? days[6] : days[dateOfMonth(i).getDay()-1] }} {{formatDate(dateOfMonth(i))}} | ||||
|           <div class="body" style="background-color:#181818;">{{ dateOfMonth(i).getDay()-1== -1 ? i18n(days[6]) : i18n(days[dateOfMonth(i).getDay()-1]) }} {{formatDate(dateOfMonth(i))}} | ||||
| </div> | ||||
|           <template v-if="scheduleByWeek != null"> | ||||
|           <div  class="body" style="background-color:#353535;" > | ||||
| @ -502,20 +529,20 @@ | ||||
|  | ||||
|     <div class="options"> | ||||
|       <div class="settings"> | ||||
|       <div class="body"  style="background-color:rgb(50,50,50);margin:5% 0 5% 0;">Settings</div> | ||||
|       <div class="body"  style="background-color:rgb(50,50,50);margin:5% 0 5% 0;">{{i18n("schedule.settings")}}</div> | ||||
|       <select @change="changeSchedule()" v-model="trueSchedule"> | ||||
|         <option v-for="item in allSchedules" :value='item'>{{item.curriculum.option}}-{{item.curriculum.year}}</option> | ||||
|       </select> | ||||
|       <button v-if="display=='Week'" @click="display='Month'">Week</button> | ||||
|       <button v-if="display=='Month'" @click="display='Week'; value=1;">Month</button> | ||||
|       <button v-if="format == 'Grid'" @click="format ='List'">Grid</button> | ||||
|       <button v-if="format == 'List'" @click ="format = 'Grid'">List</button> | ||||
|       <button v-if="verifUser()" @click="jsonMod=false ;displayOwnSchedule();">OwnSchedule</button> | ||||
|       <button v-if="importedJSON != null" @click="switchToJSON()">Switch to JSON FILE</button> | ||||
|       <button v-if="display=='Week'" @click="display='Month'">{{i18n("Week")}}</button> | ||||
|       <button v-if="display=='Month'" @click="display='Week'; value=1;">{{i18("Month")}}</button> | ||||
|       <button v-if="format == 'Grid'" @click="format ='List'">{{i18n("Grid")}}</button> | ||||
|       <button v-if="format == 'List'" @click ="format = 'Grid'">{{i18n("List")}}</button> | ||||
|       <button v-if="verifUser()" @click="jsonMod=false ;displayOwnSchedule();">{{i18n("OwnSchedule")}}</button> | ||||
|       <button v-if="importedJSON != null" @click="switchToJSON()">{{i18n("SwitchToJSON")}}</button> | ||||
|  | ||||
|       <select v-if="schedule != null && !jsonMod" @change="subFilter = 'null'" v-model="filter"> | ||||
|         <option :value ="null">No Filter</option> | ||||
|         <option v-for="item in filters" :value="item">{{item}}</option> | ||||
|         <option v-for="item in filters" :value="item">{{i18n(item)}}</option> | ||||
|       </select> | ||||
|       <select @change="sortSchedule()" v-if="filter == 'Teacher'" v-model="subFilter"> | ||||
|         <option :value ="null">No Filter</option> | ||||
| @ -527,7 +554,7 @@ | ||||
|       </select> | ||||
|       <select @change="sortSchedule()" v-if="filter == 'Type'" v-model="subFilter"> | ||||
|         <option :value ="null">No Filter</option> | ||||
|         <option v-for="item in types" :value='item'>{{item}}</option> | ||||
|         <option v-for="item in types" :value='item'>{{i18n(item)}}</option> | ||||
|       </select> | ||||
|         <button @click="exportJSON()" >Export JSON</button> | ||||
|          | ||||
| @ -537,22 +564,22 @@ | ||||
|  | ||||
|       </div> | ||||
|       <div v-if="focus != null && !jsonMod" class="moreInfos"> | ||||
|         <div class="body" style="background-color:rgb(50,50,50); height:10%; font-size:2em;" >More infos</div> | ||||
|         <div class="body" style="background-color:rgb(50,50,50); height:10%; font-size:2em;" >{{i18n("request.moreInfos")}}</div> | ||||
|         <div class="body" :style="{background:focus.color,height:auto,fontSize:1.2+'em', alignItems:center}"> | ||||
|           {{focus.course.title}}</div> | ||||
|  | ||||
|         <div class="body"  style="background-color:rgb(50,50,50);">Teacher(s)</div> | ||||
|         <div class="body"  style="background-color:rgb(50,50,50);">{{i18n("schedule.teachers")}}</div> | ||||
|         <div class="body" style="background-color:#484848;"> | ||||
|           <div>{{focus.course.owner.lastName}}</div> | ||||
|           <div v-for="element in focus.course.owner.assistants"> | ||||
|           <div v-for="element in focus.course.assistants"> | ||||
|             {{element.lastName}} | ||||
|           </div> | ||||
|         </div> | ||||
|         <div class="body"  style="background-color:rgb(50,50,50);">Lessons</div> | ||||
|         <div class="body"  style="background-color:rgb(50,50,50);">{{i18n("schedule.courses")}}</div> | ||||
|        <div class="body" style="background-color:#484848;"v-for="lesson in focusLessons"> | ||||
|           {{ getHoursMinutes(lesson.lessonStart)}}-{{getHoursMinutes(lesson.lessonEnd)}} | ||||
|           {{ lesson.local}} | ||||
|           {{lesson.lessonType}} | ||||
|           {{i18n(lesson.lessonType.toString())}} | ||||
|         </div>   | ||||
|  | ||||
|       </div> | ||||
| @ -561,7 +588,7 @@ | ||||
| </template> | ||||
| <style scoped> | ||||
|   .grid{ | ||||
|     min-width:1200px; | ||||
|     min-width:1400px; | ||||
|     display:grid; | ||||
|     margin-top:2%; | ||||
|     align-items:center; | ||||
|  | ||||
| @ -12,7 +12,7 @@ | ||||
| <template style="margin-top:5%;"> | ||||
|   <div v-if="list === false"> | ||||
|     <AboutStudent :target=targetRegNo /> | ||||
|     <button style="background-color:rgb(105,05,105);width:5%; margin-left: 10%;" @click="list = true;">Back</button> | ||||
|     <button style="background-color:rgb(105,05,105);width:5%; margin-left: 10%;" @click="list = true;">{{ i18n("courses.back") }}</button> | ||||
|   </div> | ||||
|   <div style="display:flex; justify-content:center; " v-for="item in users" v-if="list === true"> | ||||
|     <div class="bodu"> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user