Merge branch 'develop' of https://git.minedu.gov.gr/itminedu/e-epal into lock_actions

updated code
parents abbc55b6 4e8a9459
......@@ -79,7 +79,7 @@ epal.allocation:
requirements:
_user_is_logged_in: 'TRUE'
sectorperschool:
path: '/epal/sectorperSchool/{epalId}'
path: '/epal/sectorperSchool'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -87,7 +87,7 @@ sectorperschool:
requirements:
_user_is_logged_in: 'TRUE'
specialityperschool:
path: '/epal/specialityperSchool/{epalId}/{sectorId}'
path: '/epal/specialityperSchool/{sectorId}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -103,7 +103,7 @@ confirmstudents:
requirements:
_user_is_logged_in: 'TRUE'
studentperschool:
path: '/epal/studentperSchool/{epalId}/{selectId}/{classId}/{limitdown}/{limitup}'
path: '/epal/studentperSchool/{selectId}/{classId}/{limitdown}/{limitup}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -111,7 +111,7 @@ studentperschool:
requirements:
_user_is_logged_in: 'TRUE'
savecapacity:
path: '/epal/savecapacity/{taxi}/{tomeas}/{specialit}/{schoolid}'
path: '/epal/savecapacity/{taxi}/{tomeas}/{specialit}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -207,7 +207,7 @@ critirioschosen:
requirements:
_user_is_logged_in: 'TRUE'
findcapacity:
path: '/epal/findCapacity/{taxi}/{tomeas}/{specialit}/{schoolid}'
path: '/epal/findCapacity/{taxi}/{tomeas}/{specialit}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -222,3 +222,13 @@ findschoolid:
_controller: '\Drupal\epal\Controller\DirectorView::getSchoolID'
requirements:
_user_is_logged_in: 'TRUE'
gettypeofschool:
path: '/epal/gettypeofschool'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::gettypeofschool'
requirements:
_user_is_logged_in: 'TRUE'
......@@ -30,6 +30,7 @@ import {
<option value="1" >Α' Λυκείου</option>
<option value="2" >Β' Λυκείου</option>
<option value="3" >Γ' Λυκείου</option>
<option value="4" >Δ' Λυκείου</option>
</select>
</div>
<div class="form-group">
......@@ -65,7 +66,7 @@ import {
<option value=2>Όχι</option>
<option value=3 selected></option>
</select>
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent()">
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent(txoption)">
Επιβεβαίωση Εγγραφής
</button>
......@@ -173,7 +174,7 @@ import {
private currentclass: Number;
private saved: Array<number> = new Array();
private limitdown = 0;
private limitup = 25;
private limitup = 5;
private pageno = 1;
private userActive = <number>-1;
private type: Number;
......@@ -251,7 +252,7 @@ import {
}
else if (txop.value === "2") {
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(data => {
this.StudentSelectedSub = this._hds.getSectorPerSchool().subscribe(data => {
this.selectionBClass.next(true);
this.selectionCClass.next(false);
this.StudentSelected$.next(data);
......@@ -263,13 +264,12 @@ import {
},
() => console.log("Getting StudentSelectedSpecial"));
}
else if (txop.value === "3") {
else if (txop.value === "3" || txop.value === "4") {
var sectorint = +this.formGroup.value.tomeas;
console.log(sectorint, "test");
if (this.formGroup.value.tomeas != '') {
if (this.formGroup.value.tomeas != '') {
var sectorint = +this.formGroup.value.tomeas;
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(data => {
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(sectorint).subscribe(data => {
this.StudentSelectedSpecial$.next(data);
},
error => {
......@@ -279,7 +279,7 @@ import {
() => console.log("Getting StudentSelectedSpecial"));
}
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(data => {
this.StudentSelectedSub = this._hds.getSectorPerSchool().subscribe(data => {
this.StudentSelected$.next(data);
this.selectionBClass.next(true);
this.selectionCClass.next(true);
......@@ -299,9 +299,9 @@ import {
this.retrievedStudent.next(false);
var sectorint = +this.formGroup.value.tomeas;
console.log(sectorint, "tomeas");
if (txop.value === "3") {
if (txop.value === "3" || txop.value === "4") {
// this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(data => {
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(sectorint).subscribe(data => {
this.StudentSelectedSpecial$.next(data);
},
......@@ -327,10 +327,13 @@ import {
this.currentclass = 3;
}
else if (txop.value === "4") {
this.currentclass = 4;
}
this.formGroup.get('pageno').setValue(this.pageno);
if (this.pageno == 1) {
console.log(this.SchoolId, sectorint, this.currentclass, "test");
this.StudentsSizeSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint, this.currentclass, 0, 0).subscribe(x => {
console.log(this.SchoolId, sectorint, this.currentclass, "testaaaaaa");
this.StudentsSizeSub = this._hds.getStudentPerSchool(sectorint, this.currentclass, 0, 0).subscribe(x => {
this.StudentsSize$.next(x);
tot_pages = x.id / 5;
if (x.id % 5 > 0) {
......@@ -341,7 +344,7 @@ import {
}
this.StudentInfoSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint, this.currentclass, this.limitdown, this.limitup).subscribe(data => {
this.StudentInfoSub = this._hds.getStudentPerSchool(sectorint, this.currentclass, this.limitdown, this.limitup).subscribe(data => {
this.StudentInfo$.next(data);
this.retrievedStudent.next(true);
},
......@@ -364,12 +367,7 @@ import {
else if (cbvalue.value === '2') {
this.saved[i] = id;
this.type = 2;
//var count = this.saved.length;
//for (var j = 0; j < count; j++) {
// if (this.saved[j] === id) {
// this.saved.splice(j, 1);
// }
console.log("not confirmed")
}
else if (cbvalue.value === '3') {
......@@ -379,8 +377,10 @@ import {
confirmStudent() {
confirmStudent(txop) {
this._hds.saveConfirmStudents(this.saved, this.type);
this.findstudent(txop, this.pageno)
console.log(txop, this.pageno, "aaaaaaa");
}
checkcclass() {
......
......@@ -85,7 +85,7 @@ import {
this.School$.next(x);
console.log(x[0].id, "perfectureID");
this.perfecture = x[0].id;
this.SchoolPerPerfSub = this._hds.getSchoolPerPerfecture(this.perfecture).subscribe(data => {
this.SchoolPerPerfSub = this._hds.getSchoolPerPerfecture().subscribe(data => {
this.SchoolsPerPerf$.next(data);
},
error => {
......
......@@ -273,7 +273,7 @@ html2canvas(document.getElementById("target"), <Html2Canvas.Html2CanvasOptions>{
}, 10000);
}, 100000);
doc.addImage(img, 'PNG',0, 0, 1000, 1000);
console.log("mphkaneoneo");
doc.save('applications.pdf');
......
......@@ -515,8 +515,8 @@ export class HelperDataService implements OnInit, OnDestroy {
}
getSectorPerSchool(SchoolId) {
let SchoolIdNew = SchoolId.toString();
getSectorPerSchool() {
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
this.authRole = loginInfoToken.auth_role;
......@@ -526,12 +526,13 @@ export class HelperDataService implements OnInit, OnDestroy {
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/sectorperSchool/` + SchoolIdNew, options)
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/sectorperSchool/` , options)
.map(response => response.json());
}
getSpecialityPerSchool(SchoolId, SectorId) {
let SchoolIdNew = SchoolId.toString();
getSpecialityPerSchool( SectorId) {
let SectorIdNew = SectorId.toString();
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
......@@ -542,14 +543,14 @@ export class HelperDataService implements OnInit, OnDestroy {
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/specialityperSchool/` + SchoolIdNew + '/' + SectorIdNew, options)
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/specialityperSchool/` + SectorIdNew, options)
.map(response => response.json());
}
getStudentPerSchool(SchoolId, SelectId, classId, limitdown, limitup) {
let SchoolIdNew = SchoolId.toString();
getStudentPerSchool( SelectId, classId, limitdown, limitup) {
let SelectIdNew = SelectId.toString();
......@@ -563,7 +564,7 @@ export class HelperDataService implements OnInit, OnDestroy {
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/studentperSchool/` + SchoolIdNew + '/' + SelectIdNew + '/' + classId + '/' + limitdown + '/' + limitup, options)
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/studentperSchool/` + SelectIdNew + '/' + classId + '/' + limitdown + '/' + limitup, options)
.map(response => response.json());
}
......@@ -596,7 +597,7 @@ export class HelperDataService implements OnInit, OnDestroy {
saveCapacity(taxi, tomeas, specialit, capacity, schoolid) {
saveCapacity(taxi, tomeas, specialit, capacity) {
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
......@@ -607,19 +608,11 @@ export class HelperDataService implements OnInit, OnDestroy {
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return new Promise((resolve, reject) => {
this.http.post(`${AppSettings.API_ENDPOINT}/epal/savecapacity/` + taxi + '/' + tomeas + '/' + specialit + '/' + schoolid, { capacity }, options)
.map(response => response.json())
.subscribe(data => {
resolve(data);
},
error => {
console.log("Error Saving Capacity");
reject("Error Saving Capacity");
},
() => console.log("Saving Capacity"));
});
return this.http.post(`${AppSettings.API_ENDPOINT}/epal/savecapacity/` + taxi + '/' + tomeas + '/' + specialit, { capacity }, options)
.map(response => response.json());
}
sendMinisrtyCredentials(username, userpassword) {
......@@ -734,10 +727,10 @@ export class HelperDataService implements OnInit, OnDestroy {
}
getSchoolPerPerfecture(PerfectureId) {
console.log(PerfectureId,"a");
getSchoolPerPerfecture() {
//let PerfectureIdNew = PerfectureId.toString();
let PerfectureIdNew = PerfectureId;
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
......@@ -751,7 +744,7 @@ export class HelperDataService implements OnInit, OnDestroy {
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/ScoolperPerf/` + PerfectureIdNew , options)
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/ScoolperPerf/` , options)
.map(response => response.json());
}
......@@ -903,9 +896,9 @@ getCourses(username, userpassword, sectorid) {
}
getCapacityPerSchool(taxi, tomeas, specialit, schoolid) {
getCapacityPerSchool(taxi, tomeas, specialit) {
console.log(tomeas,specialit,"news")
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
......@@ -916,7 +909,7 @@ getCapacityPerSchool(taxi, tomeas, specialit, schoolid) {
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/findCapacity/` + taxi + '/' + tomeas + '/' + specialit + '/' + schoolid, options)
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/findCapacity/` + taxi + '/' + tomeas + '/' + specialit, options)
.map(response => response.json());
}
......@@ -939,6 +932,21 @@ getSchoolId() {
}
gettypeofschool(){
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
this.authRole = loginInfoToken.auth_role;
});
let headers = new Headers({
"Content-Type": "application/json",
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/gettypeofschool/`, options)
.map(response => response.json());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment