Compare commits
2 Commits
43f3d66eb9
...
b52c50fd76
Author | SHA1 | Date | |
---|---|---|---|
b52c50fd76 | |||
9a5115f7fe |
@ -39,7 +39,7 @@ public class ExternalCurriculumController {
|
||||
user = userRepository.findById((Integer) externalCurrInfos.get("userRegNo"));
|
||||
}
|
||||
|
||||
ExternalCurriculum toSave = new ExternalCurriculum(ir, (String) externalCurrInfos.get("school"),(String) externalCurrInfos.get("formation"),(String) externalCurrInfos.get("completion"), (Integer)externalCurrInfos.get("startYear"), (Integer)externalCurrInfos.get("endYear"), (String)externalCurrInfos.get("justifDocUrl"), user);
|
||||
ExternalCurriculum toSave = new ExternalCurriculum(ir, (String) externalCurrInfos.get("school"),(String) externalCurrInfos.get("formation"),(String) externalCurrInfos.get("completion"), (Integer)externalCurrInfos.get("startYear"), (Integer)externalCurrInfos.get("endYear"), (String)externalCurrInfos.get("justifdocUrl"), user);
|
||||
|
||||
return new ResponseEntity<>(ecr.save(toSave), HttpStatus.OK);
|
||||
}
|
||||
|
@ -3,10 +3,12 @@ package ovh.herisson.Clyde.EndPoints.Inscription;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
|
||||
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
|
||||
import ovh.herisson.Clyde.Services.AuthenticatorService;
|
||||
import ovh.herisson.Clyde.Services.Inscription.InscriptionService;
|
||||
import ovh.herisson.Clyde.Services.ProtectionService;
|
||||
import ovh.herisson.Clyde.Tables.Curriculum;
|
||||
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
|
||||
import ovh.herisson.Clyde.Tables.RequestState;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
@ -19,10 +21,11 @@ public class InscriptionController {
|
||||
|
||||
private final InscriptionService inscriptionServ;
|
||||
private final AuthenticatorService authServ;
|
||||
|
||||
public InscriptionController(InscriptionService inscriptionServ, AuthenticatorService authServ){
|
||||
private final CurriculumRepository curriculumRepository;
|
||||
public InscriptionController(InscriptionService inscriptionServ, AuthenticatorService authServ, CurriculumRepository curriculumRepository){
|
||||
this.inscriptionServ = inscriptionServ;
|
||||
this.authServ = authServ;
|
||||
this.curriculumRepository = curriculumRepository;
|
||||
}
|
||||
|
||||
|
||||
@ -103,4 +106,31 @@ public class InscriptionController {
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PatchMapping("/request/registerequivimpose/{id}/{cursusid}")
|
||||
public ResponseEntity<Object> editRegisterEquiv(@RequestHeader("Authorization") String token, @PathVariable long id, @PathVariable long cursusid){
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher}, token))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
InscriptionRequest toEdit = inscriptionServ.getById(id);
|
||||
|
||||
//If the request is already accepted we just return ok (otherwise we would duplicate the procedure below)
|
||||
if (toEdit.getEquivalenceState() == RequestState.Accepted){
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
//We impose a curriculum
|
||||
Curriculum curriculum = curriculumRepository.findById(cursusid);
|
||||
|
||||
toEdit.setCurriculumId(curriculum.getCurriculumId());
|
||||
toEdit.setEquivalenceState(RequestState.Accepted);
|
||||
|
||||
inscriptionServ.save(toEdit);
|
||||
|
||||
if (toEdit.getState() == RequestState.Accepted && (toEdit.getEquivalenceState() == RequestState.Accepted || toEdit.getEquivalenceState() == RequestState.Unrequired))
|
||||
{
|
||||
inscriptionServ.createUser(toEdit);
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
@ -5,10 +5,7 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import ovh.herisson.Clyde.Repositories.CourseRepository;
|
||||
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
|
||||
import ovh.herisson.Clyde.Repositories.Inscription.ChangeCurriculumRequestRepository;
|
||||
import ovh.herisson.Clyde.Repositories.Inscription.ExemptionsRequestRepository;
|
||||
import ovh.herisson.Clyde.Repositories.Inscription.ScholarshipRequestRepository;
|
||||
import ovh.herisson.Clyde.Repositories.Inscription.UnregisterRequestRepository;
|
||||
import ovh.herisson.Clyde.Repositories.Inscription.*;
|
||||
import ovh.herisson.Clyde.Repositories.UserCurriculumRepository;
|
||||
import ovh.herisson.Clyde.Repositories.UserRepository;
|
||||
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
|
||||
@ -17,6 +14,7 @@ import ovh.herisson.Clyde.Services.TokenService;
|
||||
import ovh.herisson.Clyde.Services.UserService;
|
||||
import ovh.herisson.Clyde.Tables.*;
|
||||
import ovh.herisson.Clyde.Tables.Inscription.ExemptionsRequest;
|
||||
import ovh.herisson.Clyde.Tables.Inscription.Minerval;
|
||||
import ovh.herisson.Clyde.Tables.Inscription.ScholarshipRequest;
|
||||
import ovh.herisson.Clyde.Tables.Inscription.UnregisterRequest;
|
||||
|
||||
@ -39,10 +37,10 @@ public class RequestsController {
|
||||
public final UserService userService;
|
||||
public final UserCurriculumRepository userCurriculumRepository;
|
||||
public final CurriculumRepository curriculumRepository;
|
||||
|
||||
public final MinervalRepository minervalRepository;
|
||||
public final ChangeCurriculumRequestRepository changeCurriculumRequestRepository;
|
||||
|
||||
public RequestsController(TokenService tokenService, ExemptionsRequestRepository err, ScholarshipRequestRepository srr, UserRepository userRepository, AuthenticatorService authServ, UnregisterRequestRepository unregisterRequestRepository, CourseRepository courseRepository, UserService userService, UserCurriculumRepository userCurriculumRepository, CurriculumRepository curriculumRepository, ChangeCurriculumRequestRepository changeCurriculumRequestRepository) {
|
||||
public RequestsController(TokenService tokenService, ExemptionsRequestRepository err, ScholarshipRequestRepository srr, UserRepository userRepository, AuthenticatorService authServ, UnregisterRequestRepository unregisterRequestRepository, CourseRepository courseRepository, UserService userService, UserCurriculumRepository userCurriculumRepository, CurriculumRepository curriculumRepository, MinervalRepository minervalRepository, ChangeCurriculumRequestRepository changeCurriculumRequestRepository) {
|
||||
this.tokenService = tokenService;
|
||||
this.err = err;
|
||||
this.srr = srr;
|
||||
@ -53,6 +51,7 @@ public class RequestsController {
|
||||
this.userService = userService;
|
||||
this.userCurriculumRepository = userCurriculumRepository;
|
||||
this.curriculumRepository = curriculumRepository;
|
||||
this.minervalRepository = minervalRepository;
|
||||
this.changeCurriculumRequestRepository = changeCurriculumRequestRepository;
|
||||
}
|
||||
|
||||
@ -154,6 +153,8 @@ public class RequestsController {
|
||||
|
||||
ScholarshipRequest scholarshipRequest = srr.findById((Integer) infos.get("id"));
|
||||
|
||||
User u = scholarshipRequest.getUser();
|
||||
|
||||
//If the request is already accepted we just return ok (otherwise we would duplicate the procedure below)
|
||||
if (scholarshipRequest.getState() == RequestState.Accepted){
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
@ -162,6 +163,12 @@ public class RequestsController {
|
||||
if (infos.get("state").equals("Accepted")){
|
||||
scholarshipRequest.setState(RequestState.Accepted);
|
||||
scholarshipRequest.setAmount((int) infos.get("amount"));
|
||||
|
||||
//We then deduce then amount from the minerval
|
||||
ArrayList<Minerval> minerval = minervalRepository.getMinervalsByStudentRegNoOrderByYearDesc(u.getRegNo());
|
||||
minerval.get(0).setPaidAmount(minerval.get(0).getPaidAmount() + scholarshipRequest.getAmount());
|
||||
minerval.get(0).setToPay(minerval.get(0).getToPay() - scholarshipRequest.getAmount());
|
||||
minervalRepository.save(minerval.get(0));
|
||||
}else{
|
||||
scholarshipRequest.setState(RequestState.Refused);
|
||||
}
|
||||
|
@ -89,7 +89,8 @@ public class InscriptionService {
|
||||
inscrRequest.getCountry(),
|
||||
inscrRequest.getBirthDate(),
|
||||
inscrRequest.getProfilePicture(),
|
||||
inscrRequest.getPassword()
|
||||
inscrRequest.getPassword(),
|
||||
inscrRequest.getIdentityCard()
|
||||
);
|
||||
|
||||
userService.save(userFromRequest);
|
||||
|
@ -30,6 +30,7 @@ public class ProtectionService {
|
||||
toReturn.put("country",user.getCountry());
|
||||
toReturn.put("profilePictureUrl",user.getProfilePictureUrl());
|
||||
toReturn.put("role",user.getRole());
|
||||
toReturn.put("identityCard", user.getIdentityCardUrl());
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@ public class User {
|
||||
private Date birthDate;
|
||||
private String profilePictureUrl;
|
||||
private Role role;
|
||||
private String identityCardUrl;
|
||||
@JsonIgnore
|
||||
private String password;
|
||||
|
||||
@ -53,8 +54,10 @@ public class User {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
//This constructor is used to add a student
|
||||
public User(String lastName, String firstName, String email, String address,
|
||||
String country, Date birthDate, String profilePictureUrl, String password)
|
||||
String country, Date birthDate, String profilePictureUrl, String password,String identityCardUrl)
|
||||
{
|
||||
this.lastName = lastName;
|
||||
this.firstName = firstName;
|
||||
@ -65,6 +68,7 @@ public class User {
|
||||
this.profilePictureUrl = profilePictureUrl;
|
||||
this.password = password;
|
||||
this.role = Role.Student;
|
||||
this.identityCardUrl = identityCardUrl;
|
||||
}
|
||||
public User() {}
|
||||
|
||||
@ -138,4 +142,12 @@ public class User {
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public void setIdentityCardUrl(String identityCardUrl) {
|
||||
this.identityCardUrl = identityCardUrl;
|
||||
}
|
||||
|
||||
public String getIdentityCardUrl() {
|
||||
return identityCardUrl;
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ app.language=Language
|
||||
app.manage.profile=Manage profile
|
||||
app.studentList=Students List
|
||||
app.users=Users
|
||||
app.payments = Payments
|
||||
app.payments=Payments
|
||||
request.moreInfos=More Infos
|
||||
request.accept=Accept
|
||||
request.refuse=Refuse
|
||||
@ -82,7 +82,7 @@ dltaxdoc=Download tax justification document
|
||||
dlresidency=Download residency justification document
|
||||
enteramount=Please enter the amount to provide :
|
||||
oldcursus=Old curriculums
|
||||
newcursus = New curriculums
|
||||
newcursus=New curriculums
|
||||
year=Year
|
||||
reason=Reason :
|
||||
selectedcursus=Selected curriculum :
|
||||
@ -144,3 +144,6 @@ chcur=Change from a cursus to another
|
||||
iwouldlike=I would like to :
|
||||
newcurr=New curriculum
|
||||
cursusprereq=The cursus you selected has some prerequisites ensure that your external curriculum data is updated in your profile
|
||||
imposecurriculum=Impose a curriculum
|
||||
impose=Impose
|
||||
gotimposed=The selected curriculum has been imposed
|
@ -35,7 +35,7 @@ app.language=Langue
|
||||
app.manage.profile=Gérer le profil
|
||||
app.studentList=Liste des étudiants
|
||||
app.users=Utilisateurs
|
||||
app.payments = Payements
|
||||
app.payments=Payements
|
||||
request.moreInfos=Plus d'Infos
|
||||
request.accept=Accepter
|
||||
request.refuse=Refuser
|
||||
@ -144,3 +144,6 @@ chcur=Changer d'un cursus vers un autre
|
||||
iwouldlike=Je voudrais :
|
||||
newcurr=Nouveau cursus
|
||||
cursusprereq=Le cursus que vous avez selectionné a des prérequis assurez vous que votre dossier de parcours est a jour dans votre profil
|
||||
imposecurriculum=Imposer un cursusgotimposed
|
||||
impose=Imposer
|
||||
gotimposed=Le cursus selectionné a été imposé
|
@ -1,15 +1,12 @@
|
||||
<script setup>
|
||||
|
||||
import {
|
||||
addUninscReq, editChangeCurrReq, editChangeCurrReqTeacherState,
|
||||
editScholarshipReq,
|
||||
editUnregReq, getChangeCurrReqById,
|
||||
getScholarshipReqById,
|
||||
getUnregisterbyId
|
||||
editChangeCurrReq, editChangeCurrReqTeacherState,
|
||||
getChangeCurrReqById,
|
||||
} from "@/rest/requests.js";
|
||||
import i18n from "@/i18n.js";
|
||||
import {getSelf, getUser} from "@/rest/Users.js";
|
||||
import {reactive, ref} from "vue";
|
||||
import {getSelf} from "@/rest/Users.js";
|
||||
import {ref} from "vue";
|
||||
import AboutStudent from "@/Apps/Inscription/AboutStudent.vue";
|
||||
|
||||
const props = defineProps(["reqId"])
|
||||
@ -88,11 +85,6 @@ async function editChangeCurrReqTeacherApproval(state){
|
||||
"minfos minfos";
|
||||
}
|
||||
|
||||
.profilPic{
|
||||
width:100%;
|
||||
grid-area:profilPic;
|
||||
}
|
||||
|
||||
.globalInfos {
|
||||
grid-area:globalInfos;
|
||||
align-self :center;
|
||||
@ -108,13 +100,6 @@ async function editChangeCurrReqTeacherApproval(state){
|
||||
margin-top:7%;
|
||||
}
|
||||
|
||||
.subContainter{
|
||||
width:100%;
|
||||
background-color:rgb(50,50,50);
|
||||
border-radius:20px;
|
||||
border:4px solid black;
|
||||
}
|
||||
|
||||
.infosContainer {
|
||||
min-width:350px;
|
||||
padding-bottom:50px;
|
||||
|
@ -1,15 +1,11 @@
|
||||
<script setup>
|
||||
|
||||
import {
|
||||
addUninscReq,
|
||||
editExempReqState,
|
||||
editScholarshipReq,
|
||||
getExempReq,
|
||||
getScholarshipReqById
|
||||
} from "@/rest/requests.js";
|
||||
import i18n from "@/i18n.js";
|
||||
import {getUser} from "@/rest/Users.js";
|
||||
import {reactive, ref} from "vue";
|
||||
import {ref} from "vue";
|
||||
import AboutStudent from "@/Apps/Inscription/AboutStudent.vue";
|
||||
|
||||
const props = defineProps(["reqId"])
|
||||
@ -44,7 +40,7 @@ async function editExemp(newstate){
|
||||
<button @click="profile = !profile">{{ i18n("seeprofile") }}</button>
|
||||
</div>
|
||||
<div>
|
||||
<button>{{ i18n("dljustifdoc") }}</button>
|
||||
<button><a :href="req.justifDocument">{{ i18n("dljustifdoc") }}</a></button>
|
||||
</div>
|
||||
<div>
|
||||
<button v-if="req.state === 'Pending'" @click="req.state='Accepted';editExemp('Accepted')">{{ i18n("request.accept") }}</button>
|
||||
@ -76,11 +72,6 @@ async function editExemp(newstate){
|
||||
"minfos minfos";
|
||||
}
|
||||
|
||||
.profilPic{
|
||||
width:100%;
|
||||
grid-area:profilPic;
|
||||
}
|
||||
|
||||
.globalInfos {
|
||||
grid-area:globalInfos;
|
||||
align-self :center;
|
||||
@ -96,13 +87,6 @@ async function editExemp(newstate){
|
||||
margin-top:7%;
|
||||
}
|
||||
|
||||
.subContainter{
|
||||
width:100%;
|
||||
background-color:rgb(50,50,50);
|
||||
border-radius:20px;
|
||||
border:4px solid black;
|
||||
}
|
||||
|
||||
.infosContainer {
|
||||
min-width:350px;
|
||||
padding-bottom:50px;
|
||||
|
@ -1,20 +1,23 @@
|
||||
<script setup>
|
||||
import i18n from "@/i18n.js"
|
||||
import {getSelf, getUser} from '../../rest/Users.js'
|
||||
import {getcurriculum} from "@/rest/curriculum.js";
|
||||
import {getSelf} from '../../rest/Users.js'
|
||||
import {getAllCurriculums, 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";
|
||||
import {ref} from "vue";
|
||||
import ExternalCurriculumList from "@/Apps/Inscription/ExternalCurriculumList.vue";
|
||||
import {editEquivalenceState} from "@/rest/requests.js";
|
||||
import {editEquivalenceState, imposeCurriculum} from "@/rest/requests.js";
|
||||
|
||||
const curriculums = await getAllCurriculums()
|
||||
const props = defineProps(['target']);
|
||||
const request = await getRegisters(props.target);
|
||||
const cursus = await getcurriculum(request.curriculum);
|
||||
const user = await getSelf();
|
||||
const list = ref(false);
|
||||
const externalCurriculum = await getExternalCurriculumByInscrReq(request.id)
|
||||
const impose = ref(false)
|
||||
const imposeCurr = ref(0)
|
||||
const imposed = ref(false)
|
||||
|
||||
//Get the parent page windowState to display the correct button
|
||||
const windowState = defineModel("windowState")
|
||||
@ -28,6 +31,10 @@ function getPP(){
|
||||
async function editEquivalence(id, newstate){
|
||||
await editEquivalenceState(id, newstate)
|
||||
}
|
||||
|
||||
async function refreshCursus(){
|
||||
cursus.value = await getcurriculum(request.curriculum)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -57,10 +64,10 @@ async function editEquivalence(id, newstate){
|
||||
{{ 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>
|
||||
<button><a :href="request.identityCard">{{ i18n("dlidentitycard") }}</a></button>
|
||||
<button v-if="request.admissionDocUrl != null"><a :href="request.admissionDocUrl">{{ i18n("dladmissiondoc") }}</a></button>
|
||||
</div>
|
||||
<div v-if="cursus.year > 1">
|
||||
<div v-if="externalCurriculum.length !== 0">
|
||||
<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>
|
||||
@ -73,9 +80,20 @@ async function editEquivalence(id, newstate){
|
||||
<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%" 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>
|
||||
<button style="margin-left: 2%" v-if="request.equivalenceState === 'Pending' && !impose" @click="list = false;editEquivalence(request.id, 'Accepted'); request.equivalenceState='Accepted'">{{i18n("acceptequiv")}}</button>
|
||||
<button style="margin-left: 2%;margin-right: 3%" v-if="request.equivalenceState === 'Pending' && !impose" @click="list = false;editEquivalence(request.id, 'Refused'); request.equivalenceState='Refused'">{{i18n("refuseequiv")}}</button>
|
||||
<div v-if="!imposed && request.equivalenceState !== 'Accepted'" style="margin-top: 3%;margin-left: 1%">
|
||||
{{i18n("imposecurriculum")}}
|
||||
<input type="checkbox" v-model="impose" v-if="!imposed">
|
||||
<select v-if="impose" v-model="imposeCurr">
|
||||
<option v-for="item in curriculums" :value="item.curriculumId">Bac {{item.year}} {{item.option}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<button v-if="impose && !imposed" style="margin-left: 2%" @click="imposeCurriculum(request.id, imposeCurr);request.equivalenceState='Accepted';imposed=true;">{{ i18n("impose") }}</button>
|
||||
<div v-if="imposed">
|
||||
{{ i18n("gotimposed") }}
|
||||
</div>
|
||||
<button style="margin-left: 2%" @click="list=false;refreshCursus()">{{ i18n("courses.back") }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -1,8 +1,7 @@
|
||||
<script setup>
|
||||
|
||||
import {addUninscReq, editScholarshipReq, getScholarshipReqById} from "@/rest/requests.js";
|
||||
import {editScholarshipReq, getScholarshipReqById} from "@/rest/requests.js";
|
||||
import i18n from "@/i18n.js";
|
||||
import {getUser} from "@/rest/Users.js";
|
||||
import {reactive, ref} from "vue";
|
||||
|
||||
const props = defineProps(["reqId"])
|
||||
@ -54,8 +53,8 @@ async function uploadandrefreshScholarshipRequest(){
|
||||
{{ i18n("login.guest.birthday") }} : {{user.birthDate.slice(0,10)}}
|
||||
</div>
|
||||
<div>
|
||||
<button @click="">{{ i18n("dltaxdoc") }}</button>
|
||||
<button style="margin-left: 2%">{{ i18n("dlresidency") }}</button>
|
||||
<button><a :href="req.taxDocUrl">{{ i18n("dltaxdoc") }}</a></button>
|
||||
<button style="margin-left: 2%"><a :href="req.residencyDocUrl">{{ i18n("dlresidency") }}</a></button>
|
||||
</div>
|
||||
<div v-if="req.state == 'Pending'" style="margin-top: 2%; margin-bottom: 2%;">
|
||||
{{i18n("enteramount")}}
|
||||
|
@ -5,7 +5,6 @@
|
||||
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)
|
||||
@ -13,9 +12,6 @@
|
||||
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){
|
||||
@ -23,17 +19,6 @@
|
||||
}
|
||||
return user.profilePictureUrl
|
||||
}
|
||||
|
||||
//Cette function renvoie l'année académique concernée si on est dans l'année 2023-2024 elle renvoie 2023
|
||||
//car dans la db l'année scolaire 2023-2024 est representée juste par 2023 (le même système s'applique pour chaque années on prend la borne inférieure
|
||||
function getYear(){
|
||||
let date = new Date();
|
||||
if (date.getMonth() <= 6){
|
||||
return date.getFullYear()-1
|
||||
}
|
||||
return date.getFullYear()
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -60,7 +45,7 @@
|
||||
{{ i18n("login.guest.birthday") }} : {{user.birthDate}}
|
||||
</div>
|
||||
<div>
|
||||
<button v-if="watchingUser.role === 'Admin' || watchingUser.role === 'InscriptionService' || watchingUser.role === 'Secretary' || watchingUser.regNo === user.regNo">{{i18n("dlidentitycard")}}</button>
|
||||
<button v-if="watchingUser.role === 'Admin' || watchingUser.role === 'InscriptionService' || watchingUser.role === 'Secretary' || watchingUser.regNo === user.regNo"><a :href="user.identityCard">{{i18n("dlidentitycard")}}</a></button>
|
||||
</div>
|
||||
<div>
|
||||
<button @click="extercurrlist=!extercurrlist">{{i18n("seeextcur")}}</button>
|
||||
|
@ -1,26 +1,15 @@
|
||||
<script setup>
|
||||
|
||||
import {
|
||||
addUninscReq,
|
||||
editScholarshipReq,
|
||||
editUnregReq,
|
||||
getScholarshipReqById,
|
||||
getUnregisterbyId
|
||||
} from "@/rest/requests.js";
|
||||
import i18n from "@/i18n.js";
|
||||
import {getUser} from "@/rest/Users.js";
|
||||
import {reactive, ref} from "vue";
|
||||
import {ref} from "vue";
|
||||
|
||||
const props = defineProps(["reqId"])
|
||||
const req = ref(await getUnregisterbyId(props.reqId))
|
||||
|
||||
function getPP(){
|
||||
if(user.profilePictureUrl === null){
|
||||
return "/Clyde.png"
|
||||
}
|
||||
return user.profilePictureUrl
|
||||
}
|
||||
|
||||
async function uploadandrefreshUnregRequest(state){
|
||||
await editUnregReq(req.value.id, state)
|
||||
req.value.state = state
|
||||
@ -69,15 +58,9 @@ async function uploadandrefreshUnregRequest(state){
|
||||
"minfos minfos";
|
||||
}
|
||||
|
||||
.profilPic{
|
||||
width:100%;
|
||||
grid-area:profilPic;
|
||||
}
|
||||
|
||||
.globalInfos {
|
||||
grid-area:globalInfos;
|
||||
align-self :center;
|
||||
|
||||
}
|
||||
|
||||
.body {
|
||||
@ -89,13 +72,6 @@ async function uploadandrefreshUnregRequest(state){
|
||||
margin-top:7%;
|
||||
}
|
||||
|
||||
.subContainter{
|
||||
width:100%;
|
||||
background-color:rgb(50,50,50);
|
||||
border-radius:20px;
|
||||
border:4px solid black;
|
||||
}
|
||||
|
||||
.infosContainer {
|
||||
min-width:350px;
|
||||
padding-bottom:50px;
|
||||
|
@ -2,9 +2,8 @@
|
||||
|
||||
import {reactive, ref} from "vue";
|
||||
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 {uploadFile} from "@/rest/uploads.js";
|
||||
import {createExemptionsRequest, getExempByUser} from "@/rest/requests.js";
|
||||
import {getSelf} from "@/rest/Users.js";
|
||||
|
||||
@ -14,7 +13,7 @@ const user = await getSelf()
|
||||
|
||||
const windowState = defineModel("windowState")
|
||||
const exempList = await getExempByUser(user.regNo)
|
||||
|
||||
const submitted = ref(false)
|
||||
const courseslist = ref(await getcurriculum(selectedCurriculum.value.curriculumId))
|
||||
const list = ref(true)
|
||||
|
||||
@ -57,7 +56,7 @@ function isExempted(course){
|
||||
<div class="firstname">{{item.owner.firstName}}</div>
|
||||
<div class="lastname">{{item.owner.lastName}}</div>
|
||||
<div class="credits">credits : {{item.credits}}</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 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>
|
||||
@ -66,19 +65,22 @@ function isExempted(course){
|
||||
<button @click="windowState = 0">{{ i18n("courses.back")}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="list === false" class="infosContainer">
|
||||
<p>{{ i18n("uploadjustifdoc") }} </p>
|
||||
<div v-if="list === false" class="infosContainer">
|
||||
<p v-if="!submitted">{{ i18n("uploadjustifdoc") }} </p>
|
||||
<div>
|
||||
<label class="browser">
|
||||
<input type="file" @change="ppData.value = $event.target.files" accept="image/*" ref="filepath">
|
||||
<label class="browser" v-if="!submitted">
|
||||
<input type="file" @change="ppData.value = $event.target.files" ref="filepath">
|
||||
</label>
|
||||
</div>
|
||||
<button style="margin-top: 3%" @click="postExemptionRequest(ppData.value, 'JustificationDocument');">
|
||||
<button style="margin-top: 3%" v-if="!submitted" @click="postExemptionRequest(ppData.value, 'JustificationDocument');submitted=!submitted">
|
||||
{{ i18n("subexemreq") }}
|
||||
</button>
|
||||
<div v-if="submitted">
|
||||
{{i18n("reqsent")}}
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="list === false">
|
||||
<button @click="list=!list">{{ i18n("courses.back") }}</button>
|
||||
<button @click="list=!list;submitted=!submitted">{{ i18n("courses.back") }}</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
completion : "completed",
|
||||
startYear : 0,
|
||||
endYear: 0,
|
||||
justifdocUrl : null,
|
||||
justifdocUrl : "",
|
||||
userRegNo : null
|
||||
})
|
||||
|
||||
@ -43,7 +43,6 @@
|
||||
|
||||
if(props.mode !== 2){
|
||||
extCurrList.value = props.extCurrList
|
||||
console.log("oe")
|
||||
}
|
||||
|
||||
function deleteExtCursus(extcursus){
|
||||
@ -86,7 +85,7 @@
|
||||
<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>{{ i18n("dldoc") }}</button></div>
|
||||
<div class="download" v-if="props.mode!==2"><button><a :href="item.justifdocUrl">{{ i18n("dldoc") }}</a></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>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
import i18n from "@/i18n.js"
|
||||
import {ref, vModelSelect, watch} from 'vue'
|
||||
import {ref, watch} from 'vue'
|
||||
import {validateRegister, getAllRegisters } from '@/rest/ServiceInscription.js'
|
||||
import AboutRequest from "@/Apps/Inscription/AboutRequest.vue";
|
||||
import {
|
||||
@ -18,7 +18,7 @@
|
||||
const requests = ref(await getAllRegisters());
|
||||
let targetId = "";
|
||||
const user = await getSelf()
|
||||
const requestType = ref("inscription");
|
||||
const requestType = ref(i18n("inscription"));
|
||||
const filterType = ref("None");
|
||||
|
||||
//0 = liste, 1 = détails, 2 = sure?, 3 = manage scholarship, 4 manage unregister, 5 = manage curriculum change, 6 = manage exemptions
|
||||
@ -91,8 +91,8 @@
|
||||
<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="accept" v-if="item.state === 'Pending' && (user.role === 'Admin' || user.role === 'InscriptionService')"><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' && (user.role === 'Admin' || user.role === 'InscriptionService')"><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 === i18n('scholarship')">
|
||||
@ -131,10 +131,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style='display:flex; justify-content:center; min-width:1140px;margin-top: 10%' v-if="windowsState === 2">
|
||||
<div class="infosContainer" style='margin-left:15%;display:flex; justify-content:center; width: 70%;margin-top: 10%' v-if="windowsState === 2">
|
||||
<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 style="margin-left: 10%; margin-top: 1.5%; width: 30%">
|
||||
<button style="background-color:rgb(105,05,105);margin-right: 2%" @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>
|
||||
<div v-if="windowsState === 3">
|
||||
<AboutScholarship :req-id="targetId"></AboutScholarship>
|
||||
@ -253,7 +255,15 @@
|
||||
background-color:rgb(50,50,50);
|
||||
}
|
||||
|
||||
|
||||
.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>
|
||||
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
<script setup>
|
||||
import i18n from "@/i18n.js";
|
||||
import {ref} from "vue";
|
||||
import {getAllPayments} from "@/rest/requests.js";
|
||||
|
||||
const paymentsList = await getAllPayments()
|
||||
|
@ -2,7 +2,7 @@
|
||||
import {reactive, ref } from 'vue'
|
||||
import i18n from '@/i18n.js'
|
||||
import {login, register, disconnect, isLogged} from '@/rest/Users.js'
|
||||
import {getAllCurriculums, getcurriculum} from '@/rest/curriculum.js'
|
||||
import {getAllCurriculums} from '@/rest/curriculum.js'
|
||||
import {uploadFile, uploadProfilePicture} from '@/rest/uploads.js'
|
||||
import {toast} from 'vue3-toastify'
|
||||
import 'vue3-toastify/dist/index.css';
|
||||
@ -31,8 +31,9 @@
|
||||
const passwordConfirm=ref("")
|
||||
|
||||
const imageSaved = ref(false)
|
||||
let ppData = ""
|
||||
|
||||
|
||||
const ppData = ref({})
|
||||
const idcardfile = ref({})
|
||||
const justifcardfile = ref({})
|
||||
|
||||
@ -58,11 +59,6 @@
|
||||
disconnect();
|
||||
window.location.reload();}
|
||||
|
||||
async function uploadPP(arg){
|
||||
const data = await uploadProfilePicture(arg);
|
||||
ppData = data.url;
|
||||
}
|
||||
|
||||
//This functions makes the distinction between a master cursus (year 4 or more) and a bachelor cursus (year 3 or less)
|
||||
function getCursusDisplay(cursus){
|
||||
if (cursus.year <= 3){
|
||||
@ -77,6 +73,7 @@
|
||||
//We upload the two files and we get their paths on the server
|
||||
const identityCardFile = await uploadFile(idcardfile.value, "IdentityCard")
|
||||
const justifFile = ref(null)
|
||||
const profilepic = await uploadProfilePicture(ppData.value)
|
||||
|
||||
if (curricula[outputs.curriculum-1].requireCertificate){
|
||||
justifFile.value = await uploadFile(justifcardfile.value, "JustificationDocument")
|
||||
@ -89,7 +86,7 @@
|
||||
justif = null
|
||||
}
|
||||
|
||||
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);
|
||||
const val = await register(outputs.firstname, outputs.surname, outputs.birthday, outputs.password, outputs.email, outputs.address, outputs.country, outputs.curriculum, profilepic.url, identityCardFile.url, new Date(), outputs.equivalenceState, justif);
|
||||
|
||||
for (let item in externalCurrTab.value){
|
||||
const temp = await uploadFile(externalCurrTab.value[item].justifdocUrl, "JustificationDocument")
|
||||
@ -178,10 +175,10 @@
|
||||
</form>
|
||||
<label class="browser">
|
||||
{{i18n("login.guest.browse")}}
|
||||
<input type="file" :disabled="imageSaved" @change="ppData = uploadProfilePicture($event.target.files); imageSaved = true;" accept="image/*">
|
||||
<input type="file" :disabled="imageSaved" @change="ppData = $event.target.files; imageSaved = true;" accept="image/*">
|
||||
</label>
|
||||
<form novalidate enctype="multipart/form-data" class="inputBox">
|
||||
<input type="file" @change="uploadPP($event.target.files); imageSaved = true;" accept="image/*">
|
||||
<input type="file" @change="imageSaved = true;" accept="image/*">
|
||||
</form>
|
||||
<div class="inputBox">
|
||||
<p>{{i18n("Curriculum").toUpperCase()}}</p>
|
||||
@ -221,15 +218,17 @@
|
||||
</div>
|
||||
</div>
|
||||
<button @click="page++;" style="margin-top: 10%">{{i18n("login.guest.nextpage")}}</button>
|
||||
|
||||
</div>
|
||||
<div v-if="page === 3">
|
||||
<p style="color:rgb(239,60,168);margin-bottom: 5%">
|
||||
{{i18n("login.guest.formationdisclaimer")}}
|
||||
</p>
|
||||
<button @click="page++">{{i18n("login.guest.managecareer")}}</button>
|
||||
<button @click="postRegisterReq();">{{ i18n("login.guest.sendRegReq") }}</button>
|
||||
<button @click="postRegisterReq();page+=2">{{ i18n("login.guest.sendRegReq") }}</button>
|
||||
</div>
|
||||
<div v-if="page===5" style="margin-left: 7%">
|
||||
<p style="color: rgb(239,60,168);">{{i18n("reqsent")}}</p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@ -297,13 +296,7 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.bodu {
|
||||
margin-top:2%;
|
||||
width:50%;
|
||||
border:2px solid black;
|
||||
border-radius:9px;
|
||||
background-color:rgb(50,50,50);
|
||||
}
|
||||
|
||||
|
||||
.switchpage{
|
||||
width:100px;
|
||||
@ -342,22 +335,8 @@ input[type=file]{
|
||||
background:#FFFFFF;
|
||||
}
|
||||
|
||||
.container{
|
||||
margin-top: 2%;
|
||||
color:white;
|
||||
height:60px;
|
||||
font-size:30px;
|
||||
display:grid;
|
||||
grid-template-columns:30% 30% 20% 20%;
|
||||
grid-template-areas:
|
||||
"school formation completion edit remove";
|
||||
column-gap:10px;
|
||||
}
|
||||
|
||||
button:active ,.switchpage:active{
|
||||
opacity:0.8;
|
||||
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script setup>
|
||||
import {reactive, ref } from 'vue'
|
||||
import {getSelf,alterSelf,disconnect,deleteUser} from '../rest/Users.js'
|
||||
import {getSelfCurriculum, getAllCurriculums, getSomeonesCurriculumList, getcurriculum} from '../rest/curriculum.js'
|
||||
import {getSelf,alterSelf} from '../rest/Users.js'
|
||||
import {getAllCurriculums, getSomeonesCurriculumList, getcurriculum} from '../rest/curriculum.js'
|
||||
import {getCourses} from "../rest/courses.js"
|
||||
import i18n from "@/i18n.js"
|
||||
import {uploadFile, uploadProfilePicture} from '@/rest/uploads.js'
|
||||
@ -119,16 +119,6 @@
|
||||
toModify.password= item.password;
|
||||
}
|
||||
|
||||
|
||||
async function unRegister(){
|
||||
deleteUser(user.value.regNo);
|
||||
disconnect()
|
||||
setTimeout(() => {
|
||||
window.location.href="#/home";
|
||||
}, "500");
|
||||
|
||||
}
|
||||
|
||||
function getPP(){
|
||||
if(user.value.profilePictureUrl === null){
|
||||
return "/Clyde.png"
|
||||
@ -136,14 +126,6 @@
|
||||
return user.profilePictureUrl
|
||||
}
|
||||
|
||||
function getYear(){
|
||||
let date = new Date();
|
||||
if (date.getMonth() <= 6){
|
||||
return date.getFullYear()-1
|
||||
}
|
||||
return date.getFullYear()
|
||||
}
|
||||
|
||||
async function refreshExtCurrList(){
|
||||
extcurrlist.value = await getExternalCurriculumByUser(user.value.regNo)
|
||||
}
|
||||
@ -258,7 +240,7 @@
|
||||
<button @click="windowState=0">{{i18n("courses.back")}}</button>
|
||||
</div>
|
||||
<div v-else-if="windowState === 5" class="infosContainer">
|
||||
<div v-if="minerv.value.toPay !== 0">
|
||||
<div v-if="minerv.value.toPay > 0">
|
||||
{{ i18n("payment") }} : {{minerv.value.toPay}}€ {{ i18n("lefttopay") }}
|
||||
<div v-if="minerv.value.paidAmount <= 50">
|
||||
<button @click="windowState=6; paymentAmount = 50">{{ i18n("paydeposit") }} (50€)</button>
|
||||
@ -271,7 +253,7 @@
|
||||
{{ i18n("alreadypaid") }}
|
||||
</div>
|
||||
<div>
|
||||
<button @click="windowState=7">{{ i18n("askscholarship") }}</button>
|
||||
<button @click="windowState=7" v-if="minerv.value.toPay <= 0">{{ i18n("askscholarship") }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="windowState === 5">
|
||||
|
@ -78,4 +78,8 @@ export async function editExempReqState(id, newstate){
|
||||
|
||||
export async function getExempByUser(userId){
|
||||
return restGet("/exemptionreq/"+userId)
|
||||
}
|
||||
|
||||
export async function imposeCurriculum(id, cursusid){
|
||||
return restPatch("/request/registerequivimpose/"+id+"/"+cursusid)
|
||||
}
|
Loading…
Reference in New Issue
Block a user