Commit 74234637 authored by Ασπασία Κατσή's avatar Ασπασία Κατσή

Merge branch 'gelAppSubmit' into 'develop'

Gel app submit

See merge request !6
parents 40347486 d2ac0e08
gel.user.get_data:
path: '/gel/userdata'
gel.application_submit:
path: '/gel/appsubmit'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\gel\Controller\CurrentUser::getGelUserData'
requirements:
_user_is_logged_in: 'TRUE'
gel.current_user:
path: '/gel/curuser'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\gel\Controller\CurrentUser::getLoginInfo'
requirements:
_user_is_logged_in: 'TRUE'
gel.user.save_profile:
path: '/gel/user/save'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\gel\Controller\CurrentUser::saveUserProfile'
_controller: '\Drupal\gel\Controller\GelApplicationSubmit::appSubmit'
requirements:
_user_is_logged_in: 'TRUE'
This diff is collapsed.
This diff is collapsed.
......@@ -16,7 +16,7 @@ class Crypt
if (is_string($fname)) {
$this->fname = $fname;
} else {
$this->fname = __DIR__ . "/../../../../../app.txt";
$this->fname = __DIR__ . "/../../../app.txt";
}
}
......
......@@ -82,6 +82,15 @@ class GelStudentChoices extends ContentEntityBase implements GelStudentChoicesIn
return $this;
}
public function getOrder_no() {
return $this->get('order_id')->value;
}
public function setOrder_no($name) {
$this->set('order_id', $name);
return $this;
}
/**
* {@inheritdoc}
*/
......@@ -193,7 +202,7 @@ class GelStudentChoices extends ContentEntityBase implements GelStudentChoicesIn
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['student_id'] = BaseFieldDefinition::create('entity_reference')
$fields['student_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Id μαθητη '))
->setDescription(t('Δώσε το id του μαθητη.'))
->setSetting('target_type', 'gel_student')
......@@ -218,13 +227,13 @@ class GelStudentChoices extends ContentEntityBase implements GelStudentChoicesIn
->setDisplayConfigurable('view', true);
$fields['choice_id'] = BaseFieldDefinition::create('entity_reference')
$fields['choice_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Id επιλογής '))
->setDescription(t('Δώσε το id της επιλογής.'))
->setSetting('target_type', 'gel_choices')
->setSetting('handler', 'default')
->setRequired(true)
->setDisplayOptions('view', array(
->setRequired(true)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'author',
'weight' => 0,
......@@ -242,6 +251,25 @@ class GelStudentChoices extends ContentEntityBase implements GelStudentChoicesIn
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true);
$fields['order_id'] = BaseFieldDefinition::create('integer')
->setLabel(t('Σειρά προτίμησης'))
->setDescription(t('Δώσε τη σειρά προτίμησης.'))
->setSettings(array(
'max_length' => 2,
'text_processing' => 0,
))
->setRequired(true)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'integer',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'integer',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['status'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Publishing status'))
......
......@@ -217,8 +217,10 @@ import {
let sdfds = <IStudentDataFieldRecords>studentDataFields;
if (sdfds.size > 0) {
sdfds.reduce(({}, studentDataField) => {
if (this.appUpdate.getValue() && !this.dataEdit.getValue())
this.lastSchName.next((studentDataField.get("lastschool_schoolname")).name);
//if (this.appUpdate.getValue() && !this.dataEdit.getValue())
this.lastSchName.next((studentDataField.get("lastschool_schoolname")).name);
if (typeof this.lastSchName.getValue() === "undefined" )
this.lastSchName.next("");
this.studentDataGroup.controls["name"].setValue(studentDataField.get("name"));
this.studentDataGroup.controls["studentsurname"].setValue(studentDataField.get("studentsurname"));
......
......@@ -24,6 +24,7 @@ import { ORIENTATIONGROUP_INITIAL_STATE } from "../../store/orientationgroup/ori
import { IAppState } from "../../store/store";
import { ELECTIVECOURSE_FIELDS_INITIAL_STATE } from "../../store/electivecoursesfields/electivecoursesfields.initial-state";
@Component({
selector: "application-preview-select",
template: `
......@@ -47,7 +48,7 @@ import { ELECTIVECOURSE_FIELDS_INITIAL_STATE } from "../../store/electivecourses
</li>
<li class="list-group-item">
{{gelclass$.name}} - {{gelclass$.category}}
</li>
</li>
</ul>
</div>
......@@ -58,7 +59,7 @@ import { ELECTIVECOURSE_FIELDS_INITIAL_STATE } from "../../store/electivecourses
</li>
<li class="list-group-item">
{{or_group$.name}}
</li>
</li>
</ul>
</div>
......@@ -142,7 +143,7 @@ import { ELECTIVECOURSE_FIELDS_INITIAL_STATE } from "../../store/electivecourses
private schooltype$: BehaviorSubject<ISchoolTypeRecords>;
private gelclasses$: BehaviorSubject<IGelClassRecords>;
private electivecourses$: BehaviorSubject<IElectiveCourseFieldRecords>;
private OrientationGroup$: BehaviorSubject<IOrientationGroupRecords>;
private OrientationGroup$: BehaviorSubject<IOrientationGroupRecords>;
private OrientationGroupSub: Subscription;
private electivecoursesSub: Subscription;
private schooltypeSub: Subscription;
......@@ -157,6 +158,7 @@ import { ELECTIVECOURSE_FIELDS_INITIAL_STATE } from "../../store/electivecourses
private electivecourseSelected = <number>0;
private selectedCourses$: BehaviorSubject<Array<IElectiveCourseFieldRecord>> = new BehaviorSubject(Array());
constructor(private _ngRedux: NgRedux<IAppState>,
private router: Router
) {
......@@ -171,6 +173,7 @@ import { ELECTIVECOURSE_FIELDS_INITIAL_STATE } from "../../store/electivecourses
this.gelclasses$ = new BehaviorSubject(GELCLASSES_INITIAL_STATE);
this.OrientationGroup$ = new BehaviorSubject(ORIENTATIONGROUP_INITIAL_STATE);
this.electivecourses$= new BehaviorSubject(ELECTIVECOURSE_FIELDS_INITIAL_STATE);
};
ngOnInit() {
......@@ -236,20 +239,18 @@ import { ELECTIVECOURSE_FIELDS_INITIAL_STATE } from "../../store/electivecourses
this.epalclasses$.next(ecs);
}, error => { console.log("error selecting epalclasses"); });
this.schooltypeSub = this._ngRedux.select("schooltype")
.map(schooltype => <ISchoolTypeRecords>schooltype)
.subscribe(ecs => {
if (ecs.size > 0) {
ecs.reduce(({}, type) => {
ecs.reduce(({}, type) => {
return type;
}, {});
}, {});
} else {
//this.formGroup.controls["typeId"].setValue("0");
}
this.schooltype$.next(ecs);
}, error => { console.log("error selecting schooltype"); });
}, error => { console.log("error selecting schooltype"); });
this.gelclassesSub = this._ngRedux.select("gelclasses")
.subscribe(gelclasses => {
......@@ -285,14 +286,14 @@ import { ELECTIVECOURSE_FIELDS_INITIAL_STATE } from "../../store/electivecourses
++this.electivecourseSelected;
selectedCourses.push(electivecourseField.toJS());
}
return electivecourseField;
}, {});
this.electivecourses$.next(sfds);
selectedCourses.sort(this.compareCourses);
for (let i = 0; i < selectedCourses.length; i++)
selectedCourses[i].order_id = i + 1;
this.selectedCourses$.next(selectedCourses);
}, error => { console.log("error selecting electivecourseFields"); });
......@@ -301,7 +302,7 @@ import { ELECTIVECOURSE_FIELDS_INITIAL_STATE } from "../../store/electivecourses
.map(orientationGroup => <IOrientationGroupRecords>orientationGroup)
.subscribe(ogs => {
this.OrientationGroup$.next(ogs);
}, error => { console.log("error selecting orientation"); });
}, error => { console.log("error selecting orientation"); });
}
......@@ -334,6 +335,7 @@ import { ELECTIVECOURSE_FIELDS_INITIAL_STATE } from "../../store/electivecourses
if (this.epalclassesSub) {
this.epalclassesSub.unsubscribe();
}
if (this.electivecoursesSub){
this.electivecoursesSub.unsubscribe();
}
......
......@@ -66,6 +66,7 @@ import { IAppState } from "../../store/store";
selectClass() {
//this._cfb.getClassesList(false);
this.gelclassesSub = this._ngRedux.select("gelclasses")
.map(gelclasses => <IGelClassRecords>gelclasses)
.subscribe(ecs => {
......
......@@ -101,6 +101,7 @@ import {
private _ngRedux: NgRedux<IAppState>,
private router: Router,
private http: Http) {
this.populateSchoolyears();
this.modalTitle = new BehaviorSubject("");
this.modalText = new BehaviorSubject("");
......@@ -137,12 +138,13 @@ import {
lastschool_schoolyear: ["", this.checkChoice],
lastschool_class: ["", this.checkChoice],
});
};
ngOnInit() {
(<any>$("#applicationFormNotice")).appendTo("body");
this._cfb.getClassesList(false);
//this._cfb.getClassesList(false);
this.gelclassesSub = this._ngRedux.select("gelclasses")
.map(gelclasses => <IGelClassRecords>gelclasses)
.subscribe(ecs => {
......@@ -211,13 +213,15 @@ import {
}, error => { console.log("error selecting datamode"); });
*/
this.studentDataFieldsSub = this._ngRedux.select("studentDataFields")
this.studentDataFieldsSub = this._ngRedux.select("gelstudentDataFields")
.subscribe(studentDataFields => {
let sdfds = <IGelStudentDataFieldRecords>studentDataFields;
if (sdfds.size > 0) {
sdfds.reduce(({}, studentDataField) => {
if (this.appUpdate.getValue() && !this.dataEdit.getValue())
this.lastSchName.next((studentDataField.get("lastschool_schoolname")).name);
//if (this.appUpdate.getValue() && !this.dataEdit.getValue())
this.lastSchName.next((studentDataField.get("lastschool_schoolname")).name);
if (typeof this.lastSchName.getValue() === "undefined" )
this.lastSchName.next("");
this.studentDataGroup.controls["name"].setValue(studentDataField.get("name"));
this.studentDataGroup.controls["studentsurname"].setValue(studentDataField.get("studentsurname"));
......@@ -291,7 +295,8 @@ import {
}
*/
this.router.navigate(["/application-submit"]);
this.router.navigate(["/gel-application-submit"]);
}
}
......
......@@ -128,8 +128,11 @@ import { IAppState } from "../../store/store";
this.isModalShown.next(false);
}
selectClass() {
//this._cfb.getClassesList(false);
this.gelclassesSub = this._ngRedux.select("gelclasses")
.map(gelclasses => <IGelClassRecords>gelclasses)
.subscribe(ecs => {
......
......@@ -9,6 +9,7 @@ import { SchoolTypeActions } from "../../actions/schooltype.actions";
import { GelClassesActions } from "../../actions/gelclasses.actions";
import { OrientationGroupActions } from "../../actions/orientationgroup.action";
import { ElectiveCourseFieldsActions } from "../../actions/electivecoursesfields.actions";
import { EpalClassesActions } from "../../actions/epalclass.actions";
import { RegionSchoolsActions } from "../../actions/regionschools.actions";
import { SectorCoursesActions } from "../../actions/sectorcourses.actions";
......@@ -20,7 +21,7 @@ import { IAppState } from "../../store/store";
import { schooltypeReducer } from "../../store/schooltype/schooltype.reducer";
@Component({
selector: "school-type-select",
selector: "school-type-select",
template: `
<div id="SchoolTypeNotice" (onHidden)="onHidden()" class="modal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog modal-lg">
......@@ -48,9 +49,9 @@ import { schooltypeReducer } from "../../store/schooltype/schooltype.reducer";
<div class="form-group" style= "margin-top: 50px; margin-bottom: 100px;">
<label for="typeId">Τύπος Σχολείου:</label><br/>
<select class="form-control" formControlName="typeId" (change)="initializestore()">
<option value="0">Επιλέξτε Τύπο Σχολείου:</option>
<option value="1">Γενικό Λύκειο (ΓΕΛ)</option>
<option value="2">Επαγγελματικό Λύκειο (ΕΠΑΛ)</option>
<option value="0">Επιλέξτε Τύπο Σχολείου</option>
<option value="1">ΓΕΛ - Γενικό Λύκειο</option>
<option value="2">ΕΠΑΛ - Επαγγελματικό Λύκειο</option>
</select>
</div>
......@@ -119,21 +120,27 @@ import { schooltypeReducer } from "../../store/schooltype/schooltype.reducer";
}, error => { console.log("error selecting schooltype"); });
}
ngOnDestroy() {
if (this.schooltypeSub)
this.schooltypeSub.unsubscribe();
(<any>$("#SchoolTypeNotice")).remove();
}
public showModal(): void {
(<any>$("#SchoolTypeNotice")).modal("show");
}
public hideModal(): void {
(<any>$("#SchoolTypeNotice")).modal("hide");
}
public onHidden(): void {
this.isModalShown.next(false);
}
navigateBack() {
this.router.navigate(["/school-type-select"]);
}
......@@ -148,12 +155,15 @@ import { schooltypeReducer } from "../../store/schooltype/schooltype.reducer";
}
else {
if (this.formGroup.value.typeId === "1"){
this._sta.saveSchoolTypeSelected(this.formGroup.value.typeId,"ΓΕΛ");
this.router.navigate(["/gel-class-select"]);
}
else if (this.formGroup.value.typeId === "2"){
this._sta.saveSchoolTypeSelected(this.formGroup.value.typeId,"ΕΠΑΛ");
this.router.navigate(["/epal-class-select"]);
}
}
}
initializestore() {
......
......@@ -20,3 +20,11 @@ export class StudentSectorChosen {
public sectorfield_id: number,
) { }
}
export class StudentGelCourseChosen {
constructor(
public student_id: number,
public choice_id: number,
public order_id: number,
) { }
}
......@@ -58,6 +58,7 @@ import CoursesOrderSelect from "../components/student-application-form/courses.o
import ClassSelection from "../components/student-application-form/class.selection";
import GelStudentApplicationMain from "../components/student-application-form/gelapplication.form.main";
import SchoolTypeSelection from "../components/student-application-form/schooltype.selection";
import GelApplicationSubmit from "../components/student-application-form/gelapplication.submit";
......@@ -110,6 +111,7 @@ export const MainRoutes: Routes = [
{ path: "gel-class-select", component: ClassSelection, canActivate: [StudentAuthGuard, StudentLockGuard]},
{ path: "gelstudent-application-form-main", component: GelStudentApplicationMain, canActivate: [StudentAuthGuard, StudentLockGuard] },
{ path: "school-type-select", component: SchoolTypeSelection, canActivate: [StudentAuthGuard, StudentLockGuard]},
{ path: "gel-application-submit", component: GelApplicationSubmit, canActivate: [StudentAuthGuard, StudentLockGuard] },
];
......@@ -161,5 +163,6 @@ export const MainDeclarations = [
CoursesOrderSelect,
ClassSelection,
GelStudentApplicationMain,
SchoolTypeSelection
SchoolTypeSelection,
GelApplicationSubmit
];
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