Commit f8cd29c1 authored by Χάρης Παπαδόπουλος's avatar Χάρης Παπαδόπουλος
Browse files

Merge branch 'application_form' into 'develop'

Merger updated code and resolved conflicts

See merge request !160
parents b632bf1c 99593fe7
......@@ -188,9 +188,11 @@ class CASLogin extends ControllerBase
phpCAS::trace($umdobject);
phpCAS::trace($physicaldeliveryofficename);
$gsnunitcodedn = $filterAttribute('edupersonorgunitdn:gsnunitcode:extended');
// phpCAS::trace($physicaldeliveryofficename);
// $gsnunitcodedn = $filterAttribute('edupersonorgunitdn:gsnunitcode:extended');
$gsnunitcode = substr($gsnunitcodedn, strpos($gsnunitcodedn, ";") + 1);
// $gsnunitcode = $filterAttribute('edupersonorgunitdn:gsnunitcode');
phpCAS::trace("$gsnunitcode=");
phpCAS::trace($gsnunitcode);
/* check if myschool account */
......
......@@ -46,6 +46,14 @@ epal.submitedapplications:
_controller: '\Drupal\epal\Controller\SubmitedApplications::getSubmittedApplications'
requirements:
_user_is_logged_in: 'TRUE'
epal.application_delete:
path: '/epal/application/delete'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\SubmitedApplications::deleteApplication'
requirements:
_user_is_logged_in: 'TRUE'
epal.studentapplication:
path: '/epal/student/{studentId}'
options:
......
......@@ -285,6 +285,7 @@ class ApplicationSubmit extends ControllerBase
*/
private function validateStudent($student)
{
$error_code = 0;
if (!$student["agreement"]) {
return 1001;
}
......
This diff is collapsed.
......@@ -44,6 +44,86 @@ class SubmitedApplications extends ControllerBase
);
}
public function deleteApplication(Request $request)
{
if (!$request->isMethod('POST')) {
return $this->respondWithStatus([
"error_code" => 2001
], Response::HTTP_METHOD_NOT_ALLOWED);
}
$content = $request->getContent();
$applicationId = 0;
if (!empty($content)) {
$postArr = json_decode($content, TRUE);
$applicationId = $postArr['applicationId'];
}
else {
return $this->respondWithStatus([
"error_code" => 5002
], Response::HTTP_BAD_REQUEST);
}
$authToken = $request->headers->get('PHP_AUTH_USER');
$transaction = $this->connection->startTransaction();
try {
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if ($epalUser) {
$userid = $epalUser->id();
$epalStudents = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('epaluser_id' => $userid, 'id' => $applicationId));
$epalStudent = reset($epalStudents);
if ($epalStudent) {
$epalStudentClasses = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('student_id' => $applicationId));
$epalStudentClass = reset($epalStudentClasses);
if ($epalStudentClass) {
return $this->respondWithStatus([
"error_code" => 3002
], Response::HTTP_FORBIDDEN);
}
$delQuery = $this->connection->delete('epal_student_epal_chosen');
$delQuery->condition('student_id', $applicationId);
$delQuery->execute();
$delQuery = $this->connection->delete('epal_student_sector_field');
$delQuery->condition('student_id', $applicationId);
$delQuery->execute();
$delQuery = $this->connection->delete('epal_student_course_field');
$delQuery->condition('student_id', $applicationId);
$delQuery->execute();
$delQuery = $this->connection->delete('epal_student_class');
$delQuery->condition('student_id', $applicationId);
$delQuery->execute();
$epalStudent->delete();
return $this->respondWithStatus([
'error_code' => 0,
], Response::HTTP_OK);
} else {
return $this->respondWithStatus([
'message' => t('EPAL student not found'),
], Response::HTTP_FORBIDDEN);
}
} else {
return $this->respondWithStatus([
'message' => t('EPAL user not found'),
], Response::HTTP_FORBIDDEN);
}
} catch (\Exception $e) {
$this->logger->warning($e->getMessage());
$transaction->rollback();
return $this->respondWithStatus([
'error_code' => 5001,
], Response::HTTP_INTERNAL_SERVER_ERROR);
}
}
public function getSubmittedApplications(Request $request)
{
$authToken = $request->headers->get('PHP_AUTH_USER');
......@@ -54,13 +134,21 @@ class SubmitedApplications extends ControllerBase
$epalStudents = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('epaluser_id' => $userid));
$i = 0;
$list = array();
if ($epalStudents) {
$crypt = new Crypt();
$list = array();
foreach ($epalStudents as $object) {
$indexid = intval($object->id()) - 1;
foreach ($epalStudents as $object) {
$canDelete = 0;
$epalStudentClasses = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('student_id' => $object->id()));
$epalStudentClass = reset($epalStudentClasses);
if ($epalStudentClass) {
$canDelete = 0;
}
else {
$canDelete = 1;
}
try {
$name_decoded = $crypt->decrypt($object->name->value);
$studentsurname_decoded = $crypt->decrypt($object->studentsurname->value);
......@@ -74,11 +162,12 @@ class SubmitedApplications extends ControllerBase
}
$list[] = array(
'id' => $indexid,
'id' => $object->id(),
//'name' => $object -> name ->value,
'name' => $name_decoded,
//'studentsurname' => $object -> studentsurname ->value);
'studentsurname' => $studentsurname_decoded, );
'studentsurname' => $studentsurname_decoded,
'candelete' => $canDelete, );
++$i;
}
......@@ -87,9 +176,8 @@ class SubmitedApplications extends ControllerBase
return $this->respondWithStatus(
$list, Response::HTTP_OK);
} else {
return $this->respondWithStatus([
'message' => t('EPAL user not found'),
], Response::HTTP_FORBIDDEN);
return $this->respondWithStatus(
$list, Response::HTTP_OK);
}
} else {
return $this->respondWithStatus([
......
......@@ -200,9 +200,12 @@ class CBController extends ControllerBase
'drupaluser_id' => $user->id(),
'taxis_userid' => $taxis_userData['tin'],
'taxis_taxid' => $taxis_userData['tin'],
'name' => $taxis_userData['firstName'],
/* 'name' => $taxis_userData['firstName'],
'surname' => $taxis_userData['surname'],
'fathername' => $taxis_userData['fathersName'],
'fathername' => $taxis_userData['fathersName'], */
'name' => $unique_id,
'surname' => $unique_id,
'fathername' => $unique_id,
'mothername' => $unique_id,
'accesstoken' => $accessToken['oauth_token'],
'accesstoken_secret' => $accessToken['oauth_token_secret'],
......
......@@ -28,24 +28,23 @@ import {
<div style="min-height: 500px;">
<form [formGroup]="formGroup">
<p style="margin-top: 20px; line-height: 2em;"> H παρακάτω λίστα διαμορφώνει τη δυναμική του σχολείου σας σε τμήματα με κριτήριο τον αριθμό των διαθεσίμων αιθουσών. </p>
<p style="margin-top: 20px; line-height: 2em;"> Παρακαλείστε να καταγράψετε τον αριθμό των τμημάτων ανά τάξη, τομέα και ειδικότητα. </p>
<div class="row" style="margin-top: 20px; line-height: 2em;" > <b> Τα τμήματα του σχολείου σας. </b></div>
<div *ngFor="let CoursesPerSchools$ of CoursesPerSchool$ | async; let i=index; let isOdd=odd; let isEven=even" >
<li class="list-group-item isclickable" (click)="setActive(i)"
(click)="findstudent(CoursesPerSchools$.class, CoursesPerSchools$.newsector, CoursesPerSchools$.newspecialit)"
[class.changelistcolor]= "CoursesPerSchools$.size < CoursesPerSchools$.limitdown"
<li class="list-group-item isclickable" (click)="setActive(i)"
(click)="findstudent(CoursesPerSchools$.class, CoursesPerSchools$.newsector, CoursesPerSchools$.newspecialit)"
[class.changelistcolor]= "CoursesPerSchools$.size < CoursesPerSchools$.limitdown"
[class.oddout]="isOdd" [class.evenout]="isEven" [class.selectedout]="courseActive === i" >
<h5 >{{CoursesPerSchools$.taxi}}&nbsp; <b></b></h5>
</li>
<div [hidden]="courseActive !== i" *ngIf="(retrievedStudent | async)">
<div *ngFor="let StudentDetails$ of StudentInfo$ | async; let j=index; let isOdd=odd; let isEven=even" class="row list-group-item isclickable"
[class.selectedappout]="StudentActive === j"
<div *ngFor="let StudentDetails$ of StudentInfo$ | async; let j=index; let isOdd=odd; let isEven=even" class="row list-group-item isclickable"
[class.selectedappout]="StudentActive === j"
[class.confirmed]="StudentDetails$.checkstatus === '1'"
[class.notconfirmed]="StudentDetails$.checkstatus === '0'"
[class.notconfirmed]="StudentDetails$.checkstatus === '0'"
[class.notchecked]="(StudentDetails$.checkstatus !== '1') && (StudentDetails$.checkstatus !== '0')"
[class.oddout]="isOdd" [class.evenout]="isEven" style="margin: 0px 2px 0px 2px;">
<div class="col-md-4" style="font-size: 0.8em; font-weight: bold;" (click) ="setActiveStudent(j)" >{{StudentDetails$.studentsurname}}</div>
......@@ -113,42 +112,37 @@ import {
</div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-3" style="font-size: 0.8em;">Ημερομηνία Γέννησης</div>
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.birthdate}}</div>
<div class="col-md-3" style="font-size: 0.8em;">Τύπος απολυτηρίου</div>
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.certificatetype}}</div>
<div class="col-md-9" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.birthdate}}</div>
</div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-3" style="font-size: 0.8em;">Έτος κτήσης απολυτηρίου</div>
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.graduation_year}}</div>
<div class="col-md-3" style="font-size: 0.8em;">Σχολείο τελευταίας φοίτησης</div>
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.lastschool_schoolname}}</div>
<div class="col-md-3" style="font-size: 0.8em;">Σχολικό έτος τελευταίας φοίτησης</div>
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.lastschool_schoolyear}}</div>
</div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-3" style="font-size: 0.8em;">Σχολικό έτος τελευταίας φοίτησης</div>
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.lastschool_schoolyear}}</div>
<div class="col-md-3" style="font-size: 0.8em;">Τάξη τελευταίας φοίτησης</div>
<div *ngIf="StudentDetails$.lastschool_class === '1'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Α</div>
<div *ngIf="StudentDetails$.lastschool_class === '2'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Β</div>
<div *ngIf="StudentDetails$.lastschool_class === '3'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Γ</div>
<div *ngIf="StudentDetails$.lastschool_class === '4'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Δ</div>
</div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-6" style="font-size: 0.8em;">Τάξη φοίτησης για το νέο σχολικό έτος</div>
<div *ngIf="StudentDetails$.currentclass === '1'" class="col-md-6" style="font-size: 0.8em; font-weight: bold">Α</div>
<div *ngIf="StudentDetails$.currentclass === '2'" class="col-md-6" style="font-size: 0.8em; font-weight: bold">Β</div>
<div *ngIf="StudentDetails$.currentclass === '3'" class="col-md-6" style="font-size: 0.8em; font-weight: bold">Γ</div>
<div *ngIf="StudentDetails$.currentclass === '4'" class="col-md-6" style="font-size: 0.8em; font-weight: bold">Δ</div>
<div class="col-md-3" style="font-size: 0.8em;">Τάξη φοίτησης για το νέο σχολικό έτος</div>
<div *ngIf="StudentDetails$.currentclass === '1'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Α</div>
<div *ngIf="StudentDetails$.currentclass === '2'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Β</div>
<div *ngIf="StudentDetails$.currentclass === '3'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Γ</div>
<div *ngIf="StudentDetails$.currentclass === '4'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Δ</div>
</div>
<div *ngIf="StudentDetails$.currentclass === '2'" class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-6" style="font-size: 0.8em;">Τομέας φοίτησης για το νέο σχολικό έτος</div>
<div class="col-md-6" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.currentsector}}</div>
<div class="col-md-3" style="font-size: 0.8em;">Τομέας φοίτησης για το νέο σχολικό έτος</div>
<div class="col-md-9" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.currentsector}}</div>
</div>
<div *ngIf="StudentDetails$.currentclass === '3' || StudentDetails$.currentclass === '4'" class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-6" style="font-size: 0.8em;">Ειδικότητα φοίτησης για το νέο σχολικό έτος</div>
<div class="col-md-6" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.currentcourse}}</div>
<div class="col-md-3" style="font-size: 0.8em;">Ειδικότητα φοίτησης για το νέο σχολικό έτος</div>
<div class="col-md-9" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.currentcourse}}</div>
</div>
</div>
......@@ -243,7 +237,7 @@ import {
private StudentActive = <number>-1;
private showLoader: BehaviorSubject<boolean>;
private opened;
constructor(private fb: FormBuilder,
......@@ -259,24 +253,24 @@ import {
this.opened = false;
this.formGroup = this.fb.group({
});
});
}
public showModal(popupMsgId):void {
public showModal(popupMsgId): void {
console.log("about to show modal", popupMsgId);
(<any>$(popupMsgId)).modal('show');
}
public hideModal(popupMsgId):void {
public hideModal(popupMsgId): void {
(<any>$(popupMsgId)).modal('hide');
}
public onHidden(popupMsgId):void {
public onHidden(popupMsgId): void {
}
......@@ -286,97 +280,88 @@ import {
}
ngOnInit() {
(<any>$('#checksaved')).appendTo("body");
(<any>$('#dangermodal')).appendTo("body");
(<any>$('#emptyselection')).appendTo("body");
this.showLoader.next(true);
this.CoursesPerSchoolSub = this._hds.FindCoursesPerSchool().subscribe(x => {
this.CoursesPerSchool$.next(x);
this.showLoader.next(false);
},
error => {
this.CoursesPerSchool$.next([{}]);
console.log("Error Getting courses perSchool");
this.showLoader.next(false);
},
() => console.log("Getting School "));
(<any>$('#checksaved')).appendTo("body");
(<any>$('#dangermodal')).appendTo("body");
(<any>$('#emptyselection')).appendTo("body");
this.showLoader.next(true);
this.CoursesPerSchoolSub = this._hds.FindCoursesPerSchool().subscribe(x => {
this.CoursesPerSchool$.next(x);
this.showLoader.next(false);
},
error => {
this.CoursesPerSchool$.next([{}]);
console.log("Error Getting courses perSchool");
this.showLoader.next(false);
},
() => console.log("Getting School "));
}
findstudent(taxi,sector,special) {
this.showLoader.next(true);
this.retrievedStudent.next(false);
this.StudentInfoSub = this._hds.getStudentPerSchool(taxi,sector,special)
.subscribe(data => {
this.StudentInfo$.next(data);
this.retrievedStudent.next(true);
this.showLoader.next(false);
},
findstudent(taxi, sector, special) {
this.showLoader.next(true);
this.retrievedStudent.next(false);
this.StudentInfoSub = this._hds.getStudentPerSchool(taxi, sector, special)
.subscribe(data => {
this.StudentInfo$.next(data);
this.retrievedStudent.next(true);
this.showLoader.next(false);
},
error => {
this.StudentInfo$.next([{}]);
console.log("Error Getting Students");
this.showLoader.next(false);
this.showModal("#emptyselection");
},
() => console.log("Getting Students"));
this.StudentInfo$.next([{}]);
console.log("Error Getting Students");
this.showLoader.next(false);
this.showModal("#emptyselection");
},
() => console.log("Getting Students"));
}
setActive(ind) {
this.StudentActive = -1;
if (this.courseActive == ind)
{
ind = -1;
}
this.courseActive = ind;
console.log(this.courseActive, ind, "ind");
setActive(ind) {
this.StudentActive = -1;
if (this.courseActive == ind) {
ind = -1;
}
this.courseActive = ind;
console.log(this.courseActive, ind, "ind");
}
setActiveStudent(ind)
{
this.opened = true;
if (this.StudentActive == ind)
{
ind = -1;
}
this.StudentActive = ind;
console.log(this.courseActive, ind, "ind");
}
setActiveStudent(ind) {
this.opened = true;
if (this.StudentActive == ind) {
ind = -1;
}
this.StudentActive = ind;
console.log(this.courseActive, ind, "ind");
}
setActiveStudentnew(ind)
{
this.opened = false;
if (this.StudentActive == ind)
{
ind = -1;
}
this.StudentActive = ind;
console.log(this.courseActive, ind, "ind");
}
setActiveStudentnew(ind) {
this.opened = false;
if (this.StudentActive == ind) {
ind = -1;
}
this.StudentActive = ind;
console.log(this.courseActive, ind, "ind");
}
confirmStudent(student, cb, ind) {
var rtype;
confirmStudent(student, cb, ind) {
var rtype;
if (cb.value == 1)
rtype = '1';
rtype = '1';
if (cb.value == 2)
rtype = '0';
rtype = '0';
if (cb.value == 3)
rtype = null;
rtype = null;
var type = cb.value;
console.log(type, "aaa");
this.showLoader.next(true);
let std = this.StudentInfo$.getValue();
std[ind].checkstatus = rtype;
let std = this.StudentInfo$.getValue();
std[ind].checkstatus = rtype;
this.SavedStudentsSub = this._hds.saveConfirmStudents(student, type).subscribe(data => {
this.SavedStudents$.next(data);
......@@ -393,10 +378,8 @@ setActiveStudentnew(ind)
() => {
console.log("saved Students");
this.showModal("#checksaved");
});
});
}
}
......@@ -3,12 +3,12 @@
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-3"><span class="ft-text">Copyright (c) ΥΠ.Π.Ε.Θ. 2017</span></div>
<div class="col-xs-12 col-md-4"><span class="ft-text">Copyright (c) ΥΠ.Π.Ε.Θ. 2017</span></div>
<div class="cols-xs-12 col-md-6 text-center">
<span class="ft-text"><a href="#">ΟΡΟΙ ΧΡΗΣΗΣ – ΕΜΠΙΣΤΕΥΤΙΚΟΤΗΤΑ</a></span>
<span class="ft-text"><a href="#">ΠΡΟΣΩΠΙΚΑ ΔΕΔΟΜΕΝΑ</a></span>
<!-- <span class="ft-text"><a href="#">ΟΡΟΙ ΧΡΗΣΗΣ – ΕΜΠΙΣΤΕΥΤΙΚΟΤΗΤΑ</a></span>
<span class="ft-text"><a href="#">ΠΡΟΣΩΠΙΚΑ ΔΕΔΟΜΕΝΑ</a></span> -->
</div>
<div class="col-xs-12 col-md-3"><span class="ft-text">Version 1</span></div>
<div class="col-xs-12 col-md-2"><span class="ft-text" style="text-align: right;">Version 1.0</span></div>
</div>
</div>
</footer>
......@@ -139,34 +139,6 @@
Συμπληρώστε την ημερομηνία γέννησης του μαθητή!
</div>
<div class="form-group">
<label for="certificatetype">Τύπος απολυτηρίου(<span style="color: #ff0000;">*</span>)</label><br/>
<select class="form-control" formControlName="certificatetype">
<option value="">Παρακαλώ επιλέξτε...</option>
<option value="Απολυτήριο Γυμνασίου">Απολυτήριο Γυμνασίου</option>
<option value="Απολυτήριο Λυκείου">Απολυτήριο Λυκείου</option>
</select>
</div>
<div class="alert alert-danger" *ngIf="studentDataGroup.get('certificatetype').dirty && studentDataGroup.get('certificatetype').hasError('status')">
Η επιλογή από αυτή τη λίστα είναι απαραίτητη!
</div>
<div class="form-group">
<label for="graduation_year">Έτος κτήσης απολυτηρίου(<span style="color: #ff0000;">*</span>)</label>
<br/>
<select class="form-control" formControlName="graduation_year">
<option value="">Παρακαλώ επιλέξτε...</option>
<option *ngFor="let graduationyear of graduationyears" value="{{graduationyear}}">
{{ graduationyear }}
</option>
</select>
</div>
<div class="alert alert-danger" *ngIf="studentDataGroup.get('graduation_year').dirty && studentDataGroup.get('graduation_year').hasError('status')">
Η επιλογή από αυτή τη λίστα είναι απαραίτητη!
</div>
<div class="form-group">
<label for="lastschool_schoolname">Σχολείο τελευταίας φοίτησης(<span style="color: #ff0000;">*</span>)</label><br/>
<input ngui-auto-complete formControlName="lastschool_schoolname" [source]="observableSource.bind(this)" [list-formatter]="lastSchoolListFormatter" [value-formatter]="lastSchoolValueFormatter" [min-chars]="5" no-match-found-text="Δεν βρέθηκαν σχολεία"
......@@ -243,4 +215,4 @@
</form>
<!-- <pre>{{studentDataGroup.value | json}}</pre> -->
<!-- <pre>{{studentDataGroup.value | json}}</pre> -->
......@@ -47,7 +47,6 @@ import {
private modalText: BehaviorSubject<string>;
private modalHeader: BehaviorSubject<string>;
private schoolyears: string[];
private graduationyears: string[];
private rss = new FormArray([]);
......@@ -85,7 +84,6 @@ import {
private router: Router,
private http: Http) {
this.populateSchoolyears();
this.populateGraduationyears();
this.loginInfo$ = new BehaviorSubject(LOGININFO_INITIAL_STATE);
this.modalTitle = new BehaviorSubject("");
this.modalText = new BehaviorSubject("");
......@@ -94,31 +92,20 @@ import {
this.studentDataFields$ = new BehaviorSubject(STUDENT_DATA_FIELDS_INITIAL_STATE);
this.criteria$ = new BehaviorSubject(CRITERIA_INITIAL_STATE);
this.studentDataGroup = this.fb.group({
// epaluser_id: [,[]],
name: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]],
studentsurname: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]],
studentbirthdate: ['', [Validators.required]],
//studentbirthdate: ['', [Validators.pattern(VALID_DATE_PATTERN),Validators.required]],
fatherfirstname: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]],
motherfirstname: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]],
regionaddress: ['', [Validators.pattern(VALID_ADDRESS_PATTERN),Validators.required]],
regiontk: ['', [Validators.pattern(VALID_ADDRESSTK_PATTERN),Validators.required]],
regionarea: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]],
certificatetype: ['', this.checkChoice],
relationtostudent: ['', this.checkChoice],
telnum: ['', [Validators.pattern(VALID_TELEPHONE_PATTERN),Validators.required]],
graduation_year: ['', this.checkChoice],
lastschool_schoolname: ['', [Validators.required]],
lastschool_schoolyear: ['', this.checkChoice],
lastschool_class: ['', this.checkChoice],