added drupal view courseperschool_night, modified front-end files for supporting night schools

parent a1d62450
......@@ -92,9 +92,23 @@ import {
this.School$.next([{}]);
console.log("Error Getting School");
},
() => console.log("Getting School "));
() => {
console.log("Getting School ");
this.SchoolPerPerfSub = this._hds.getSchoolPerPerfecture(this.perfecture).subscribe(data => {
this.SchoolsPerPerf$.next(data);
},
error => {
this.SchoolsPerPerf$.next([{}]);
console.log("Error Getting Schools");
},
() => console.log("Getting Schools"));
}
);
/*
this.SchoolPerPerfSub = this._hds.getSchoolPerPerfecture(this.perfecture).subscribe(data => {
this.SchoolsPerPerf$.next(data);
},
......@@ -103,6 +117,7 @@ import {
console.log("Error Getting Schools");
},
() => console.log("Getting Schools"));
*/
......
......@@ -244,6 +244,9 @@ import { API_ENDPOINT } from '../../app.settings';
if (loginInfoToken.auth_role == PDE_ROLE) {
this.regionSelected = regId;
this.showAdminList.next(true);
console.log("Nikos1..");
console.log(this.regionSelected);
this.checkregion(this. regionSelected);
}
else if (loginInfoToken.auth_role == DIDE_ROLE) {
......@@ -337,6 +340,14 @@ createReport(regionSel) {
courSel = this.courseSelected;
}
if (this.userLoggedIn == PDE_ROLE) {
regSel = this.regionSelected;
console.log("Nikos2..");
console.log(regSel);
}
else if (this.userLoggedIn == DIDE_ROLE)
admSel = this.adminAreaSelected;
this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, regSel, admSel, schSel, clSel, secSel, courSel).subscribe(data => {
this.generalReport$.next(data);
this.data = data;
......
......@@ -128,6 +128,11 @@ reportCompletenessSchema = {
title: 'Πληρότητα Γ\' τάξης (%)',
width: '11%',
filter: false
},
percD: {
title: 'Πληρότητα Δ\' τάξης (%)',
width: '11%',
filter: false
}
}
};
......
......@@ -41,6 +41,9 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st
<li class="list-group-item" *ngIf="epalclass$.name === '3'">
Γ’ Λυκείου
</li>
<li class="list-group-item" *ngIf="epalclass$.name === '4'">
Δ’ Λυκείου
</li>
</ul>
</div>
......@@ -68,8 +71,6 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st
</ul>
</div>
<ul *ngIf="(regions$ | async).size > 0" class="list-group left-side-view" style="margin-bottom: 20px;">
<div *ngFor="let epal$ of selectedSchools$ | async; let i=index; let isOdd=odd; let isEven=even" >
......@@ -241,6 +242,8 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st
this.classSelected = 2;
else if (epalclass.name === "Γ' Λυκείου")
this.classSelected = 3;
else if (epalclass.name === "Δ' Λυκείου")
this.classSelected = 4;
return epalclass;
}, {});
return state.epalclasses;
......
......@@ -254,7 +254,7 @@ import { HelperDataService } from '../../services/helper-data-service';
if (aitisiObj[0]['currentclass'] === "2" )
aitisiObj['3'] = new StudentSectorChosen(null, this.sectorSelected);
//else if (aitisiObj[0]['currentclass'] === "Γ' Λυκείου" )
else if (aitisiObj[0]['currentclass'] === "3" ) {
else if (aitisiObj[0]['currentclass'] === "3" || aitisiObj[0]['currentclass'] === "4" ) {
aitisiObj['3'] = new StudentCourseChosen(null, this.courseSelected);
}
......
......@@ -33,7 +33,8 @@ import {AppSettings} from '../../app.settings';
<option value=1>Α’ Λυκείου</option>
<option value=2>Β’ Λυκείου</option>
<option value=3>Γ' Λυκείου / Δ' Λυκείου</option>
<option value=3>Γ' Λυκείου</option>
<option value=4>Δ' Λυκείου</option>
</select>
......@@ -99,7 +100,7 @@ import {AppSettings} from '../../app.settings';
this.router.navigate(['/region-schools-select']);
else if (this.formGroup.value.name === "2")
this.router.navigate(['/sector-fields-select']);
else if (this.formGroup.value.name === "3")
else if (this.formGroup.value.name === "3" || this.formGroup.value.name === "4")
this.router.navigate(['/sectorcourses-fields-select']);
}
......
......@@ -73,7 +73,9 @@ import {AppSettings} from '../../app.settings';
</button>
</div>
<div class="col-md-6">
<button type="button" class="btn-primary btn-lg pull-right isclickable" style="width: 9em;" (click)="navigateToApplication()" [disabled] = "(selectionLimitOptional | async) === false && (numSelected | async) < (selectionLimit | async)">
<button type="button" class="btn-primary btn-lg pull-right isclickable" style="width: 9em;" (click)="navigateToApplication()"
[disabled] = " ( (selectionLimitOptional | async) === false && (classNight | async) === false && (numSelected | async) < (selectionLimit | async) )
|| ( (numSelected | async) === 0)">
<span style="font-size: 0.9em; font-weight: bold;">Συνέχεια&nbsp;&nbsp;&nbsp;</span><i class="fa fa-forward"></i>
</button>
</div>
......@@ -100,10 +102,9 @@ import {AppSettings} from '../../app.settings';
private numSelected: BehaviorSubject<number>;
private selectionLimit: BehaviorSubject<number>;
private selectionLimitOptional: BehaviorSubject<boolean>;
// private selectionLimit = <number>3;
private regionSizeLimit = <number>3;
// private selectionLimitOptional = <boolean>false;
//private schoolArray: Array<boolean> = new Array();
private classNight: BehaviorSubject<boolean>;
constructor(private fb: FormBuilder,
private _rsa: RegionSchoolsActions,
......@@ -124,6 +125,7 @@ import {AppSettings} from '../../app.settings';
this.numSelected = new BehaviorSubject(0);
this.selectionLimit = new BehaviorSubject(3);
this.selectionLimitOptional = new BehaviorSubject(false);
this.classNight = new BehaviorSubject(false);
};
......@@ -158,6 +160,13 @@ import {AppSettings} from '../../app.settings';
if (state.epalclasses.size > 0) {
state.epalclasses.reduce(({}, epalclass, i) => {
this.setClassActive(epalclass.name);
console.log("My class:");
console.log(epalclass.name);
if (epalclass.name === "4") {
//this.selectionLimitOptional.next(true);
this.classNight.next(true);
console.log("Mphka!");
}
this.getAppropriateSchools(epalclass.name);
return epalclass;
}, {});
......@@ -221,14 +230,15 @@ import {AppSettings} from '../../app.settings';
return state.sectorFields;
}).subscribe(this.sectorFields$);
}
else if (epalClass === "3") {
else if (epalClass === "3" || epalClass === "4") {
this.sectorsSub = this._ngRedux.select(state => {
state.sectors.reduce((prevSector, sector) =>{
if (sector.sector_selected === true) {
sector.courses.reduce((prevCourse, course) =>{
if (course.selected === true) {
this.courseActive = parseInt(course.course_id);
this._rsa.getRegionSchools(3,this.courseActive, false);
//this._rsa.getRegionSchools(3,this.courseActive, false);
this._rsa.getRegionSchools(Number(epalClass),this.courseActive, false);
}
return course;
}, {});
......@@ -248,7 +258,7 @@ import {AppSettings} from '../../app.settings';
else if (this.classActive === "2") {
this.router.navigate(['/sector-fields-select']);
}
else if (this.classActive === "3") {
else if (this.classActive === "3" || this.classActive === "4") {
this.router.navigate(['/sectorcourses-fields-select']);
}
}
......
......@@ -246,13 +246,23 @@ export class HelperDataService implements OnInit, OnDestroy {
return new Promise((resolve, reject) => {
let getConnectionString = null;
//if (courseActive === -1)
console.log("Class:");
console.log(classActive);
console.log("Course:");
console.log(courseActive);
if (classActive === 1)
getConnectionString = `${AppSettings.API_ENDPOINT}/regions/list`;
else if (classActive === 2)
getConnectionString = `${AppSettings.API_ENDPOINT}/sectorsperschool/list?sector_id=${courseActive}`;
else if (classActive === 3)
getConnectionString = `${AppSettings.API_ENDPOINT}/coursesperschool/list?course_id=${courseActive}`;
else if (classActive === 4)
getConnectionString = `${AppSettings.API_ENDPOINT}/coursesperschool_night/list?course_id=${courseActive}`;
console.log("Path:");
console.log(getConnectionString);
this.http.get(getConnectionString, options)
.map(response => response.json())
......@@ -260,7 +270,7 @@ export class HelperDataService implements OnInit, OnDestroy {
resolve(this.transformRegionSchoolsSchema(data));
}, // put the data returned from the server in our variable
error => {
console.log("Error HTTP GET Service"); // in case of failure show this message
console.log("Error HTTP GET Service in getRegionsWithSchools method"); // in case of failure show this message
reject("Error HTTP GET Service");
},
() => console.log("region schools service"));//run this code in all cases); */
......@@ -686,6 +696,9 @@ export class HelperDataService implements OnInit, OnDestroy {
makeReport(username, userpassword, routepath, regionsel, adminsel, schsel, clsel, secsel, coursel) {
console.log("Service..Nikos..");
console.log(regionsel);
let headers = new Headers({
"Content-Type": "application/json",
});
......@@ -693,9 +706,6 @@ export class HelperDataService implements OnInit, OnDestroy {
this.createMinistryAuthorizationHeader(headers, username, userpassword );
let options = new RequestOptions({ headers: headers });
//console.log("Testing..");
//console.log(`${AppSettings.API_ENDPOINT}` + routepath + regionsel);
if (routepath == "/ministry/general-report/") {
return this.http.get(`${AppSettings.API_ENDPOINT}` + routepath , options)
.map(response => response.json());
......@@ -739,7 +749,8 @@ export class HelperDataService implements OnInit, OnDestroy {
getSchoolPerPerfecture(PerfectureId) {
console.log(PerfectureId,"a");
let PerfectureIdNew = PerfectureId.toString();
//let PerfectureIdNew = PerfectureId.toString();
let PerfectureIdNew = PerfectureId;
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
......
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