...
 
Commits (107)
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'
......
......@@ -86,6 +86,14 @@ epal.application_submit:
_controller: '\Drupal\epal\Controller\ApplicationSubmit::appSubmit'
requirements:
_user_is_logged_in: 'TRUE'
epal.application_update:
path: '/epal/appupdate/{studentId}/{schNonCheckOccup}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\ApplicationSubmit::appUpdate'
requirements:
_user_is_logged_in: 'TRUE'
epal.allocation:
path: '/epal/distribution'
options:
......@@ -95,7 +103,7 @@ epal.allocation:
requirements:
_user_is_logged_in: 'TRUE'
epal.allocation_second:
path: '/epal/distribution-secondperiod'
path: '/epal/distribution-secondperiod/{dateStart}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -166,14 +174,6 @@ epal.ministry.report-completeness:
_controller: '\Drupal\epal\Controller\ReportsCreator::makeReportCompleteness'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.report-all-stat:
path: '/ministry/report-all-stat/{regionId}/{adminId}/{schId}/{classId}/{sectorId}/{courseId}/{finalized}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\ReportsCreator::makeReportAllStat'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.report-no-capacity:
path: '/ministry/report-no-capacity/{capacityEnabled}'
options:
......@@ -229,7 +229,7 @@ epal.ministry.retrievesettings:
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.storesettings:
path: '/ministry/store-settings/{capacityDisabled}/{directorViewDisabled}/{applicantsLoginDisabled}/{applicantsResultsDisabled}/{secondPeriodEnabled}'
path: '/ministry/store-settings/{capacityDisabled}/{directorViewDisabled}/{applicantsLoginDisabled}/{applicantsAppModifyDisabled}/{applicantsAppDeleteDisabled}/{applicantsResultsDisabled}/{secondPeriodEnabled}/{dateStart}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -269,7 +269,7 @@ epal.findcapacityperschool:
requirements:
_user_is_logged_in: 'TRUE'
epal.applicant.creationpdf:
path: '/epal/pdf-application/{studentId}'
path: '/epal/pdf-application/{studentId}/{status}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -340,3 +340,99 @@ epal.application_delete_director:
_controller: '\Drupal\epal\Controller\SubmitedApplications::deleteApplicationFromDirector'
requirements:
_user_is_logged_in: 'TRUE'
epal.small_groups:
path: '/epal/getsmallgroups/{classId}/{sector}/{specialit}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\SmallClassDistribution::findSmallGroups'
requirements:
_user_is_logged_in: 'TRUE'
epal.merge_courses:
path: '/epal/getcoursesformerge/{firstid}/{classId}/{sector}/{specialit}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\SmallClassDistribution::findGroupsForMerging'
requirements:
_user_is_logged_in: 'TRUE'
epal.user.merging:
path: '/epal/mergecourses/{classId}/{sector}/{speciality}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\SmallClassDistribution::merging'
requirements:
_user_is_logged_in: 'TRUE'
epal.merging_groups:
path: '/epal/getmergingsmallgroupsforundo/{classId}/{sector}/{specialit}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\SmallClassDistribution::findMergingSchoolsforUndo'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.report-merged-classes:
path: '/ministry/report-merged-classes/{regionId}/{adminId}/{schId}/{classId}/{sectorId}/{courseId}/{finalized}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\ReportsCreator::makeReportMergedClasses'
requirements:
_user_is_logged_in: 'TRUE'
epal.undomerge:
path: '/epal/undomerge/{classId}/{sector}/{speciality}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\SmallClassDistribution::UndoMerge'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.report-applications:
path: '/ministry/report-applications/{regionId}/{adminId}/{schId}/{classId}/{sectorId}/{courseId}/{finalized}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\ReportsCreator::makeReportApplications'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.report-user-applications:
path: '/ministry/report-user-applications/{regionId}/{adminId}/{schId}/{classId}/{sectorId}/{courseId}/{finalized}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\ReportsCreator::makeReportUserApplications'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.report-gel-students:
path: '/ministry/report-gel-students/{regionId}/{adminId}/{schId}/{classId}/{sectorId}/{courseId}/{finalized}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\ReportsCreator::makeReportGelStudents'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.report-students-num:
path: '/ministry/report-students-num/{regionId}/{adminId}/{schId}/{classId}/{sectorId}/{courseId}/{finalized}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\ReportsCreator::makeReportStudentsNum'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.report-small-classest:
path: '/ministry/report-small-classes/{regionId}/{adminId}/{schId}/{classId}/{sectorId}/{courseId}/{finalized}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\ReportsCreator::makeReportSmallClasses'
requirements:
_user_is_logged_in: 'TRUE'
epal.undomergeall:
path: '/epal/undomergeall'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\SmallClassDistribution::UndoMergeAll'
requirements:
_user_is_logged_in: 'TRUE'
\ No newline at end of file
......@@ -50,11 +50,24 @@ class DirectorView extends ControllerBase
"error_code" => 3001
], Response::HTTP_FORBIDDEN);
}
else
$lock_delete = $epalConfig->lock_delete->value;
/*
if ($epalConfig->lock_school_students_view->value) {
return $this->respondWithStatus([
"error_code" => 3002
], Response::HTTP_FORBIDDEN);
}
*/
/*
if ($epalConfig->lock_delete->value) {
return $this->respondWithStatus([
"error_code" => 3002
], Response::HTTP_FORBIDDEN);
}
*/
$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken));
$user = reset($users);
......@@ -125,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);
......@@ -158,13 +169,13 @@ 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),
'birthdate' => date("d-m-Y", strtotime($epalStudent->birthdate->value)),
'checkstatus' => $checkstudentstatus -> directorconfirm ->value,
'lock_delete' => $lock_delete,
'created' => date('d/m/Y H:i', $epalStudent -> created ->value),
);
......@@ -808,7 +819,6 @@ class DirectorView extends ControllerBase
return $this->respondWithStatus(['message' => t('EPAL user not found')], Response::HTTP_FORBIDDEN);
}
}
public function FindCoursesPerSchool(Request $request)
{
$i = 0;
......@@ -945,6 +955,9 @@ class DirectorView extends ControllerBase
}
}
private function respondWithStatus($arr, $s)
{
$res = new JsonResponse($arr);
......
......@@ -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');
......
......@@ -98,19 +98,24 @@ class MinisterSettings extends ControllerBase {
$capacityDisabled = $epalConfig->lock_school_capacity->getString();
$directorViewDisabled = $epalConfig->lock_school_students_view->getString();
$applicantsLoginDisabled = $epalConfig->lock_application->getString();
$applicantsAppModifyDisabled = $epalConfig->lock_modify->getString();
$applicantsAppDeleteDisabled = $epalConfig->lock_delete->getString();
$applicantsResultsDisabled = $epalConfig->lock_results->getString();
$secondPeriodEnabled = $epalConfig->activate_second_period->getString();
$dateStart = $epalConfig->date_start_b_period->getString();
}
$config_storage->resetCache();
return $this->respondWithStatus([
//'message' => t("post successful"),
'capacityDisabled' => $capacityDisabled,
'directorViewDisabled' => $directorViewDisabled,
'applicantsLoginDisabled' => $applicantsLoginDisabled,
'applicantsAppModifyDisabled' => $applicantsAppModifyDisabled,
'applicantsAppDeleteDisabled' => $applicantsAppDeleteDisabled,
'applicantsResultsDisabled' => $applicantsResultsDisabled,
'secondPeriodEnabled' => $secondPeriodEnabled,
'dateStart' => $dateStart,
], Response::HTTP_OK);
} //end try
......@@ -127,7 +132,8 @@ class MinisterSettings extends ControllerBase {
}
public function storeSettings(Request $request, $capacityDisabled, $directorViewDisabled, $applicantsLoginDisabled, $applicantsResultsDisabled, $secondPeriodEnabled ) {
public function storeSettings(Request $request, $capacityDisabled, $directorViewDisabled, $applicantsLoginDisabled, $applicantsAppModifyDisabled,
$applicantsAppDeleteDisabled, $applicantsResultsDisabled, $secondPeriodEnabled, $dateStart ) {
try {
if (!$request->isMethod('GET')) {
......@@ -172,8 +178,11 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
$epalConfig->set('lock_school_capacity', $capacityDisabled);
$epalConfig->set('lock_school_students_view', $directorViewDisabled);
$epalConfig->set('lock_application', $applicantsLoginDisabled);
$epalConfig->set('lock_modify', $applicantsAppModifyDisabled);
$epalConfig->set('lock_delete', $applicantsAppDeleteDisabled);
$epalConfig->set('lock_results', $applicantsResultsDisabled);
$epalConfig->set('activate_second_period', $secondPeriodEnabled);
$epalConfig->set('date_start_b_period', $dateStart);
$epalConfig->save();
}
......@@ -185,8 +194,11 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
'capacityDisabled' => $capacityDisabled,
'directorViewDisabled' => $directorViewDisabled,
'applicantsLoginDisabled' => $applicantsLoginDisabled,
'applicantsAppModifyDisabled' => $applicantsAppModifyDisabled,
'applicantsAppDeleteDisabled' => $applicantsAppDeleteDisabled,
'applicantsResultsDisabled' => $applicantsResultsDisabled,
'secondPeriodEnabled' => $secondPeriodEnabled,
'dateStart' => $dateStart,
], Response::HTTP_OK);
} //end try
......
......@@ -37,6 +37,7 @@ class PDFCreator extends ControllerBase {
protected $fontSizeHeader;
protected $fontSizeRegular;
protected $crypt;
//protected $applicantsResultsDisabled;
public function __construct(
EntityTypeManagerInterface $entityTypeManager,
......@@ -61,7 +62,7 @@ class PDFCreator extends ControllerBase {
);
}
public function createApplicantPDF(Request $request, $studentId) {
public function createApplicantPDF(Request $request, $studentId, $status) {
try {
if (!$request->isMethod('GET')) {
......@@ -91,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();
......@@ -125,12 +126,25 @@ class PDFCreator extends ControllerBase {
], Response::HTTP_FORBIDDEN);
}
//$user->id()
$epalStudents = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('id'=> $studentId));
if (sizeof($epalStudents) === 1) {
$epalStudent = reset($epalStudents);
/*
//ανάκτηση τιμής από ρυθμίσεις διαχειριστή για lock_results
$config_storage = $this->entityTypeManager->getStorage('epal_config');
$epalConfigs = $config_storage->loadByProperties(array('name' => 'epal_config'));
$epalConfig = reset($epalConfigs);
if (!$epalConfig) {
return $this->respondWithStatus([
'message' => t("EpalConfig Enity not found"),
], Response::HTTP_FORBIDDEN);
}
else {
$this->applicantsResultsDisabled = $epalConfig->lock_results->getString();
}
*/
}
else {
return $this->respondWithStatus([
......@@ -144,7 +158,7 @@ class PDFCreator extends ControllerBase {
$this->fontSizeRegular = 11;
$this->initPdfHandler();
$this->createHeader($epalStudent);
$this->createHeader($epalStudent,$status);
$ret = $this->createGuardianInfo($epalStudent);
if ($ret === ERROR_DECODING)
return $this->respondWithStatus([
......@@ -187,12 +201,18 @@ class PDFCreator extends ControllerBase {
}
private function createHeader($student) {
private function createHeader($student,$status) {
$this->pdf->SetFont($this->fontBold, '', 16);
$this->pdf->MultiCell(0, 8, $this->prepareString('Ηλεκτρονική Δήλωση Προτίμησης ΕΠΑΛ'), 0, 'C');
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeHeader);
$this->pdf->MultiCell(0, 8, $this->prepareString('με αριθμό δήλωσης: ' . $student->id->value . ' / ' . date('d-m-y (ώρα: H:i:s)', $student->created->value)), 0, 'C');
$this->pdf->MultiCell(0, 8, $this->prepareString('με αριθμό δήλωσης: ' . $student->id->value . ' / ' . date('d-m-y (ώρα: H:i:s)', $student->changed->value)), 0, 'C');
$this->pdf->SetFont($this->fontLight, '', 11);
//if ($this->applicantsResultsDisabled === "1")
if ($status === "0" || $status === "3" || $status === "4")
$this->pdf->MultiCell(0, 8, $this->prepareString('(Αρχική)'), 0, 'R');
$this->pdf->Ln();
}
......@@ -297,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) {
......@@ -375,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);
......@@ -412,8 +414,8 @@ class PDFCreator extends ControllerBase {
$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->relationtostudent->value), 0, 'L');
$this->pdf->Cell($width, $height, $this->prepareString($relationtostudent_decoded), 0, 'L');
//$this->pdf->Cell($width, $height, $this->prepareString($relationtostudent_decoded), 0, 'L');
$this->pdf->Cell($width, $height, $this->prepareString($student->relationtostudent->value), 0, 'L');
$this->pdf->Ln();
$this->pdf->Ln();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -187,7 +187,7 @@ class EpalConfig extends ContentEntityBase implements EpalConfigInterface {
'max_length' => 50,
'text_processing' => 0,
))
->setDefaultValue('')
->setDefaultValue('epal_config')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
......@@ -260,6 +260,46 @@ class EpalConfig extends ContentEntityBase implements EpalConfigInterface {
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['lock_modify'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Lock Modifications'))
->setDescription(t('Lock Modifications.'))
->setSettings(array(
'text_processing' => 0,
))
->setRequired(FALSE)
->setDefaultValue(FALSE)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'boolean',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'boolean',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['lock_delete'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Lock Deletions'))
->setDescription(t('Lock Deletions.'))
->setSettings(array(
'text_processing' => 0,
))
->setRequired(FALSE)
->setDefaultValue(FALSE)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'boolean',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'boolean',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['lock_results'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Lock Results'))
->setDescription(t('Lock Results.'))
......@@ -280,7 +320,7 @@ class EpalConfig extends ContentEntityBase implements EpalConfigInterface {
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['activate_second_period'] = BaseFieldDefinition::create('boolean')
$fields['activate_second_period'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Activate second periods of applications'))
->setDescription(t('Activate second periods of applications.'))
->setSettings(array(
......@@ -300,6 +340,22 @@ class EpalConfig extends ContentEntityBase implements EpalConfigInterface {
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['date_start_b_period'] = BaseFieldDefinition::create('datetime')
->setLabel(t('Ημερομηνία έναρξης για κατανομή Β περιόδου'))
->setDescription(t('Ημερομηνία έναρξης για κατανομή Β περιόδου.'))
->setSetting('datetime_type', 'date')
->setRequired(false)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => -4,
))
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true);
$fields['status'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Publishing status'))
->setDescription(t('A boolean indicating whether the Epal config is published.'))
......
......@@ -177,6 +177,12 @@ class EpalStudentClass extends ContentEntityBase implements EpalStudentClassInte
}
public function getepalid() {
return $this->get('initial_epal_id')->target_id;
// return $this->get('initial_epal_id')->id();
}
/**
* {@inheritdoc}
......@@ -449,6 +455,54 @@ class EpalStudentClass extends ContentEntityBase implements EpalStudentClassInte
->setLabel(t('Changed'))
->setDescription(t('The time that the entity was last edited.'));
$fields['initial_epal_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Id ΕΠΑΛ Προέλευσης'))
->setDescription(t('Σχολείο πριν την συγχώνευση'))
->setSetting('target_type', 'eepal_school')
->setSetting('handler', 'default')
->setRequired(true)
->setTranslatable(TRUE)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'author',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'entity_reference_autocomplete',
'weight' => -4,
'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
'autocomplete_type' => 'tags',
'placeholder' => '',
),
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['merging_role'] = BaseFieldDefinition::create('string')
->setLabel(t('Ο ρόλος του χρήστη που κάνει συγχώνευση'))
->setDescription(t('Ρόλος του χρήστη που κάνει συγχώνευση'))
->setSettings(array(
'max_length' => 50,
'text_processing' => 0,
))
->setDefaultValue('')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
return $fields;
}
......
......@@ -85,27 +85,19 @@ interface EpalStudentInterface extends ContentEntityInterface, EntityChangedInt
public function setBirthdate($val);
public function getFatherFirstname();
public function setFatherFirstname($val);
public function getMotherSurname();
public function setMotherSurname($val);
public function getStudentAmka();
public function setStudentAmka($val);
public function getRegionAddress();
public function setRegionAddress($val);
public function getRegionTK();
public function setRegionTK($val);
public function getRegionArea();
public function setRegionArea($val);
public function getCertificateType();
public function setCertificateType($val);
public function getCurrentclass();
public function setCurrentclass($val);
public function getCurrentepal();
public function setCurrentepal($val);
public function getCurrentsector();
public function setCurrentsector($val);
public function getTelnum();
public function setTelnum($val);
public function getRelationToStudent();
public function setRelationToStudent($val);
}
<?php
namespace Drupal\epal\Entity;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityChangedInterface;
use Drupal\user\EntityOwnerInterface;
/**
* Provides an interface for defining Epal users entities.
*
* @ingroup epal
*/
interface EpalUsersInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface {
// Add get/set methods for your configuration properties here.
/**
* Gets the Epal users name.
*
* @return string
* Name of the Epal users.
*/
public function getName();
/**
* Sets the Epal users name.
*
* @param string $name
* The Epal users name.
*
* @return \Drupal\epal\Entity\EpalUsersInterface
* The called Epal users entity.
*/
public function setName($name);
/**
* Gets the Epal users creation timestamp.
*
* @return int
* Creation timestamp of the Epal users.
*/
public function getCreatedTime();
/**
* Sets the Epal users creation timestamp.
*
* @param int $timestamp
* The Epal users creation timestamp.
*
* @return \Drupal\epal\Entity\EpalUsersInterface
* The called Epal users entity.
*/
public function setCreatedTime($timestamp);
/**
* Returns the Epal users published status indicator.
*
* Unpublished Epal users are only visible to restricted users.
*
* @return bool
* TRUE if the Epal users is published.
*/
public function isPublished();
/**
* Sets the published status of a Epal users.
*
* @param bool $published
* TRUE to set this Epal users to published, FALSE to set it to unpublished.
*
* @return \Drupal\epal\Entity\EpalUsersInterface
* The called Epal users entity.
*/
public function setPublished($published);
//get/set methods for additional fields for configuration properties.
public function getDrupaluser_id();
public function setDrupaluser_id($val);
public function getTaxis_userid();
public function setTaxis_userid($val);
public function getTaxis_taxid();
public function setTaxis_taxid($val);
public function getSurname();
public function setSurname($val);
public function getFathername();
public function setFathername($val);
public function getMothername();
public function setMothername($val);
//public function getAddress();
//public function setAddress($val);
//public function getAddresstk();
//public function setAddresstk($val);
//public function getAddressarea();
//public function setAddressarea($val);
public function getAccesstoken();
public function setAccesstoken($val);
public function getAuthtoken();
public function setAuthtoken($val);
public function getTimelogin();
public function setTimelogin($val);
public function getTimeregistration();
public function setTimeregistration($val);
public function getTimetokeninvalid();
public function setTimetokeninvalid($val);
public function getUserip();
public function setUserip($val);
}
......@@ -24,8 +24,7 @@ class EpalStudentListBuilder extends EntityListBuilder {
$header['epaluser_id'] = $this->t('ID χρήστη ΕΠΑΛ');
$header['name'] = $this->t('Όνομα');
$header['studentsurname'] = $this->t('Επώνυμο');
$header['studentamka'] = $this->t('AMKA μαθητή');
return $header + parent::buildHeader();
}
......@@ -35,7 +34,7 @@ class EpalStudentListBuilder extends EntityListBuilder {
public function buildRow(EntityInterface $entity) {
/* @var $entity \Drupal\epal\Entity\EpalStudent */
$row['id'] = $entity->id();
$row['epaluser_id'] = $this->l(
$entity->getEpaluser_id(),
new Url(
......@@ -44,7 +43,7 @@ class EpalStudentListBuilder extends EntityListBuilder {
)
)
);
$row['name'] = $this->l(
$entity->getName(),
new Url(
......@@ -63,15 +62,6 @@ class EpalStudentListBuilder extends EntityListBuilder {
)
);
$row['studentAmka'] = $this->l(
$entity->getStudentAmka(),
new Url(
'entity.epal_student.edit_form', array(
'epal_student' => $entity->id(),
)
)
);
return $row + parent::buildRow($entity);
}
......
<?php
namespace Drupal\epal;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Routing\LinkGeneratorTrait;
use Drupal\Core\Url;
/**
* Defines a class to build a listing of Epal users entities.
*
* @ingroup epal
*/
class EpalUsersListBuilder extends EntityListBuilder {
use LinkGeneratorTrait;
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['id'] = $this->t('ID');
$header['name'] = $this->t('Όνομα');
$header['surname'] = $this->t('Επώνυμο');
$header['fathername'] = $this->t('Όνομα πατέρα');
$header['mothername'] = $this->t('Όνομα μητέρας');
//$header['drupaluser_id'] = $this->t('ID χρήστη Drupal');
//$header['taxis_userid'] = $this->t('ID χρήστη από taxisnet');
//$header['taxis_taxid'] = $this->t('TAXID χρήστη από taxisnet');
//$header['address'] = $this->t('Διεύθυνση');
//$header['addresstk'] = $this->t('ΤΚ');
//$header['addressarea'] = $this->t('Περιοχή');
//$header['accesstoken'] = $this->t('AccessToken');
//$header['authtoken'] = $this->t('AuthToken');
//$header['timelogin'] = $this->t('Time Login');
//$header['timeregistration'] = $this->t('Time Registration');
//$header['timetokeninvalid'] = $this->t('Time Token Invalid');
//$header['userip'] = $this->t('User IP');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/* @var $entity \Drupal\epal\Entity\EpalUsers */
$row['id'] = $entity->id();
$row['name'] = $this->l(
$entity->label(),
new Url(
'entity.epal_users.edit_form', array(
'epal_users' => $entity->id(),
)
)
);
$row['surname'] = $this->l(
$entity->getSurname(),
new Url(
'entity.epal_users.edit_form', array(
'epal_users' => $entity->id(),
)
)
);
$row['fathername'] = $this->l(
$entity->getFathername(),
new Url(
'entity.epal_users.edit_form', array(
'epal_users' => $entity->id(),
)
)
);
$row['mothername'] = $this->l(
$entity->getMothername(),
new Url(
'entity.epal_users.edit_form', array(
'epal_users' => $entity->id(),
)
)
);
return $row + parent::buildRow($entity);
}
}
<?php
namespace Drupal\epal\Form;
use Drupal\Core\Entity\ContentEntityDeleteForm;
/**
* Provides a form for deleting Epal users entities.
*
* @ingroup epal
*/
class EpalUsersDeleteForm extends ContentEntityDeleteForm {
}
CREATE UNIQUE INDEX uidx_region_regno ON eepal_region_field_data(registry_no);
CREATE UNIQUE INDEX uidx_adminarea_regno ON eepal_admin_area_field_data(registry_no);
CREATE UNIQUE INDEX uidx_taxis_userid ON epal_users(taxis_userid);
CREATE INDEX uidx_authtoken ON epal_users(authtoken(150));
CREATE UNIQUE INDEX uidx_taxis_userid ON applicant_users(taxis_userid);
CREATE INDEX uidx_authtoken ON applicant_users(authtoken(150));
......@@ -7,8 +7,8 @@ dependencies:
- hal
- serialization
- user
id: entity.epal_users
plugin_id: 'entity:epal_users'
id: entity.applicant_users
plugin_id: 'entity:applicant_users'
granularity: method
configuration:
GET:
......
......@@ -11,31 +11,31 @@ permissions:
- 'add epal student course field entities'
- 'add epal student epal chosen entities'
- 'add epal student sector field entities'
- 'add epal users entities'
- 'add applicant users entities'
- 'delete epal student class entities'
- 'delete epal student entities'
- 'delete epal student course field entities'
- 'delete epal student epal chosen entities'
- 'delete epal student sector field entities'
- 'delete epal users entities'
- 'delete applicant users entities'
- 'edit epal student class entities'
- 'edit epal student entities'
- 'edit epal student course field entities'
- 'edit epal student epal chosen entities'
- 'edit epal student sector field entities'
- 'edit epal users entities'
- 'edit applicant users entities'
- 'view published epal student class entities'
- 'view published epal student entities'
- 'view published epal student course field entities'
- 'view published epal student epal chosen entities'
- 'view published epal student sector field entities'
- 'view published epal users entities'
- 'view published applicant users entities'
- 'view unpublished epal student class entities'
- 'view unpublished epal student entities'
- 'view unpublished epal student course field entities'
- 'view unpublished epal student epal chosen entities'
- 'view unpublished epal student sector field entities'
- 'view unpublished epal users entities'
- 'view unpublished applicant users entities'
- 'view published eepal admin area entities'
- 'view published eepal prefecture entities'
- 'view published eepal region entities'
......
......@@ -14,7 +14,7 @@ permissions:
- 'view published epal student epal chosen entities'
- 'view published epal student moria entities'
- 'view published epal student sector field entities'
- 'view published epal users entities'
- 'view published applicant users entities'
- 'view unpublished epal student class entities'
- 'view unpublished epal student entities'
- 'view unpublished epal class limits entities'
......@@ -23,7 +23,7 @@ permissions:
- 'view unpublished epal student epal chosen entities'
- 'view unpublished epal student moria entities'
- 'view unpublished epal student sector field entities'
- 'view unpublished epal users entities'
- 'view unpublished applicant users entities'
- 'view published eepal admin area entities'
- 'view published eepal prefecture entities'
- 'view published eepal region entities'
......
......@@ -9,24 +9,24 @@ permissions:
- 'add epal student course field entities'
- 'add epal student epal chosen entities'
- 'add epal student sector field entities'
- 'add epal users entities'
- 'add applicant users entities'
- 'delete epal student course field entities'
- 'delete epal student epal chosen entities'
- 'delete epal student sector field entities'
- 'delete epal users entities'
- 'delete applicant users entities'
- 'edit epal class limits entities'
- 'edit epal student course field entities'
- 'edit epal student epal chosen entities'
- 'edit epal student sector field entities'
- 'edit epal users entities'
- 'edit applicant users entities'
- 'view published epal student course field entities'
- 'view published epal student epal chosen entities'
- 'view published epal student sector field entities'
- 'view published epal users entities'
- 'view published applicant users entities'
- 'view unpublished epal student course field entities'
- 'view unpublished epal student epal chosen entities'
- 'view unpublished epal student sector field entities'
- 'view unpublished epal users entities'
- 'view unpublished applicant users entities'
- 'view published eepal admin area entities'
- 'view published eepal prefecture entities'
- 'view published eepal region entities'
......
......@@ -9,24 +9,24 @@ permissions:
- 'add epal student course field entities'
- 'add epal student epal chosen entities'
- 'add epal student sector field entities'
- 'add epal users entities'
- 'add applicant users entities'
- 'delete epal student course field entities'
- 'delete epal student epal chosen entities'
- 'delete epal student sector field entities'
- 'delete epal users entities'
- 'delete applicant users entities'
- 'edit epal class limits entities'
- 'edit epal student course field entities'
- 'edit epal student epal chosen entities'
- 'edit epal student sector field entities'
- 'edit epal users entities'
- 'edit applicant users entities'
- 'view published epal student course field entities'
- 'view published epal student epal chosen entities'
- 'view published epal student sector field entities'
- 'view published epal users entities'
- 'view published applicant users entities'
- 'view unpublished epal student course field entities'
- 'view unpublished epal student epal chosen entities'
- 'view unpublished epal student sector field entities'
- 'view unpublished epal users entities'
- 'view unpublished applicant users entities'
- 'view published eepal admin area entities'
- 'view published eepal prefecture entities'
- 'view published eepal region entities'
......
......@@ -14,7 +14,7 @@ permissions:
- 'view published epal student epal chosen entities'
- 'view published epal student moria entities'
- 'view published epal student sector field entities'
- 'view published epal users entities'
- 'view published applicant users entities'
- 'view unpublished epal student class entities'
- 'view unpublished epal student entities'
- 'view unpublished epal class limits entities'
......@@ -23,7 +23,7 @@ permissions:
- 'view unpublished epal student epal chosen entities'
- 'view unpublished epal student moria entities'
- 'view unpublished epal student sector field entities'
- 'view unpublished epal users entities'
- 'view unpublished applicant users entities'
- 'view published eepal admin area entities'
- 'view published eepal prefecture entities'
- 'view published eepal region entities'
......
......@@ -2,26 +2,28 @@
/**
* @file
* Contains epal_users.page.inc.
* Contains applicant_users.page.inc.
*
* Page callback for Epal users entities.
* Page callback for Applicant users entities.
*/
use Drupal\Core\Render\Element;
use Drupal\Core\Link;
use Drupal\Core\Url;
/**
* Prepares variables for Epal users templates.
* Prepares variables for Applicant users templates.
*
* Default template: epal_users.html.twig.
* Default template: applicant_users.html.twig.
*
* @param array $variables
* An associative array containing:
* - elements: An associative array containing the user information and any
* - attributes: HTML attributes for the containing element.
*/
function template_preprocess_epal_users(array &$variables) {
// Fetch EpalUsers Entity Object.
$epal_users = $variables['elements']['#epal_users'];
function template_preprocess_applicant_users(array &$variables) {
// Fetch ApplicantUsers Entity Object.
$applicant_users = $variables['elements']['#applicant_users'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
......
......@@ -8,3 +8,8 @@ entity.oauthost_session.add_form:
title: 'Add OAuthOST Session'
appears_on:
- entity.oauthost_session.collection
entity.applicant_users.add_form:
route_name: entity.applicant_users.add_form
title: 'Add Applicant users'
appears_on:
- entity.applicant_users.collection
......@@ -26,3 +26,16 @@ oauthost_session.admin.structure.settings:
description: 'Configure OAuthOST Session entities'
route_name: oauthost_session.settings
parent: system.admin_structure
# Applicant users menu items definition
entity.applicant_users.collection:
title: 'Applicant users list'
route_name: entity.applicant_users.collection
description: 'List Applicant users entities'
parent: system.admin_structure
weight: 100
applicant_users.admin.structure.settings:
title: Applicant users settings
description: 'Configure Applicant users entities'
route_name: applicant_users.settings
parent: system.admin_structure
......@@ -42,3 +42,24 @@ entity.oauthost_session.delete_form:
title: Delete
weight: 10
# Applicant users routing definition
applicant_users.settings_tab:
route_name: applicant_users.settings
title: 'Settings'
base_route: applicant_users.settings
entity.applicant_users.canonical:
route_name: entity.applicant_users.canonical
base_route: entity.applicant_users.canonical
title: 'View'
entity.applicant_users.edit_form:
route_name: entity.applicant_users.edit_form
base_route: entity.applicant_users.canonical
title: Edit
entity.applicant_users.delete_form:
route_name: entity.applicant_users.delete_form
base_route: entity.applicant_users.canonical
title: Delete
weight: 10
......@@ -42,3 +42,22 @@ view published oauthost session entities:
view unpublished oauthost session entities:
title: 'View unpublished OAuthOST Session entities'
add applicant users entities:
title: 'Create new Applicant users entities'
administer applicant users entities:
title: 'Administer Applicant users entities'
description: 'Allow to access the administration form to configure Applicant users entities.'
restrict access: true
delete applicant users entities:
title: 'Delete Applicant users entities'
edit applicant users entities:
title: 'Edit Applicant users entities'
view published applicant users entities:
title: 'View published Applicant users entities'
view unpublished applicant users entities:
title: 'View unpublished Applicant users entities'
services:
logger.channel.oauth:
parent: 'logger.channel_base'
arguments: ['epal']
arguments: ['school']
<?php
namespace Drupal\epal;
namespace Drupal\oauthost;
use Drupal\Core\Entity\EntityAccessControlHandler;
use Drupal\Core\Entity\EntityInterface;
......@@ -8,29 +8,28 @@ use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Access\AccessResult;
/**
* Access controller for the Epal users entity.
* Access controller for the Applicant users entity.
*
* @see \Drupal\epal\Entity\EpalUsers.
* @see \Drupal\oauthost\Entity\ApplicantUsers.
*/
class EpalUsersAccessControlHandler extends EntityAccessControlHandler {
class ApplicantUsersAccessControlHandler extends EntityAccessControlHandler {
/**
* {@inheritdoc}
*/
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
/** @var \Drupal\epal\Entity\EpalUsersInterface $entity */
/** @var \Drupal\oauthost\ApplicantUsersInterface $entity */
switch ($operation) {