Commit 06162909 authored by Open Source Developer's avatar Open Source Developer

merge

parents ca5b8668 ddd865b4
......@@ -64,6 +64,7 @@ class CreateDemoData extends ControllerBase {
public function createData() {
$transaction = $this->connection->startTransaction();
try {
//insert demo records in entity: epal_student
$entity_manager = \Drupal::entityTypeManager();
......@@ -132,7 +133,7 @@ class CreateDemoData extends ControllerBase {
for ($j = 0; $j < $numEpalsChosen ; $j++) {
print_r("<br>Data: Student" . $created_student_id . "EPAL" . $epal_id . "CHOICE" . $j );
// print_r("<br>Data: Student" . $created_student_id . "EPAL" . $epal_id . "CHOICE" . $j );
$epalchosen = array(
'student_id' => $created_student_id,
'epal_id' => $epal_id[$j],
......@@ -186,6 +187,7 @@ class CreateDemoData extends ControllerBase {
$returnmsg = "Αποτυχία καταχώρησης demo data!";
$response = new JsonResponse([$returnmsg]);
$transaction->rollback();
return $response;
}
......
......@@ -23,32 +23,32 @@ class SubmitedApplications extends ControllerBase
return new static(
$container->get('entity_type.manager')
);
}
}
public function getSubmittedApplications(Request $request)
{
$authToken = $request->headers->get('PHP_AUTH_USER');
$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));
$i = 0;
if ($epalStudents) {
$list = array();
foreach ($epalStudents as $object) {
$list[] = array(
'id' => $object -> id(),
'name' => $object -> name ->value,
'studentsurname' => $object -> studentsurname ->value);
$i++;
}
return $this->respondWithStatus(
$list
, Response::HTTP_OK);
......@@ -58,8 +58,8 @@ class SubmitedApplications extends ControllerBase
'message' => t("EPAL user not found"),
], Response::HTTP_FORBIDDEN);
}
} else {
......@@ -67,15 +67,15 @@ class SubmitedApplications extends ControllerBase
'message' => t("User not found"),
], Response::HTTP_FORBIDDEN);
}
}
public function getStudentApplications(Request $request, $studentId)
{
$authToken = $request->headers->get('PHP_AUTH_USER');
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
......@@ -100,7 +100,7 @@ class SubmitedApplications extends ControllerBase
$i++;
}
return $this->respondWithStatus(
$list
, Response::HTTP_OK);
......@@ -110,7 +110,7 @@ class SubmitedApplications extends ControllerBase
'message' => t("EPAL user not found"),
], Response::HTTP_FORBIDDEN);
}
} else {
......@@ -118,13 +118,13 @@ class SubmitedApplications extends ControllerBase
'message' => t("User not found"),
], Response::HTTP_FORBIDDEN);
}
}
public function getEpalChosen(Request $request, $studentId)
{
$authToken = $request->headers->get('PHP_AUTH_USER');
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
......@@ -144,7 +144,7 @@ public function getEpalChosen(Request $request, $studentId)
$i++;
}
return $this->respondWithStatus(
$list
, Response::HTTP_OK);
......@@ -154,7 +154,7 @@ public function getEpalChosen(Request $request, $studentId)
'message' => t("EPAL chosen not found!!!"),
], Response::HTTP_FORBIDDEN);
}
} else {
......@@ -162,7 +162,7 @@ public function getEpalChosen(Request $request, $studentId)
'message' => t("User not found"),
], Response::HTTP_FORBIDDEN);
}
}
......@@ -180,8 +180,3 @@ public function getEpalChosen(Request $request, $studentId)
}
......@@ -13,7 +13,7 @@ dependencies:
- serialization
- user
_core:
default_config_hash: X-Hp7xhmfNgEXwpE0VYHvI6BIYiDJDxGhGXtNwpeiCs
default_config_hash: 7lFDDggbFVzw0CGbo37kC2WLyNHGubRf8VfvN8b5iQ0
id: coursesperschool
label: coursesperschool
module: views
......@@ -368,6 +368,73 @@ display:
entity_type: eepal_school
entity_field: name
plugin_id: field
special_case:
id: special_case
table: eepal_school_field_data
field: special_case
relationship: epal_id
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: boolean
settings:
format: default
format_custom_true: ''
format_custom_false: ''
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: eepal_school
entity_field: special_case
plugin_id: field
filters: { }
sorts:
id_1:
......@@ -519,11 +586,8 @@ display:
name_2:
alias: epal_name
raw_output: true
id_2:
alias: course_id
raw_output: true
specialty_id:
alias: course_name
special_case:
alias: epal_special_case
raw_output: true
path: coursesperschool/list
pager:
......
......@@ -12,7 +12,7 @@ dependencies:
- serialization
- user
_core:
default_config_hash: jN_EIEThsJ2oXHaytnygkFnn2JT0t0QskuCm77DjmZk
default_config_hash: ZHZhkwcVWVjmlZWp7DXduGPF5RhR1_GHwIV4HQXZC2w
id: regional_epal
label: regional_epal
module: views
......@@ -214,6 +214,73 @@ display:
multi_type: separator
separator: ', '
field_api_classes: false
special_case:
id: special_case
table: eepal_school_field_data
field: special_case
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: boolean
settings:
format: default
format_custom_true: ''
format_custom_false: ''
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: eepal_school
entity_field: special_case
plugin_id: field
id:
id: id
table: eepal_region_field_data
......@@ -429,6 +496,9 @@ display:
name:
alias: epal_name
raw_output: true
special_case:
alias: epal_special_case
raw_output: true
id:
alias: region_id
raw_output: true
......
......@@ -13,7 +13,7 @@ dependencies:
- serialization
- user
_core:
default_config_hash: fK5R5e8RHCNJLfhNG1jGBtHtSy6rExm-UquW3n8og9w
default_config_hash: o0V3xnPZovHSa__1qsBLwwmvNQJ_b2iETZGlge06J9Q
id: sectorsperschool
label: sectorsperschool
module: views
......@@ -329,6 +329,73 @@ display:
entity_type: eepal_school
entity_field: name
plugin_id: field
special_case:
id: special_case
table: eepal_school_field_data
field: special_case
relationship: epal_id
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: boolean
settings:
format: default
format_custom_true: ''
format_custom_false: ''
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: eepal_school
entity_field: special_case
plugin_id: field
filters: { }
sorts:
id:
......@@ -486,6 +553,9 @@ display:
name_1:
alias: epal_name
raw_output: true
special_case:
alias: epal_special_case
raw_output: true
pager:
type: some
options:
......
export const API_ENDPOINT = 'http://localhost/angular/eepal-front/drupal';
// export const API_ENDPOINT = 'http://eduslim2.minedu.gov.gr/drupal';
export const API_ENDPOINT = 'http://localhost/drupal-8.2.6';
export class AppSettings {
public static get API_ENDPOINT(): string {
return 'http://localhost/angular/eepal-front/drupal';
// return 'http://eduslim2.minedu.gov.gr/drupal';
return 'http://localhost/drupal-8.2.6';
}
}
......@@ -36,6 +36,10 @@ import HeaderComponent from './components/header/header.component';
import NavbarComponent from './components/navbar/navbar.component';
import MainComponent from './components/main/main.component';
import FooterComponent from './components/footer/footer.component';
import { ModalModule } from 'ng2-bootstrap/modal';
import { AlertModule } from 'ng2-bootstrap/alert';
import {enableProdMode} from '@angular/core';
class MyLocalization extends NgLocalization {
getPluralCategory(value: any) {
......@@ -55,7 +59,8 @@ class MyLocalization extends NgLocalization {
HttpModule,
Ng2SmartTableModule,
NgReduxModule,
ModalModule.forRoot(),
AlertModule.forRoot()
],
declarations: [
Main, FooterComponent, HeaderComponent, NavbarComponent, MainComponent,
......@@ -75,4 +80,5 @@ class MyLocalization extends NgLocalization {
})
class AppModule {}
// enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);
......@@ -88,4 +88,4 @@ export default class Home implements OnInit {
checkvalidation() {
}
}
\ No newline at end of file
}
......@@ -107,6 +107,8 @@ import {
ngOnDestroy() {
if (this.studentDataFieldsSub) this.studentDataFieldsSub.unsubscribe();
if (this.criteriaSub) this.criteriaSub.unsubscribe();
if (this.studentDataFields$) this.studentDataFields$.unsubscribe();
if (this.criteria$) this.criteria$.unsubscribe();
}
navigateBack() {
......
......@@ -225,6 +225,11 @@ import { STUDENT_DATA_FIELDS_INITIAL_STATE } from '../../store/studentdatafields
this.sectorsSub.unsubscribe();
this.sectorFieldsSub.unsubscribe();
this.studentDataFieldsSub.unsubscribe();
this.regions$.unsubscribe();
this.epalclasses$.unsubscribe();
this.sectors$.unsubscribe();
this.sectorFields$.unsubscribe();
this.studentDataFields$.unsubscribe();
}
showValues() {
......
......@@ -163,6 +163,13 @@ import {AppSettings} from '../../app.settings';
if (this.sectorFieldsSub) this.sectorFieldsSub.unsubscribe();
if (this.epalclassesSub) this.epalclassesSub.unsubscribe();
if (this.loginInfoSub) this.loginInfoSub.unsubscribe();
this.regions$.unsubscribe();
this.epalclasses$.unsubscribe();
this.sectors$.unsubscribe();
this.sectorFields$.unsubscribe();
this.studentDataFields$.unsubscribe();
this.criteria$.unsubscribe();
this.loginInfo$.unsubscribe();
}
submitNow() {
......
<div class = "loading" *ngIf="(epalUserData$ | async) === {}"></div>
<div *ngIf="(isModalShown | async)" [config]="{ show: true }" (onHidden)="onHidden()" bsModal #autoShownModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title pull-left">Auto shown modal</h4>
<button type="button" class="close pull-right" aria-label="Close" (click)="hideModal()">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>-------------------------</p>
<p>-------------------------</p>
<p>-------------------------</p>
</div>
</div>
</div>
</div>
<form [formGroup]="formGroup">
<div class="form-group">
......@@ -36,6 +53,9 @@
<div class="form-group" *ngIf="(verificationCodeSent | async) && !(verificationCodeVerified | async)">
<alert type="success">
<strong>Ελέγξτε το email σας!</strong> Αντιγράψτε τον κωδικό που σας στείλαμε εδώ και επιλέξτε "Αποστολή Κωδικού Επαλήθευσης"
</alert>
<label for="verificationCode">Κωδικός επαλήθευσης</label><input class="form-control" type="text" formControlName="verificationCode">
</div>
<div class="row" *ngIf="(verificationCodeSent | async) && !(verificationCodeVerified | async)">
......@@ -45,47 +65,53 @@
</button>
</div>
</div>
<alert type="success" *ngIf="(verificationCodeSent | async) && (verificationCodeVerified | async)">
<strong>Επιτυχία!</strong> Το email σας επαληθεύθηκε και είναι αυτό με το οποίο θα επικοινωνούμε μαζί σας στο εξής
</alert>
<div class="form-group" *ngIf="!(userEmailEnabled | async) && (verificationCodeVerified | async)">
<label for="userName">Όνομα</label><input class="form-control" type="text" formControlName="userName">
<div class="alert alert-danger" *ngIf="formGroup.get('userName').touched && formGroup.get('userName').hasError('required') ">
Το πεδίο δεν μπορεί να αφεθεί κενό!
</div>
<div class="alert alert-danger" *ngIf="formGroup.get('userName').hasError('pattern')">
Πληκτρολογήστε το όνομά σας!
</div>
</div>
<div class="alert alert-danger" *ngIf="formGroup.get('userName').touched && formGroup.get('userName').hasError('required') ">
Το πεδίο δεν μπορεί να αφεθεί κενό!
</div>
<div class="alert alert-danger" *ngIf="formGroup.get('userName').hasError('pattern')">
Πληκτρολογήστε το όνομά σας!
</div>
<div class="form-group" *ngIf="!(userEmailEnabled | async) && (verificationCodeVerified | async)">
<label for="userSurname">Επώνυμο</label><input class="form-control" type="text" formControlName="userSurname">
<div class="alert alert-danger" *ngIf="formGroup.get('userSurname').touched && formGroup.get('userSurname').hasError('required') ">
Το πεδίο δεν μπορεί να αφεθεί κενό!
</div>
<div class="alert alert-danger" *ngIf="formGroup.get('userSurname').hasError('pattern')">
Πληκτρολογήστε το επώνυμό σας!
</div>
</div>
<div class="alert alert-danger" *ngIf="formGroup.get('userSurname').touched && formGroup.get('userSurname').hasError('required') ">
Το πεδίο δεν μπορεί να αφεθεί κενό!
</div>
<div class="alert alert-danger" *ngIf="formGroup.get('userSurname').hasError('pattern')">
Πληκτρολογήστε το επώνυμό σας!
</div>