Commit 85569720 authored by Open Source Developer's avatar Open Source Developer

changes

parent 4f57c01d
......@@ -78,22 +78,6 @@ epal.allocation:
_controller: '\Drupal\epal\Controller\Distribution::createDistribution'
requirements:
_user_is_logged_in: 'TRUE'
epal.sectorperschool:
path: '/epal/sectorperschool'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::getSectorsPerSchool'
requirements:
_user_is_logged_in: 'TRUE'
epal.specialityperschool:
path: '/epal/specialityperschool/{sectorId}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::getSpecialPerSchool'
requirements:
_user_is_logged_in: 'TRUE'
epal.confirmstudents:
path: '/epal/confirmstudent'
options:
......@@ -229,7 +213,7 @@ epal.coursesperschools:
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::getCoursesPerSchool'
requirements:
_user_is_logged_in: 'TRUE'
_user_is_logged_in: 'TRUE'
epal.critirioschosen:
path: '/epal/critiriachosen/{studentId}/{type}'
options:
......@@ -238,38 +222,6 @@ epal.critirioschosen:
_controller: '\Drupal\epal\Controller\SubmitedApplications::getCritiria'
requirements:
_user_is_logged_in: 'TRUE'
epal.findcapacity:
path: '/epal/findcapacity/{taxi}/{tomeas}/{specialit}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::findCapacity'
requirements:
_user_is_logged_in: 'TRUE'
epal.findschoolid:
path: '/epal/getschool'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::getSchoolID'
requirements:
_user_is_logged_in: 'TRUE'
epal.gettypeofschool:
path: '/epal/gettypeofschool'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::gettypeofschool'
requirements:
_user_is_logged_in: 'TRUE'
epal.getlimitspercourse:
path: '/epal/getlimitspercourse/{classid}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::getlimitsperCourse'
requirements:
_user_is_logged_in: 'TRUE'
epal.findcapacityperschool:
path: '/epal/findcapacityperschool'
options:
......@@ -310,3 +262,14 @@ epal.svc.getstudentcertification:
_controller: '\Drupal\epal\Controller\WSConsumer::getStudentEpalCertification'
requirements:
_user_is_logged_in: 'TRUE'
epal.findcoursesperschool:
path: '/epal/findcoursesperschool'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::FindCoursesPerSchool'
requirements:
_user_is_logged_in: 'TRUE'
......@@ -101,10 +101,8 @@ import {
private isEdit: boolean;
private courseActive = <number>-1;
private showLoader: BehaviorSubject<boolean>;
private School$: BehaviorSubject<any>;
private SchoolSub: Subscription;
private selectiontype: BehaviorSubject<boolean>;
private SchoolId;
......@@ -116,8 +114,7 @@ import {
this.CapacityPerCourse$ = new BehaviorSubject([{}]);
this.showLoader = new BehaviorSubject(false);
this.isEdit = false;
this.School$ = new BehaviorSubject([{}]);
this.selectiontype = new BehaviorSubject(true);
this.formGroup = this.fb.group({
});
......@@ -148,20 +145,7 @@ import {
ngOnInit() {
(<any>$('#checksaved1')).appendTo("body");
this.SchoolSub = this._hds.gettypeofschool().subscribe(x => {
this.School$.next(x);
console.log(x[0].type, "schoolid!");
this.SchoolId = x[0].type;
if (this.SchoolId == 'ΗΜΕΡΗΣΙΟ'){
this.selectiontype.next(false);
}
},
error => {
this.School$.next([{}]);
console.log("Error Getting School");
},
() => console.log("Getting School "));
......
......@@ -242,10 +242,6 @@ import {
private courseActive = <number>-1;
private StudentActive = <number>-1;
private showLoader: BehaviorSubject<boolean>;
private School$: BehaviorSubject<any>;
private SchoolSub: Subscription;
private selectiontype: BehaviorSubject<boolean>;
private SchoolId;
private opened;
......@@ -257,8 +253,6 @@ import {
this.CoursesPerSchool$ = new BehaviorSubject([{}]);
this.showLoader = new BehaviorSubject(false);
this.School$ = new BehaviorSubject([{}]);
this.selectiontype = new BehaviorSubject(true);
this.StudentInfo$ = new BehaviorSubject([{}]);
this.retrievedStudent = new BehaviorSubject(false);
this.SavedStudents$ = new BehaviorSubject({});
......@@ -295,25 +289,8 @@ import {
(<any>$('#checksaved')).appendTo("body");
(<any>$('#dangermodal')).appendTo("body");
(<any>$('#emptyselection')).appendTo("body");
this.SchoolSub = this._hds.gettypeofschool().subscribe(x => {
this.School$.next(x);
console.log(x[0].type, "schoolid!");
this.SchoolId = x[0].type;
if (this.SchoolId == 'ΗΜΕΡΗΣΙΟ'){
this.selectiontype.next(false);
}
},
error => {
this.School$.next([{}]);
console.log("Error Getting School");
},
() => console.log("Getting School "));
this.showLoader.next(true);
this.CoursesPerSchoolSub = this._hds.FindCapacityPerSchool().subscribe(x => {
this.CoursesPerSchoolSub = this._hds.FindCoursesPerSchool().subscribe(x => {
this.CoursesPerSchool$.next(x);
this.showLoader.next(false);
......
This diff is collapsed.
......@@ -19,30 +19,32 @@ import {
@Component({
selector: 'eduadmin-view',
template: `
<h4> Αριθμός Μαθητών ανα τμήμα σχολείου!!! </h4>
<div class = "loading" *ngIf="(SchoolsPerPerf$ | async).size === 0">
<div class = "loading" *ngIf="(showLoader | async) === true"></div>
<div style="min-height: 500px;">
<form [formGroup]="formGroup">
<p style="margin-top: 20px; line-height: 2em;">Στην παρακάτω λίστα βλέπετε τα σχολεία ευθύνης σας.
</p>
<div class="row" style="margin-top: 20px; line-height: 2em;" > <b> Τα τμήματα. </b>
</div>
<ul class="list-group main-view">
<div *ngFor="let SchoolNames$ of SchoolsPerPerf$ | async; let i=index; let isOdd=odd; let isEven=even" >
<li class="list-group-item isclickable" (click)="setActiveRegion(SchoolNames$.id)" [class.changelistcolor]= "SchoolNames$.status === false" [class.oddout]="isOdd" [class.evenout]="isEven" [class.selectedout]="regionActive === SchoolNames$.id" >
<h5> {{SchoolNames$.name}}</h5>
</li>
<div class = "loading" *ngIf="(CoursesPerPerf$ | async).size === 0">
<div *ngFor="let SchoolNames$ of SchoolsPerPerf$ | async; let i=index; let isOdd=odd; let isEven=even" >
<li class="list-group-item isclickable" (click)="setActiveRegion(SchoolNames$.id)"
[class.changelistcolor]= "SchoolNames$.status === false" [class.oddout]="isOdd"
[class.evenout]="isEven" [class.selectedout]="regionActive === SchoolNames$.id" >
<div class="col-md-12" style="font-size: 0.8em; font-weight: bold;" >{{SchoolNames$.name}}</div>
</li>
<div class = "row" *ngFor="let CoursesNames$ of CoursesPerPerf$ | async; let j=index; let isOdd2=odd; let isEven2=even"
[class.oddin]="isOdd2" [class.evenin]="isEven2" [class.changecolor]="calccolor(CoursesNames$.size,CoursesNames$.limitdown)"
[class.selectedappout]="regionActive === j"
[hidden]="SchoolNames$.id !== regionActive" style="margin: 0px 2px 0px 2px;">
<div class="col-md-6" style="font-size: 0.8em; font-weight: bold;" >{{CoursesNames$.name}}</div>
<div class="col-md-6" style="font-size: 0.8em; font-weight: bold;" >{{CoursesNames$.size}}</div>
</div>
</div>
<div *ngFor="let CoursesNames$ of CoursesPerPerf$ | async; let j=index; let isOdd2=odd; let isEven2=even" [class.oddin]="isOdd2" [class.evenin]="isEven2" [class.changecolor]="calccolor(CoursesNames$.size,CoursesNames$.limitdown)" [hidden]="SchoolNames$.id !== regionActive" >
<div> {{CoursesNames$.name}}</div> <div class= "aastyle"><strong>Αριθμός Μαθητών:</strong>{{CoursesNames$.size}} </div>
</div>
</div>
</ul>
<div class="col-md-6">
<button type="button" class="btn-primary btn-lg pull-right" (click)="navigateToApplication()" >
<i class="fa fa-forward"></i>
</button>
</div>
</form>
</div>
`
})
......@@ -58,6 +60,7 @@ import {
private CoursesPerPerfSub: Subscription;
private StudentsSize$: BehaviorSubject<any>;
private StudentsSizeSub: Subscription;
private showLoader: BehaviorSubject<boolean>;
public perfecture ;
private regionActive = <number>-1;
private School$: BehaviorSubject<any>;
......@@ -74,6 +77,7 @@ import {
this.CoursesPerPerf$ = new BehaviorSubject([{}]);
this.StudentsSize$ = new BehaviorSubject({});
this.School$ = new BehaviorSubject([{}]);
this.showLoader = new BehaviorSubject(false);
this.formGroup = this.fb.group({
});
......@@ -84,12 +88,11 @@ import {
ngOnInit() {
this.SchoolSub = this._hds.getSchoolId().subscribe(x => {
this.School$.next(x);
console.log(x[0].id, "perfectureID");
this.perfecture = x[0].id;
this.showLoader.next(true);
this.SchoolPerPerfSub = this._hds.getSchools().subscribe(data => {
this.SchoolsPerPerf$.next(data);
this.showLoader.next(false);
},
error => {
this.SchoolsPerPerf$.next([{}]);
......@@ -97,53 +100,52 @@ import {
},
() => console.log("Getting Schools"));
},
error => {
this.School$.next([{}]);
console.log("Error Getting School");
},
() => console.log("Getting School "));
}
setActiveRegion(ind) {
if (ind === this.regionActive)
ind = -1;
calccolor(size, limit)
{
if (size < limit)
return true;
else
return false;
}
this.regionActive = ind;
setActiveRegion(ind) {
console.log(ind, this.regionActive,"ind");
if (ind === this.regionActive){
ind = -1;
this.regionActive = ind;
}
else
{
this.regionActive = ind;
this.showLoader.next(true);
this.CoursesPerPerfSub = this._hds.getCoursePerPerfecture(this.regionActive).subscribe(data => {
this.CoursesPerPerf$.next(data);
this.showLoader.next(false);
},
error => {
this.CoursesPerPerf$.next([{}]);
console.log("Error Getting Courses");
this.showLoader.next(false);
},
() => console.log("Getting Courses Per Perf"));
}
this.regionActive = ind;
}
navigateToApplication()
{
var id: string= String(this.regionActive);
this.router.navigate(['', {ids:id}]);
}
calccolor(size, limit)
{
if (size < limit)
return true;
else
return false;
}
}
......@@ -81,10 +81,6 @@ import {
ngOnInit() {
this.SchoolSub = this._hds.getSchoolId().subscribe(x => {
this.School$.next(x);
console.log(x[0].id, "perfectureID");
this.perfecture = x[0].id;
this.SchoolPerPerfSub = this._hds.getSchools().subscribe(data => {
this.SchoolsPerPerf$.next(data);
},
......@@ -94,14 +90,7 @@ import {
},
() => console.log("Getting Schools"));
},
error => {
this.School$.next([{}]);
console.log("Error Getting School");
},
() => console.log("Getting School "));
}
......
......@@ -498,39 +498,7 @@ export class HelperDataService implements OnInit, OnDestroy {
}
getSectorPerSchool() {
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/sectorperschool/`, options)
.map(response => response.json());
}
getSpecialityPerSchool(SectorId) {
let SectorIdNew = SectorId.toString();
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/specialityperschool/` + SectorIdNew, options)
.map(response => response.json());
}
getStudentPerSchool(classId, sector, specialit) {
......@@ -858,22 +826,7 @@ export class HelperDataService implements OnInit, OnDestroy {
}
getCapacityPerSchool(taxi, tomeas, specialit) {
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/findcapacity/` + taxi + "/" + tomeas + "/" + specialit, options)
.map(response => response.json());
}
getSchoolId() {
this.loginInfo$.getValue().forEach(loginInfoToken => {
......@@ -890,23 +843,10 @@ export class HelperDataService implements OnInit, OnDestroy {
}
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());
}
getlimitsofcourse(classid) {
FindCapacityPerSchool() {
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
......@@ -917,13 +857,14 @@ export class HelperDataService implements OnInit, OnDestroy {
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/getlimitspercourse/` + classid, options)
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/findcapacityperschool/`, options)
.map(response => response.json());
}
FindCapacityPerSchool() {
FindCoursesPerSchool() {
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
......@@ -934,7 +875,7 @@ export class HelperDataService implements OnInit, OnDestroy {
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/findcapacityperschool/`, options)
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/findcoursesperschool/`, 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