Merge branch 'pde-dde-views' into 'develop'

Pde dde views

See merge request !216
parents 70e9508f c939aceb
...@@ -446,6 +446,7 @@ class DirectorView extends ControllerBase ...@@ -446,6 +446,7 @@ class DirectorView extends ControllerBase
if ($SchoolCat) { if ($SchoolCat) {
$categ = $SchoolCat->metathesis_region->value; $categ = $SchoolCat->metathesis_region->value;
$operation_shift = $SchoolCat->operation_shift->value; $operation_shift = $SchoolCat->operation_shift->value;
$capacity_class_a = ($SchoolCat -> capacity_class_a ->value) *25;
} else { } else {
return $this->respondWithStatus([ return $this->respondWithStatus([
'message' => t('No school located'), 'message' => t('No school located'),
...@@ -476,6 +477,8 @@ class DirectorView extends ControllerBase ...@@ -476,6 +477,8 @@ class DirectorView extends ControllerBase
'categ' => $categ, 'categ' => $categ,
'classes' => 1, 'classes' => 1,
'limitdown' => $limit, 'limitdown' => $limit,
'capc' => $capacity_class_a,
); );
} }
} }
...@@ -494,6 +497,7 @@ class DirectorView extends ControllerBase ...@@ -494,6 +497,7 @@ class DirectorView extends ControllerBase
foreach ($CourseB as $object) { foreach ($CourseB as $object) {
$sectorid = $object->sector_id->entity->id(); $sectorid = $object->sector_id->entity->id();
$capacity_class_b = ($object -> capacity_class_sector ->value) *25;
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class') $studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')
->loadByProperties(array('epal_id' => $schoolid, 'specialization_id' => $sectorid, 'currentclass' => 2)); ->loadByProperties(array('epal_id' => $schoolid, 'specialization_id' => $sectorid, 'currentclass' => 2));
$list[] = array( $list[] = array(
...@@ -503,6 +507,8 @@ class DirectorView extends ControllerBase ...@@ -503,6 +507,8 @@ class DirectorView extends ControllerBase
'categ' => $categ, 'categ' => $categ,
'classes' => 2, 'classes' => 2,
'limitdown' => $limit, 'limitdown' => $limit,
'capc' => $capacity_class_b,
); );
} }
} }
...@@ -520,6 +526,7 @@ class DirectorView extends ControllerBase ...@@ -520,6 +526,7 @@ class DirectorView extends ControllerBase
foreach ($CourseC as $object) { foreach ($CourseC as $object) {
$specialityid = $object->specialty_id->entity->id(); $specialityid = $object->specialty_id->entity->id();
$capacity_class_c = ($object -> capacity_class_specialty ->value) *25;
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class') $studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')
->loadByProperties(array('epal_id' => $schoolid, 'specialization_id' => $specialityid, 'currentclass' => 3)); ->loadByProperties(array('epal_id' => $schoolid, 'specialization_id' => $specialityid, 'currentclass' => 3));
$list[] = array( $list[] = array(
...@@ -529,6 +536,8 @@ class DirectorView extends ControllerBase ...@@ -529,6 +536,8 @@ class DirectorView extends ControllerBase
'categ' => $categ, 'categ' => $categ,
'classes' => 3, 'classes' => 3,
'limitdown' => $limit, 'limitdown' => $limit,
'capc' => $capacity_class_c,
); );
} }
} }
...@@ -546,7 +555,7 @@ class DirectorView extends ControllerBase ...@@ -546,7 +555,7 @@ class DirectorView extends ControllerBase
$specialityid = $object->specialty_id->entity->id(); $specialityid = $object->specialty_id->entity->id();
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class') $studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')
->loadByProperties(array('epal_id' => $schoolid, 'specialization_id' => $specialityid, 'currentclass' => 4)); ->loadByProperties(array('epal_id' => $schoolid, 'specialization_id' => $specialityid, 'currentclass' => 4));
$capacity_class_d = ($object -> capacity_class_specialty_d ->value) *25;
$list[] = array( $list[] = array(
'id' => $object->specialty_id->entity->id(), 'id' => $object->specialty_id->entity->id(),
'name' => 'Δ Λυκείου '.$object->specialty_id->entity->get('name')->value, 'name' => 'Δ Λυκείου '.$object->specialty_id->entity->get('name')->value,
...@@ -554,6 +563,7 @@ class DirectorView extends ControllerBase ...@@ -554,6 +563,7 @@ class DirectorView extends ControllerBase
'categ' => $categ, 'categ' => $categ,
'classes' => 4, 'classes' => 4,
'limitdown' => $limit, 'limitdown' => $limit,
'capc' => $capacity_class_d,
); );
} }
} }
......
...@@ -37,6 +37,7 @@ export default class HeaderComponent implements OnInit, OnDestroy { ...@@ -37,6 +37,7 @@ export default class HeaderComponent implements OnInit, OnDestroy {
private TotalStudents$: BehaviorSubject<any>; private TotalStudents$: BehaviorSubject<any>;
private TotalStudentsSub: Subscription; private TotalStudentsSub: Subscription;
private showLoader: BehaviorSubject<boolean>; private showLoader: BehaviorSubject<boolean>;
private hasvalue: boolean;
constructor(private _ata: LoginInfoActions, constructor(private _ata: LoginInfoActions,
private _hds: HelperDataService, private _hds: HelperDataService,
...@@ -60,6 +61,7 @@ export default class HeaderComponent implements OnInit, OnDestroy { ...@@ -60,6 +61,7 @@ export default class HeaderComponent implements OnInit, OnDestroy {
this.modalHeader = new BehaviorSubject(""); this.modalHeader = new BehaviorSubject("");
this.TotalStudents$ = new BehaviorSubject([{}]); this.TotalStudents$ = new BehaviorSubject([{}]);
this.showLoader = new BehaviorSubject(false); this.showLoader = new BehaviorSubject(false);
this.hasvalue = false;
}; };
...@@ -74,19 +76,21 @@ export default class HeaderComponent implements OnInit, OnDestroy { ...@@ -74,19 +76,21 @@ export default class HeaderComponent implements OnInit, OnDestroy {
return loginInfoToken; return loginInfoToken;
}, {}); }, {});
if (this.hasvalue == false)
{
this.showLoader.next(true); this.showLoader.next(true);
this.TotalStudentsSub = this._hds.findTotalStudents().subscribe(x => { this.TotalStudentsSub = this._hds.findTotalStudents().subscribe(x => {
this.TotalStudents$.next(x); this.TotalStudents$.next(x);
this.showLoader.next(false); this.showLoader.next(false);
this.hasvalue = true;
}, },
error => { error => {
this.TotalStudents$.next([{}]); this.TotalStudents$.next([{}]);
console.log("Error Getting courses perSchool"); console.log("Error Getting courses perSchool");
this.showLoader.next(false); this.showLoader.next(false);
}); });
}
} }
......
...@@ -46,13 +46,19 @@ import { ...@@ -46,13 +46,19 @@ import {
[class.oddout]="isOdd" [class.oddout]="isOdd"
[class.evenout]="isEven" [class.selectedout]="regionActive === SchoolNames$.id" > [class.evenout]="isEven" [class.selectedout]="regionActive === SchoolNames$.id" >
<div [class.changelistcolor]= "SchoolNames$.status === false" class="col-md-12">{{SchoolNames$.name}}</div> <div [class.changelistcolor]= "SchoolNames$.status === false" class="col-md-12">{{SchoolNames$.name}}</div>
<div class = "row" [hidden]="SchoolNames$.id !== regionActive" style="margin: 0px 2px 0px 2px;">
<div class="col-md-8">Τμήματα</div>
<div class="col-md-2">Επιλεχθέντες</div>
<div class="col-md-2">Χωρητικότητα</div>
</div>
<div class = "row" *ngFor="let CoursesNames$ of CoursesPerPerf$ | async; let j=index; let isOdd2=odd; let isEven2=even" <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.oddin]="isOdd2" [class.evenin]="isEven2" [class.changecolor]="calccolor(CoursesNames$.size,CoursesNames$.limitdown)"
[class.changecolorbalck]="calccolor(CoursesNames$.limitdown, CoursesNames$.size)" [class.changecolorbalck]="calccolor(CoursesNames$.limitdown, CoursesNames$.size)"
[class.selectedappout]="regionActive === j" [class.selectedappout]="regionActive === j"
[hidden]="SchoolNames$.id !== regionActive" style="margin: 0px 2px 0px 2px;"> [hidden]="SchoolNames$.id !== regionActive" style="margin: 0px 2px 0px 2px;">
<div class="col-md-9">{{CoursesNames$.name}}</div> <div class="col-md-8">{{CoursesNames$.name}}</div>
<div class="col-md-3">{{CoursesNames$.size}}</div> <div class="col-md-2">{{CoursesNames$.size}}</div>
<div class="col-md-2">{{CoursesNames$.capc}}</div>
</div> </div>
</li> </li>
</div> </div>
......
...@@ -46,12 +46,18 @@ import { ...@@ -46,12 +46,18 @@ import {
[class.oddout]="isOdd" [class.oddout]="isOdd"
[class.evenout]="isEven" [class.selectedout]="regionActive === SchoolNames$.id" > [class.evenout]="isEven" [class.selectedout]="regionActive === SchoolNames$.id" >
<div [class.changelistcolor]= "SchoolNames$.status === false" class="col-md-12">{{SchoolNames$.name}}</div> <div [class.changelistcolor]= "SchoolNames$.status === false" class="col-md-12">{{SchoolNames$.name}}</div>
<div class = "row" [hidden]="SchoolNames$.id !== regionActive" style="margin: 0px 2px 0px 2px;">
<div class="col-md-8">Τμήματα</div>
<div class="col-md-2">Επιλεχθέντες</div>
<div class="col-md-2">Χωρητικότητα</div>
</div>
<div class = "row" *ngFor="let CoursesNames$ of CoursesPerPerf$ | async; let j=index; let isOdd2=odd; let isEven2=even" <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.oddin]="isOdd2" [class.evenin]="isEven2" [class.changecolor]="calccolor(CoursesNames$.size,CoursesNames$.limitdown)"
[class.selectedappout]="regionActive === j" [class.selectedappout]="regionActive === j"
[hidden]="SchoolNames$.id !== regionActive" style="margin: 0px 2px 0px 2px;"> [hidden]="SchoolNames$.id !== regionActive" style="margin: 0px 2px 0px 2px;">
<div class="col-md-9">{{CoursesNames$.name}}</div> <div class="col-md-8">{{CoursesNames$.name}}</div>
<div class="col-md-3">{{CoursesNames$.size}}</div> <div class="col-md-2">{{CoursesNames$.size}}</div>
<div class="col-md-2">{{CoursesNames$.capc}}</div>
</div> </div>
</li> </li>
</div> </div>
......
...@@ -46,17 +46,27 @@ ...@@ -46,17 +46,27 @@
<a class="nav-link" [routerLink]="['/ministry/minister-informstudents']" [routerLinkActive]="['active']"><b>Αποστολή Ειδοποιήσεων</b></a> <a class="nav-link" [routerLink]="['/ministry/minister-informstudents']" [routerLinkActive]="['active']"><b>Αποστολή Ειδοποιήσεων</b></a>
</li> </li>
</div> </div>
<div *ngIf="(loginInfo$ | async).size > 0" class="nav-item" >
<li *ngIf="authRole=='pde'" class="nav-item" >
<a class="nav-link" [routerLink]="['/school/perfecture-view']" [routerLinkActive]="['active']"><b>Πληρότητα Σχολείων</b></a>
</li>
</div>
<div *ngIf="(loginInfo$ | async).size > 0" class="nav-item" > <div *ngIf="(loginInfo$ | async).size > 0" class="nav-item" >
<li *ngIf="authRole=='pde'" class="nav-item" > <li *ngIf="authRole=='pde'" class="nav-item" >
<a class="nav-link" [routerLink]="['/ministry/minister-reports']" [routerLinkActive]="['active']"><b>Αναφορές</b></a> <a class="nav-link" [routerLink]="['/ministry/minister-reports']" [routerLinkActive]="['active']"><b>Αναφορές</b></a>
</li> </li>
</div> </div>
<div *ngIf="(loginInfo$ | async).size > 0" class="nav-item" >
<li *ngIf="authRole=='dide'" class="nav-item" >
<a class="nav-link" [routerLink]="['/school/eduadmin-view']" [routerLinkActive]="['active']" ><b>Πληρότητα Σχολείων</b></a>
</li>
</div>
<div *ngIf="(loginInfo$ | async).size > 0" class="nav-item" > <div *ngIf="(loginInfo$ | async).size > 0" class="nav-item" >
<li *ngIf="authRole=='dide'" class="nav-item" > <li *ngIf="authRole=='dide'" class="nav-item" >
<a class="nav-link" [routerLink]="['/ministry/minister-reports']" [routerLinkActive]="['active']" ><b>Αναφορές</b></a> <a class="nav-link" [routerLink]="['/ministry/minister-reports']" [routerLinkActive]="['active']" ><b>Αναφορές</b></a>
</li> </li>
</div> </div>
</div> </div>
......
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