updated ministry environment

parent 7cb36363
......@@ -42,13 +42,13 @@ import { API_ENDPOINT } from '../../app.settings';
<h5> >Αποστολή ειδοποιήσεων <br></h5>
<br><br>
<div class="col-md-12">
<button type="submit" class="btn btn-lg btn-block" *ngIf="(loginInfo$ | async).size !== 0" (click)="informUnlocatedStudents(true)" >
<button type="submit" class="btn btn-lg btn-block" *ngIf="(loginInfo$ | async).size !== 0" (click)="informUnlocatedStudents(true)" [disabled] = "!applicantsResultsDisabled" >
Μαζική αποστολή e-mail στους μαθητές που ΔΕΝ τοποθετήθηκαν<span class="glyphicon glyphicon-menu-right"></span>
</button>
</div>
<br>
<div class="col-md-12">
<button type="submit" class="btn btn-lg btn-block" *ngIf="(loginInfo$ | async).size !== 0" (click)="informUnlocatedStudents(false)" >
<button type="submit" class="btn btn-lg btn-block" *ngIf="(loginInfo$ | async).size !== 0" (click)="informUnlocatedStudents(false)" [disabled] = "!applicantsResultsDisabled">
Μαζική αποστολή e-mail στους μαθητές που τοποθετήθηκαν<span class="glyphicon glyphicon-menu-right"></span>
</button>
</div>
......@@ -62,14 +62,16 @@ import { API_ENDPOINT } from '../../app.settings';
private modalTitle: BehaviorSubject<string>;
private modalText: BehaviorSubject<string>;
private modalHeader: BehaviorSubject<string>;
//public modalHeader: string;
private settings$: BehaviorSubject<any>;
loginInfoSub: Subscription;
private settingsSub: Subscription;
private numSuccessMails:number;
private numFailMails:number;
private successSending:number;
private apiEndPoint = API_ENDPOINT;
private minedu_userName: string;
private minedu_userPassword: string;
private applicantsResultsDisabled: boolean;
constructor(
private _ngRedux: NgRedux<IAppState>,
......@@ -78,10 +80,10 @@ import { API_ENDPOINT } from '../../app.settings';
private router: Router) {
this.loginInfo$ = new BehaviorSubject(LOGININFO_INITIAL_STATE);
//this.isModalShown = new BehaviorSubject(false);
this.modalTitle = new BehaviorSubject("");
this.modalText = new BehaviorSubject("");
this.modalHeader = new BehaviorSubject("");
this.settings$ = new BehaviorSubject([{}]);
}
......@@ -104,6 +106,8 @@ import { API_ENDPOINT } from '../../app.settings';
this.numFailMails = 0;
this.successSending = -1;
this.retrieveSettings();
}
ngOnDestroy() {
......@@ -114,11 +118,16 @@ import { API_ENDPOINT } from '../../app.settings';
this.loginInfoSub.unsubscribe();
if (this.loginInfo$)
this.loginInfo$.unsubscribe();
if (this.settingsSub)
this.settingsSub.unsubscribe();
if (this.loginInfo$)
this.loginInfo$.unsubscribe();
if (this.settings$)
this.settings$.unsubscribe();
}
public showModal():void {
console.log("about to show modal");
(<any>$('#emaiSentNotice')).modal('show');
......@@ -172,4 +181,31 @@ import { API_ENDPOINT } from '../../app.settings';
}
retrieveSettings() {
this.settingsSub = this._hds.retrieveAdminSettings(this.minedu_userName, this.minedu_userPassword).subscribe(data => {
this.settings$.next(data);
},
error => {
this.settings$.next([{}]);
console.log("Error Getting MinisterRetrieveSettings");
},
() => {
console.log("Success Getting MinisterRetrieveSettings");
this.applicantsResultsDisabled = Boolean(Number(this.settings$.value['applicantsResultsDisabled']));
if (this.applicantsResultsDisabled == false) {
this.modalTitle.next("Κατανομή Μαθητών");
this.modalText.next(("ΠΡΟΣΟΧΗ: Για να μπορείτε να αποστείλετε e-mail ενημέρωσης, παρακαλώ πηγαίνετε στις Ρυθμίσεις και ΕΝΕΡΓΟΠΟΙΗΣΤΕ ") +
("τη δυνατότητα της προβολής αποτελεσμάτων κατανομής από τους μαθητές.") );
this.modalHeader.next("modal-header-warning");
this.showModal();
}
}
)
}
}
......@@ -32,6 +32,8 @@ import { API_ENDPOINT } from '../../app.settings';
<h5> >Επιλογή Αναφοράς<br><br></h5>
<div class="col-md-1">
<!--
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(1)" [hidden]="minedu_userName == '' || userRole == 'pde' || userRole == 'dide'" >
<i class="fa fa-file-text"></i>
Κατανομή Μαθητών με Βάση τη Σειρά Προτίμησης
......@@ -52,12 +54,50 @@ import { API_ENDPOINT } from '../../app.settings';
Σχολικές μονάδες που δεν έχουν δηλώσει Χωρητικότητα τμημάτων
</button>
<br><br>
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(5)" [hidden]="minedu_userName == '' " >
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(5)" [hidden]="minedu_userName == '' || userRole == 'pde' || userRole == 'dide' " >
<i class="fa fa-file-text"></i>
Ολιγομελή τμήματα (Προσωρινά τοποθετημένοι μαθητές)
</button>
<br><br>
</div>
-->
<div *ngIf = "minedu_userName != '' && userRole != 'pde' && userRole != 'dide'">
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(1)" >
<i class="fa fa-file-text"></i>
Κατανομή Μαθητών με Βάση τη Σειρά Προτίμησης
</button>
<br><br>
</div>
<div *ngIf = "minedu_userName != ''" >
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(2)" >
<i class="fa fa-file-text"></i>
Συνολική Πληρότητα σχολικών μονάδων ΕΠΑΛ ανά τάξη
</button>
<br><br>
</div>
<div *ngIf = "minedu_userName != ''" >
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(3)" >
<i class="fa fa-file-text"></i>
Αριθμός Μαθητών και Πληρότητα σχολικών μονάδων ΕΠΑΛ
</button>
<br><br>
</div>
<div *ngIf = "minedu_userName != '' && userRole != 'pde' && userRole != 'dide'">
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(4)" >
<i class="fa fa-file-text"></i>
Σχολικές μονάδες που δεν έχουν δηλώσει Χωρητικότητα τμημάτων
</button>
<br><br>
</div>
<div *ngIf = "minedu_userName != '' && userRole != 'pde' && userRole != 'dide'">
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(5)" >
<i class="fa fa-file-text"></i>
Ολιγομελή τμήματα (Προσωρινά τοποθετημένοι μαθητές)
</button>
<br><br>
</div>
</div>
</div>
......
......@@ -85,6 +85,17 @@ import {
</div>
<br>
<div class="row">
<div class="col-md-1 ">
<input type="checkbox" [checked]="applicantsResultsDisabled" formControlName="applicantsResultsDisabled"
(click)="toggleApplicantsResults()" >
</div>
<div class="col-md-9">
<label for="applicantsResultsDisabled">Απενεργοποίηση δυνατότητας προβολής αποτελεσμάτων κατανομής από τους μαθητές </label>
</div>
</div>
<br>
<button type="submit" class="btn btn-md pull-right" (click)="storeSettings()" >
Εφαρμογή
</button>
......@@ -106,11 +117,11 @@ import {
private settings$: BehaviorSubject<any>;
loginInfoSub: Subscription;
private settingsSub: Subscription;
//private data;
private capacityDisabled: boolean;
private directorViewDisabled: boolean;
private applicantsLoginDisabled: boolean;
private applicantsResultsDisabled: boolean;
private dataRetrieved: number;
private minedu_userName: string;
......@@ -125,6 +136,7 @@ import {
capacityDisabled: ['', []],
directorViewDisabled: ['', []],
applicantsLoginDisabled: ['', []],
applicantsResultsDisabled: ['', []],
});
this.loginInfo$ = new BehaviorSubject(LOGININFO_INITIAL_STATE);
......@@ -201,6 +213,7 @@ import {
this.capacityDisabled = Boolean(Number(this.settings$.value['capacityDisabled']));
this.directorViewDisabled = Boolean(Number(this.settings$.value['directorViewDisabled']));
this.applicantsLoginDisabled = Boolean(Number(this.settings$.value['applicantsLoginDisabled']));
this.applicantsResultsDisabled = Boolean(Number(this.settings$.value['applicantsResultsDisabled']));
this.dataRetrieved = 1;
}
......@@ -212,7 +225,8 @@ import {
this.dataRetrieved = -1;
this.settingsSub = this._hds.storeAdminSettings(this.minedu_userName, this.minedu_userPassword, this.capacityDisabled, this.directorViewDisabled, this.applicantsLoginDisabled )
this.settingsSub = this._hds.storeAdminSettings(this.minedu_userName, this.minedu_userPassword,
this.capacityDisabled, this.directorViewDisabled, this.applicantsLoginDisabled, this.applicantsResultsDisabled )
.subscribe(data => {
this.settings$.next(data);
//this.data = data;
......@@ -262,11 +276,11 @@ import {
}
toggleApplicantsResults() {
this.applicantsResultsDisabled = !this.applicantsResultsDisabled;
}
......
......@@ -105,6 +105,7 @@ import { API_ENDPOINT } from '../../app.settings';
private distStatus = "READY";
private capacityDisabled: boolean;
private directorViewDisabled: boolean;
private applicantsResultsDisabled: boolean;
constructor(/*private fb: FormBuilder,*/
// private _ata: LoginInfoActions,
......@@ -205,10 +206,7 @@ import { API_ENDPOINT } from '../../app.settings';
this.showModal("#distributionWaitingNotice");
this._hds.makeDistribution(this.minedu_userName, this.minedu_userPassword)
.then(msg => {
//console.log("Nikos2");
this.modalTitle.next("Κατανομή Μαθητών");
this.modalText.next("Η κατανομή ολοκληρώθηκε με επιτυχία!");
this.modalHeader.next("modal-header-success");
......@@ -218,8 +216,6 @@ import { API_ENDPOINT } from '../../app.settings';
this.distStatus = "FINISHED";
})
.catch(err => {console.log(err);
//console.log("Nikos1");
//console.log(err);
this.distStatus = "ERROR";
this.modalTitle.next("Κατανομή Μαθητών");
......@@ -247,6 +243,7 @@ import { API_ENDPOINT } from '../../app.settings';
this.capacityDisabled = Boolean(Number(this.settings$.value['capacityDisabled']));
this.directorViewDisabled = Boolean(Number(this.settings$.value['directorViewDisabled']));
this.applicantsResultsDisabled = Boolean(Number(this.settings$.value['applicantsResultsDisabled']));
console.log("Debugging..");
console.log(this.capacityDisabled);
......@@ -265,7 +262,13 @@ import { API_ENDPOINT } from '../../app.settings';
this.modalHeader.next("modal-header-warning");
this.showModal("#distributionNotice");
}
else if (this.applicantsResultsDisabled == false) {
this.modalTitle.next("Κατανομή Μαθητών");
this.modalText.next(("ΠΡΟΣΟΧΗ: Για να μπορείτε να εκτελέσετε την κατανομή, παρακαλώ πηγαίνετε στις Ρυθμίσεις και ΑΠΕΝΕΡΓΟΠΟΙΗΣΤΕ ") +
("τη δυνατότητα της προβολής αποτελεσμάτων κατανομής από τους μαθητές.") );
this.modalHeader.next("modal-header-warning");
this.showModal("#distributionNotice");
}
//this.dataRetrieved = 1;
}
......
......@@ -12,7 +12,7 @@ import { ILoginInfo } from '../../store/logininfo/logininfo.types';
import { Ng2SmartTableModule, LocalDataSource } from 'ng2-smart-table';
import {reportsSchema, TableColumn} from './reports-schema';
import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial-state';
import { PDE_ROLE, DIDE_ROLE } from '../../constants';
import { DIDE_ROLE, PDE_ROLE, MINISTRY_ROLE } from '../../constants';
import {csvCreator} from './csv-creator';
import {chartCreator} from './chart-creator';
......@@ -43,8 +43,13 @@ import { API_ENDPOINT } from '../../app.settings';
<!--<h5> >Επιλογή Φίλτρων <br><br></h5>-->
<br>
<button type="button" class="btn-link" (click)="toggleRegionFilter()" >
> Φίλτρο Επιλογής Περιφ/κής Δ/νσης - Δ/νσης Εκπ/σης - Σχολείου
<div *ngIf = "userLoggedIn == 'supervisor'"> > Φίλτρο Επιλογής Περιφ/κής Δ/νσης - Δ/νσης Εκπ/σης - Σχολείου </div>
<div *ngIf = "userLoggedIn == 'dide'" > > Φίλτρο Επιλογής Σχολείου </div>
<div *ngIf = "userLoggedIn == 'pde'"> > Φίλτρο Επιλογής Δ/νσης Εκπ/σης - Σχολείου </div>
</button>
<div class="col-md-11 offset-md-1">
<label *ngIf = "enableRegionFilter && userLoggedIn == 'supervisor'"> Περιφερειακή Διεύθυνση </label>
<select #regsel class="form-control" (change)="checkregion(regsel)" *ngIf = "enableRegionFilter" [value] = "regionSelected" [hidden] = "userLoggedIn != 'supervisor'" formControlName="region">
......@@ -67,10 +72,12 @@ import { API_ENDPOINT } from '../../app.settings';
</select>
</div>
<button type="button" class="btn-link" (click)="toggleCourseFilter()" *ngIf = "reportId == 3 || reportId == 5" >
<div *ngIf = "reportId == 3 || reportId == 5" >
<button type="button" class="btn-link" (click)="toggleCourseFilter()" >
> Φίλτρο Επιλογής Τομέα / Ειδικότητας
</button>
<br>
</div>
<div class="col-md-11 offset-md-1">
<label for="classid" *ngIf = "enableCourseFilter" >Τάξη</label><br/>
<select #class_sel class="form-control" (change)="checkclass(class_sel)" *ngIf = "enableCourseFilter" formControlName="classid" >
......@@ -97,7 +104,6 @@ import { API_ENDPOINT } from '../../app.settings';
<option *ngFor="let CourseSelection$ of CourseSelections$ | async; let i=index" [value] = "CourseSelection$.id"> {{CourseSelection$.name}}</option>
</select>
</div>
<br>
<button type="submit" class="btn btn-alert" (click)="createReport(regsel)" [hidden]="minedu_userName == ''" >
<i class="fa fa-file-text"></i>
......
......@@ -778,7 +778,7 @@ retrieveAdminSettings(username, userpassword) {
.map(response => response.json());
}
storeAdminSettings(username, userpassword, capac, dirview, applogin) {
storeAdminSettings(username, userpassword, capac, dirview, applogin, appresults) {
let headers = new Headers({
"Content-Type": "application/json",
......@@ -787,7 +787,8 @@ storeAdminSettings(username, userpassword, capac, dirview, applogin) {
this.createMinistryAuthorizationHeader(headers, username, userpassword );
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/ministry/store-settings/` + Number(capac) + "/" + Number(dirview) + "/" + Number(applogin) , options)
return this.http.get(`${AppSettings.API_ENDPOINT}/ministry/store-settings/` +
Number(capac) + "/" + Number(dirview) + "/" + Number(applogin) + "/" + Number(appresults) , 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