Compare commits
	
		
			8 Commits
		
	
	
		
			e0a3a618a1
			...
			master
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| fa1a2c6d3b | |||
| 4485dbf803 | |||
| b52c50fd76 | |||
| 172837d6d1 | |||
| 9a5115f7fe | |||
| 0d6b4ec57c | |||
| 43f3d66eb9 | |||
| e25ead6230 | 
| @ -46,5 +46,5 @@ jobs: | |||||||
|         scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r * ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:api/ |         scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r * ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:api/ | ||||||
|     - name: restarting the backend  |     - name: restarting the backend  | ||||||
|       run: | |       run: | | ||||||
|         ssh -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd api/ && docker-compose up --force-recreate --build -d' |         ssh -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd api/ && sed -i compose.yaml -e "s/8080:8080/4001:8080/" -e "s/8000:8080/4000:8080/" && docker-compose up --force-recreate --build -d' | ||||||
|     - run: echo "The backend has been deployed. running at https://clyde.herisson.ovh/api" |     - run: echo "The backend has been deployed. running at https://clyde.herisson.ovh/api" | ||||||
|  | |||||||
| @ -27,6 +27,7 @@ dependencies { | |||||||
| 	implementation("com.kohlschutter.junixsocket:junixsocket-core:2.9.0") | 	implementation("com.kohlschutter.junixsocket:junixsocket-core:2.9.0") | ||||||
| 	// implementation("org.springframework.session:spring-session-jdbc") | 	// implementation("org.springframework.session:spring-session-jdbc") | ||||||
| 	developmentOnly("org.springframework.boot:spring-boot-devtools") | 	developmentOnly("org.springframework.boot:spring-boot-devtools") | ||||||
|  | 	developmentOnly("org.springframework.boot:spring-boot-docker-compose") | ||||||
| 	runtimeOnly("org.postgresql:postgresql") | 	runtimeOnly("org.postgresql:postgresql") | ||||||
| 	testImplementation("org.springframework.boot:spring-boot-starter-test") | 	testImplementation("org.springframework.boot:spring-boot-starter-test") | ||||||
| 	testImplementation("org.springframework.boot:spring-boot-testcontainers") | 	testImplementation("org.springframework.boot:spring-boot-testcontainers") | ||||||
|  | |||||||
| @ -88,7 +88,6 @@ public class CourseController { | |||||||
|     { |     { | ||||||
|         if (authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token)) |         if (authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token)) | ||||||
|             return new UnauthorizedResponse<>(null); |             return new UnauthorizedResponse<>(null); | ||||||
|         System.out.println(course.getOwner().getRegNo()); |  | ||||||
|         Course createdCourse = courseServ.save(course); |         Course createdCourse = courseServ.save(course); | ||||||
|         if (createdCourse == null) |         if (createdCourse == null) | ||||||
|             return new ResponseEntity<>(null,HttpStatus.BAD_REQUEST); |             return new ResponseEntity<>(null,HttpStatus.BAD_REQUEST); | ||||||
|  | |||||||
| @ -39,7 +39,7 @@ public class ExternalCurriculumController { | |||||||
|             user = userRepository.findById((Integer) externalCurrInfos.get("userRegNo")); |             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); |         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.HttpStatus; | ||||||
| import org.springframework.http.ResponseEntity; | import org.springframework.http.ResponseEntity; | ||||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||||
|  | import ovh.herisson.Clyde.Repositories.CurriculumRepository; | ||||||
| import ovh.herisson.Clyde.Responses.UnauthorizedResponse; | import ovh.herisson.Clyde.Responses.UnauthorizedResponse; | ||||||
| import ovh.herisson.Clyde.Services.AuthenticatorService; | import ovh.herisson.Clyde.Services.AuthenticatorService; | ||||||
| import ovh.herisson.Clyde.Services.Inscription.InscriptionService; | import ovh.herisson.Clyde.Services.Inscription.InscriptionService; | ||||||
| import ovh.herisson.Clyde.Services.ProtectionService; | import ovh.herisson.Clyde.Services.ProtectionService; | ||||||
|  | import ovh.herisson.Clyde.Tables.Curriculum; | ||||||
| import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest; | import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest; | ||||||
| import ovh.herisson.Clyde.Tables.RequestState; | import ovh.herisson.Clyde.Tables.RequestState; | ||||||
| import ovh.herisson.Clyde.Tables.Role; | import ovh.herisson.Clyde.Tables.Role; | ||||||
| @ -19,10 +21,11 @@ public class InscriptionController { | |||||||
|  |  | ||||||
|     private final InscriptionService inscriptionServ; |     private final InscriptionService inscriptionServ; | ||||||
|     private final AuthenticatorService authServ; |     private final AuthenticatorService authServ; | ||||||
|  |     private final CurriculumRepository curriculumRepository; | ||||||
|     public InscriptionController(InscriptionService inscriptionServ, AuthenticatorService authServ){ |     public InscriptionController(InscriptionService inscriptionServ, AuthenticatorService authServ, CurriculumRepository curriculumRepository){ | ||||||
|         this.inscriptionServ = inscriptionServ; |         this.inscriptionServ = inscriptionServ; | ||||||
|         this.authServ = authServ; |         this.authServ = authServ; | ||||||
|  |         this.curriculumRepository = curriculumRepository; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
| @ -103,4 +106,31 @@ public class InscriptionController { | |||||||
|         } |         } | ||||||
|         return new ResponseEntity<>(HttpStatus.OK); |         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 org.springframework.web.bind.annotation.*; | ||||||
| import ovh.herisson.Clyde.Repositories.CourseRepository; | import ovh.herisson.Clyde.Repositories.CourseRepository; | ||||||
| import ovh.herisson.Clyde.Repositories.CurriculumRepository; | import ovh.herisson.Clyde.Repositories.CurriculumRepository; | ||||||
| import ovh.herisson.Clyde.Repositories.Inscription.ChangeCurriculumRequestRepository; | import ovh.herisson.Clyde.Repositories.Inscription.*; | ||||||
| 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.UserCurriculumRepository; | ||||||
| import ovh.herisson.Clyde.Repositories.UserRepository; | import ovh.herisson.Clyde.Repositories.UserRepository; | ||||||
| import ovh.herisson.Clyde.Responses.UnauthorizedResponse; | 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.Services.UserService; | ||||||
| import ovh.herisson.Clyde.Tables.*; | import ovh.herisson.Clyde.Tables.*; | ||||||
| import ovh.herisson.Clyde.Tables.Inscription.ExemptionsRequest; | 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.ScholarshipRequest; | ||||||
| import ovh.herisson.Clyde.Tables.Inscription.UnregisterRequest; | import ovh.herisson.Clyde.Tables.Inscription.UnregisterRequest; | ||||||
|  |  | ||||||
| @ -39,10 +37,10 @@ public class RequestsController { | |||||||
|     public final UserService userService; |     public final UserService userService; | ||||||
|     public final UserCurriculumRepository userCurriculumRepository; |     public final UserCurriculumRepository userCurriculumRepository; | ||||||
|     public final CurriculumRepository curriculumRepository; |     public final CurriculumRepository curriculumRepository; | ||||||
|  |     public final MinervalRepository minervalRepository; | ||||||
|     public final ChangeCurriculumRequestRepository changeCurriculumRequestRepository; |     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.tokenService = tokenService; | ||||||
|         this.err = err; |         this.err = err; | ||||||
|         this.srr = srr; |         this.srr = srr; | ||||||
| @ -53,6 +51,7 @@ public class RequestsController { | |||||||
|         this.userService = userService; |         this.userService = userService; | ||||||
|         this.userCurriculumRepository = userCurriculumRepository; |         this.userCurriculumRepository = userCurriculumRepository; | ||||||
|         this.curriculumRepository = curriculumRepository; |         this.curriculumRepository = curriculumRepository; | ||||||
|  |         this.minervalRepository = minervalRepository; | ||||||
|         this.changeCurriculumRequestRepository = changeCurriculumRequestRepository; |         this.changeCurriculumRequestRepository = changeCurriculumRequestRepository; | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @ -154,6 +153,8 @@ public class RequestsController { | |||||||
|  |  | ||||||
|         ScholarshipRequest scholarshipRequest = srr.findById((Integer) infos.get("id")); |         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 the request is already accepted we just return ok (otherwise we would duplicate the procedure below) | ||||||
|         if (scholarshipRequest.getState() == RequestState.Accepted){ |         if (scholarshipRequest.getState() == RequestState.Accepted){ | ||||||
|             return new ResponseEntity<>(HttpStatus.OK); |             return new ResponseEntity<>(HttpStatus.OK); | ||||||
| @ -162,6 +163,12 @@ public class RequestsController { | |||||||
|         if (infos.get("state").equals("Accepted")){ |         if (infos.get("state").equals("Accepted")){ | ||||||
|             scholarshipRequest.setState(RequestState.Accepted); |             scholarshipRequest.setState(RequestState.Accepted); | ||||||
|             scholarshipRequest.setAmount((int) infos.get("amount")); |             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{ |         }else{ | ||||||
|             scholarshipRequest.setState(RequestState.Refused); |             scholarshipRequest.setState(RequestState.Refused); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -89,7 +89,8 @@ public class InscriptionService { | |||||||
|                 inscrRequest.getCountry(), |                 inscrRequest.getCountry(), | ||||||
|                 inscrRequest.getBirthDate(), |                 inscrRequest.getBirthDate(), | ||||||
|                 inscrRequest.getProfilePicture(), |                 inscrRequest.getProfilePicture(), | ||||||
|                 inscrRequest.getPassword() |                 inscrRequest.getPassword(), | ||||||
|  |                 inscrRequest.getIdentityCard() | ||||||
|         ); |         ); | ||||||
|  |  | ||||||
|         userService.save(userFromRequest); |         userService.save(userFromRequest); | ||||||
|  | |||||||
| @ -74,8 +74,8 @@ public class LessonRequestService { | |||||||
|         if(lessonRequest == null || state == lessonRequest.getState()  || state == null){ |         if(lessonRequest == null || state == lessonRequest.getState()  || state == null){ | ||||||
|             return false;} |             return false;} | ||||||
|         if (state == RequestState.Accepted){ |         if (state == RequestState.Accepted){ | ||||||
|             Course course = courseRepository.findById(lessonRequest.getCourse().getCourseId()); |             Course course = courseRepository.findById(lessonRequest.getCourse().getCourseID()); | ||||||
|             if(courseRepository.findById(lessonRequest.getCourse().getCourseId())==null|| local == null){ |             if(courseRepository.findById(lessonRequest.getCourse().getCourseID())==null|| local == null){ | ||||||
|                 return false;} |                 return false;} | ||||||
|             Lesson lesson = new Lesson(); |             Lesson lesson = new Lesson(); | ||||||
|             lesson.setCourse(course); |             lesson.setCourse(course); | ||||||
|  | |||||||
| @ -103,7 +103,7 @@ public class LessonService { | |||||||
|                 case "lessonType": |                 case "lessonType": | ||||||
|                     target.setLessonType((String) entry.getValue()); |                     target.setLessonType((String) entry.getValue()); | ||||||
|                     break; |                     break; | ||||||
|                 case "courseId": |                 case "courseID": | ||||||
|                     target.setCourse(courseRepo.findById((int) entry.getValue())); |                     target.setCourse(courseRepo.findById((int) entry.getValue())); | ||||||
|                     break; |                     break; | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -29,6 +29,7 @@ public class ProtectionService { | |||||||
|         toReturn.put("country",user.getCountry()); |         toReturn.put("country",user.getCountry()); | ||||||
|         toReturn.put("profilePictureUrl",user.getProfilePictureUrl()); |         toReturn.put("profilePictureUrl",user.getProfilePictureUrl()); | ||||||
|         toReturn.put("role",user.getRole()); |         toReturn.put("role",user.getRole()); | ||||||
|  |         toReturn.put("identityCard", user.getIdentityCardUrl()); | ||||||
|         return toReturn; |         return toReturn; | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @ -50,7 +51,7 @@ public class ProtectionService { | |||||||
|  |  | ||||||
|         HashMap<String ,Object> toReturn = new HashMap<>(); |         HashMap<String ,Object> toReturn = new HashMap<>(); | ||||||
|  |  | ||||||
|         toReturn.put("courseID",course.getCourseId()); |         toReturn.put("courseID",course.getCourseID()); | ||||||
|         toReturn.put("credits",course.getCredits()); |         toReturn.put("credits",course.getCredits()); | ||||||
|         toReturn.put("title", course.getTitle()); |         toReturn.put("title", course.getTitle()); | ||||||
|         toReturn.put("owner", userWithoutPassword(course.getOwner())); |         toReturn.put("owner", userWithoutPassword(course.getOwner())); | ||||||
|  | |||||||
| @ -18,7 +18,7 @@ import org.hibernate.annotations.OnDeleteAction; | |||||||
| public class Course { | public class Course { | ||||||
|     @Id |     @Id | ||||||
|     @GeneratedValue(strategy = GenerationType.AUTO) |     @GeneratedValue(strategy = GenerationType.AUTO) | ||||||
|     private int courseId; |     private int courseID; | ||||||
|     private int credits; |     private int credits; | ||||||
|     private String title; |     private String title; | ||||||
|  |  | ||||||
|  | |||||||
| @ -28,6 +28,7 @@ public class User { | |||||||
|     private Date birthDate; |     private Date birthDate; | ||||||
|     private String profilePictureUrl; |     private String profilePictureUrl; | ||||||
|     private Role role; |     private Role role; | ||||||
|  |     private String identityCardUrl; | ||||||
| 	@JsonIgnore | 	@JsonIgnore | ||||||
|     private String password; |     private String password; | ||||||
|  |  | ||||||
| @ -53,8 +54,10 @@ public class User { | |||||||
|         this.password = password; |         this.password = password; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     //This constructor is used to add a student | ||||||
|     public User(String lastName, String firstName, String email, String address, |     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.lastName = lastName; | ||||||
|         this.firstName = firstName; |         this.firstName = firstName; | ||||||
| @ -65,6 +68,7 @@ public class User { | |||||||
|         this.profilePictureUrl = profilePictureUrl; |         this.profilePictureUrl = profilePictureUrl; | ||||||
|         this.password = password; |         this.password = password; | ||||||
|         this.role = Role.Student; |         this.role = Role.Student; | ||||||
|  |         this.identityCardUrl = identityCardUrl; | ||||||
|     } |     } | ||||||
|     public User() {} |     public User() {} | ||||||
|  |  | ||||||
| @ -138,4 +142,12 @@ public class User { | |||||||
|     public void setPassword(String password) { |     public void setPassword(String password) { | ||||||
|         this.password = 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.users=Users | ||||||
| app.manageOwnLessons=Manage Owned Courses Schedule | app.manageOwnLessons=Manage Owned Courses Schedule | ||||||
| app.lessonRequests=Schedule Requests | app.lessonRequests=Schedule Requests | ||||||
| app.payments = Payments | app.payments=Payments | ||||||
| request.moreInfos=More Infos | request.moreInfos=More Infos | ||||||
| request.accept=Accept | request.accept=Accept | ||||||
| request.refuse=Refuse | request.refuse=Refuse | ||||||
| @ -142,7 +142,7 @@ dltaxdoc=Download tax justification document | |||||||
| dlresidency=Download residency justification document | dlresidency=Download residency justification document | ||||||
| enteramount=Please enter the amount to provide : | enteramount=Please enter the amount to provide : | ||||||
| oldcursus=Old curriculums | oldcursus=Old curriculums | ||||||
| newcursus = New curriculums | newcursus=New curriculums | ||||||
| year=Year | year=Year | ||||||
| reason=Reason : | reason=Reason : | ||||||
| selectedcursus=Selected curriculum : | selectedcursus=Selected curriculum : | ||||||
| @ -204,3 +204,6 @@ chcur=Change from a cursus to another | |||||||
| iwouldlike=I would like to : | iwouldlike=I would like to : | ||||||
| newcurr=New curriculum | newcurr=New curriculum | ||||||
| cursusprereq=The cursus you selected has some prerequisites ensure that your external curriculum data is updated in your profile | 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.users=Utilisateurs | ||||||
| app.manageOwnLessons=Gérer ses horaires de cours | app.manageOwnLessons=Gérer ses horaires de cours | ||||||
| app.lessonRequests=Requêtes d'horaire | app.lessonRequests=Requêtes d'horaire | ||||||
| app.payments = Payements | app.payments=Payements | ||||||
| request.moreInfos=Plus d'Infos | request.moreInfos=Plus d'Infos | ||||||
| request.accept=Accepter | request.accept=Accepter | ||||||
| request.refuse=Refuser | request.refuse=Refuser | ||||||
| @ -204,3 +204,6 @@ chcur=Changer d'un cursus vers un autre | |||||||
| iwouldlike=Je voudrais : | iwouldlike=Je voudrais : | ||||||
| newcurr=Nouveau cursus | 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 | 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> | <script setup> | ||||||
|  |  | ||||||
| import { | import { | ||||||
|   addUninscReq, editChangeCurrReq, editChangeCurrReqTeacherState, |   editChangeCurrReq, editChangeCurrReqTeacherState, | ||||||
|   editScholarshipReq, |   getChangeCurrReqById, | ||||||
|   editUnregReq, getChangeCurrReqById, |  | ||||||
|   getScholarshipReqById, |  | ||||||
|   getUnregisterbyId |  | ||||||
| } from "@/rest/requests.js"; | } from "@/rest/requests.js"; | ||||||
| import i18n from "@/i18n.js"; | import i18n from "@/i18n.js"; | ||||||
| import {getSelf, getUser} from "@/rest/Users.js"; | import {getSelf} from "@/rest/Users.js"; | ||||||
| import {reactive, ref} from "vue"; | import {ref} from "vue"; | ||||||
| import AboutStudent from "@/Apps/Inscription/AboutStudent.vue"; | import AboutStudent from "@/Apps/Inscription/AboutStudent.vue"; | ||||||
|  |  | ||||||
| const props = defineProps(["reqId"]) | const props = defineProps(["reqId"]) | ||||||
| @ -88,11 +85,6 @@ async function editChangeCurrReqTeacherApproval(state){ | |||||||
|   "minfos minfos"; |   "minfos minfos"; | ||||||
| } | } | ||||||
|  |  | ||||||
| .profilPic{ |  | ||||||
|   width:100%; |  | ||||||
|   grid-area:profilPic; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .globalInfos { | .globalInfos { | ||||||
|   grid-area:globalInfos; |   grid-area:globalInfos; | ||||||
|   align-self :center; |   align-self :center; | ||||||
| @ -108,13 +100,6 @@ async function editChangeCurrReqTeacherApproval(state){ | |||||||
|   margin-top:7%; |   margin-top:7%; | ||||||
| } | } | ||||||
|  |  | ||||||
| .subContainter{ |  | ||||||
|   width:100%; |  | ||||||
|   background-color:rgb(50,50,50); |  | ||||||
|   border-radius:20px; |  | ||||||
|   border:4px solid black; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .infosContainer { | .infosContainer { | ||||||
|   min-width:350px; |   min-width:350px; | ||||||
|   padding-bottom:50px; |   padding-bottom:50px; | ||||||
|  | |||||||
| @ -1,15 +1,11 @@ | |||||||
| <script setup> | <script setup> | ||||||
|  |  | ||||||
| import { | import { | ||||||
|   addUninscReq, |  | ||||||
|   editExempReqState, |   editExempReqState, | ||||||
|   editScholarshipReq, |  | ||||||
|   getExempReq, |   getExempReq, | ||||||
|   getScholarshipReqById |  | ||||||
| } from "@/rest/requests.js"; | } from "@/rest/requests.js"; | ||||||
| import i18n from "@/i18n.js"; | import i18n from "@/i18n.js"; | ||||||
| import {getUser} from "@/rest/Users.js"; | import {ref} from "vue"; | ||||||
| import {reactive, ref} from "vue"; |  | ||||||
| import AboutStudent from "@/Apps/Inscription/AboutStudent.vue"; | import AboutStudent from "@/Apps/Inscription/AboutStudent.vue"; | ||||||
|  |  | ||||||
| const props = defineProps(["reqId"]) | const props = defineProps(["reqId"]) | ||||||
| @ -44,7 +40,7 @@ async function editExemp(newstate){ | |||||||
|             <button @click="profile = !profile">{{ i18n("seeprofile") }}</button> |             <button @click="profile = !profile">{{ i18n("seeprofile") }}</button> | ||||||
|           </div> |           </div> | ||||||
|           <div> |           <div> | ||||||
|             <button>{{ i18n("dljustifdoc") }}</button> |             <button><a :href="req.justifDocument">{{ i18n("dljustifdoc") }}</a></button> | ||||||
|           </div> |           </div> | ||||||
|           <div> |           <div> | ||||||
|             <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='Accepted';editExemp('Accepted')">{{ i18n("request.accept") }}</button> | ||||||
| @ -76,11 +72,6 @@ async function editExemp(newstate){ | |||||||
|   "minfos minfos"; |   "minfos minfos"; | ||||||
| } | } | ||||||
|  |  | ||||||
| .profilPic{ |  | ||||||
|   width:100%; |  | ||||||
|   grid-area:profilPic; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .globalInfos { | .globalInfos { | ||||||
|   grid-area:globalInfos; |   grid-area:globalInfos; | ||||||
|   align-self :center; |   align-self :center; | ||||||
| @ -96,13 +87,6 @@ async function editExemp(newstate){ | |||||||
|   margin-top:7%; |   margin-top:7%; | ||||||
| } | } | ||||||
|  |  | ||||||
| .subContainter{ |  | ||||||
|   width:100%; |  | ||||||
|   background-color:rgb(50,50,50); |  | ||||||
|   border-radius:20px; |  | ||||||
|   border:4px solid black; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .infosContainer { | .infosContainer { | ||||||
|   min-width:350px; |   min-width:350px; | ||||||
|   padding-bottom:50px; |   padding-bottom:50px; | ||||||
|  | |||||||
| @ -1,20 +1,23 @@ | |||||||
| <script setup> | <script setup> | ||||||
| import i18n from "@/i18n.js" | import i18n from "@/i18n.js" | ||||||
| import {getSelf, getUser} from '../../rest/Users.js' | import {getSelf} from '../../rest/Users.js' | ||||||
| import {getcurriculum} from "@/rest/curriculum.js"; | import {getAllCurriculums, getcurriculum} from "@/rest/curriculum.js"; | ||||||
| import {getRegisters} from "@/rest/ServiceInscription.js"; | import {getRegisters} from "@/rest/ServiceInscription.js"; | ||||||
| import {get} from "jsdom/lib/jsdom/named-properties-tracker.js"; |  | ||||||
| import {getExternalCurriculumByInscrReq} from "@/rest/externalCurriculum.js"; | import {getExternalCurriculumByInscrReq} from "@/rest/externalCurriculum.js"; | ||||||
| import {ref} from "vue"; | import {ref} from "vue"; | ||||||
| import ExternalCurriculumList from "@/Apps/Inscription/ExternalCurriculumList.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 props = defineProps(['target']); | ||||||
| const request = await getRegisters(props.target); | const request = await getRegisters(props.target); | ||||||
| const cursus = await getcurriculum(request.curriculum); | const cursus = await getcurriculum(request.curriculum); | ||||||
| const user = await getSelf(); | const user = await getSelf(); | ||||||
| const list = ref(false); | const list = ref(false); | ||||||
| const externalCurriculum = await getExternalCurriculumByInscrReq(request.id) | 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 | //Get the parent page windowState to display the correct button | ||||||
| const windowState = defineModel("windowState") | const windowState = defineModel("windowState") | ||||||
| @ -28,6 +31,10 @@ function getPP(){ | |||||||
| async function editEquivalence(id, newstate){ | async function editEquivalence(id, newstate){ | ||||||
|   await editEquivalenceState(id, newstate) |   await editEquivalenceState(id, newstate) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | async function refreshCursus(){ | ||||||
|  |   cursus.value = await getcurriculum(request.curriculum) | ||||||
|  | } | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
| @ -57,10 +64,10 @@ async function editEquivalence(id, newstate){ | |||||||
|             {{ i18n("WantedCursus") }} : BAB {{cursus.year}} {{cursus.option}} |             {{ i18n("WantedCursus") }} : BAB {{cursus.year}} {{cursus.option}} | ||||||
|           </div> |           </div> | ||||||
|           <div style="margin-top: 3%"> |           <div style="margin-top: 3%"> | ||||||
|             <a :href="request.identityCard">{{ i18n("dlidentitycard") }}</a> |             <button><a :href="request.identityCard">{{ i18n("dlidentitycard") }}</a></button> | ||||||
|             <button v-if="request.admissionDocUrl != null">{{ i18n("dladmissiondoc") }}</button> |             <button v-if="request.admissionDocUrl != null"><a :href="request.admissionDocUrl">{{ i18n("dladmissiondoc") }}</a></button> | ||||||
|           </div> |           </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> |             <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> | ||||||
| @ -73,9 +80,20 @@ async function editEquivalence(id, newstate){ | |||||||
|   <div v-if="list==true"> |   <div v-if="list==true"> | ||||||
|     <ExternalCurriculumList :ext-curr-list="externalCurriculum" :mode="0"></ExternalCurriculumList> |     <ExternalCurriculumList :ext-curr-list="externalCurriculum" :mode="0"></ExternalCurriculumList> | ||||||
|     <div style="margin-left: 15%;margin-top: 5%;"> |     <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' && !impose" @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%;margin-right: 3%" v-if="request.equivalenceState === 'Pending' && !impose" @click="list = false;editEquivalence(request.id, 'Refused'); request.equivalenceState='Refused'">{{i18n("refuseequiv")}}</button> | ||||||
|       <button style="margin-left: 2%" @click="list=false">Back</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> | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
|  | |||||||
| @ -1,8 +1,7 @@ | |||||||
| <script setup> | <script setup> | ||||||
|  |  | ||||||
| import {addUninscReq, editScholarshipReq, getScholarshipReqById} from "@/rest/requests.js"; | import {editScholarshipReq, getScholarshipReqById} from "@/rest/requests.js"; | ||||||
| import i18n from "@/i18n.js"; | import i18n from "@/i18n.js"; | ||||||
| import {getUser} from "@/rest/Users.js"; |  | ||||||
| import {reactive, ref} from "vue"; | import {reactive, ref} from "vue"; | ||||||
|  |  | ||||||
| const props = defineProps(["reqId"]) | const props = defineProps(["reqId"]) | ||||||
| @ -54,8 +53,8 @@ async function uploadandrefreshScholarshipRequest(){ | |||||||
|             {{ i18n("login.guest.birthday") }} : {{user.birthDate.slice(0,10)}} |             {{ i18n("login.guest.birthday") }} : {{user.birthDate.slice(0,10)}} | ||||||
|           </div> |           </div> | ||||||
|           <div> |           <div> | ||||||
|             <button @click="">{{ i18n("dltaxdoc") }}</button> |             <button><a :href="req.taxDocUrl">{{ i18n("dltaxdoc") }}</a></button> | ||||||
|             <button style="margin-left: 2%">{{ i18n("dlresidency") }}</button> |             <button style="margin-left: 2%"><a :href="req.residencyDocUrl">{{ i18n("dlresidency") }}</a></button> | ||||||
|           </div> |           </div> | ||||||
|           <div v-if="req.state == 'Pending'" style="margin-top: 2%; margin-bottom: 2%;"> |           <div v-if="req.state == 'Pending'" style="margin-top: 2%; margin-bottom: 2%;"> | ||||||
|             {{i18n("enteramount")}} |             {{i18n("enteramount")}} | ||||||
|  | |||||||
| @ -5,7 +5,6 @@ | |||||||
|   import {ref} from "vue"; |   import {ref} from "vue"; | ||||||
|   import ExternalCurriculumList from "@/Apps/Inscription/ExternalCurriculumList.vue"; |   import ExternalCurriculumList from "@/Apps/Inscription/ExternalCurriculumList.vue"; | ||||||
|   import {getExternalCurriculumByUser} from "@/rest/externalCurriculum.js"; |   import {getExternalCurriculumByUser} from "@/rest/externalCurriculum.js"; | ||||||
|   import {getUserActualCourses} from "@/rest/courses.js"; |  | ||||||
|  |  | ||||||
|   const props = defineProps(['target']) |   const props = defineProps(['target']) | ||||||
|   const user = await getUser(props.target) |   const user = await getUser(props.target) | ||||||
| @ -13,9 +12,6 @@ | |||||||
|   const externalcurrlist = await getExternalCurriculumByUser(user.regNo) |   const externalcurrlist = await getExternalCurriculumByUser(user.regNo) | ||||||
|   const extercurrlist = ref(false) |   const extercurrlist = ref(false) | ||||||
|  |  | ||||||
|   const courselist = await getUserActualCourses(user.regNo) |  | ||||||
|   console.log(courselist) |  | ||||||
|  |  | ||||||
|   const watchingUser = await getSelf() |   const watchingUser = await getSelf() | ||||||
|   function getPP(){ |   function getPP(){ | ||||||
|     if(user.profilePictureUrl === null){ |     if(user.profilePictureUrl === null){ | ||||||
| @ -23,17 +19,6 @@ | |||||||
|     } |     } | ||||||
|     return user.profilePictureUrl |     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> | </script> | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
| @ -60,7 +45,7 @@ | |||||||
|             {{ i18n("login.guest.birthday") }} : {{user.birthDate}} |             {{ i18n("login.guest.birthday") }} : {{user.birthDate}} | ||||||
|           </div> |           </div> | ||||||
|           <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> | ||||||
|           <div> |           <div> | ||||||
|             <button @click="extercurrlist=!extercurrlist">{{i18n("seeextcur")}}</button> |             <button @click="extercurrlist=!extercurrlist">{{i18n("seeextcur")}}</button> | ||||||
|  | |||||||
| @ -1,26 +1,15 @@ | |||||||
| <script setup> | <script setup> | ||||||
|  |  | ||||||
| import { | import { | ||||||
|   addUninscReq, |  | ||||||
|   editScholarshipReq, |  | ||||||
|   editUnregReq, |   editUnregReq, | ||||||
|   getScholarshipReqById, |  | ||||||
|   getUnregisterbyId |   getUnregisterbyId | ||||||
| } from "@/rest/requests.js"; | } from "@/rest/requests.js"; | ||||||
| import i18n from "@/i18n.js"; | import i18n from "@/i18n.js"; | ||||||
| import {getUser} from "@/rest/Users.js"; | import {ref} from "vue"; | ||||||
| import {reactive, ref} from "vue"; |  | ||||||
|  |  | ||||||
| const props = defineProps(["reqId"]) | const props = defineProps(["reqId"]) | ||||||
| const req = ref(await getUnregisterbyId(props.reqId)) | const req = ref(await getUnregisterbyId(props.reqId)) | ||||||
|  |  | ||||||
| function getPP(){ |  | ||||||
|   if(user.profilePictureUrl === null){ |  | ||||||
|     return "/Clyde.png" |  | ||||||
|   } |  | ||||||
|   return user.profilePictureUrl |  | ||||||
| } |  | ||||||
|  |  | ||||||
| async function uploadandrefreshUnregRequest(state){ | async function uploadandrefreshUnregRequest(state){ | ||||||
|   await editUnregReq(req.value.id, state) |   await editUnregReq(req.value.id, state) | ||||||
|   req.value.state = state |   req.value.state = state | ||||||
| @ -69,15 +58,9 @@ async function uploadandrefreshUnregRequest(state){ | |||||||
|   "minfos minfos"; |   "minfos minfos"; | ||||||
| } | } | ||||||
|  |  | ||||||
| .profilPic{ |  | ||||||
|   width:100%; |  | ||||||
|   grid-area:profilPic; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .globalInfos { | .globalInfos { | ||||||
|   grid-area:globalInfos; |   grid-area:globalInfos; | ||||||
|   align-self :center; |   align-self :center; | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
| .body { | .body { | ||||||
| @ -89,13 +72,6 @@ async function uploadandrefreshUnregRequest(state){ | |||||||
|   margin-top:7%; |   margin-top:7%; | ||||||
| } | } | ||||||
|  |  | ||||||
| .subContainter{ |  | ||||||
|   width:100%; |  | ||||||
|   background-color:rgb(50,50,50); |  | ||||||
|   border-radius:20px; |  | ||||||
|   border:4px solid black; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .infosContainer { | .infosContainer { | ||||||
|   min-width:350px; |   min-width:350px; | ||||||
|   padding-bottom:50px; |   padding-bottom:50px; | ||||||
|  | |||||||
| @ -2,9 +2,8 @@ | |||||||
|  |  | ||||||
| import {reactive, ref} from "vue"; | import {reactive, ref} from "vue"; | ||||||
| import i18n from "@/i18n.js"; | import i18n from "@/i18n.js"; | ||||||
| import {getCourse} from "@/rest/courses.js"; |  | ||||||
| import {getcurriculum} from "@/rest/curriculum.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 {createExemptionsRequest, getExempByUser} from "@/rest/requests.js"; | ||||||
| import {getSelf} from "@/rest/Users.js"; | import {getSelf} from "@/rest/Users.js"; | ||||||
|  |  | ||||||
| @ -14,7 +13,7 @@ const user = await getSelf() | |||||||
|  |  | ||||||
| const windowState = defineModel("windowState") | const windowState = defineModel("windowState") | ||||||
| const exempList = await getExempByUser(user.regNo) | const exempList = await getExempByUser(user.regNo) | ||||||
|  | const submitted = ref(false) | ||||||
| const courseslist = ref(await getcurriculum(selectedCurriculum.value.curriculumId)) | const courseslist = ref(await getcurriculum(selectedCurriculum.value.curriculumId)) | ||||||
| const list = ref(true) | const list = ref(true) | ||||||
|  |  | ||||||
| @ -57,7 +56,7 @@ function isExempted(course){ | |||||||
|           <div class="firstname">{{item.owner.firstName}}</div> |           <div class="firstname">{{item.owner.firstName}}</div> | ||||||
|           <div class="lastname">{{item.owner.lastName}}</div> |           <div class="lastname">{{item.owner.lastName}}</div> | ||||||
|           <div class="credits">credits : {{item.credits}}</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 v-else class="askexemption" style="font-size: 50%">{{ i18n("exemp") }}</div> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
| @ -66,19 +65,22 @@ function isExempted(course){ | |||||||
|       <button @click="windowState = 0">{{ i18n("courses.back")}}</button> |       <button @click="windowState = 0">{{ i18n("courses.back")}}</button> | ||||||
|     </div> |     </div> | ||||||
|   </div> |   </div> | ||||||
|   <div v-if="list === false" class="infosContainer"> |   <div v-if="list === false"  class="infosContainer"> | ||||||
|       <p>{{ i18n("uploadjustifdoc") }} </p> |       <p v-if="!submitted">{{ i18n("uploadjustifdoc") }} </p> | ||||||
|     <div> |     <div> | ||||||
|     <label class="browser"> |     <label class="browser" v-if="!submitted"> | ||||||
|       <input  type="file" @change="ppData.value = $event.target.files" accept="image/*" ref="filepath"> |       <input  type="file" @change="ppData.value = $event.target.files" ref="filepath"> | ||||||
|     </label> |     </label> | ||||||
|     </div> |     </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") }} |       {{ i18n("subexemreq") }} | ||||||
|     </button> |     </button> | ||||||
|  |     <div v-if="submitted"> | ||||||
|  |       {{i18n("reqsent")}} | ||||||
|  |     </div> | ||||||
|   </div> |   </div> | ||||||
|   <div v-if="list === false"> |   <div v-if="list === false"> | ||||||
|     <button @click="list=!list">{{ i18n("courses.back") }}</button> |     <button @click="list=!list;submitted=!submitted">{{ i18n("courses.back") }}</button> | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ | |||||||
|     completion : "completed", |     completion : "completed", | ||||||
|     startYear : 0, |     startYear : 0, | ||||||
|     endYear: 0, |     endYear: 0, | ||||||
|     justifdocUrl : null, |     justifdocUrl : "", | ||||||
|     userRegNo : null |     userRegNo : null | ||||||
|   }) |   }) | ||||||
|  |  | ||||||
| @ -43,7 +43,6 @@ | |||||||
|  |  | ||||||
|   if(props.mode !== 2){ |   if(props.mode !== 2){ | ||||||
|     extCurrList.value = props.extCurrList |     extCurrList.value = props.extCurrList | ||||||
|     console.log("oe") |  | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   function deleteExtCursus(extcursus){ |   function deleteExtCursus(extcursus){ | ||||||
| @ -86,7 +85,7 @@ | |||||||
|           <div class="school"><a>{{item.school}}</a></div> |           <div class="school"><a>{{item.school}}</a></div> | ||||||
|           <div class="formation"><a>{{item.formation}}</a></div> |           <div class="formation"><a>{{item.formation}}</a></div> | ||||||
|           <div class="completion"><a>{{item.completion}}</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="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 class="delete" v-if="props.mode === 2"><button @click="deleteExtCursus(item)">{{ i18n("delete") }}</button></div> | ||||||
|         </div> |         </div> | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| <script setup> | <script setup> | ||||||
|   import i18n from "@/i18n.js" |   import i18n from "@/i18n.js" | ||||||
|   import {ref, vModelSelect, watch} from 'vue' |   import {ref, watch} from 'vue' | ||||||
|   import {validateRegister, getAllRegisters } from '@/rest/ServiceInscription.js' |   import {validateRegister, getAllRegisters } from '@/rest/ServiceInscription.js' | ||||||
|   import AboutRequest from "@/Apps/Inscription/AboutRequest.vue"; |   import AboutRequest from "@/Apps/Inscription/AboutRequest.vue"; | ||||||
|   import { |   import { | ||||||
| @ -18,7 +18,7 @@ | |||||||
|   const requests = ref(await getAllRegisters()); |   const requests = ref(await getAllRegisters()); | ||||||
|   let targetId = ""; |   let targetId = ""; | ||||||
|   const user = await getSelf() |   const user = await getSelf() | ||||||
|   const requestType = ref("inscription"); |   const requestType = ref(i18n("inscription")); | ||||||
|   const filterType = ref("None"); |   const filterType = ref("None"); | ||||||
|  |  | ||||||
|   //0 = liste, 1 = détails, 2 = sure?, 3 = manage scholarship, 4 manage unregister, 5 = manage curriculum change, 6 = manage exemptions |   //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="equivalencestate" style="font-size: 80%">{{ i18n("teacherapproval") }} {{item.equivalenceState}}</div> | ||||||
|           <div class="surname">{{item.lastName}}</div> |           <div class="surname">{{item.lastName}}</div> | ||||||
|           <div class="firstname">{{item.firstName}}</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="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'"><button @click="upPage(item.id,'Refused')" style="background-color:rgb(105,0,0);">{{i18n("request.refuse")}}</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 class="infos"><button style="background-color:rgb(105,05,105);" @click="targetId=item.id;windowsState=1;">{{i18n("request.moreInfos")}}</button></div> | ||||||
|         </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')"> |         <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> | ||||||
|   </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> |     <p>{{ i18n("surreq") }}</p> | ||||||
|     <button style="background-color:rgb(105,05,105);" @click="upPage(targetId,'Accepted');windowsState=0;">{{ i18n("validate") }}</button> |     <div style="margin-left: 10%; margin-top: 1.5%; width: 30%"> | ||||||
|     <button style="background-color:rgb(105,05,105);" @click="windowsState=0;">{{ i18n("courses.back")}}</button> |       <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> | ||||||
|   <div v-if="windowsState === 3"> |   <div v-if="windowsState === 3"> | ||||||
|     <AboutScholarship :req-id="targetId"></AboutScholarship> |     <AboutScholarship :req-id="targetId"></AboutScholarship> | ||||||
| @ -253,7 +255,15 @@ | |||||||
|     background-color:rgb(50,50,50); |     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> | </style> | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,6 +1,5 @@ | |||||||
| <script setup> | <script setup> | ||||||
| import i18n from "@/i18n.js"; | import i18n from "@/i18n.js"; | ||||||
| import {ref} from "vue"; |  | ||||||
| import {getAllPayments} from "@/rest/requests.js"; | import {getAllPayments} from "@/rest/requests.js"; | ||||||
|  |  | ||||||
| const paymentsList = await getAllPayments() | const paymentsList = await getAllPayments() | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ | |||||||
|   import {reactive, ref } from 'vue' |   import {reactive, ref } from 'vue' | ||||||
|   import i18n from '@/i18n.js' |   import i18n from '@/i18n.js' | ||||||
|   import {login, register, disconnect, isLogged} from '@/rest/Users.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 {uploadFile, uploadProfilePicture} from '@/rest/uploads.js' | ||||||
|   import {toast} from 'vue3-toastify' |   import {toast} from 'vue3-toastify' | ||||||
|   import 'vue3-toastify/dist/index.css'; |   import 'vue3-toastify/dist/index.css'; | ||||||
| @ -31,8 +31,9 @@ | |||||||
|   const passwordConfirm=ref("") |   const passwordConfirm=ref("") | ||||||
|   |   | ||||||
|   const imageSaved = ref(false) |   const imageSaved = ref(false) | ||||||
|   let ppData = "" |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |   const ppData = ref({}) | ||||||
|   const idcardfile = ref({}) |   const idcardfile = ref({}) | ||||||
|   const justifcardfile = ref({}) |   const justifcardfile = ref({}) | ||||||
|  |  | ||||||
| @ -58,11 +59,6 @@ | |||||||
|   disconnect(); |   disconnect(); | ||||||
|   window.location.reload();} |   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) |   //This functions makes the distinction between a master cursus (year 4 or more) and a bachelor cursus (year 3 or less) | ||||||
|   function getCursusDisplay(cursus){ |   function getCursusDisplay(cursus){ | ||||||
|     if (cursus.year <= 3){ |     if (cursus.year <= 3){ | ||||||
| @ -77,6 +73,7 @@ | |||||||
|     //We upload the two files and we get their paths on the server |     //We upload the two files and we get their paths on the server | ||||||
|     const identityCardFile = await uploadFile(idcardfile.value, "IdentityCard") |     const identityCardFile = await uploadFile(idcardfile.value, "IdentityCard") | ||||||
|     const justifFile = ref(null) |     const justifFile = ref(null) | ||||||
|  |     const profilepic = await uploadProfilePicture(ppData.value) | ||||||
|  |  | ||||||
|     if (curricula[outputs.curriculum-1].requireCertificate){ |     if (curricula[outputs.curriculum-1].requireCertificate){ | ||||||
|       justifFile.value = await uploadFile(justifcardfile.value, "JustificationDocument") |       justifFile.value = await uploadFile(justifcardfile.value, "JustificationDocument") | ||||||
| @ -89,7 +86,7 @@ | |||||||
|       justif = null |       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){ |     for (let item in externalCurrTab.value){ | ||||||
|       const temp = await uploadFile(externalCurrTab.value[item].justifdocUrl, "JustificationDocument") |       const temp = await uploadFile(externalCurrTab.value[item].justifdocUrl, "JustificationDocument") | ||||||
| @ -178,10 +175,10 @@ | |||||||
|               </form> |               </form> | ||||||
|               <label class="browser"> |               <label class="browser"> | ||||||
|                 {{i18n("login.guest.browse")}} |                 {{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> |               </label> | ||||||
|               <form novalidate enctype="multipart/form-data" class="inputBox"> |               <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> |               </form> | ||||||
|               <div class="inputBox"> |               <div class="inputBox"> | ||||||
|                 <p>{{i18n("Curriculum").toUpperCase()}}</p>  |                 <p>{{i18n("Curriculum").toUpperCase()}}</p>  | ||||||
| @ -221,15 +218,17 @@ | |||||||
|                 </div> |                 </div> | ||||||
|               </div> |               </div> | ||||||
|               <button @click="page++;" style="margin-top: 10%">{{i18n("login.guest.nextpage")}}</button> |               <button @click="page++;" style="margin-top: 10%">{{i18n("login.guest.nextpage")}}</button> | ||||||
|  |  | ||||||
|             </div> |             </div> | ||||||
|             <div v-if="page === 3"> |             <div v-if="page === 3"> | ||||||
|               <p style="color:rgb(239,60,168);margin-bottom: 5%"> |               <p style="color:rgb(239,60,168);margin-bottom: 5%"> | ||||||
|                 {{i18n("login.guest.formationdisclaimer")}} |                 {{i18n("login.guest.formationdisclaimer")}} | ||||||
|               </p> |               </p> | ||||||
|               <button @click="page++">{{i18n("login.guest.managecareer")}}</button> |               <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> | ||||||
|  |            <div v-if="page===5" style="margin-left: 7%"> | ||||||
|  |              <p style="color: rgb(239,60,168);">{{i18n("reqsent")}}</p> | ||||||
|  |            </div> | ||||||
|           </form> |           </form> | ||||||
|          </div> |          </div> | ||||||
|     </div> |     </div> | ||||||
| @ -297,13 +296,7 @@ | |||||||
|   cursor: pointer; |   cursor: pointer; | ||||||
| } | } | ||||||
|  |  | ||||||
| .bodu { |  | ||||||
|   margin-top:2%; |  | ||||||
|   width:50%; |  | ||||||
|   border:2px solid black; |  | ||||||
|   border-radius:9px; |  | ||||||
|   background-color:rgb(50,50,50); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .switchpage{ | .switchpage{ | ||||||
|   width:100px; |   width:100px; | ||||||
| @ -342,22 +335,8 @@ input[type=file]{ | |||||||
|   background:#FFFFFF; |   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{ | button:active ,.switchpage:active{ | ||||||
|   opacity:0.8; |   opacity:0.8; | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| </style> | </style> | ||||||
|  | |||||||
| @ -64,13 +64,13 @@ | |||||||
|   async function patchCourse(course){ |   async function patchCourse(course){ | ||||||
|     for (let element in toModify){ |     for (let element in toModify){ | ||||||
|         if (element =="owner" && (toModify[element].regNo != course.owner.regNo)){ |         if (element =="owner" && (toModify[element].regNo != course.owner.regNo)){ | ||||||
|           await alterCourse(course.courseId,{owner:toModify[element].regNo}); |           await alterCourse(course.courseID,{owner:toModify[element].regNo}); | ||||||
|         } |         } | ||||||
|         else if(element == "title" && (toModify[element] != course.title)){ |         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)){ |         else if(element == "credits" && (parseInt(toModify[element]) != course.credits)){ | ||||||
|          await alterCourse(course.courseId,{credits:parseInt(toModify[element])}); |          await alterCourse(course.courseID,{credits:parseInt(toModify[element])}); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|       toModify= Object.assign({},pattern); |       toModify= Object.assign({},pattern); | ||||||
|  | |||||||
| @ -142,7 +142,7 @@ async function askChanges(i){ | |||||||
|       <div style="margin-bottom:20px;"> |       <div style="margin-bottom:20px;"> | ||||||
|         {{i18n("course")}}: |         {{i18n("course")}}: | ||||||
|         <select v-if="curriculum != null" v-model="toModify.course"> |         <select v-if="curriculum != null" v-model="toModify.course"> | ||||||
|           <option v-for="item in courses" :value='item.courseId'>{{item.title}}</option> |           <option v-for="item in courses" :value='item.courseID'>{{item.title}}</option> | ||||||
|         </select> |         </select> | ||||||
|       </div> |       </div> | ||||||
|       <div style="margin-bottom:20px;"> |       <div style="margin-bottom:20px;"> | ||||||
|  | |||||||
| @ -55,7 +55,7 @@ const minDate = ref(invertedFormatDate((new Date()).setDate(currentDate.getDate( | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   const lessonCreator = { |   const lessonCreator = { | ||||||
|     "courseId" : null, |     "courseID" : null, | ||||||
|     "lessonStart":null, |     "lessonStart":null, | ||||||
|     "lessonEnd":null, |     "lessonEnd":null, | ||||||
|     "lessonType":null, |     "lessonType":null, | ||||||
| @ -157,7 +157,7 @@ async function setCourses(){ | |||||||
|     } |     } | ||||||
|     const matrix = []; |     const matrix = []; | ||||||
|     for (let element in lessons){ |     for (let element in lessons){ | ||||||
|       if(lessons[element].course.courseId == course.courseId){ |       if(lessons[element].course.courseID == course.courseID){ | ||||||
|         matrix.push(lessons[element]) |         matrix.push(lessons[element]) | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
| @ -210,7 +210,7 @@ async function setCourses(){ | |||||||
|         lessonCreatorBuffer.value.color = lessonBuffer.value.color; |         lessonCreatorBuffer.value.color = lessonBuffer.value.color; | ||||||
|         lessonCreatorBuffer.value.lessonType =lessonBuffer.value.lessonType; |         lessonCreatorBuffer.value.lessonType =lessonBuffer.value.lessonType; | ||||||
|         lessonCreatorBuffer.value.local = lessonBuffer.value.local; |         lessonCreatorBuffer.value.local = lessonBuffer.value.local; | ||||||
|         lessonCreatorBuffer.value.courseId = lessonBuffer.value.course.courseId; |         lessonCreatorBuffer.value.courseID = lessonBuffer.value.course.courseID; | ||||||
|          |          | ||||||
|        await createLesson(lessonCreatorBuffer.value); |        await createLesson(lessonCreatorBuffer.value); | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| <script setup> | <script setup> | ||||||
|   import {reactive, ref } from 'vue' |   import {reactive, ref } from 'vue' | ||||||
|   import {getSelf,alterSelf,disconnect,deleteUser} from '../rest/Users.js' |   import {getSelf,alterSelf} from '../rest/Users.js' | ||||||
|   import {getSelfCurriculum, getAllCurriculums, getSomeonesCurriculumList, getcurriculum} from '../rest/curriculum.js' |   import {getAllCurriculums, getSomeonesCurriculumList, getcurriculum} from '../rest/curriculum.js' | ||||||
|   import {getCourses} from "../rest/courses.js" |   import {getCourses} from "../rest/courses.js" | ||||||
|   import i18n from "@/i18n.js" |   import i18n from "@/i18n.js" | ||||||
|   import {uploadFile, uploadProfilePicture} from '@/rest/uploads.js' |   import {uploadFile, uploadProfilePicture} from '@/rest/uploads.js' | ||||||
| @ -119,16 +119,6 @@ | |||||||
|      toModify.password= item.password; |      toModify.password= item.password; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|    |  | ||||||
|   async function unRegister(){ |  | ||||||
|    deleteUser(user.value.regNo); |  | ||||||
|    disconnect() |  | ||||||
|    setTimeout(() => { |  | ||||||
|       window.location.href="#/home"; |  | ||||||
|       }, "500"); |  | ||||||
|      |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   function getPP(){ |   function getPP(){ | ||||||
|     if(user.value.profilePictureUrl === null){ |     if(user.value.profilePictureUrl === null){ | ||||||
|       return "/Clyde.png" |       return "/Clyde.png" | ||||||
| @ -136,14 +126,6 @@ | |||||||
|     return user.profilePictureUrl |     return user.profilePictureUrl | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   function getYear(){ |  | ||||||
|     let date = new Date(); |  | ||||||
|     if (date.getMonth() <= 6){ |  | ||||||
|       return date.getFullYear()-1 |  | ||||||
|     } |  | ||||||
|     return date.getFullYear() |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   async function refreshExtCurrList(){ |   async function refreshExtCurrList(){ | ||||||
|     extcurrlist.value = await getExternalCurriculumByUser(user.value.regNo) |     extcurrlist.value = await getExternalCurriculumByUser(user.value.regNo) | ||||||
|   } |   } | ||||||
| @ -258,7 +240,7 @@ | |||||||
|           <button @click="windowState=0">{{i18n("courses.back")}}</button> |           <button @click="windowState=0">{{i18n("courses.back")}}</button> | ||||||
|         </div> |         </div> | ||||||
|         <div v-else-if="windowState === 5" class="infosContainer"> |         <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") }} |             {{ i18n("payment") }} : {{minerv.value.toPay}}€ {{ i18n("lefttopay") }} | ||||||
|             <div v-if="minerv.value.paidAmount <= 50"> |             <div v-if="minerv.value.paidAmount <= 50"> | ||||||
|               <button @click="windowState=6; paymentAmount = 50">{{ i18n("paydeposit") }} (50€)</button> |               <button @click="windowState=6; paymentAmount = 50">{{ i18n("paydeposit") }} (50€)</button> | ||||||
| @ -271,7 +253,7 @@ | |||||||
|             {{ i18n("alreadypaid") }} |             {{ i18n("alreadypaid") }} | ||||||
|           </div> |           </div> | ||||||
|           <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> |         </div> | ||||||
|         <div v-if="windowState === 5"> |         <div v-if="windowState === 5"> | ||||||
|  | |||||||
| @ -196,7 +196,7 @@ | |||||||
|     focus.value = element; |     focus.value = element; | ||||||
|     var lessonsList = []; |     var lessonsList = []; | ||||||
|     for (let element in schedule.value){ |     for (let element in schedule.value){ | ||||||
|       if (schedule.value[element].course.courseId == focus.value.course.courseId){ |       if (schedule.value[element].course.courseID == focus.value.course.courseID){ | ||||||
|         lessonsList.push(schedule.value[element]);   |         lessonsList.push(schedule.value[element]);   | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
| @ -267,7 +267,7 @@ | |||||||
|     } |     } | ||||||
|     const matrix = []; |     const matrix = []; | ||||||
|     for (let element in lessons){ |     for (let element in lessons){ | ||||||
|       if(lessons[element].course.courseId == course.courseId){ |       if(lessons[element].course.courseID == course.courseID){ | ||||||
|         matrix.push(lessons[element]) |         matrix.push(lessons[element]) | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -79,3 +79,7 @@ export async function editExempReqState(id, newstate){ | |||||||
| export async function getExempByUser(userId){ | export async function getExempByUser(userId){ | ||||||
|     return restGet("/exemptionreq/"+userId) |     return restGet("/exemptionreq/"+userId) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | export async function imposeCurriculum(id, cursusid){ | ||||||
|  |     return restPatch("/request/registerequivimpose/"+id+"/"+cursusid) | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user