merged from remote - resolved conflicts

parents 47e82951 50c623c6
......@@ -82,3 +82,44 @@ epal.allocation:
_controller: '\Drupal\epal\Controller\Distribution::createDistribution'
requirements:
_access: 'TRUE'
sectorperschool:
path: '/epal/sectorperSchool/{epalId}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::getSectorsPerSchool'
requirements:
_user_is_logged_in: 'TRUE'
specialityperschool:
path: '/epal/specialityperSchool/{epalId}/{sectorId}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::getSpecialPerSchool'
requirements:
_user_is_logged_in: 'TRUE'
confirmstudents:
path: '/epal/confirmstudent'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::ConfirmStudents'
requirements:
_user_is_logged_in: 'TRUE'
studentperschool:
path: '/epal/studentperSchool/{epalId}/{selectId}/{classId}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::getStudentPerSchool'
requirements:
_user_is_logged_in: 'TRUE'
savecapacity:
path: '/epal/savecapacity/{taxi}/{tomeas}/{specialit}/{schoolid}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::SaveCapacity'
requirements:
_user_is_logged_in: 'TRUE'
......@@ -71,7 +71,7 @@ class CreateDemoData extends ControllerBase {
$epaluserid = \Drupal::currentUser()->id();
for ($i = 1; $i <= 1100; $i++) {
for ($i = 1; $i <= 10000; $i++) {
//srand($this->make_seed());
//$curclass = rand(1,3);
......
This diff is collapsed.
......@@ -122,6 +122,7 @@ class EpalStudentClass extends ContentEntityBase implements EpalStudentClassInte
return $this;
}
/**
* {@inheritdoc}
*/
......
......@@ -13,7 +13,7 @@ dependencies:
- serialization
- user
_core:
default_config_hash: X-Hp7xhmfNgEXwpE0VYHvI6BIYiDJDxGhGXtNwpeiCs
default_config_hash: 7lFDDggbFVzw0CGbo37kC2WLyNHGubRf8VfvN8b5iQ0
id: coursesperschool
label: coursesperschool
module: views
......@@ -368,6 +368,73 @@ display:
entity_type: eepal_school
entity_field: name
plugin_id: field
special_case:
id: special_case
table: eepal_school_field_data
field: special_case
relationship: epal_id
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: boolean
settings:
format: default
format_custom_true: ''
format_custom_false: ''
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: eepal_school
entity_field: special_case
plugin_id: field
filters: { }
sorts:
id_1:
......@@ -519,11 +586,8 @@ display:
name_2:
alias: epal_name
raw_output: true
id_2:
alias: course_id
raw_output: true
specialty_id:
alias: course_name
special_case:
alias: epal_special_case
raw_output: true
path: coursesperschool/list
pager:
......
......@@ -12,7 +12,7 @@ dependencies:
- serialization
- user
_core:
default_config_hash: jN_EIEThsJ2oXHaytnygkFnn2JT0t0QskuCm77DjmZk
default_config_hash: ZHZhkwcVWVjmlZWp7DXduGPF5RhR1_GHwIV4HQXZC2w
id: regional_epal
label: regional_epal
module: views
......@@ -214,6 +214,73 @@ display:
multi_type: separator
separator: ', '
field_api_classes: false
special_case:
id: special_case
table: eepal_school_field_data
field: special_case
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: boolean
settings:
format: default
format_custom_true: ''
format_custom_false: ''
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: eepal_school
entity_field: special_case
plugin_id: field
id:
id: id
table: eepal_region_field_data
......@@ -429,6 +496,9 @@ display:
name:
alias: epal_name
raw_output: true
special_case:
alias: epal_special_case
raw_output: true
id:
alias: region_id
raw_output: true
......
......@@ -13,7 +13,7 @@ dependencies:
- serialization
- user
_core:
default_config_hash: fK5R5e8RHCNJLfhNG1jGBtHtSy6rExm-UquW3n8og9w
default_config_hash: o0V3xnPZovHSa__1qsBLwwmvNQJ_b2iETZGlge06J9Q
id: sectorsperschool
label: sectorsperschool
module: views
......@@ -329,6 +329,73 @@ display:
entity_type: eepal_school
entity_field: name
plugin_id: field
special_case:
id: special_case
table: eepal_school_field_data
field: special_case
relationship: epal_id
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: boolean
settings:
format: default
format_custom_true: ''
format_custom_false: ''
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: eepal_school
entity_field: special_case
plugin_id: field
filters: { }
sorts:
id:
......@@ -486,6 +553,9 @@ display:
name_1:
alias: epal_name
raw_output: true
special_case:
alias: epal_special_case
raw_output: true
pager:
type: some
options:
......
......@@ -356,7 +356,7 @@ class EepalSchool extends ContentEntityBase implements EepalSchoolInterface {
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['e-mail'] = BaseFieldDefinition::create('string')
$fields['maile'] = BaseFieldDefinition::create('string')
->setLabel(t('e-mail Σχολείου'))
->setDescription(t('Δώσε το e-mail Σχολείου'))
->setSettings(array(
......
import { Component, OnInit, OnDestroy,ElementRef, ViewChild} from "@angular/core";
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import {Observable} from "rxjs/Observable";
import {Http, Headers, RequestOptions} from '@angular/http';
import { NgRedux, select } from 'ng2-redux';
import { IAppState } from '../../store/store';
import {Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import { ILoginInfo } from '../../store/logininfo/logininfo.types';
import {
FormBuilder,
FormGroup,
FormControl,
FormArray,
Validators,
} from '@angular/forms';
@Component({
selector: 'director-classcapacity',
template: `
<form [formGroup]="formGroup">
<label for="taxi">Τάξη</label><br/>
<div class="form-group">
<select #txoption class="form-control" (change)="verifyclass(txoption)" formControlName="taxi">
<option value="1" >Α' Λυκείου</option>
<option value="2" >Β' Λυκείου</option>
<option value="3" >Γ' Λυκείου</option>
</select>
</div>
<div class="form-group">
<select #tmop class="form-control" *ngIf="(selectionBClass | async)" (change)="checkbclass(tmop,txoption)" formControlName="tomeas">
<option *ngFor="let SectorSelection$ of StudentSelected$ | async; let i=index" [value] = "SectorSelection$.id"> {{SectorSelection$.sector_id}} </option>
</select>
</div>
<div class="form-group">
<select #spop class="form-control" *ngIf="(selectionCClass | async)" formControlName="specialit">
<option *ngFor="let SpecialSelection$ of StudentSelectedSpecial$ | async; let i=index" [value] = "SpecialSelection$.id"> {{SpecialSelection$.specialty_id}} </option>
</select>
</div>
<strong>Δυναμική σε τμήματα:</strong>
<input type="number" formControlName="capacity" min="1" max="10">
<button type="button" class="btn-primary btn-sm pull-right" (click) ="saveCapacity()">
Αποθήκευση
</button>
`
})
@Injectable() export default class DirectorClassCapacity implements OnInit , OnDestroy{
public formGroup: FormGroup;
private StudentSelected$: BehaviorSubject<any>;
private StudentSelectedSub: Subscription;
private StudentSelectedSpecial$: BehaviorSubject<any>;
private StudentSelectedSpecialSub: Subscription;
private selectionBClass: BehaviorSubject<boolean>;
private selectionCClass: BehaviorSubject<boolean>;
private SchoolId = 147 ;
private currentclass: Number;
constructor( private fb: FormBuilder,
private _hds: HelperDataService,
private activatedRoute: ActivatedRoute,
private router: Router )
{
this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.selectionBClass = new BehaviorSubject(false);
this.selectionCClass = new BehaviorSubject(false);
this.formGroup = this.fb.group({
tomeas: ['', []],
taxi: ['', []],
specialit: ['', []],
capacity: ['', []],
});
}
ngOnDestroy()
{
if (this.StudentSelectedSub)
this.StudentSelectedSub.unsubscribe();
if (this.StudentSelectedSpecialSub)
this.StudentSelectedSpecialSub.unsubscribe();
if (this.selectionBClass)
this.selectionBClass.unsubscribe();
if (this.selectionCClass)
this.selectionCClass.unsubscribe();
}
ngOnInit() {
}
verifyclass(txop)
{
if (txop.value === "1")
{
this.selectionBClass.next(false);
this.selectionCClass.next(false);
this.formGroup.patchValue({
tomeas: '',
specialit: '',
});
}
else if (txop.value === "2")
{
this.formGroup.patchValue({
specialit: '',
});
this.selectionBClass.next(true);
this.selectionCClass.next(false);
this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$);
}
else if (txop.value === "3")
{
var sectorint = +this.formGroup.value.tomeas;
console.log(sectorint,"test");
if (this.formGroup.value.tomeas != '')
{
var sectorint = +this.formGroup.value.tomeas;
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$);
}
this.selectionBClass.next(true);
this.selectionCClass.next(true);
this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$);
}
}
checkbclass(tmop,txop)
{
var sectorint = +this.formGroup.value.tomeas;
console.log(sectorint,"tomeas");
if (txop.value === "3")
{
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$);
}
}
saveCapacity()
{
var tomeas = +this.formGroup.value.tomeas;
var specialit = +this.formGroup.value.specialit;
console.log(tomeas, specialit);
this._hds.saveCapacity(this.formGroup.value.taxi,tomeas,specialit, this.formGroup.value.capacity, this.SchoolId );
}
}
\ No newline at end of file
import { Component, OnInit, OnDestroy,ElementRef, ViewChild} from "@angular/core";
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import {Observable} from "rxjs/Observable";
import {Http, Headers, RequestOptions} from '@angular/http';
import { NgRedux, select } from 'ng2-redux';
import { IAppState } from '../../store/store';
import {Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import { ILoginInfo } from '../../store/logininfo/logininfo.types';
import {
FormBuilder,
FormGroup,
FormControl,
FormArray,
Validators,
} from '@angular/forms';
@Component({
selector: 'director-view',
template: `
<form [formGroup]="formGroup">
<label for="taxi">Τάξη</label><br/>
<div class="form-group">
<select #txoption class="form-control" (change)="verifyclass(txoption)" formControlName="taxi">
<option value="1" >Α' Λυκείου</option>
<option value="2" >Β' Λυκείου</option>
<option value="3" >Γ' Λυκείου</option>
</select>
</div>
<div class="form-group">
<select #tmop class="form-control" *ngIf="(selectionBClass | async)" (change)="checkbclass(tmop,txoption)" formControlName="tomeas">
<option *ngFor="let SectorSelection$ of StudentSelected$ | async; let i=index" [value] = "SectorSelection$.id"> {{SectorSelection$.sector_id}} </option>
</select>
</div>
<div class="form-group">
<select #spop class="form-control" *ngIf="(selectionCClass | async)" (change) ="checkcclass()" formControlName="specialit">
<option *ngFor="let SpecialSelection$ of StudentSelectedSpecial$ | async; let i=index" [value] = "SpecialSelection$.id"> {{SpecialSelection$.specialty_id}} </option>
</select>
</div>
<button type="button" class="btn-primary btn-sm pull-right" (click)="findstudent(txoption)">
Αναζήτηση
</button>
<div *ngIf="(retrievedStudent | async)">
<div *ngFor="let StudentDetails$ of StudentInfo$ | async">
<br>
<br>
Όνομα: {{StudentDetails$.name}} <br>
Επώνυμο: {{StudentDetails$.studentsurname}}<br>
Όνομα Πατέρα: {{StudentDetails$.fatherfirstname}}<br>
Επώνυμο Πατέρα:{{StudentDetails$.fathersurname}}<br>
Όνομα Μητέρας: {{StudentDetails$.motherfirstname}}<br>
Επώνυμο Μητέρας:{{StudentDetails$.mothersurname}}<br>
Ημερομηνία Γέννησης: {{StudentDetails$.birthdate}}<br>
<strong>Επιβεβαίωση Εγγραφής: </strong>
<input #cb class="pull-right" type="checkbox" name="{{ StudentDetails$.id }}" (change)="updateCheckedOptions(StudentDetails$.id, $event)" >
</div>
</div>
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent()">
Επιβεβαίωση Εγγραφής
</button>
`
})
@Injectable() export default class DirectorView implements OnInit , OnDestroy{
public formGroup: FormGroup;
private StudentSelected$: BehaviorSubject<any>;
private StudentSelectedSub: Subscription;
private StudentInfo$: BehaviorSubject<any>;
private StudentInfoSub: Subscription;
private StudentSelectedSpecial$: BehaviorSubject<any>;
private StudentSelectedSpecialSub: Subscription;
private retrievedStudent: BehaviorSubject<boolean>;
private selectionBClass: BehaviorSubject<boolean>;