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

updated parent.form. Removed fields from application.form.main. Birthdate...

updated parent.form. Removed fields from application.form.main. Birthdate checking. Other fixes, updates
parent 577c0784
...@@ -188,9 +188,11 @@ class CASLogin extends ControllerBase ...@@ -188,9 +188,11 @@ class CASLogin extends ControllerBase
phpCAS::trace($umdobject); phpCAS::trace($umdobject);
phpCAS::trace($physicaldeliveryofficename); // phpCAS::trace($physicaldeliveryofficename);
$gsnunitcodedn = $filterAttribute('edupersonorgunitdn:gsnunitcode:extended'); // $gsnunitcodedn = $filterAttribute('edupersonorgunitdn:gsnunitcode:extended');
$gsnunitcode = substr($gsnunitcodedn, strpos($gsnunitcodedn, ";") + 1); $gsnunitcode = substr($gsnunitcodedn, strpos($gsnunitcodedn, ";") + 1);
// $gsnunitcode = $filterAttribute('edupersonorgunitdn:gsnunitcode');
phpCAS::trace("$gsnunitcode=");
phpCAS::trace($gsnunitcode); phpCAS::trace($gsnunitcode);
/* check if myschool account */ /* check if myschool account */
......
...@@ -46,6 +46,14 @@ epal.submitedapplications: ...@@ -46,6 +46,14 @@ epal.submitedapplications:
_controller: '\Drupal\epal\Controller\SubmitedApplications::getSubmittedApplications' _controller: '\Drupal\epal\Controller\SubmitedApplications::getSubmittedApplications'
requirements: requirements:
_user_is_logged_in: 'TRUE' _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: epal.studentapplication:
path: '/epal/student/{studentId}' path: '/epal/student/{studentId}'
options: options:
......
...@@ -266,6 +266,7 @@ class ApplicationSubmit extends ControllerBase ...@@ -266,6 +266,7 @@ class ApplicationSubmit extends ControllerBase
*/ */
private function validateStudent($student) private function validateStudent($student)
{ {
$error_code = 0;
if (!$student["agreement"]) { if (!$student["agreement"]) {
return 1001; return 1001;
} }
......
This diff is collapsed.
...@@ -44,29 +44,84 @@ class SubmitedApplications extends ControllerBase ...@@ -44,29 +44,84 @@ class SubmitedApplications extends ControllerBase
); );
} }
public function deleteApplication(Request $request) { 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'); $authToken = $request->headers->get('PHP_AUTH_USER');
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken)); $transaction = $this->connection->startTransaction();
$epalUser = reset($epalUsers); try {
if ($epalUser) { $epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$userid = $epalUser->id(); $epalUser = reset($epalUsers);
if ($epalUser) {
$userid = $epalUser->id();
$epalStudents = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('epaluser_id' => $userid, 'id' => $applicationId));
$epalStudent = reset($epalStudents);
$epalStudents = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('epaluser_id' => $userid));
$epalStudent = reset($epalStudents);
if ($epalStudent) {
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 { } else {
return $this->respondWithStatus([ return $this->respondWithStatus([
'message' => t('EPAL user not found'), 'message' => t('EPAL user not found'),
], Response::HTTP_FORBIDDEN);
}
} else {
return $this->respondWithStatus([
'message' => t('User not found'),
], Response::HTTP_FORBIDDEN); ], 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) public function getSubmittedApplications(Request $request)
...@@ -79,13 +134,21 @@ class SubmitedApplications extends ControllerBase ...@@ -79,13 +134,21 @@ class SubmitedApplications extends ControllerBase
$epalStudents = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('epaluser_id' => $userid)); $epalStudents = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('epaluser_id' => $userid));
$i = 0; $i = 0;
$list = array();
if ($epalStudents) { if ($epalStudents) {
$crypt = new Crypt(); $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 { try {
$name_decoded = $crypt->decrypt($object->name->value); $name_decoded = $crypt->decrypt($object->name->value);
$studentsurname_decoded = $crypt->decrypt($object->studentsurname->value); $studentsurname_decoded = $crypt->decrypt($object->studentsurname->value);
...@@ -99,11 +162,12 @@ class SubmitedApplications extends ControllerBase ...@@ -99,11 +162,12 @@ class SubmitedApplications extends ControllerBase
} }
$list[] = array( $list[] = array(
'id' => $indexid, 'id' => $object->id(),
//'name' => $object -> name ->value, //'name' => $object -> name ->value,
'name' => $name_decoded, 'name' => $name_decoded,
//'studentsurname' => $object -> studentsurname ->value); //'studentsurname' => $object -> studentsurname ->value);
'studentsurname' => $studentsurname_decoded, ); 'studentsurname' => $studentsurname_decoded,
'candelete' => $canDelete, );
++$i; ++$i;
} }
...@@ -112,9 +176,8 @@ class SubmitedApplications extends ControllerBase ...@@ -112,9 +176,8 @@ class SubmitedApplications extends ControllerBase
return $this->respondWithStatus( return $this->respondWithStatus(
$list, Response::HTTP_OK); $list, Response::HTTP_OK);
} else { } else {
return $this->respondWithStatus([ return $this->respondWithStatus(
'message' => t('EPAL user not found'), $list, Response::HTTP_OK);
], Response::HTTP_FORBIDDEN);
} }
} else { } else {
return $this->respondWithStatus([ return $this->respondWithStatus([
......
...@@ -200,9 +200,12 @@ class CBController extends ControllerBase ...@@ -200,9 +200,12 @@ class CBController extends ControllerBase
'drupaluser_id' => $user->id(), 'drupaluser_id' => $user->id(),
'taxis_userid' => $taxis_userData['tin'], 'taxis_userid' => $taxis_userData['tin'],
'taxis_taxid' => $taxis_userData['tin'], 'taxis_taxid' => $taxis_userData['tin'],
'name' => $taxis_userData['firstName'], /* 'name' => $taxis_userData['firstName'],
'surname' => $taxis_userData['surname'], 'surname' => $taxis_userData['surname'],
'fathername' => $taxis_userData['fathersName'], 'fathername' => $taxis_userData['fathersName'], */
'name' => $unique_id,
'surname' => $unique_id,
'fathername' => $unique_id,
'mothername' => $unique_id, 'mothername' => $unique_id,
'accesstoken' => $accessToken['oauth_token'], 'accesstoken' => $accessToken['oauth_token'],
'accesstoken_secret' => $accessToken['oauth_token_secret'], 'accesstoken_secret' => $accessToken['oauth_token_secret'],
......
...@@ -28,24 +28,24 @@ import { ...@@ -28,24 +28,24 @@ import {
<div style="min-height: 500px;"> <div style="min-height: 500px;">
<form [formGroup]="formGroup"> <form [formGroup]="formGroup">
<p style="margin-top: 20px; line-height: 2em;"> Στην παρακάτω λίστα βλέπετε τα τμήματα του σχολείου σας. Κάντε κλίκ σε κάθε τμήμα για να δείτε <p style="margin-top: 20px; line-height: 2em;"> Στην παρακάτω λίστα βλέπετε τα τμήματα του σχολείου σας. Κάντε κλίκ σε κάθε τμήμα για να δείτε
τους μαθητές που κατανεμίθηκαν μετά απο ηλεκτρονική δήλωση προτίμησης τους στο σχολείο σας. Προσοχή! κάποια τμήματα τα βλέπετε με κόκκινο χρώμα. Τους μαθητές των τους μαθητές που κατανεμίθηκαν μετά απο ηλεκτρονική δήλωση προτίμησης τους στο σχολείο σας. Προσοχή! κάποια τμήματα τα βλέπετε με κόκκινο χρώμα. Τους μαθητές των
τμημάτων αυτών δεν μπορείτε ακόμα να τους εγγράψετε επισήμως στο σχολείο σας. Εκκρεμμεί η έγκριση λειτουργίας των τμημάτων αυτών. </p> τμημάτων αυτών δεν μπορείτε ακόμα να τους εγγράψετε επισήμως στο σχολείο σας. Εκκρεμμεί η έγκριση λειτουργίας των τμημάτων αυτών. </p>
<div class="row" style="margin-top: 20px; line-height: 2em;" > <b> Τα τμήματα του σχολείου σας. </b></div> <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" > <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)" <li class="list-group-item isclickable" (click)="setActive(i)"
(click)="findstudent(CoursesPerSchools$.class, CoursesPerSchools$.newsector, CoursesPerSchools$.newspecialit)" (click)="findstudent(CoursesPerSchools$.class, CoursesPerSchools$.newsector, CoursesPerSchools$.newspecialit)"
[class.changelistcolor]= "CoursesPerSchools$.size < CoursesPerSchools$.limitdown" [class.changelistcolor]= "CoursesPerSchools$.size < CoursesPerSchools$.limitdown"
[class.oddout]="isOdd" [class.evenout]="isEven" [class.selectedout]="courseActive === i" > [class.oddout]="isOdd" [class.evenout]="isEven" [class.selectedout]="courseActive === i" >
<h5 >{{CoursesPerSchools$.taxi}}&nbsp; <b></b></h5> <h5 >{{CoursesPerSchools$.taxi}}&nbsp; <b></b></h5>
</li> </li>
<div [hidden]="courseActive !== i" *ngIf="(retrievedStudent | async)"> <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" <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.selectedappout]="StudentActive === j"
[class.confirmed]="StudentDetails$.checkstatus === '1'" [class.confirmed]="StudentDetails$.checkstatus === '1'"
[class.notconfirmed]="StudentDetails$.checkstatus === '0'" [class.notconfirmed]="StudentDetails$.checkstatus === '0'"
[class.notchecked]="(StudentDetails$.checkstatus !== '1') && (StudentDetails$.checkstatus !== '0')" [class.notchecked]="(StudentDetails$.checkstatus !== '1') && (StudentDetails$.checkstatus !== '0')"
[class.oddout]="isOdd" [class.evenout]="isEven" style="margin: 0px 2px 0px 2px;"> [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> <div class="col-md-4" style="font-size: 0.8em; font-weight: bold;" (click) ="setActiveStudent(j)" >{{StudentDetails$.studentsurname}}</div>
...@@ -113,42 +113,37 @@ import { ...@@ -113,42 +113,37 @@ import {
</div> </div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;"> <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;">Ημερομηνία Γέννησης</div>
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.birthdate}}</div> <div class="col-md-9" 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> </div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;"> <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;">Σχολείο τελευταίας φοίτησης</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; 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>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;"> <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 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 === '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 === '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 === '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 *ngIf="StudentDetails$.lastschool_class === '4'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Δ</div>
</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 class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;"> <div *ngIf="StudentDetails$.currentclass === '2'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Β</div>
<div class="col-md-6" style="font-size: 0.8em;">Τάξη φοίτησης για το νέο σχολικό έτος</div> <div *ngIf="StudentDetails$.currentclass === '3'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Γ</div>
<div *ngIf="StudentDetails$.currentclass === '1'" class="col-md-6" 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 *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> </div>
<div *ngIf="StudentDetails$.currentclass === '2'" class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;"> <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-3" 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-9" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.currentsector}}</div>
</div> </div>
<div *ngIf="StudentDetails$.currentclass === '3' || StudentDetails$.currentclass === '4'" class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;"> <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-3" 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-9" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.currentcourse}}</div>
</div> </div>
</div> </div>
...@@ -247,7 +242,7 @@ import { ...@@ -247,7 +242,7 @@ import {
private selectiontype: BehaviorSubject<boolean>; private selectiontype: BehaviorSubject<boolean>;
private SchoolId; private SchoolId;
private opened; private opened;
constructor(private fb: FormBuilder, constructor(private fb: FormBuilder,
...@@ -273,12 +268,12 @@ import { ...@@ -273,12 +268,12 @@ import {
public showModal(popupMsgId):void { public showModal(popupMsgId):void {
console.log("about to show modal", popupMsgId); console.log("about to show modal", popupMsgId);
(<any>$(popupMsgId)).modal('show'); (<any>$(popupMsgId)).modal('show');
} }
public hideModal(popupMsgId):void { public hideModal(popupMsgId):void {
(<any>$(popupMsgId)).modal('hide'); (<any>$(popupMsgId)).modal('hide');
} }
...@@ -295,7 +290,7 @@ import { ...@@ -295,7 +290,7 @@ import {
(<any>$('#checksaved')).appendTo("body"); (<any>$('#checksaved')).appendTo("body");
(<any>$('#dangermodal')).appendTo("body"); (<any>$('#dangermodal')).appendTo("body");
(<any>$('#emptyselection')).appendTo("body"); (<any>$('#emptyselection')).appendTo("body");
this.SchoolSub = this._hds.gettypeofschool().subscribe(x => { this.SchoolSub = this._hds.gettypeofschool().subscribe(x => {
this.School$.next(x); this.School$.next(x);
console.log(x[0].type, "schoolid!"); console.log(x[0].type, "schoolid!");
...@@ -421,5 +416,5 @@ setActiveStudentnew(ind) ...@@ -421,5 +416,5 @@ setActiveStudentnew(ind)
} }
} }
This diff is collapsed.
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<div class="row"> <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"> <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>
<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>
</div> </div>
</footer> </footer>
...@@ -139,34 +139,6 @@ ...@@ -139,34 +139,6 @@
Συμπληρώστε την ημερομηνία γέννησης του μαθητή! Συμπληρώστε την ημερομηνία γέννησης του μαθητή!
</div> </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"> <div class="form-group">
<label for="lastschool_schoolname">Σχολείο τελευταίας φοίτησης(<span style="color: #ff0000;">*</span>)</label><br/> <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="Δεν βρέθηκαν σχολεία" <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 @@ ...@@ -243,4 +215,4 @@
</form> </form>
<!-- <pre>{{studentDataGroup.value | json}}</pre> --> <!-- <pre>{{studentDataGroup.value | json}}</pre> -->
...@@ -47,7 +47,6 @@ import { ...@@ -47,7 +47,6 @@ import {
private modalText: BehaviorSubject<string>; private modalText: BehaviorSubject<string>;
private modalHeader: BehaviorSubject<string>; private modalHeader: BehaviorSubject<string>;
private schoolyears: string[]; private schoolyears: string[];
private graduationyears: string[];
private rss = new FormArray([]); private rss = new FormArray([]);
...@@ -85,7 +84,6 @@ import { ...@@ -85,7 +84,6 @@ import {
private router: Router, private router: Router,
private http: Http) { private http: Http) {
this.populateSchoolyears(); this.populateSchoolyears();
this.populateGraduationyears();
this.loginInfo$ = new BehaviorSubject(LOGININFO_INITIAL_STATE); this.loginInfo$ = new BehaviorSubject(LOGININFO_INITIAL_STATE);
this.modalTitle = new BehaviorSubject(""); this.modalTitle = new BehaviorSubject("");
this.modalText = new BehaviorSubject(""); this.modalText = new BehaviorSubject("");
...@@ -94,31 +92,20 @@ import { ...@@ -94,31 +92,20 @@ import {
this.studentDataFields$ = new BehaviorSubject(STUDENT_DATA_FIELDS_INITIAL_STATE); this.studentDataFields$ = new BehaviorSubject(STUDENT_DATA_FIELDS_INITIAL_STATE);
this.criteria$ = new BehaviorSubject(CRITERIA_INITIAL_STATE); this.criteria$ = new BehaviorSubject(CRITERIA_INITIAL_STATE);
this.studentDataGroup = this.fb.group({ this.studentDataGroup = this.fb.group({
// epaluser_id: [,[]],
name: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]], name: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]],
studentsurname: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]], studentsurname: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]],
studentbirthdate: ['', [Validators.required]], studentbirthdate: ['', [Validators.required]],
//studentbirthdate: ['', [Validators.pattern(VALID_DATE_PATTERN),Validators.required]],
fatherfirstname: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]], fatherfirstname: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]],
motherfirstname: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]], motherfirstname: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]],
regionaddress: ['', [Validators.pattern(VALID_ADDRESS_PATTERN),Validators.required]], regionaddress: ['', [Validators.pattern(VALID_ADDRESS_PATTERN),Validators.required]],
regiontk: ['', [Validators.pattern(VALID_ADDRESSTK_PATTERN),Validators.required]], regiontk: ['', [Validators.pattern(VALID_ADDRESSTK_PATTERN),Validators.required]],
regionarea: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]], regionarea: ['', [Validators.pattern(VALID_NAMES_PATTERN),Validators.required]],
certificatetype: ['', this.checkChoice],
relationtostudent: ['', this.checkChoice], relationtostudent: ['', this.checkChoice],
telnum: ['', [Validators.pattern(VALID_TELEPHONE_PATTERN),Validators.required]], telnum: ['', [Validators.pattern(VALID_TELEPHONE_PATTERN),Validators.required]],
graduation_year: ['', this.checkChoice],
lastschool_schoolname: ['', [Validators.required]], lastschool_schoolname: ['', [Validators.required]],
lastschool_schoolyear: ['', this.checkChoice], lastschool_schoolyear: ['', this.checkChoice],
lastschool_class: ['', this.checkChoice], lastschool_class: ['', this.checkChoice],
}); });
/* this.studentCriteriaGroup = this.fb.group({
formArray: this.rss,
}); */
}; };