Merge branch 'component_updates' into 'develop'

Component updates

See merge request !111
parents ccb9f67e c2652204
...@@ -46,10 +46,15 @@ function epal_mail($key, &$message, $params) { ...@@ -46,10 +46,15 @@ function epal_mail($key, &$message, $params) {
$message['subject'] = t('Σύστημα υποβολής αιτήσεων εγγραφής σε ΕΠΑΛ: Επιβεβαίωση e-mail', $options); $message['subject'] = t('Σύστημα υποβολής αιτήσεων εγγραφής σε ΕΠΑΛ: Επιβεβαίωση e-mail', $options);
$message['body'][] = $params['message']; $message['body'][] = $params['message'];
break; break;
case 'massive_mail': case 'massive_mail_unallocated':
$message['from'] = \Drupal::config('system.site')->get('mail'); $message['from'] = \Drupal::config('system.site')->get('mail');
$message['subject'] = t('Μη ικανοποίηση ηλεκτρονικής αίτησης για εγγραφή σε ΕΠΑΛ', $options); $message['subject'] = t('Μη ικανοποίηση ηλεκτρονικής αίτησης για εγγραφή σε ΕΠΑΛ', $options);
$message['body'][] = $params['message']; $message['body'][] = $params['message'];
break; break;
case 'massive_mail_located':
$message['from'] = \Drupal::config('system.site')->get('mail');
$message['subject'] = t('Ικανοποίηση ηλεκτρονικής αίτησης για εγγραφή σε ΕΠΑΛ', $options);
$message['body'][] = $params['message'];
break;
} }
} }
...@@ -73,7 +73,7 @@ epal.application_submit: ...@@ -73,7 +73,7 @@ epal.application_submit:
epal.allocation: epal.allocation:
path: '/epal/distribution' path: '/epal/distribution'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
_controller: '\Drupal\epal\Controller\Distribution::createDistribution' _controller: '\Drupal\epal\Controller\Distribution::createDistribution'
requirements: requirements:
...@@ -151,7 +151,7 @@ epal.ministry.report-completeness: ...@@ -151,7 +151,7 @@ epal.ministry.report-completeness:
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
epal.ministry.report-all-stat: epal.ministry.report-all-stat:
path: '/ministry/report-all-stat/{regionId}/{adminId}/{schId}/{classId}/{sectorId}/{courseId}' path: '/ministry/report-all-stat/{regionId}/{adminId}/{schId}/{classId}/{sectorId}/{courseId}/{finalized}'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
...@@ -174,12 +174,20 @@ epal.ministry.retrieve-registry-id: ...@@ -174,12 +174,20 @@ epal.ministry.retrieve-registry-id:
_controller: '\Drupal\epal\Controller\ReportsCreator::retrieveUserRegistryNo' _controller: '\Drupal\epal\Controller\ReportsCreator::retrieveUserRegistryNo'
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
epal.ministry.massive_mail: epal.ministry.massive_mail_unallocated:
path: '/ministry/send-massive-mail' path: '/ministry/send-unallocated-massive-mail'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToUnallocatedStudents'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.massive_mail_located:
path: '/ministry/send-located-massive-mail'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
_controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToStudents' _controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToLocatedStudents'
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
epal.ministry.retrievesettings: epal.ministry.retrievesettings:
...@@ -254,5 +262,3 @@ getlimitspercourse: ...@@ -254,5 +262,3 @@ getlimitspercourse:
_controller: '\Drupal\epal\Controller\DirectorView::getlimitsperCourse' _controller: '\Drupal\epal\Controller\DirectorView::getlimitsperCourse'
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
...@@ -87,7 +87,7 @@ class MinisterSettings extends ControllerBase { ...@@ -87,7 +87,7 @@ class MinisterSettings extends ControllerBase {
//minister settings retrieve //minister settings retrieve
$config_storage = $this->entityTypeManager->getStorage('epal_config'); $config_storage = $this->entityTypeManager->getStorage('epal_config');
$epalConfigs = $config_storage->loadByProperties(array('id' => 1)); $epalConfigs = $config_storage->loadByProperties(array('name' => 'epal_config'));
$epalConfig = reset($epalConfigs); $epalConfig = reset($epalConfigs);
if (!$epalConfig) { if (!$epalConfig) {
return $this->respondWithStatus([ return $this->respondWithStatus([
...@@ -157,7 +157,7 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView ...@@ -157,7 +157,7 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
} }
$config_storage = $this->entityTypeManager->getStorage('epal_config'); $config_storage = $this->entityTypeManager->getStorage('epal_config');
$epalConfigs = $config_storage->loadByProperties(array('id' => 1)); $epalConfigs = $config_storage->loadByProperties(array('name' => 'epal_config'));
$epalConfig = reset($epalConfigs); $epalConfig = reset($epalConfigs);
if (!$epalConfig) { if (!$epalConfig) {
return $this->respondWithStatus([ return $this->respondWithStatus([
......
...@@ -42,8 +42,14 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -42,8 +42,14 @@ import { API_ENDPOINT } from '../../app.settings';
<h5> >Αποστολή ειδοποιήσεων <br></h5> <h5> >Αποστολή ειδοποιήσεων <br></h5>
<br><br> <br><br>
<div class="col-md-12"> <div class="col-md-12">
<button type="submit" class="btn btn-lg btn-block" *ngIf="(loginInfo$ | async).size !== 0" (click)="informUnlocatedStudents()" > <button type="submit" class="btn btn-lg btn-block" *ngIf="(loginInfo$ | async).size !== 0" (click)="informUnlocatedStudents(true)" >
Μαζική αποστολή e-mail στους μαθητές που δεν τοποθετήθηκαν<span class="glyphicon glyphicon-menu-right"></span> Μαζική αποστολή 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)" >
Μαζική αποστολή e-mail στους μαθητές που τοποθετήθηκαν<span class="glyphicon glyphicon-menu-right"></span>
</button> </button>
</div> </div>
...@@ -126,13 +132,13 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -126,13 +132,13 @@ import { API_ENDPOINT } from '../../app.settings';
//this.isModalShown.next(false); //this.isModalShown.next(false);
} }
informUnlocatedStudents() { informUnlocatedStudents(unallocated) {
this.successSending = -2; this.successSending = -2;
this.numSuccessMails = 0; this.numSuccessMails = 0;
this.numFailMails = 0; this.numFailMails = 0;
this._hds.informUnlocatedStudents(this.minedu_userName, this.minedu_userPassword).subscribe(data => { this._hds.informUnlocatedStudents(this.minedu_userName, this.minedu_userPassword, unallocated).subscribe(data => {
this.numSuccessMails = data.num_success_mail; this.numSuccessMails = data.num_success_mail;
this.numFailMails = data.num_fail_mail; this.numFailMails = data.num_fail_mail;
//console.log("HERE!"); //console.log("HERE!");
...@@ -144,20 +150,17 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -144,20 +150,17 @@ import { API_ENDPOINT } from '../../app.settings';
this.modalTitle.next("Κατανομή Μαθητών"); this.modalTitle.next("Κατανομή Μαθητών");
this.modalText.next("Αποτυχία αποστολής e-mails!"); this.modalText.next("Αποτυχία αποστολής e-mails!");
//this.modalHeader = "modal-header-warning";
this.modalHeader.next("modal-header-warning"); this.modalHeader.next("modal-header-warning");
this.showModal(); this.showModal();
}, },
() => { () => {
console.log("Success"); console.log("Επιτυχής αποστολή e-mails!");
this.successSending = 1; this.successSending = 1;
//this.modalHeader = "modal-header-success";
this.modalHeader.next("modal-header-success"); this.modalHeader.next("modal-header-success");
this.modalTitle.next("Κατανομή Μαθητών"); this.modalTitle.next("Κατανομή Μαθητών");
let txtModal = "Έγινε αποστολή " + this.numSuccessMails + " e-mails! "; let txtModal = "Έγινε αποστολή " + this.numSuccessMails + " e-mails! ";
if (this.numFailMails != 0) { if (this.numFailMails != 0) {
//this.modalHeader = "modal-header-warning";
this.modalHeader.next("modal-header-warning"); this.modalHeader.next("modal-header-warning");
txtModal += "Κάποια e-mail δεν έχουν σταλεί. Δεν ήταν δυνατή η αποστολή " + this.numFailMails + " e-mails!"; txtModal += "Κάποια e-mail δεν έχουν σταλεί. Δεν ήταν δυνατή η αποστολή " + this.numFailMails + " e-mails!";
} }
......
...@@ -47,11 +47,16 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -47,11 +47,16 @@ import { API_ENDPOINT } from '../../app.settings';
Αριθμός Μαθητών και Πληρότητα σχολικών μονάδων ΕΠΑΛ Αριθμός Μαθητών και Πληρότητα σχολικών μονάδων ΕΠΑΛ
</button> </button>
<br><br> <br><br>
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(4)" [hidden]="minedu_userName == ''" > <button type="button" class="btn btn-alert" (click)="nav_to_reportpath(4)" [hidden]="minedu_userName == '' || userRole == 'pde' || userRole == 'dide' " >
<i class="fa fa-file-text"></i> <i class="fa fa-file-text"></i>
Σχολικές μονάδες που δεν έχουν δηλώσει Χωρητικότητα τμημάτων Σχολικές μονάδες που δεν έχουν δηλώσει Χωρητικότητα τμημάτων
</button> </button>
<br><br> <br><br>
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(5)" [hidden]="minedu_userName == '' " >
<i class="fa fa-file-text"></i>
Ολιγομελή τμήματα (Προσωρινά τοποθετημένοι μαθητές)
</button>
<br><br>
</div> </div>
</div> </div>
...@@ -124,7 +129,7 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -124,7 +129,7 @@ import { API_ENDPOINT } from '../../app.settings';
if (repId == 1) if (repId == 1)
this.router.navigate(['/ministry/report-general', repId]); this.router.navigate(['/ministry/report-general', repId]);
else if (repId == 2 || repId == 3) else if (repId == 2 || repId == 3 || repId == 5)
this.router.navigate(['/ministry/report-all-stat', repId]); this.router.navigate(['/ministry/report-all-stat', repId]);
else if (repId == 4) else if (repId == 4)
this.router.navigate(['/ministry/report-no-capacity', repId]); this.router.navigate(['/ministry/report-no-capacity', repId]);
......
...@@ -67,7 +67,7 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -67,7 +67,7 @@ import { API_ENDPOINT } from '../../app.settings';
</select> </select>
</div> </div>
<button type="button" class="btn-link" (click)="toggleCourseFilter()" *ngIf = "reportId == 3" > <button type="button" class="btn-link" (click)="toggleCourseFilter()" *ngIf = "reportId == 3 || reportId == 5" >
> Φίλτρο Επιλογής Τομέα / Ειδικότητας > Φίλτρο Επιλογής Τομέα / Ειδικότητας
</button> </button>
<br> <br>
...@@ -170,6 +170,7 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -170,6 +170,7 @@ import { API_ENDPOINT } from '../../app.settings';
private classSelected: number; private classSelected: number;
private sectorSelected: number; private sectorSelected: number;
private courseSelected: number; private courseSelected: number;
private distribFinalized: number;
private enableRegionFilter: boolean; private enableRegionFilter: boolean;
private enableCourseFilter: boolean; private enableCourseFilter: boolean;
private userLoggedIn: string; private userLoggedIn: string;
...@@ -358,6 +359,12 @@ createReport(regionSel) { ...@@ -358,6 +359,12 @@ createReport(regionSel) {
} }
else if (this.reportId === 3) { else if (this.reportId === 3) {
route = "/ministry/report-all-stat/"; route = "/ministry/report-all-stat/";
this.distribFinalized = 1;
this.settings = this.reportSchema.reportAllStatSchema;
}
else if (this.reportId === 5) {
route = "/ministry/report-all-stat/";
this.distribFinalized = 0;
this.settings = this.reportSchema.reportAllStatSchema; this.settings = this.reportSchema.reportAllStatSchema;
} }
...@@ -385,7 +392,7 @@ createReport(regionSel) { ...@@ -385,7 +392,7 @@ createReport(regionSel) {
else if (this.userLoggedIn == DIDE_ROLE) else if (this.userLoggedIn == DIDE_ROLE)
admSel = this.adminAreaSelected; admSel = this.adminAreaSelected;
this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, regSel, admSel, schSel, clSel, secSel, courSel).subscribe(data => { this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, regSel, admSel, schSel, clSel, secSel, courSel, this.distribFinalized).subscribe(data => {
this.generalReport$.next(data); this.generalReport$.next(data);
this.data = data; this.data = data;
......
...@@ -178,7 +178,7 @@ createReport(regionSel) { ...@@ -178,7 +178,7 @@ createReport(regionSel) {
let regSel = 0; let regSel = 0;
this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, 0, 0, 0, 0, 0,0).subscribe(data => { this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, 0, 0, 0, 0, 0,0, 0).subscribe(data => {
this.generalReport$.next(data); this.generalReport$.next(data);
this.data = data; this.data = data;
}, },
...@@ -242,7 +242,8 @@ generateGraphData() { ...@@ -242,7 +242,8 @@ generateGraphData() {
labelsX.push("2η Προτίμηση"); labelsX.push("2η Προτίμηση");
labelsX.push("3η Προτίμηση"); labelsX.push("3η Προτίμηση");
labelsX.push("Μη τοποθετημένοι"); labelsX.push("Μη τοποθετημένοι");
for (let i = 1; i <= 4; i++) { labelsX.push("Προσωρινά τοποθετημένοι σε ολιγομελή");
for (let i = 1; i <= 5; i++) {
this.d3data.push([ this.d3data.push([
labelsX[i-1], labelsX[i-1],
this.data[i].numStudents / this.data[0].numStudents, this.data[i].numStudents / this.data[0].numStudents,
......
...@@ -172,7 +172,7 @@ createReport() { ...@@ -172,7 +172,7 @@ createReport() {
return; return;
} }
this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, this.enableCapacityFilter, 0, 0, 0, 0,0).subscribe(data => { this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, this.enableCapacityFilter, 0, 0, 0, 0, 0, 0).subscribe(data => {
this.generalReport$.next(data); this.generalReport$.next(data);
this.data = data; this.data = data;
}, },
......
...@@ -70,8 +70,8 @@ export const MainRoutes: Routes = [ ...@@ -70,8 +70,8 @@ export const MainRoutes: Routes = [
{ path: 'school/director-buttons', component: DirectorButtons, canActivate: [SchoolAuthGuard] }, { path: 'school/director-buttons', component: DirectorButtons, canActivate: [SchoolAuthGuard] },
{ path: 'school/director-classcapacity', component: DirectorClassCapacity, canActivate: [SchoolAuthGuard] }, { path: 'school/director-classcapacity', component: DirectorClassCapacity, canActivate: [SchoolAuthGuard] },
{ path: 'ministry/minister-view', component: MinisterView, canActivate: [MinistryAuthGuard] }, { path: 'ministry/minister-view', component: MinisterView, canActivate: [MinistryAuthGuard] },
{ path: 'ministry/minister-reports', component: MinisterReports, canActivate: [MinistryAuthGuard] }, { path: 'ministry/minister-reports', component: MinisterReports },
{ path: 'ministry/report-all-stat/:reportId', component: ReportAllStat, canActivate: [MinistryAuthGuard] }, { path: 'ministry/report-all-stat/:reportId', component: ReportAllStat },
{ path: 'ministry/report-general/:reportId', component: ReportGeneral, canActivate: [MinistryAuthGuard] }, { path: 'ministry/report-general/:reportId', component: ReportGeneral, canActivate: [MinistryAuthGuard] },
{ path: 'ministry/report-no-capacity/:reportId', component: ReportNoCapacity, canActivate: [MinistryAuthGuard] }, { path: 'ministry/report-no-capacity/:reportId', component: ReportNoCapacity, canActivate: [MinistryAuthGuard] },
{ path: 'ministry/minister-informstudents', component: InformStudents, canActivate: [MinistryAuthGuard] }, { path: 'ministry/minister-informstudents', component: InformStudents, canActivate: [MinistryAuthGuard] },
......
...@@ -12,7 +12,9 @@ export default class MinistryAuthGuard implements CanActivate { ...@@ -12,7 +12,9 @@ export default class MinistryAuthGuard implements CanActivate {
canActivate() { canActivate() {
return this.authService.isLoggedIn(MINISTRY_ROLE).then(loggedIn => { return this.authService.isLoggedIn(MINISTRY_ROLE).then(loggedIn => {
if (!loggedIn) { if (!loggedIn) {
console.log("I am IN!");
this.router.navigate(['/ministry/logout']); this.router.navigate(['/ministry/logout']);
//this.router.navigate(['/ministy/minister-settings']);
} }
return loggedIn; return loggedIn;
}).catch(err => { }).catch(err => {
......
...@@ -609,7 +609,7 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -609,7 +609,7 @@ export class HelperDataService implements OnInit, OnDestroy {
} }
makeReport(username, userpassword, routepath, regionsel, adminsel, schsel, clsel, secsel, coursel) { makeReport(username, userpassword, routepath, regionsel, adminsel, schsel, clsel, secsel, coursel, distribfinal) {
let headers = new Headers({ let headers = new Headers({
"Content-Type": "application/json", "Content-Type": "application/json",
...@@ -628,7 +628,7 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -628,7 +628,7 @@ export class HelperDataService implements OnInit, OnDestroy {
} }
else if (routepath == "/ministry/report-all-stat/"){ else if (routepath == "/ministry/report-all-stat/"){
return this.http.get(`${AppSettings.API_ENDPOINT}` + routepath + regionsel + "/" + adminsel + "/" + schsel + "/" + return this.http.get(`${AppSettings.API_ENDPOINT}` + routepath + regionsel + "/" + adminsel + "/" + schsel + "/" +
clsel + "/" + secsel + "/" + coursel , options) clsel + "/" + secsel + "/" + coursel + "/" + distribfinal , options)
.map(response => response.json()); .map(response => response.json());
} }
else if (routepath == "/ministry/report-no-capacity/"){ else if (routepath == "/ministry/report-no-capacity/"){
...@@ -641,14 +641,21 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -641,14 +641,21 @@ export class HelperDataService implements OnInit, OnDestroy {
} }
informUnlocatedStudents(username, userpassword) { informUnlocatedStudents(username, userpassword, unallocated) {
let headers = new Headers({ let headers = new Headers({
"Content-Type": "application/json", "Content-Type": "application/json",
}); });
this.createMinistryAuthorizationHeader(headers, username, userpassword ); this.createMinistryAuthorizationHeader(headers, username, userpassword );
let options = new RequestOptions({ headers: headers }); let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/ministry/send-massive-mail` , options)
let route="";
if (unallocated == true)
route = "ministry/send-unallocated-massive-mail";
else
route = "ministry/send-located-massive-mail";
return this.http.get(`${AppSettings.API_ENDPOINT}/` + route , options)
.map(response => response.json()); .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