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 {
'certificatetype' => $applicationForm[0][certificatetype],
//'lastam' => $applicationForm[0][lastam],
'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],
//'currentsector' => $applicationForm[0][currentsector],
'points' => $applicationForm[0][points],
......
......@@ -63,10 +63,10 @@ class CurrentUser extends ControllerBase
if (($userRole === 'epal') || ($userRole === 'regioneduadmin') || ($userRole === 'eduadmin')) {
return $this->respondWithStatus([
'cu_name' => $user->mail->value,
'cu_surname' => mb_substr($epalUser->surname->value,0,4,'UTF-8') !== "####" ? $epalUser->surname->value : '',
'cu_fathername' => mb_substr($epalUser->fathername->value,0,4,'UTF-8') !== "####" ? $epalUser->fathername->value : '',
'cu_mothername' => mb_substr($epalUser->mothername->value,0,4,'UTF-8') !== "####" ? $epalUser->mothername->value : '',
'cu_email' => mb_substr($user->mail->value,0,4,'UTF-8') !== "####" ? $user->mail->value : '',
'cu_surname' => '',
'cu_fathername' => '',
'cu_mothername' => '',
'cu_email' => '',
'minedu_username' => '',
'minedu_userpassword' => '',
'lock_capacity' => $epalConfig->lock_school_capacity->value,
......
......@@ -6,6 +6,7 @@ import { NgModule } from '@angular/core';
import { NgReduxModule, DevToolsExtension, NgRedux } from 'ng2-redux';
import {BrowserModule} from '@angular/platform-browser';
import { CookieModule } from 'ngx-cookie';
import { MyDatePickerModule } from 'mydatepicker';
import {
FormsModule,
ReactiveFormsModule,
......@@ -55,6 +56,7 @@ class MyLocalization extends NgLocalization {
@NgModule({
imports: [
BrowserModule,
MyDatePickerModule,
FormsModule,
RouterModule,
ReactiveFormsModule,
......
......@@ -173,7 +173,6 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st
ngOnInit() {
this.currentUrl = this.router.url;
console.log(this.currentUrl,"url");
this.sectorsSub = this._ngRedux.select(state => {
state.sectors.reduce((prevSector, sector) => {
sector.courses.reduce((prevCourse, course) => {
......
......@@ -90,6 +90,11 @@ import { HelperDataService } from '../../services/helper-data-service';
public isModalShown: BehaviorSubject<boolean>;
private showLoader: BehaviorSubject<boolean>;
public currentUrl: string;
private cu_name: string;
private cu_surname: string;
private cu_fathername: string;
private cu_mothername: string;
private disclaimer_checked: number;
constructor(
private _hds: HelperDataService,
......@@ -123,14 +128,18 @@ import { HelperDataService } from '../../services/helper-data-service';
ngOnInit() {
(<any>$('#studentFormSentNotice')).appendTo("body");
this.loginInfoSub = this._ngRedux.select(state => {
if (state.loginInfo.size > 0) {
state.loginInfo.reduce(({}, loginInfoToken) => {
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;
}, {});
}
......@@ -232,11 +241,17 @@ import { HelperDataService } from '../../services/helper-data-service';
submitNow() {
//αποστολή στοιχείων μαθητή στο 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 criteriaObj: Array<StudentCriteriaChosen> = [];
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']);
aitisiObj[0]['currentclass'] = this.classSelected;
//aitisiObj[0]['studentamka'] = ...;
......@@ -263,7 +278,6 @@ import { HelperDataService } from '../../services/helper-data-service';
submitRecord(record) {
let auth_str = this.authToken + ":" + this.authToken;
let authTokenPost = this.authToken + ":" + this.authToken;
let headers = new Headers({
......
......@@ -134,7 +134,6 @@ import {AppSettings} from '../../app.settings';
private modalTitle: BehaviorSubject<string>;
private modalText: BehaviorSubject<string>;
//private modalHeader: string;
private modalHeader: BehaviorSubject<string>;
......@@ -197,7 +196,6 @@ import {AppSettings} from '../../app.settings';
}
public showModal():void {
console.log("about to show modal");
(<any>$('#choiceSentNotice')).modal('show');
}
......@@ -214,12 +212,9 @@ import {AppSettings} from '../../app.settings';
if (state.epalclasses.size > 0) {
state.epalclasses.reduce(({}, epalclass, i) => {
this.setClassActive(epalclass.name);
console.log("My class:");
console.log(epalclass.name);
if (epalclass.name === "4") {
//this.selectionLimitOptional.next(true);
this.classNight.next(true);
console.log("Mphka!");
}
this.getAppropriateSchools(epalclass.name);
return epalclass;
......@@ -258,7 +253,6 @@ import {AppSettings} from '../../app.settings';
return region;
}, {});
this.numSelected.next(numsel);
console.log("numselected=" + this.numSelected.getValue());
return state.regions;
}).subscribe(this.regions$);
}
......@@ -332,7 +326,6 @@ import {AppSettings} from '../../app.settings';
// || ( (numSelected | async) === 0)"
if ( (this.selectionLimitOptional.value === false && this.classNight.value === false && this.numSelected.value < this.selectionLimit.value )
|| (this.numSelected.value === 0) ) {
console.log("check Behaviours..");
//this.modalHeader = "modal-header-success";
this.modalHeader.next("modal-header-success");
......
......@@ -34,7 +34,7 @@ export const CRITERIA_SAVE = 'CRITERIA_SAVE';
export const CRITERIA_INIT = 'CRITERIA_INIT';
//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_ADDRESSTK_PATTERN = '[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
let ind=0;
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);
ind++;
});
......
......@@ -31,6 +31,7 @@ export interface IStudentDataField {
relationtostudent: string;
currentclass: string;
points: number;
telnum: string;
}
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