v2.1, updated to Angular5, added applicantUsers entity in oauthost module,...

v2.1, updated to Angular5, added applicantUsers entity in oauthost module, deleted epalUsers entity in epal module, several minor changes
parent 89ef396d
dist/*
source/app.settings.ts
node_modules/*
!node_modules/zone.js/
!drupal/
drupal/*
!drupal/modules/
......
......@@ -18,11 +18,6 @@ entity.epal_student_course_field.add_form:
title: 'Add Epal student course field'
appears_on:
- entity.epal_student_course_field.collection
entity.epal_users.add_form:
route_name: entity.epal_users.add_form
title: 'Add Epal users'
appears_on:
- entity.epal_users.collection
entity.epal_student_sector_field.add_form:
route_name: entity.epal_student_sector_field.add_form
title: 'Add Epal student sector field'
......
......@@ -55,20 +55,6 @@ epal_student_course_field.admin.structure.settings:
route_name: epal_student_course_field.settings
parent: system.admin_structure
# Epal users menu items definition
entity.epal_users.collection:
title: 'Epal users list'
route_name: entity.epal_users.collection
description: 'List Epal users entities'
parent: system.admin_structure
weight: 100
epal_users.admin.structure.settings:
title: Epal users settings
description: 'Configure Epal users entities'
route_name: epal_users.settings
parent: system.admin_structure
# Epal student sector field menu items definition
entity.epal_student_sector_field.collection:
title: 'Epal student sector field list'
......
......@@ -86,28 +86,6 @@ entity.epal_student_course_field.delete_form:
title: Delete
weight: 10
# Epal users routing definition
epal_users.settings_tab:
route_name: epal_users.settings
title: 'Settings'
base_route: epal_users.settings
entity.epal_users.canonical:
route_name: entity.epal_users.canonical
base_route: entity.epal_users.canonical
title: 'View'
entity.epal_users.edit_form:
route_name: entity.epal_users.edit_form
base_route: entity.epal_users.canonical
title: 'Edit'
entity.epal_users.delete_form:
route_name: entity.epal_users.delete_form
base_route: entity.epal_users.canonical
title: Delete
weight: 10
# Epal student sector field routing definition
epal_student_sector_field.settings_tab:
route_name: epal_student_sector_field.settings
......@@ -216,4 +194,3 @@ entity.epal_config.delete_form:
base_route: entity.epal_config.canonical
title: Delete
weight: 10
......@@ -86,28 +86,7 @@ view published epal student course field entities:
view unpublished epal student course field entities:
title: 'View unpublished Epal student course field entities'
add epal users entities:
title: 'Create new Epal users entities'
administer epal users entities:
title: 'Administer Epal users entities'
description: 'Allow to access the administration form to configure Epal users entities.'
restrict access: true
delete epal users entities:
title: 'Delete Epal users entities'
edit epal users entities:
title: 'Edit Epal users entities'
access epal users overview:
title: 'Access the Epal users overview page'
view published epal users entities:
title: 'View published Epal users entities'
view unpublished epal users entities:
title: 'View unpublished Epal users entities'
add epal student sector field entities:
title: 'Create new Epal student sector field entities'
......
......@@ -167,7 +167,7 @@ class ApplicationSubmit extends ControllerBase
try {
//insert records in entity: epal_student
$authToken = $request->headers->get('PHP_AUTH_USER');
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUsers = $this->entityTypeManager->getStorage('applicant_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if (!$epalUser) {
return $this->respondWithStatus([
......@@ -179,17 +179,6 @@ class ApplicationSubmit extends ControllerBase
$student = array(
'langcode' => 'el',
'student_record_id' => 0,
'sex' => 0,
'fathersurname' => '',
'mothersurname' => '',
'studentamka' => '',
'lastam' => '',
'graduate_school' => 0,
'apolytirio_id' => '',
'currentsector' => '',
'currentcourse' => '',
'points' => 0,
'user_id' => $epalUser->user_id->target_id,
'epaluser_id' => $epalUser->id(),
'name' => $name_encoded,
......@@ -200,8 +189,6 @@ class ApplicationSubmit extends ControllerBase
'regionaddress' => $regionaddress_encoded,
'regionarea' => $regionarea_encoded,
'regiontk' => $regiontk_encoded,
// 'certificatetype' => $certificatetype_encoded,
// 'graduation_year' => $applicationForm[0]['graduation_year'],
'lastschool_registrynumber' => $applicationForm[0]['lastschool_registrynumber'],
'lastschool_unittypeid' => $applicationForm[0]['lastschool_unittypeid'],
'lastschool_schoolname' => $applicationForm[0]['lastschool_schoolname'],
......@@ -214,7 +201,6 @@ class ApplicationSubmit extends ControllerBase
'guardian_mothername' => $guardian_mothername_encoded,
'agreement' => $applicationForm[0]['disclaimer_checked'],
'hasright' => $applicationForm[0]['hasright'],
//'relationtostudent' => $relationtostudent_encoded,
'relationtostudent' => $relationtostudent,
'telnum' => $telnum_encoded,
'second_period' => $second_period,
......@@ -421,7 +407,7 @@ class ApplicationSubmit extends ControllerBase
try {
//insert records in entity: epal_student
$authToken = $request->headers->get('PHP_AUTH_USER');
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUsers = $this->entityTypeManager->getStorage('applicant_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if (!$epalUser) {
return $this->respondWithStatus([
......@@ -432,17 +418,6 @@ class ApplicationSubmit extends ControllerBase
//$second_period = $epalConfig->activate_second_period->value;
$student = array(
'langcode' => 'el',
'student_record_id' => 0,
'sex' => 0,
'fathersurname' => '',
'mothersurname' => '',
'studentamka' => '',
'lastam' => '',
'graduate_school' => 0,
'apolytirio_id' => '',
'currentsector' => '',
'currentcourse' => '',
'points' => 0,
'user_id' => $epalUser->user_id->target_id,
'epaluser_id' => $epalUser->id(),
'name' => $name_encoded,
......@@ -453,8 +428,6 @@ class ApplicationSubmit extends ControllerBase
'regionaddress' => $regionaddress_encoded,
'regionarea' => $regionarea_encoded,
'regiontk' => $regiontk_encoded,
// 'certificatetype' => $certificatetype_encoded,
// 'graduation_year' => $applicationForm[0]['graduation_year'],
'lastschool_registrynumber' => $applicationForm[0]['lastschool_registrynumber'],
'lastschool_unittypeid' => $applicationForm[0]['lastschool_unittypeid'],
'lastschool_schoolname' => $applicationForm[0]['lastschool_schoolname'],
......@@ -466,7 +439,6 @@ class ApplicationSubmit extends ControllerBase
'guardian_fathername' => $guardian_fathername_encoded,
'guardian_mothername' => $guardian_mothername_encoded,
'agreement' => $applicationForm[0]['disclaimer_checked'],
//'relationtostudent' => $relationtostudent_encoded,
'relationtostudent' => $relationtostudent,
'telnum' => $telnum_encoded,
'second_period' => $epalConfig->activate_second_period->value,
......
......@@ -84,7 +84,7 @@ class CurrentUser extends ControllerBase
}
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUsers = $this->entityTypeManager->getStorage('applicant_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if ($epalUser) {
......@@ -145,7 +145,7 @@ class CurrentUser extends ControllerBase
{
$authToken = $request->headers->get('PHP_AUTH_USER');
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUsers = $this->entityTypeManager->getStorage('applicant_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if ($epalUser) {
$user = $this->entityTypeManager->getStorage('user')->load($epalUser->user_id->target_id);
......@@ -232,7 +232,7 @@ class CurrentUser extends ControllerBase
$trx = $this->connection->startTransaction();
try {
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUsers = $this->entityTypeManager->getStorage('applicant_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if ($epalUser) {
$user = $this->entityTypeManager->getStorage('user')->load($epalUser->user_id->target_id);
......@@ -309,7 +309,7 @@ class CurrentUser extends ControllerBase
}
$authToken = $request->headers->get('PHP_AUTH_USER');
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUsers = $this->entityTypeManager->getStorage('applicant_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if ($epalUser) {
......@@ -355,14 +355,19 @@ class CurrentUser extends ControllerBase
}
$authToken = $request->headers->get('PHP_AUTH_USER');
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUsers = $this->entityTypeManager->getStorage('applicant_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if ($epalUser) {
$postData = null;
if ($content = $request->getContent()) {
$postData = json_decode($content);
/*
if (isset($postData->userProfile->representRole))
$representRole = $postData->userProfile->representRole;
if (isset($postData->userProfile->userChildren))
$userChildren = $postData->userProfile->userChildren;
*/
$representRole = $postData->userProfile->representRole;
//validate representRole
/*
if ( $epalUser->name->value !== "" && intval($epalUser->representative->value) !== $representRole )
......@@ -396,9 +401,16 @@ class CurrentUser extends ControllerBase
$epalUser->set('surname', $surname_encoded);
$epalUser->set('mothername', $fathername_encoded);
$epalUser->set('fathername', $mothername_encoded);
$epalUser->set('representative', $representRole);
if ($representRole)
$representRole = "0";
if (isset($postData->userProfile->representRole)) {
$representRole = $postData->userProfile->representRole;
$epalUser->set('representative', $representRole);
}
if ($representRole === "1")
$epalUser->set('numchildren', self::CHILDREN_LIMIT);
else if (isset($postData->userProfile->userChildren))
$epalUser->set('numchildren', $postData->userProfile->userChildren);
$epalUser->save();
$user = $this->entityTypeManager->getStorage('user')->load($epalUser->user_id->target_id);
......
......@@ -138,8 +138,6 @@ class DirectorView extends ControllerBase
$regionaddress_decoded = $crypt->decrypt($epalStudent->regionaddress->value);
$regiontk_decoded = $crypt->decrypt($epalStudent->regiontk->value);
$regionarea_decoded = $crypt->decrypt($epalStudent->regionarea->value);
// $certificatetype_decoded = $crypt->decrypt($epalStudent->certificatetype->value); // obsolete
//$relationtostudent_decoded = $crypt->decrypt($epalStudent->relationtostudent->value);
$telnum_decoded = $crypt->decrypt($epalStudent->telnum->value);
$guardian_name_decoded = $crypt->decrypt($epalStudent->guardian_name->value);
$guardian_surname_decoded = $crypt->decrypt($epalStudent->guardian_surname->value);
......@@ -171,8 +169,7 @@ class DirectorView extends ControllerBase
'regionaddress' => $regionaddress_decoded,
'regiontk' => $regiontk_decoded,
'regionarea' => $regionarea_decoded,
'certificatetype' => '', // $certificatetype_decoded, // obsolete
'graduation_year' => $epalStudent->graduation_year->value,
//'graduation_year' => $epalStudent->graduation_year->value,
'telnum' => $telnum_decoded,
'relationtostudent' => $relationtostudent_decoded,
//'birthdate' => substr($epalStudent->birthdate->value, 8, 10) . '/' . substr($epalStudent->birthdate->value, 6, 8) . '/' . substr($epalStudent->birthdate->value, 0, 4),
......@@ -958,7 +955,7 @@ class DirectorView extends ControllerBase
}
}
private function respondWithStatus($arr, $s)
......
......@@ -95,7 +95,7 @@ class InformUnlocatedStudents extends ControllerBase {
$sCon->fields('eStudentClass', array('student_id'))
->fields('eStudent', array('id', 'user_id', 'created'))
->isNull('eStudentClass.student_id');
$sCon->join('epal_users', 'eUsers', 'eUsers.user_id = eStudent.user_id');
$sCon->join('applicant_users', 'eUsers', 'eUsers.user_id = eStudent.user_id');
$sCon->join('users_field_data', 'users', 'users.uid = eUsers.user_id');
$sCon->fields('users', array('mail', 'preferred_langcode'));
$epalNonLocatedStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -167,7 +167,7 @@ class InformUnlocatedStudents extends ControllerBase {
}
$sCon->fields('eStudent', array('id', 'user_id', 'created'));
$sCon->join('epal_users', 'eUsers', 'eUsers.user_id = eStudent.user_id');
$sCon->join('applicant_users', 'eUsers', 'eUsers.user_id = eStudent.user_id');
$sCon->join('users_field_data', 'users', 'users.uid = eUsers.user_id');
$sCon->fields('users', array('mail', 'preferred_langcode'));
$sCon->join('eepal_school_field_data', 'eSchool', 'eSchool.id = eStudentClass.user_id');
......@@ -255,7 +255,7 @@ class InformUnlocatedStudents extends ControllerBase {
$sCon->join('epal_student', 'eStudent', 'eStudent.id = eStudentClass.student_id');
}
$sCon->fields('eStudent', array('id', 'user_id', 'created'));
$sCon->join('epal_users', 'eUsers', 'eUsers.user_id = eStudent.user_id');
$sCon->join('applicant_users', 'eUsers', 'eUsers.user_id = eStudent.user_id');
$sCon->join('users_field_data', 'users', 'users.uid = eUsers.user_id');
$sCon->fields('users', array('mail', 'preferred_langcode'));
$sCon->join('eepal_school_field_data', 'eSchool', 'eSchool.id = eStudentClass.user_id');
......
......@@ -92,7 +92,7 @@ class PDFCreator extends ControllerBase {
//Epal-user validation
$authToken = $request->headers->get('PHP_AUTH_USER');
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUsers = $this->entityTypeManager->getStorage('applicant_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if ($epalUser) {
$userid = $epalUser->id();
......@@ -317,8 +317,6 @@ class PDFCreator extends ControllerBase {
$studentsurname_decoded = $this->crypt->decrypt($student->studentsurname->value);
$fatherfirstname_decoded = $this->crypt->decrypt($student->fatherfirstname->value);
$motherfirstname_decoded = $this->crypt->decrypt($student->motherfirstname->value);
//$certificatetype_decoded = $this->crypt->decrypt($student->certificatetype->value);
//$relationtostudent_decoded = $this->crypt->decrypt($student->relationtostudent->value);
$telnum_decoded = $this->crypt->decrypt($student->telnum->value);
}
catch (\Exception $e) {
......@@ -395,22 +393,6 @@ class PDFCreator extends ControllerBase {
$this->pdf->Ln();
/*
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width+15, $height, $this->prepareString('Τύπος απολυτηρίου:'), 0, 'L');
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->Cell($width, $height, $this->prepareString($certificatetype_decoded), 0, 'L');
$this->pdf->Ln();
*/
/*
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width+15, $height, $this->prepareString('Έτος κτήσης απολυτηρίου:'), 0, 'L');
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->Cell($width, $height, $this->prepareString($student->graduation_year->value), 0, 'L');
$this->pdf->Ln();
*/
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width+15, $height, $this->prepareString('Σχολείο τελευταίας φοίτησης:'), 0, 'L');
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
......
......@@ -144,7 +144,7 @@ class ReportsCreator extends ControllerBase
//υπολογισμός αριθμού χρηστών
$sCon = $this->connection
->select('epal_users', 'eUser')
->select('applicant_users', 'eUser')
->fields('eUser', array('id'));
$numUsers = $sCon->countQuery()->execute()->fetchField();
array_push($list, (object) array('name' => "Αριθμός Εγγεγραμένων Χρηστών με ρόλο Αιτούντα", 'numStudents' => $numUsers));
......@@ -440,7 +440,7 @@ class ReportsCreator extends ControllerBase
}
}
private function isSmallClass($schoolId, $numStud, $classId, $sectorOrcourseId, $regionId)
{
......@@ -773,7 +773,7 @@ class ReportsCreator extends ControllerBase
$sCon = $this->connection->select('epal_class_limits', 'eSchool');
$sCon->fields('eSchool', array('name', 'limit_down'));
$sCon->condition('eSchool.name', $classId, '=');
$sCon->condition('eSchool.category', $category, '=');
$sCon->condition('eSchool.category', $category, '=');
$epalLimitDowns = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$epalLimitDown = reset($epalLimitDowns);
......@@ -854,8 +854,8 @@ class ReportsCreator extends ControllerBase
public function makeReportMergedClasses(Request $request, $regionId, $adminId, $schId, $classId, $sectorId, $courseId, $finalized)
{
try {
$list = array();
$list = array();
if (!$request->isMethod('GET')) {
return $this->respondWithStatus([
"message" => t("Method Not Allowed")
......@@ -894,7 +894,7 @@ class ReportsCreator extends ControllerBase
if ( ($classId==3 || $classId==4) && $sectorId!=0 && $courseId==0 ){
$sCon = \Drupal::database()->select('eepal_specialty_field_data', 'eSectors');
$sCon->fields('eSectors', array('sector_id', 'id', 'name', ));
$sCon->condition('eSectors.sector_id', $sectorId, '=');
$sCon->condition('eSectors.sector_id', $sectorId, '=');
$specialties_in_sector = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
}
$sector_specialties=array();
......@@ -905,28 +905,28 @@ class ReportsCreator extends ControllerBase
$sCon = \Drupal::database()->select('epal_student_class', 'eStudent');
$sCon->leftjoin('eepal_school_field_data','eSchool_initial','eSchool_initial.id=eStudent.initial_epal_id');
$sCon->join('eepal_region_field_data', 'eRegion_initial', 'eRegion_initial.id = eSchool_initial.region_edu_admin_id');
$sCon->join('eepal_admin_area_field_data', 'eAdmin_initial', 'eAdmin_initial.id = eSchool_initial.edu_admin_id');
$sCon->join('eepal_school_field_data','eSchool_epal','eSchool_epal.id=eStudent.epal_id');
$sCon->join('eepal_region_field_data', 'eRegion_epal', 'eRegion_epal.id = eSchool_epal.region_edu_admin_id');
$sCon->join('eepal_admin_area_field_data', 'eAdmin_epal', 'eAdmin_epal.id = eSchool_epal.edu_admin_id');
$sCon->leftjoin('eepal_school_field_data','eSchool_initial','eSchool_initial.id=eStudent.initial_epal_id');
$sCon->join('eepal_region_field_data', 'eRegion_initial', 'eRegion_initial.id = eSchool_initial.region_edu_admin_id');
$sCon->join('eepal_admin_area_field_data', 'eAdmin_initial', 'eAdmin_initial.id = eSchool_initial.edu_admin_id');
$sCon->join('eepal_school_field_data','eSchool_epal','eSchool_epal.id=eStudent.epal_id');
$sCon->join('eepal_region_field_data', 'eRegion_epal', 'eRegion_epal.id = eSchool_epal.region_edu_admin_id');
$sCon->join('eepal_admin_area_field_data', 'eAdmin_epal', 'eAdmin_epal.id = eSchool_epal.edu_admin_id');
$sCon->fields('eStudent', array('initial_epal_id', 'epal_id', 'currentclass', 'specialization_id'));
$sCon->addField('eRegion_initial', 'name','regionAName');
$sCon->addField('eAdmin_initial', 'name','adminAName');
$sCon->addField('eSchool_initial', 'name','schoolAName');
$sCon->addField('eRegion_epal', 'name','regionBName');
$sCon->addField('eAdmin_epal', 'name','adminBName');
$sCon->addField('eSchool_epal', 'name','schoolBName');
$sCon->addField('eRegion_initial', 'name','regionAName');
$sCon->addField('eAdmin_initial', 'name','adminAName');
$sCon->addField('eSchool_initial', 'name','schoolAName');
$sCon->addField('eRegion_epal', 'name','regionBName');
$sCon->addField('eAdmin_epal', 'name','adminBName');
$sCon->addField('eSchool_epal', 'name','schoolBName');
if ($classId != 0) {
$sCon->condition('eStudent.currentclass', $classId, '=');
}
if ($sectorId != 0) {
if ($classId==2){
$sCon->condition('eStudent.specialization_id', $sectorId, '=');
$sCon->condition('eStudent.specialization_id', $sectorId, '=');
}
if (($classId==3 || $classId==4) && $courseId==0){
$sCon->condition('eStudent.specialization_id', $sector_specialties, 'IN');
$sCon->condition('eStudent.specialization_id', $sector_specialties, 'IN');
}
}
......@@ -949,13 +949,13 @@ class ReportsCreator extends ControllerBase
$sCon->groupBy('epal_id');
$sCon->groupBy('currentclass');
$sCon->groupBy('specialization_id');
$sCon->groupBy('eRegion_initial.name');
$sCon->groupBy('eAdmin_initial.name');
$sCon->groupBy('eSchool_initial.name');
$sCon->groupBy('eRegion_epal.name');
$sCon->groupBy('eAdmin_epal.name');
$sCon->groupBy('eSchool_epal.name');
$sCon->addExpression('count(eStudent.id)', 'eStudent_count');
$sCon->groupBy('eRegion_initial.name');
$sCon->groupBy('eAdmin_initial.name');
$sCon->groupBy('eSchool_initial.name');
$sCon->groupBy('eRegion_epal.name');
$sCon->groupBy('eAdmin_epal.name');
$sCon->groupBy('eSchool_epal.name');
$sCon->addExpression('count(eStudent.id)', 'eStudent_count');
$mergedSchools = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -971,46 +971,46 @@ class ReportsCreator extends ControllerBase
$adminBColumn = array();
$numBColumn = array();
foreach ($mergedSchools as $mergedSchool) {
foreach ($mergedSchools as $mergedSchool) {
array_push($regionAColumn, $mergedSchool->regionAName);
array_push($adminAColumn, $mergedSchool->adminAName);
array_push($schoolANameColumn, $mergedSchool->schoolAName);
if ($mergedSchool->currentclass==1){
array_push($schoolSectionColumn, 'Α Tάξη');
array_push($schoolSectionColumn, 'Α Tάξη');
}
else if ($mergedSchool->currentclass==2){
else if ($mergedSchool->currentclass==2){
$sCon = \Drupal::database()->select('eepal_sectors_field_data', 'eSectors');
$sCon->addField('eSectors', 'name');
$sCon->condition('eSectors.id', $mergedSchool->specialization_id, '=');
$sCon->condition('eSectors.id', $mergedSchool->specialization_id, '=');
$sector_name = $sCon->execute()->fetchField();
array_push($schoolSectionColumn, 'Β τάξη / ' . $sector_name);
}
}
else{
$sCon = \Drupal::database()->select('eepal_specialty_field_data', 'eSpecialties');
$sCon->join('eepal_sectors_field_data', 'eSectors','eSectors.id=eSpecialties.sector_id');
$sCon->join('eepal_sectors_field_data', 'eSectors','eSectors.id=eSpecialties.sector_id');
$sCon->addField('eSectors', 'name','sectorName');
$sCon->addField('eSpecialties', 'name','specialtyName');
$sCon->condition('eSpecialties.id', $mergedSchool->specialization_id, '=');
$sCon->addField('eSpecialties', 'name','specialtyName');
$sCon->condition('eSpecialties.id', $mergedSchool->specialization_id, '=');
$sector_specialty = $sCon->execute()->fetchAssoc();
if ($mergedSchool->currentclass==3){
array_push($schoolSectionColumn, 'Γ Tάξη / ' . $sector_specialty['sectorName'].'/'.$sector_specialty['specialtyName']);//->specialization_id);
array_push($schoolSectionColumn, 'Γ Tάξη / ' . $sector_specialty['sectorName'].'/'.$sector_specialty['specialtyName']);//->specialization_id);
}
else if ($mergedSchool->currentclass==4){
array_push($schoolSectionColumn, 'Δ Tάξη / ' . $mergedSchool->specialization_id);
array_push($schoolSectionColumn, 'Δ Tάξη / ' . $mergedSchool->specialization_id);
}
}
array_push($numAColumn, $mergedSchool->eStudent_count);
array_push($regionBColumn, $mergedSchool->regionBName);
array_push($adminBColumn, $mergedSchool->adminBName);
array_push($schoolBNameColumn, $mergedSchool->schoolBName);
array_push($adminBColumn, $mergedSchool->adminBName);
array_push($schoolBNameColumn, $mergedSchool->schoolBName);
$sCon = \Drupal::database()->select('epal_student_class', 'eStudent');
$sCon->condition('eStudent.epal_id', $mergedSchool->epal_id, '=');
$sCon->condition('eStudent.currentclass', $mergedSchool->currentclass, '=');
$sCon->condition('eStudent.specialization_id', $mergedSchool->specialization_id, '=');
$sCon->addExpression('count(eStudent.id)', 'eStudent_extra_count');
$sCon->condition('eStudent.specialization_id', $mergedSchool->specialization_id, '=');
$sCon->addExpression('count(eStudent.id)', 'eStudent_extra_count');
$sCon->groupBy('eStudent.epal_id');
$sCon->groupBy('eStudent.currentclass');
$sCon->groupBy('eStudent.specialization_id');
......@@ -1020,7 +1020,7 @@ class ReportsCreator extends ControllerBase
}
for ($j = 0; $j < sizeof($schoolANameColumn); $j++) {
array_push($list, (object) array(
'nameΑ' => $schoolANameColumn[$j],
'regionΑ' => $regionAColumn[$j],
......@@ -1086,44 +1086,44 @@ class ReportsCreator extends ControllerBase
if ( ($classId==3 || $classId==4) && $sectorId!=0 && $courseId==0 ){
$sCon = \Drupal::database()->select('eepal_specialty_field_data', 'eSectors');
$sCon->fields('eSectors', array('sector_id', 'id', 'name', ));
$sCon->condition('eSectors.sector_id', $sectorId, '=');
$sCon->condition('eSectors.sector_id', $sectorId, '=');
$specialties_in_sector = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
}
$sector_specialties=array();
foreach ($specialties_in_sector as $specialty){
array_push($sector_specialties,$specialty->id);
}