Compare commits
No commits in common. "4485dbf8035c46086e1ef2187f31d2cfca28c0d2" and "172837d6d1cb5e9b1eb95217bd2312d923234256" have entirely different histories.
4485dbf803
...
172837d6d1
@ -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,12 +3,10 @@ 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;
|
||||
@ -21,11 +19,10 @@ public class InscriptionController {
|
||||
|
||||
private final InscriptionService inscriptionServ;
|
||||
private final AuthenticatorService authServ;
|
||||
private final CurriculumRepository curriculumRepository;
|
||||
public InscriptionController(InscriptionService inscriptionServ, AuthenticatorService authServ, CurriculumRepository curriculumRepository){
|
||||
|
||||
public InscriptionController(InscriptionService inscriptionServ, AuthenticatorService authServ){
|
||||
this.inscriptionServ = inscriptionServ;
|
||||
this.authServ = authServ;
|
||||
this.curriculumRepository = curriculumRepository;
|
||||
}
|
||||
|
||||
|
||||
@ -106,31 +103,4 @@ 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,7 +5,10 @@ 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.*;
|
||||
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.UserCurriculumRepository;
|
||||
import ovh.herisson.Clyde.Repositories.UserRepository;
|
||||
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
|
||||
@ -14,7 +17,6 @@ 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;
|
||||
|
||||
@ -37,10 +39,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, MinervalRepository minervalRepository, 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) {
|
||||
this.tokenService = tokenService;
|
||||
this.err = err;
|
||||
this.srr = srr;
|
||||
@ -51,7 +53,6 @@ public class RequestsController {
|
||||
this.userService = userService;
|
||||
this.userCurriculumRepository = userCurriculumRepository;
|
||||
this.curriculumRepository = curriculumRepository;
|
||||
this.minervalRepository = minervalRepository;
|
||||
this.changeCurriculumRequestRepository = changeCurriculumRequestRepository;
|
||||
}
|
||||
|
||||
@ -153,8 +154,6 @@ 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);
|
||||
@ -163,12 +162,6 @@ 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,8 +89,7 @@ public class InscriptionService {
|
||||
inscrRequest.getCountry(),
|
||||
inscrRequest.getBirthDate(),
|
||||
inscrRequest.getProfilePicture(),
|
||||
inscrRequest.getPassword(),
|
||||
inscrRequest.getIdentityCard()
|
||||
inscrRequest.getPassword()
|
||||
);
|
||||
|
||||
userService.save(userFromRequest);
|
||||
|
@ -29,7 +29,6 @@ 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,7 +28,6 @@ public class User {
|
||||
private Date birthDate;
|
||||
private String profilePictureUrl;
|
||||
private Role role;
|
||||
private String identityCardUrl;
|
||||
@JsonIgnore
|
||||
private String password;
|
||||
|
||||
@ -54,10 +53,8 @@ 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 identityCardUrl)
|
||||
String country, Date birthDate, String profilePictureUrl, String password)
|
||||
{
|
||||
this.lastName = lastName;
|
||||
this.firstName = firstName;
|
||||
@ -68,7 +65,6 @@ public class User {
|
||||
this.profilePictureUrl = profilePictureUrl;
|
||||
this.password = password;
|
||||
this.role = Role.Student;
|
||||
this.identityCardUrl = identityCardUrl;
|
||||
}
|
||||
public User() {}
|
||||
|
||||
@ -142,12 +138,4 @@ public class User {
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public void setIdentityCardUrl(String identityCardUrl) {
|
||||
this.identityCardUrl = identityCardUrl;
|
||||
}
|
||||
|
||||
public String getIdentityCardUrl() {
|
||||
return identityCardUrl;
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ app.studentList=Students List
|
||||
app.users=Users
|
||||
app.manageOwnLessons=Manage Owned Courses Schedule
|
||||
app.lessonRequests=Schedule Requests
|
||||
app.payments=Payments
|
||||
app.payments = Payments
|
||||
request.moreInfos=More Infos
|
||||
request.accept=Accept
|
||||
request.refuse=Refuse
|
||||
@ -142,7 +142,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 :
|
||||
@ -204,6 +204,3 @@ 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
|
||||
|
@ -38,7 +38,7 @@ app.studentList=Liste des étudiants
|
||||
app.users=Utilisateurs
|
||||
app.manageOwnLessons=Gérer ses horaires de cours
|
||||
app.lessonRequests=Requêtes d'horaire
|
||||
app.payments=Payements
|
||||
app.payments = Payements
|
||||
request.moreInfos=Plus d'Infos
|
||||
request.accept=Accepter
|
||||
request.refuse=Refuser
|
||||
@ -204,6 +204,3 @@ 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,12 +1,15 @@
|
||||
<script setup>
|
||||
|
||||
import {
|
||||
editChangeCurrReq, editChangeCurrReqTeacherState,
|
||||
getChangeCurrReqById,
|
||||
addUninscReq, editChangeCurrReq, editChangeCurrReqTeacherState,
|
||||
editScholarshipReq,
|
||||
editUnregReq, getChangeCurrReqById,
|
||||
getScholarshipReqById,
|
||||
getUnregisterbyId
|
||||
} from "@/rest/requests.js";
|
||||
import i18n from "@/i18n.js";
|
||||
import {getSelf} from "@/rest/Users.js";
|
||||
import {ref} from "vue";
|
||||
import {getSelf, getUser} from "@/rest/Users.js";
|
||||
import {reactive, ref} from "vue";
|
||||
import AboutStudent from "@/Apps/Inscription/AboutStudent.vue";
|
||||
|
||||
const props = defineProps(["reqId"])
|
||||
@ -85,6 +88,11 @@ async function editChangeCurrReqTeacherApproval(state){
|
||||
"minfos minfos";
|
||||
}
|
||||
|
||||
.profilPic{
|
||||
width:100%;
|
||||
grid-area:profilPic;
|
||||
}
|
||||
|
||||
.globalInfos {
|
||||
grid-area:globalInfos;
|
||||
align-self :center;
|
||||
@ -100,6 +108,13 @@ 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,11 +1,15 @@
|
||||
<script setup>
|
||||
|
||||
import {
|
||||
addUninscReq,
|
||||
editExempReqState,
|
||||
editScholarshipReq,
|
||||
getExempReq,
|
||||
getScholarshipReqById
|
||||
} from "@/rest/requests.js";
|
||||
import i18n from "@/i18n.js";
|
||||
import {ref} from "vue";
|
||||
import {getUser} from "@/rest/Users.js";
|
||||
import {reactive, ref} from "vue";
|
||||
import AboutStudent from "@/Apps/Inscription/AboutStudent.vue";
|
||||
|
||||
const props = defineProps(["reqId"])
|
||||
@ -40,7 +44,7 @@ async function editExemp(newstate){
|
||||
<button @click="profile = !profile">{{ i18n("seeprofile") }}</button>
|
||||
</div>
|
||||
<div>
|
||||
<button><a :href="req.justifDocument">{{ i18n("dljustifdoc") }}</a></button>
|
||||
<button>{{ i18n("dljustifdoc") }}</button>
|
||||
</div>
|
||||
<div>
|
||||
<button v-if="req.state === 'Pending'" @click="req.state='Accepted';editExemp('Accepted')">{{ i18n("request.accept") }}</button>
|
||||
@ -72,6 +76,11 @@ async function editExemp(newstate){
|
||||
"minfos minfos";
|
||||
}
|
||||
|
||||
.profilPic{
|
||||
width:100%;
|
||||
grid-area:profilPic;
|
||||
}
|
||||
|
||||
.globalInfos {
|
||||
grid-area:globalInfos;
|
||||
align-self :center;
|
||||
@ -87,6 +96,13 @@ 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,23 +1,20 @@
|
||||
<script setup>
|
||||
import i18n from "@/i18n.js"
|
||||
import {getSelf} from '../../rest/Users.js'
|
||||
import {getAllCurriculums, getcurriculum} from "@/rest/curriculum.js";
|
||||
import {getSelf, getUser} from '../../rest/Users.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";
|
||||
import {ref} from "vue";
|
||||
import ExternalCurriculumList from "@/Apps/Inscription/ExternalCurriculumList.vue";
|
||||
import {editEquivalenceState, imposeCurriculum} from "@/rest/requests.js";
|
||||
import {editEquivalenceState} 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")
|
||||
@ -31,10 +28,6 @@ function getPP(){
|
||||
async function editEquivalence(id, newstate){
|
||||
await editEquivalenceState(id, newstate)
|
||||
}
|
||||
|
||||
async function refreshCursus(){
|
||||
cursus.value = await getcurriculum(request.curriculum)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -64,10 +57,10 @@ async function refreshCursus(){
|
||||
{{ i18n("WantedCursus") }} : BAB {{cursus.year}} {{cursus.option}}
|
||||
</div>
|
||||
<div style="margin-top: 3%">
|
||||
<button><a :href="request.identityCard">{{ i18n("dlidentitycard") }}</a></button>
|
||||
<button v-if="request.admissionDocUrl != null"><a :href="request.admissionDocUrl">{{ i18n("dladmissiondoc") }}</a></button>
|
||||
<a :href="request.identityCard">{{ i18n("dlidentitycard") }}</a>
|
||||
<button v-if="request.admissionDocUrl != null">{{ i18n("dladmissiondoc") }}</button>
|
||||
</div>
|
||||
<div v-if="externalCurriculum.length !== 0">
|
||||
<div v-if="cursus.year > 1">
|
||||
<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>
|
||||
@ -80,20 +73,9 @@ async function refreshCursus(){
|
||||
<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' && !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>
|
||||
<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>
|
||||
</template>
|
||||
|
@ -1,7 +1,8 @@
|
||||
<script setup>
|
||||
|
||||
import {editScholarshipReq, getScholarshipReqById} from "@/rest/requests.js";
|
||||
import {addUninscReq, 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"])
|
||||
@ -53,8 +54,8 @@ async function uploadandrefreshScholarshipRequest(){
|
||||
{{ i18n("login.guest.birthday") }} : {{user.birthDate.slice(0,10)}}
|
||||
</div>
|
||||
<div>
|
||||
<button><a :href="req.taxDocUrl">{{ i18n("dltaxdoc") }}</a></button>
|
||||
<button style="margin-left: 2%"><a :href="req.residencyDocUrl">{{ i18n("dlresidency") }}</a></button>
|
||||
<button @click="">{{ i18n("dltaxdoc") }}</button>
|
||||
<button style="margin-left: 2%">{{ i18n("dlresidency") }}</button>
|
||||
</div>
|
||||
<div v-if="req.state == 'Pending'" style="margin-top: 2%; margin-bottom: 2%;">
|
||||
{{i18n("enteramount")}}
|
||||
|
@ -5,6 +5,7 @@
|
||||
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,9 @@
|
||||
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){
|
||||
@ -19,6 +23,17 @@
|
||||
}
|
||||
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>
|
||||
@ -45,7 +60,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"><a :href="user.identityCard">{{i18n("dlidentitycard")}}</a></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>
|
||||
|
@ -1,15 +1,26 @@
|
||||
<script setup>
|
||||
|
||||
import {
|
||||
addUninscReq,
|
||||
editScholarshipReq,
|
||||
editUnregReq,
|
||||
getScholarshipReqById,
|
||||
getUnregisterbyId
|
||||
} from "@/rest/requests.js";
|
||||
import i18n from "@/i18n.js";
|
||||
import {ref} from "vue";
|
||||
import {getUser} from "@/rest/Users.js";
|
||||
import {reactive, 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
|
||||
@ -58,9 +69,15 @@ async function uploadandrefreshUnregRequest(state){
|
||||
"minfos minfos";
|
||||
}
|
||||
|
||||
.profilPic{
|
||||
width:100%;
|
||||
grid-area:profilPic;
|
||||
}
|
||||
|
||||
.globalInfos {
|
||||
grid-area:globalInfos;
|
||||
align-self :center;
|
||||
|
||||
}
|
||||
|
||||
.body {
|
||||
@ -72,6 +89,13 @@ 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,8 +2,9 @@
|
||||
|
||||
import {reactive, ref} from "vue";
|
||||
import i18n from "@/i18n.js";
|
||||
import {getCourse} from "@/rest/courses.js";
|
||||
import {getcurriculum} from "@/rest/curriculum.js";
|
||||
import {uploadFile} from "@/rest/uploads.js";
|
||||
import {uploadFile, uploadProfilePicture} from "@/rest/uploads.js";
|
||||
import {createExemptionsRequest, getExempByUser} from "@/rest/requests.js";
|
||||
import {getSelf} from "@/rest/Users.js";
|
||||
|
||||
@ -13,7 +14,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)
|
||||
|
||||
@ -56,7 +57,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>
|
||||
@ -65,22 +66,19 @@ function isExempted(course){
|
||||
<button @click="windowState = 0">{{ i18n("courses.back")}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="list === false" class="infosContainer">
|
||||
<p v-if="!submitted">{{ i18n("uploadjustifdoc") }} </p>
|
||||
<div v-if="list === false" class="infosContainer">
|
||||
<p>{{ i18n("uploadjustifdoc") }} </p>
|
||||
<div>
|
||||
<label class="browser" v-if="!submitted">
|
||||
<input type="file" @change="ppData.value = $event.target.files" ref="filepath">
|
||||
<label class="browser">
|
||||
<input type="file" @change="ppData.value = $event.target.files" accept="image/*" ref="filepath">
|
||||
</label>
|
||||
</div>
|
||||
<button style="margin-top: 3%" v-if="!submitted" @click="postExemptionRequest(ppData.value, 'JustificationDocument');submitted=!submitted">
|
||||
<button style="margin-top: 3%" @click="postExemptionRequest(ppData.value, 'JustificationDocument');">
|
||||
{{ i18n("subexemreq") }}
|
||||
</button>
|
||||
<div v-if="submitted">
|
||||
{{i18n("reqsent")}}
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="list === false">
|
||||
<button @click="list=!list;submitted=!submitted">{{ i18n("courses.back") }}</button>
|
||||
<button @click="list=!list">{{ i18n("courses.back") }}</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
completion : "completed",
|
||||
startYear : 0,
|
||||
endYear: 0,
|
||||
justifdocUrl : "",
|
||||
justifdocUrl : null,
|
||||
userRegNo : null
|
||||
})
|
||||
|
||||
@ -43,6 +43,7 @@
|
||||
|
||||
if(props.mode !== 2){
|
||||
extCurrList.value = props.extCurrList
|
||||
console.log("oe")
|
||||
}
|
||||
|
||||
function deleteExtCursus(extcursus){
|
||||
@ -85,7 +86,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" v-if="props.mode!==2"><button><a :href="item.justifdocUrl">{{ i18n("dldoc") }}</a></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>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
import i18n from "@/i18n.js"
|
||||
import {ref, watch} from 'vue'
|
||||
import {ref, vModelSelect, 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(i18n("inscription"));
|
||||
const requestType = ref("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' && (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="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 === i18n('scholarship')">
|
||||
@ -131,12 +131,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="infosContainer" style='margin-left:15%;display:flex; justify-content:center; width: 70%;margin-top: 10%' v-if="windowsState === 2">
|
||||
<div style='display:flex; justify-content:center; min-width:1140px;margin-top: 10%' v-if="windowsState === 2">
|
||||
<p>{{ i18n("surreq") }}</p>
|
||||
<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>
|
||||
<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>
|
||||
@ -255,15 +253,7 @@
|
||||
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,5 +1,6 @@
|
||||
<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} from '@/rest/curriculum.js'
|
||||
import {getAllCurriculums, getcurriculum} from '@/rest/curriculum.js'
|
||||
import {uploadFile, uploadProfilePicture} from '@/rest/uploads.js'
|
||||
import {toast} from 'vue3-toastify'
|
||||
import 'vue3-toastify/dist/index.css';
|
||||
@ -31,9 +31,8 @@
|
||||
const passwordConfirm=ref("")
|
||||
|
||||
const imageSaved = ref(false)
|
||||
let ppData = ""
|
||||
|
||||
|
||||
const ppData = ref({})
|
||||
const idcardfile = ref({})
|
||||
const justifcardfile = ref({})
|
||||
|
||||
@ -59,6 +58,11 @@
|
||||
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){
|
||||
@ -73,7 +77,6 @@
|
||||
//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")
|
||||
@ -86,7 +89,7 @@
|
||||
justif = null
|
||||
}
|
||||
|
||||
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);
|
||||
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){
|
||||
const temp = await uploadFile(externalCurrTab.value[item].justifdocUrl, "JustificationDocument")
|
||||
@ -175,10 +178,10 @@
|
||||
</form>
|
||||
<label class="browser">
|
||||
{{i18n("login.guest.browse")}}
|
||||
<input type="file" :disabled="imageSaved" @change="ppData = $event.target.files; imageSaved = true;" accept="image/*">
|
||||
<input type="file" :disabled="imageSaved" @change="ppData = uploadProfilePicture($event.target.files); imageSaved = true;" accept="image/*">
|
||||
</label>
|
||||
<form novalidate enctype="multipart/form-data" class="inputBox">
|
||||
<input type="file" @change="imageSaved = true;" accept="image/*">
|
||||
<input type="file" @change="uploadPP($event.target.files); imageSaved = true;" accept="image/*">
|
||||
</form>
|
||||
<div class="inputBox">
|
||||
<p>{{i18n("Curriculum").toUpperCase()}}</p>
|
||||
@ -218,17 +221,15 @@
|
||||
</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();page+=2">{{ i18n("login.guest.sendRegReq") }}</button>
|
||||
<button @click="postRegisterReq();">{{ 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>
|
||||
@ -296,7 +297,13 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
.bodu {
|
||||
margin-top:2%;
|
||||
width:50%;
|
||||
border:2px solid black;
|
||||
border-radius:9px;
|
||||
background-color:rgb(50,50,50);
|
||||
}
|
||||
|
||||
.switchpage{
|
||||
width:100px;
|
||||
@ -335,8 +342,22 @@ 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>
|
||||
|
@ -67,7 +67,7 @@
|
||||
await alterCourse(course.courseID,{owner:toModify[element].regNo});
|
||||
}
|
||||
else if(element == "title" && (toModify[element] != course.title)){
|
||||
await alterCourse(course.courseID,{title:toModify[element]});
|
||||
await alterCourse(course.courseId,{title:toModify[element]});
|
||||
}
|
||||
else if(element == "credits" && (parseInt(toModify[element]) != course.credits)){
|
||||
await alterCourse(course.courseID,{credits:parseInt(toModify[element])});
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script setup>
|
||||
import {reactive, ref } from 'vue'
|
||||
import {getSelf,alterSelf} from '../rest/Users.js'
|
||||
import {getAllCurriculums, getSomeonesCurriculumList, getcurriculum} from '../rest/curriculum.js'
|
||||
import {getSelf,alterSelf,disconnect,deleteUser} from '../rest/Users.js'
|
||||
import {getSelfCurriculum, 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,6 +119,16 @@
|
||||
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"
|
||||
@ -126,6 +136,14 @@
|
||||
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)
|
||||
}
|
||||
@ -240,7 +258,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>
|
||||
@ -253,7 +271,7 @@
|
||||
{{ i18n("alreadypaid") }}
|
||||
</div>
|
||||
<div>
|
||||
<button @click="windowState=7" v-if="minerv.value.toPay <= 0">{{ i18n("askscholarship") }}</button>
|
||||
<button @click="windowState=7">{{ i18n("askscholarship") }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="windowState === 5">
|
||||
|
@ -78,8 +78,4 @@ 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