Commit c3bc6869 authored by Νίκος Κατσαούνος's avatar Νίκος Κατσαούνος

several updates

parents 61236250 ba544be9
......@@ -111,7 +111,7 @@ epal.confirmstudents:
requirements:
_user_is_logged_in: 'TRUE'
epal.studentperschool:
path: '/epal/studentperschool/{selectId}/{classId}/{limitdown}/{limitup}'
path: '/epal/studentperschool/{classId}/{sector}/{specialit}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -254,38 +254,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:
......@@ -326,3 +294,11 @@ 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'
This diff is collapsed.
......@@ -1255,4 +1255,4 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
return $fields;
}
}
}
\ No newline at end of file
......@@ -33,7 +33,7 @@ import {
επιλέξτε τη νέα δυναμική και πατήστε το σύμβολο <i>ok</i>. Προσοχή! Κανένα τμήμα δεν πρέπει να έχει δυναμική 0.</p>
<div class="row" style="margin-top: 20px; line-height: 2em;" > <b> Οι δηλώσεις σας </b></div>
<div *ngFor="let CapacityPerCourses$ of CapacityPerCourse$ | async; let i=index; let isOdd=odd; let isEven=even" >
<li *ngIf="(!(selectiontype | async) && (CapacityPerCourses$.class < 4)) ||((selectiontype | async) && (CapacityPerCourses$.class < 5))" class="list-group-item " [class.oddout]="isOdd" [class.evenout]="isEven" >
<li class="list-group-item " [class.oddout]="isOdd" [class.evenout]="isEven" >
<div class="row">
<div class="col-md-5">
<h5 [class.changelistcolor]= "CapacityPerCourses$.capacity === null" >{{CapacityPerCourses$.taxi}}&nbsp; <b></b></h5>
......@@ -67,13 +67,13 @@ import {
</div>
<div id="checksaved" (onHidden)="onHidden('#checksaved')"
<div id="checksaved1" (onHidden)="onHidden('#checksaved1')"
class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header modal-header-danger">
<h3 class="modal-title pull-left"><i class="fa fa-check-square-o"></i>&nbsp;&nbsp;Πρέπει να συπληρώσετε σωστά τη δυναμική</h3>
<button type="button" class="close pull-right" aria-label="Close" (click)="hideModal('#checksaved')">
<button type="button" class="close pull-right" aria-label="Close" (click)="hideModal('#checksaved1')">
<span aria-hidden="true"><i class="fa fa-times"></i></span>
</button>
</div>
......@@ -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({
});
......@@ -127,7 +124,7 @@ import {
public showModal(popupMsgId):void {
console.log("about to show modal");
console.log("about to show modal",popupMsgId);
//(<any>$('#distributionWaitingNotice')).modal('show');
(<any>$(popupMsgId)).modal('show');
}
......@@ -147,21 +144,8 @@ import {
}
ngOnInit() {
(<any>$('#checksaved')).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 "));
(<any>$('#checksaved1')).appendTo("body");
......@@ -195,7 +179,7 @@ import {
{
if (this.newvalue <=0 || this.newvalue >10)
{
this.showModal("#checksaved");
this.showModal("#checksaved1");
}
else
{
......@@ -212,7 +196,7 @@ import {
error => {
std[ind].capacity = oldvalue;
this.CapacityPerCourse$.next(std);
this.showLoader.next(false);
console.log("Error Saving Capacity");
},
() =>{
......@@ -226,7 +210,7 @@ import {
else
{
if (oldvalue === null)
this.showModal("#checksaved");
this.showModal("#checksaved1");
}
}
......
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,45 +498,10 @@ 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(SelectId, classId, limitdown, limitup) {
let SelectIdNew = SelectId.toString();
getStudentPerSchool(classId, sector, specialit) {
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
......@@ -548,13 +513,14 @@ export class HelperDataService implements OnInit, OnDestroy {
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/studentperschool/` + SelectIdNew + "/" + classId + "/" + limitdown + "/" + limitup, options)
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/studentperschool/` + classId + "/" + sector + "/" + specialit, options)
.map(response => response.json());
}
saveConfirmStudents(students, type) {
console.log(students, type, "confirm");
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
this.authRole = loginInfoToken.auth_role;
......@@ -887,22 +853,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 => {
......@@ -919,23 +870,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;
......@@ -946,13 +884,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;
......@@ -963,7 +902,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