lock flags implementation(WIP) - Added new fields in application form -...

lock flags implementation(WIP) - Added new fields in application form - Updated submission process. Other fixes
parent c2e11bc8
...@@ -83,6 +83,12 @@ class ApplicationSubmit extends ControllerBase { ...@@ -83,6 +83,12 @@ class ApplicationSubmit extends ControllerBase {
'certificatetype' => $applicationForm[0][certificatetype], 'certificatetype' => $applicationForm[0][certificatetype],
//'lastam' => $applicationForm[0][lastam], //'lastam' => $applicationForm[0][lastam],
'currentclass' => $applicationForm[0][currentclass], 'currentclass' => $applicationForm[0][currentclass],
'guardian_name' => $applicationForm[0][cu_name],
'guardian_surnname' => $applicationForm[0][cu_surname],
'guardian_fathername' => $applicationForm[0][cu_fathername],
'guardian_mothername' => $applicationForm[0][cu_mothername],
'agreement' => $applicationForm[0][disclaimer_checked],
//'currentepal' => $applicationForm[0][currentepal], //'currentepal' => $applicationForm[0][currentepal],
//'currentsector' => $applicationForm[0][currentsector], //'currentsector' => $applicationForm[0][currentsector],
'points' => $applicationForm[0][points], 'points' => $applicationForm[0][points],
......
...@@ -63,10 +63,10 @@ class CurrentUser extends ControllerBase ...@@ -63,10 +63,10 @@ class CurrentUser extends ControllerBase
if (($userRole === 'epal') || ($userRole === 'regioneduadmin') || ($userRole === 'eduadmin')) { if (($userRole === 'epal') || ($userRole === 'regioneduadmin') || ($userRole === 'eduadmin')) {
return $this->respondWithStatus([ return $this->respondWithStatus([
'cu_name' => $user->mail->value, 'cu_name' => $user->mail->value,
'cu_surname' => mb_substr($epalUser->surname->value,0,4,'UTF-8') !== "####" ? $epalUser->surname->value : '', 'cu_surname' => '',
'cu_fathername' => mb_substr($epalUser->fathername->value,0,4,'UTF-8') !== "####" ? $epalUser->fathername->value : '', 'cu_fathername' => '',
'cu_mothername' => mb_substr($epalUser->mothername->value,0,4,'UTF-8') !== "####" ? $epalUser->mothername->value : '', 'cu_mothername' => '',
'cu_email' => mb_substr($user->mail->value,0,4,'UTF-8') !== "####" ? $user->mail->value : '', 'cu_email' => '',
'minedu_username' => '', 'minedu_username' => '',
'minedu_userpassword' => '', 'minedu_userpassword' => '',
'lock_capacity' => $epalConfig->lock_school_capacity->value, 'lock_capacity' => $epalConfig->lock_school_capacity->value,
......
...@@ -6,6 +6,7 @@ import { NgModule } from '@angular/core'; ...@@ -6,6 +6,7 @@ import { NgModule } from '@angular/core';
import { NgReduxModule, DevToolsExtension, NgRedux } from 'ng2-redux'; import { NgReduxModule, DevToolsExtension, NgRedux } from 'ng2-redux';
import {BrowserModule} from '@angular/platform-browser'; import {BrowserModule} from '@angular/platform-browser';
import { CookieModule } from 'ngx-cookie'; import { CookieModule } from 'ngx-cookie';
import { MyDatePickerModule } from 'mydatepicker';
import { import {
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
...@@ -55,6 +56,7 @@ class MyLocalization extends NgLocalization { ...@@ -55,6 +56,7 @@ class MyLocalization extends NgLocalization {
@NgModule({ @NgModule({
imports: [ imports: [
BrowserModule, BrowserModule,
MyDatePickerModule,
FormsModule, FormsModule,
RouterModule, RouterModule,
ReactiveFormsModule, ReactiveFormsModule,
......
...@@ -173,7 +173,6 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st ...@@ -173,7 +173,6 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st
ngOnInit() { ngOnInit() {
this.currentUrl = this.router.url; this.currentUrl = this.router.url;
console.log(this.currentUrl,"url");
this.sectorsSub = this._ngRedux.select(state => { this.sectorsSub = this._ngRedux.select(state => {
state.sectors.reduce((prevSector, sector) => { state.sectors.reduce((prevSector, sector) => {
sector.courses.reduce((prevCourse, course) => { sector.courses.reduce((prevCourse, course) => {
......
...@@ -90,6 +90,11 @@ import { HelperDataService } from '../../services/helper-data-service'; ...@@ -90,6 +90,11 @@ import { HelperDataService } from '../../services/helper-data-service';
public isModalShown: BehaviorSubject<boolean>; public isModalShown: BehaviorSubject<boolean>;
private showLoader: BehaviorSubject<boolean>; private showLoader: BehaviorSubject<boolean>;
public currentUrl: string; public currentUrl: string;
private cu_name: string;
private cu_surname: string;
private cu_fathername: string;
private cu_mothername: string;
private disclaimer_checked: number;
constructor( constructor(
private _hds: HelperDataService, private _hds: HelperDataService,
...@@ -123,14 +128,18 @@ import { HelperDataService } from '../../services/helper-data-service'; ...@@ -123,14 +128,18 @@ import { HelperDataService } from '../../services/helper-data-service';
ngOnInit() { ngOnInit() {
(<any>$('#studentFormSentNotice')).appendTo("body"); (<any>$('#studentFormSentNotice')).appendTo("body");
this.loginInfoSub = this._ngRedux.select(state => { this.loginInfoSub = this._ngRedux.select(state => {
if (state.loginInfo.size > 0) { if (state.loginInfo.size > 0) {
state.loginInfo.reduce(({}, loginInfoToken) => { state.loginInfo.reduce(({}, loginInfoToken) => {
this.authToken = loginInfoToken.auth_token; this.authToken = loginInfoToken.auth_token;
this.cu_name = loginInfoToken.cu_name;
this.cu_surname = loginInfoToken.cu_surname;
this.cu_fathername = loginInfoToken.cu_fathername;
this.cu_mothername = loginInfoToken.cu_mothername;
this.disclaimer_checked = loginInfoToken.disclaimer_checked;
return loginInfoToken; return loginInfoToken;
}, {}); }, {});
} }
...@@ -232,11 +241,17 @@ import { HelperDataService } from '../../services/helper-data-service'; ...@@ -232,11 +241,17 @@ import { HelperDataService } from '../../services/helper-data-service';
submitNow() { submitNow() {
//αποστολή στοιχείων μαθητή στο entity: epal_student //αποστολή στοιχείων μαθητή στο entity: epal_student
let aitisiObj: Array<Student | StudentEpalChosen[] | StudentCriteriaChosen[] | StudentCourseChosen | StudentSectorChosen > = []; // let aitisiObj: Array<Student | StudentEpalChosen[] | StudentCriteriaChosen[] | StudentCourseChosen | StudentSectorChosen > = [];
let aitisiObj: Array<any> = [];
let epalObj: Array<StudentEpalChosen> = []; let epalObj: Array<StudentEpalChosen> = [];
let criteriaObj: Array<StudentCriteriaChosen> = []; let criteriaObj: Array<StudentCriteriaChosen> = [];
aitisiObj[0] = this.student; aitisiObj[0] = this.student;
aitisiObj[0].cu_name = this.cu_name;
aitisiObj[0].cu_surname = this.cu_surname;
aitisiObj[0].cu_fathername = this.cu_fathername;
aitisiObj[0].cu_mothername = this.cu_mothername;
aitisiObj[0].disclaimer_checked = this.disclaimer_checked;
//console.log(aitisiObj[0]['studentbirthdate']); //console.log(aitisiObj[0]['studentbirthdate']);
aitisiObj[0]['currentclass'] = this.classSelected; aitisiObj[0]['currentclass'] = this.classSelected;
//aitisiObj[0]['studentamka'] = ...; //aitisiObj[0]['studentamka'] = ...;
...@@ -263,7 +278,6 @@ import { HelperDataService } from '../../services/helper-data-service'; ...@@ -263,7 +278,6 @@ import { HelperDataService } from '../../services/helper-data-service';
submitRecord(record) { submitRecord(record) {
let auth_str = this.authToken + ":" + this.authToken;
let authTokenPost = this.authToken + ":" + this.authToken; let authTokenPost = this.authToken + ":" + this.authToken;
let headers = new Headers({ let headers = new Headers({
......
...@@ -134,7 +134,6 @@ import {AppSettings} from '../../app.settings'; ...@@ -134,7 +134,6 @@ import {AppSettings} from '../../app.settings';
private modalTitle: BehaviorSubject<string>; private modalTitle: BehaviorSubject<string>;
private modalText: BehaviorSubject<string>; private modalText: BehaviorSubject<string>;
//private modalHeader: string;
private modalHeader: BehaviorSubject<string>; private modalHeader: BehaviorSubject<string>;
...@@ -197,7 +196,6 @@ import {AppSettings} from '../../app.settings'; ...@@ -197,7 +196,6 @@ import {AppSettings} from '../../app.settings';
} }
public showModal():void { public showModal():void {
console.log("about to show modal");
(<any>$('#choiceSentNotice')).modal('show'); (<any>$('#choiceSentNotice')).modal('show');
} }
...@@ -214,12 +212,9 @@ import {AppSettings} from '../../app.settings'; ...@@ -214,12 +212,9 @@ import {AppSettings} from '../../app.settings';
if (state.epalclasses.size > 0) { if (state.epalclasses.size > 0) {
state.epalclasses.reduce(({}, epalclass, i) => { state.epalclasses.reduce(({}, epalclass, i) => {
this.setClassActive(epalclass.name); this.setClassActive(epalclass.name);
console.log("My class:");
console.log(epalclass.name);
if (epalclass.name === "4") { if (epalclass.name === "4") {
//this.selectionLimitOptional.next(true); //this.selectionLimitOptional.next(true);
this.classNight.next(true); this.classNight.next(true);
console.log("Mphka!");
} }
this.getAppropriateSchools(epalclass.name); this.getAppropriateSchools(epalclass.name);
return epalclass; return epalclass;
...@@ -258,7 +253,6 @@ import {AppSettings} from '../../app.settings'; ...@@ -258,7 +253,6 @@ import {AppSettings} from '../../app.settings';
return region; return region;
}, {}); }, {});
this.numSelected.next(numsel); this.numSelected.next(numsel);
console.log("numselected=" + this.numSelected.getValue());
return state.regions; return state.regions;
}).subscribe(this.regions$); }).subscribe(this.regions$);
} }
...@@ -332,7 +326,6 @@ import {AppSettings} from '../../app.settings'; ...@@ -332,7 +326,6 @@ import {AppSettings} from '../../app.settings';
// || ( (numSelected | async) === 0)" // || ( (numSelected | async) === 0)"
if ( (this.selectionLimitOptional.value === false && this.classNight.value === false && this.numSelected.value < this.selectionLimit.value ) if ( (this.selectionLimitOptional.value === false && this.classNight.value === false && this.numSelected.value < this.selectionLimit.value )
|| (this.numSelected.value === 0) ) { || (this.numSelected.value === 0) ) {
console.log("check Behaviours..");
//this.modalHeader = "modal-header-success"; //this.modalHeader = "modal-header-success";
this.modalHeader.next("modal-header-success"); this.modalHeader.next("modal-header-success");
......
...@@ -34,7 +34,7 @@ export const CRITERIA_SAVE = 'CRITERIA_SAVE'; ...@@ -34,7 +34,7 @@ export const CRITERIA_SAVE = 'CRITERIA_SAVE';
export const CRITERIA_INIT = 'CRITERIA_INIT'; export const CRITERIA_INIT = 'CRITERIA_INIT';
//export const VALID_NAMES_PATTERN = '[Α-ΩΆΈΉΊΎΌΏα-ωάέήίύόώ ]*$'; //export const VALID_NAMES_PATTERN = '[Α-ΩΆΈΉΊΎΌΏα-ωάέήίύόώ ]*$';
export const VALID_NAMES_PATTERN = '[A-Za-zΑ-ΩΆΈΉΊΎΌΏα-ωάέήίύόώ ]*$'; export const VALID_NAMES_PATTERN = '[A-Za-zΑ-ΩΆΈΉΊΙΎΌΏα-ωάέήίΐύόώ ]*$';
export const VALID_ADDRESS_PATTERN = '[0-9A-Za-zΑ-ΩΆΈΉΊΎΌΏα-ωάέήίύόώ ]*$'; export const VALID_ADDRESS_PATTERN = '[0-9A-Za-zΑ-ΩΆΈΉΊΎΌΏα-ωάέήίύόώ ]*$';
export const VALID_ADDRESSTK_PATTERN = '[0-9 ]*$'; export const VALID_ADDRESSTK_PATTERN = '[0-9 ]*$';
export const VALID_DIGITS_PATTERN = '69[0-9]*$'; export const VALID_DIGITS_PATTERN = '69[0-9]*$';
......
This diff is collapsed.
...@@ -10,6 +10,14 @@ export function studentDataFieldsReducer(state: IStudentDataFields = STUDENT_DAT ...@@ -10,6 +10,14 @@ export function studentDataFieldsReducer(state: IStudentDataFields = STUDENT_DAT
let ind=0; let ind=0;
action.payload.studentDataFields.forEach(studentDataField => { action.payload.studentDataFields.forEach(studentDataField => {
let transformedDate = studentDataField.studentbirthdate.date.year + "-";
transformedDate += studentDataField.studentbirthdate.date.month < 10 ? "0" + studentDataField.studentbirthdate.date.month + "-" : studentDataField.studentbirthdate.date.month + "-";
transformedDate += studentDataField.studentbirthdate.date.day < 10 ? "0" + studentDataField.studentbirthdate.date.day : studentDataField.studentbirthdate.date.day;
// transformedDate = studentDataField.studentbirthdate.jsDate;
studentDataField.studentbirthdate = transformedDate;
studentDataFields.push(<IStudentDataField>studentDataField); studentDataFields.push(<IStudentDataField>studentDataField);
ind++; ind++;
}); });
......
...@@ -31,6 +31,7 @@ export interface IStudentDataField { ...@@ -31,6 +31,7 @@ export interface IStudentDataField {
relationtostudent: string; relationtostudent: string;
currentclass: string; currentclass: string;
points: number; points: number;
telnum: string;
} }
export type IStudentDataFields = List<IStudentDataField>; export type IStudentDataFields = List<IStudentDataField>;
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