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) {
$message['subject'] = t('Σύστημα υποβολής αιτήσεων εγγραφής σε ΕΠΑΛ: Επιβεβαίωση e-mail', $options);
$message['body'][] = $params['message'];
break;
case 'massive_mail':
case 'massive_mail_unallocated':
$message['from'] = \Drupal::config('system.site')->get('mail');
$message['subject'] = t('Μη ικανοποίηση ηλεκτρονικής αίτησης για εγγραφή σε ΕΠΑΛ', $options);
$message['body'][] = $params['message'];
break;
case 'massive_mail_located':
$message['from'] = \Drupal::config('system.site')->get('mail');
$message['subject'] = t('Ικανοποίηση ηλεκτρονικής αίτησης για εγγραφή σε ΕΠΑΛ', $options);
$message['body'][] = $params['message'];
break;
}
}
......@@ -151,7 +151,7 @@ epal.ministry.report-completeness:
requirements:
_user_is_logged_in: 'TRUE'
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:
_auth: [ 'basic_auth' ]
defaults:
......@@ -174,12 +174,20 @@ epal.ministry.retrieve-registry-id:
_controller: '\Drupal\epal\Controller\ReportsCreator::retrieveUserRegistryNo'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.massive_mail:
path: '/ministry/send-massive-mail'
epal.ministry.massive_mail_unallocated:
path: '/ministry/send-unallocated-massive-mail'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToStudents'
_controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToUnallocatedStudents'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.massive_mail_located:
path: '/ministry/send-located-massive-mail'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToLocatedStudents'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.retrievesettings:
......@@ -254,5 +262,3 @@ getlimitspercourse:
_controller: '\Drupal\epal\Controller\DirectorView::getlimitsperCourse'
requirements:
_user_is_logged_in: 'TRUE'
......@@ -87,7 +87,7 @@ class MinisterSettings extends ControllerBase {
//minister settings retrieve
$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);
if (!$epalConfig) {
return $this->respondWithStatus([
......@@ -157,7 +157,7 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
}
$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);
if (!$epalConfig) {
return $this->respondWithStatus([
......
......@@ -42,8 +42,14 @@ 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()" >
Μαζική αποστολή e-mail στους μαθητές που δεν τοποθετήθηκαν<span class="glyphicon glyphicon-menu-right"></span>
<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>
</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>
</div>
......@@ -126,13 +132,13 @@ import { API_ENDPOINT } from '../../app.settings';
//this.isModalShown.next(false);
}
informUnlocatedStudents() {
informUnlocatedStudents(unallocated) {
this.successSending = -2;
this.numSuccessMails = 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.numFailMails = data.num_fail_mail;
//console.log("HERE!");
......@@ -144,20 +150,17 @@ import { API_ENDPOINT } from '../../app.settings';
this.modalTitle.next("Κατανομή Μαθητών");
this.modalText.next("Αποτυχία αποστολής e-mails!");
//this.modalHeader = "modal-header-warning";
this.modalHeader.next("modal-header-warning");
this.showModal();
},
() => {
console.log("Success");
console.log("Επιτυχής αποστολή e-mails!");
this.successSending = 1;
//this.modalHeader = "modal-header-success";
this.modalHeader.next("modal-header-success");
this.modalTitle.next("Κατανομή Μαθητών");
let txtModal = "Έγινε αποστολή " + this.numSuccessMails + " e-mails! ";
if (this.numFailMails != 0) {
//this.modalHeader = "modal-header-warning";
this.modalHeader.next("modal-header-warning");
txtModal += "Κάποια e-mail δεν έχουν σταλεί. Δεν ήταν δυνατή η αποστολή " + this.numFailMails + " e-mails!";
}
......
......@@ -47,11 +47,16 @@ import { API_ENDPOINT } from '../../app.settings';
Αριθμός Μαθητών και Πληρότητα σχολικών μονάδων ΕΠΑΛ
</button>
<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>
Σχολικές μονάδες που δεν έχουν δηλώσει Χωρητικότητα τμημάτων
</button>
<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>
......@@ -124,7 +129,7 @@ import { API_ENDPOINT } from '../../app.settings';
if (repId == 1)
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]);
else if (repId == 4)
this.router.navigate(['/ministry/report-no-capacity', repId]);
......
......@@ -67,7 +67,7 @@ import { API_ENDPOINT } from '../../app.settings';
</select>
</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>
<br>
......@@ -170,6 +170,7 @@ import { API_ENDPOINT } from '../../app.settings';
private classSelected: number;
private sectorSelected: number;
private courseSelected: number;
private distribFinalized: number;
private enableRegionFilter: boolean;
private enableCourseFilter: boolean;
private userLoggedIn: string;
......@@ -358,6 +359,12 @@ createReport(regionSel) {
}
else if (this.reportId === 3) {
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;
}
......@@ -385,7 +392,7 @@ createReport(regionSel) {
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.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.data = data;
......
......@@ -178,7 +178,7 @@ createReport(regionSel) {
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.data = data;
},
......@@ -242,7 +242,8 @@ generateGraphData() {
labelsX.push("2η Προτίμηση");
labelsX.push("3η Προτίμηση");
labelsX.push("Μη τοποθετημένοι");
for (let i = 1; i <= 4; i++) {
labelsX.push("Προσωρινά τοποθετημένοι σε ολιγομελή");
for (let i = 1; i <= 5; i++) {
this.d3data.push([
labelsX[i-1],
this.data[i].numStudents / this.data[0].numStudents,
......
......@@ -172,7 +172,7 @@ createReport() {
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.data = data;
},
......
......@@ -70,8 +70,8 @@ export const MainRoutes: Routes = [
{ path: 'school/director-buttons', component: DirectorButtons, canActivate: [SchoolAuthGuard] },
{ path: 'school/director-classcapacity', component: DirectorClassCapacity, canActivate: [SchoolAuthGuard] },
{ path: 'ministry/minister-view', component: MinisterView, canActivate: [MinistryAuthGuard] },
{ path: 'ministry/minister-reports', component: MinisterReports, canActivate: [MinistryAuthGuard] },
{ path: 'ministry/report-all-stat/:reportId', component: ReportAllStat, canActivate: [MinistryAuthGuard] },
{ path: 'ministry/minister-reports', component: MinisterReports },
{ path: 'ministry/report-all-stat/:reportId', component: ReportAllStat },
{ path: 'ministry/report-general/:reportId', component: ReportGeneral, canActivate: [MinistryAuthGuard] },
{ path: 'ministry/report-no-capacity/:reportId', component: ReportNoCapacity, canActivate: [MinistryAuthGuard] },
{ path: 'ministry/minister-informstudents', component: InformStudents, canActivate: [MinistryAuthGuard] },
......
......@@ -12,7 +12,9 @@ export default class MinistryAuthGuard implements CanActivate {
canActivate() {
return this.authService.isLoggedIn(MINISTRY_ROLE).then(loggedIn => {
if (!loggedIn) {
console.log("I am IN!");
this.router.navigate(['/ministry/logout']);
//this.router.navigate(['/ministy/minister-settings']);
}
return loggedIn;
}).catch(err => {
......
......@@ -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({
"Content-Type": "application/json",
......@@ -628,7 +628,7 @@ export class HelperDataService implements OnInit, OnDestroy {
}
else if (routepath == "/ministry/report-all-stat/"){
return this.http.get(`${AppSettings.API_ENDPOINT}` + routepath + regionsel + "/" + adminsel + "/" + schsel + "/" +
clsel + "/" + secsel + "/" + coursel , options)
clsel + "/" + secsel + "/" + coursel + "/" + distribfinal , options)
.map(response => response.json());
}
else if (routepath == "/ministry/report-no-capacity/"){
......@@ -641,14 +641,21 @@ export class HelperDataService implements OnInit, OnDestroy {
}
informUnlocatedStudents(username, userpassword) {
informUnlocatedStudents(username, userpassword, unallocated) {
let headers = new Headers({
"Content-Type": "application/json",
});
this.createMinistryAuthorizationHeader(headers, username, userpassword );
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());
}
......
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