Commit 7b48d16d authored by Ασπασία Κατσή's avatar Ασπασία Κατσή

Services

parents 7d60623f 566d628e
ws_endpoint: 'https://the.url'
ws_username: 'username'
ws_password: 'password'
verbose: true
NO_SAFE_CURL: false
epal.applicationdetails: epal.applicationdetails:
path: '/epal/application/{studentId}' path: '/epal/application/{studentId}'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
_controller: '\Drupal\epal\Controller\SubmitedApplications::getApplicationDetails' _controller: '\Drupal\epal\Controller\SubmitedApplications::getApplicationDetails'
requirements: requirements:
...@@ -244,16 +244,8 @@ epal.svc.getdidacticyears: ...@@ -244,16 +244,8 @@ epal.svc.getdidacticyears:
_controller: '\Drupal\epal\Controller\WSConsumer::getAllDidactiYear' _controller: '\Drupal\epal\Controller\WSConsumer::getAllDidactiYear'
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
epal.svc.getstudentpromotion:
path: '/epal/get-student-promotion/{didactic_year_id}/{lastname}/{firstname}/{father_firstname}/{mother_firstname}/{birthdate}/{registry_no}/{level_name}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\WSConsumer::getStudentEpalPromotion'
requirements:
_user_is_logged_in: 'TRUE'
epal.svc.getstudentcertification: epal.svc.getstudentcertification:
path: '/epal/get-student-certification/{didactic_year_id}/{lastname}/{firstname}/{father_firstname}/{mother_firstname}/{birthdate}/{registry_no}/{level_name}' path: '/epal/get-student-certification/{id}'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
...@@ -444,3 +436,11 @@ epal.getcoursesperschoolsmallclasses_night: ...@@ -444,3 +436,11 @@ epal.getcoursesperschoolsmallclasses_night:
_controller: '\Drupal\epal\Controller\SmallClassDistribution::getCoursesPerSchoolSmallClassesNight' _controller: '\Drupal\epal\Controller\SmallClassDistribution::getCoursesPerSchoolSmallClassesNight'
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
epal.svc.getstudentinfo:
path: '/epal/get-student-info/{didactic_year_id}/{lastname}/{firstname}/{father_firstname}/{mother_firstname}/{birthdate}/{registry_no}/{registration_no}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\WSConsumer::getStudentEpalInfo'
requirements:
_user_is_logged_in: 'TRUE'
<?php <?php
namespace Drupal\epal; namespace Drupal\epal;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
...@@ -32,7 +32,7 @@ class Client ...@@ -32,7 +32,7 @@ class Client
$this->_settings = array_merge($this->_settings, $settings); $this->_settings = array_merge($this->_settings, $settings);
$this->_settings['ws_endpoint_token'] = "{$this->_settings['ws_endpoint']}/oauth2/token"; $this->_settings['ws_endpoint_token'] = "{$this->_settings['ws_endpoint']}/oauth2/token";
$this->_settings['ws_endpoint_token_granttype'] = 'password'; $this->_settings['ws_endpoint_token_granttype'] = 'password';
$this->_settings['ws_endpoint_studentepalcertification'] = "{$this->_settings['ws_endpoint']}/api/epal/GetStudentEpalCertification"; $this->_settings['ws_endpoint_studentepalInfo'] = "{$this->_settings['ws_endpoint']}/api/epal/GetStudentEpalInfo";
$this->_settings['ws_endpoint_studentepalpromotion'] = "{$this->_settings['ws_endpoint']}/api/epal/GetStudentEpalPromotion"; $this->_settings['ws_endpoint_studentepalpromotion'] = "{$this->_settings['ws_endpoint']}/api/epal/GetStudentEpalPromotion";
$this->_settings['ws_endpoint_alldidactiyear'] = "{$this->_settings['ws_endpoint']}/api/general/GetAllDidactiYear"; $this->_settings['ws_endpoint_alldidactiyear'] = "{$this->_settings['ws_endpoint']}/api/general/GetAllDidactiYear";
} }
...@@ -135,14 +135,52 @@ class Client ...@@ -135,14 +135,52 @@ class Client
* @return boolean|null * @return boolean|null
* @throws \Exception Σε περίπτωση οποιουδήποτε λάθους * @throws \Exception Σε περίπτωση οποιουδήποτε λάθους
*/ */
public function getStudentEpalPromotionOrCertification($endpoint_base_url, $didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $level_name) public function getStudentEpalPromotionOrCertification($endpoint_base_url, $id)
{
if (mb_strlen($id) == 0) {
$this->log(__METHOD__ . " Missing parameters", "error");
throw new Exception('Όλες οι παράμετροι είναι υποχρεωτικοί!!!'.$id, Response::HTTP_BAD_REQUEST);
}
$headers = [
'Accept: application/json',
// 'Accept-Language: en-gb',
'Accept-Language: {"Accept-Language":"en-gb"}', // as per spec provided...
'Audience: Any',
'Authorization: ' . $this->getTokenBearer(),
'User-Agent: OSTEAM Client/v1.1 osteam'
];
$endpoint = $endpoint_base_url."/".intval($id);
$result = $this->get($endpoint, [], $headers); // data as path params...
try {
$crypt = new Crypt();
$val = 'call:' . print_r($endpoint, true) . ':rcv:' . print_r($result, true);
$val_enc = $crypt->encrypt($val);
$this->log(__METHOD__ . $val_enc, 'info');
} catch (\Exception $e) {
$this->log(__METHOD__ . " cannot log encrypted", 'info');
}
if ($result['success'] === false) {
$this->log(__METHOD__ . " Error while calling ws. Diagnostic: {$result['response']}. Response code: {$result['http_status']}", "error");
throw new Exception("Προέκυψε λάθος κατά την άντληση των στοιχείων.");
}
return $result['response'];
}
public function getStudentEpalInfoNew($endpoint_base_url, $didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $registration_no)
{ {
$parts = explode('-', $birthdate, 3); $parts = explode('-', $birthdate, 3);
if (($parts === false) || count($parts) != 3 || checkdate(intval($parts[1]), intval($parts[0]), intval($parts[2])) === false) { if (($parts === false) || count($parts) != 3 || checkdate(intval($parts[1]), intval($parts[0]), intval($parts[2])) === false) {
$this->log(__METHOD__ . " Mallformed birthdate", "error"); $this->log(__METHOD__ . " Mallformed birthdate", "error");
throw new Exception('Η ημερομηνία γέννησης πρέπει να είναι της μορφής Η/Μ/Ε', Response::HTTP_BAD_REQUEST); throw new Exception('Η ημερομηνία γέννησης πρέπει να είναι της μορφής Η/Μ/Ε', Response::HTTP_BAD_REQUEST);
} }
if (mb_strlen($lastname) == 0 || mb_strlen($firstname) == 0 || mb_strlen($father_firstname) == 0 || mb_strlen($mother_firstname) == 0) { if (mb_strlen($registration_no) == 0 || mb_strlen($registry_no) == 0 ) {
$this->log(__METHOD__ . " Missing parameters", "error"); $this->log(__METHOD__ . " Missing parameters", "error");
throw new Exception('Όλες οι παράμετροι είναι υποχρεωτικοί', Response::HTTP_BAD_REQUEST); throw new Exception('Όλες οι παράμετροι είναι υποχρεωτικοί', Response::HTTP_BAD_REQUEST);
} }
...@@ -155,7 +193,7 @@ class Client ...@@ -155,7 +193,7 @@ class Client
'MotherFirstname' => $mother_firstname, 'MotherFirstname' => $mother_firstname,
'BirthDate' => $birthdate, 'BirthDate' => $birthdate,
'RegistryNo' => $registry_no, 'RegistryNo' => $registry_no,
'LevelName' => $level_name 'RegistrationNo' => $registration_no
]; ];
$headers = [ $headers = [
...@@ -190,16 +228,16 @@ class Client ...@@ -190,16 +228,16 @@ class Client
return $result['response']; return $result['response'];
} }
public function getStudentEpalPromotion($didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $level_name) public function getStudentEpalInfo($didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $registration_no)
{ {
$this->log(__METHOD__); $this->log(__METHOD__);
return $this->getStudentEpalPromotionOrCertification($this->_settings['ws_endpoint_studentepalpromotion'], $didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $level_name); return $this->getStudentEpalInfoNew($this->_settings['ws_endpoint_studentepalInfo'], $didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $registration_no);
} }
public function getStudentEpalCertification($didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $level_name) public function getStudentEpalCertification($id)
{ {
$this->log(__METHOD__); $this->log(__METHOD__);
return $this->getStudentEpalPromotionOrCertification($this->_settings['ws_endpoint_studentepalcertification'], $didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $level_name); return $this->getStudentEpalPromotionOrCertification($this->_settings['ws_endpoint_studentepalpromotion'], $id);
} }
protected function setCommonCurlOptions($ch, $uri, $headers) protected function setCommonCurlOptions($ch, $uri, $headers)
......
...@@ -887,13 +887,9 @@ public function GetRegions(Request $request) ...@@ -887,13 +887,9 @@ public function GetRegions(Request $request)
if ($schools) { if ($schools) {
$list = array(); $list = array();
foreach ($schools as $object) foreach ($schools as $object)
{ $SmallClassesAppr = $object -> approved_a -> value ; {
$categ = $object->metathesis_region->value; $SmallClassesAppr = $object -> approved_a -> value ;
$limit = $this->getLimit(1, $categ); if ( $SmallClassesAppr == 1)
$status = $this-> findStatus($object->id(),1, 0, 0);
$stat = intval($status);
$lim = intval($limit);
if ($stat >= $lim || $SmallClassesAppr == 1)
{ {
$prefid = intval($object->getperfecture()); $prefid = intval($object->getperfecture());
$prefectionname = $this -> entityTypeManager ->getStorage('eepal_region') ->loadByProperties(array('id' => $prefid)); $prefectionname = $this -> entityTypeManager ->getStorage('eepal_region') ->loadByProperties(array('id' => $prefid));
...@@ -936,9 +932,8 @@ public function GetSectorsperschool(Request $request, $courseActive ) ...@@ -936,9 +932,8 @@ public function GetSectorsperschool(Request $request, $courseActive )
$list = array(); $list = array();
foreach ($schools as $object) foreach ($schools as $object)
{ {
$lala = $object->epal_id -> entity ->id(); $id_new = $object->epal_id -> entity ->id();
$this->logger->notice($lala); $schooldata = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $id_new));
$schooldata = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $lala));
$sdata = reset($schooldata); $sdata = reset($schooldata);
if (!$sdata){ if (!$sdata){
return $this->respondWithStatus([ return $this->respondWithStatus([
...@@ -947,13 +942,9 @@ public function GetSectorsperschool(Request $request, $courseActive ) ...@@ -947,13 +942,9 @@ public function GetSectorsperschool(Request $request, $courseActive )
} }
else else
{ {
$categ = $sdata -> metathesis_region->value;
$SmallClassesAppr = $object -> approved_sector -> value ; $SmallClassesAppr = $object -> approved_sector -> value ;
$limit = $this->getLimit(2, $categ); if ( $SmallClassesAppr == 1)
$status = $this-> findStatus($object->id(),2, $courseActive, 0);
$stat = intval($status);
$lim = intval($limit);
if ($stat >= $lim || $SmallClassesAppr == 1)
{ {
$prefid = intval($sdata->getperfecture()); $prefid = intval($sdata->getperfecture());
$prefectionname = $this -> entityTypeManager ->getStorage('eepal_region') ->loadByProperties(array('id' => $prefid)); $prefectionname = $this -> entityTypeManager ->getStorage('eepal_region') ->loadByProperties(array('id' => $prefid));
...@@ -1002,9 +993,9 @@ public function getCoursesPerSchoolSmallClasses(Request $request, $courseActive ...@@ -1002,9 +993,9 @@ public function getCoursesPerSchoolSmallClasses(Request $request, $courseActive
$list = array(); $list = array();
foreach ($schools as $object) foreach ($schools as $object)
{ {
$lala = $object->epal_id -> entity ->id(); $id_new = $object->epal_id -> entity ->id();
$this->logger->notice($lala); $this->logger->notice($id_new);
$schooldata = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $lala)); $schooldata = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $id_new));
$sdata = reset($schooldata); $sdata = reset($schooldata);
if (!$sdata){ if (!$sdata){
return $this->respondWithStatus([ return $this->respondWithStatus([
...@@ -1013,13 +1004,9 @@ public function getCoursesPerSchoolSmallClasses(Request $request, $courseActive ...@@ -1013,13 +1004,9 @@ public function getCoursesPerSchoolSmallClasses(Request $request, $courseActive
} }
else else
{ {
$categ = $sdata -> metathesis_region->value;
$SmallClassesAppr = $object -> approved_sector -> value ; $SmallClassesAppr = $object -> approved_sector -> value ;
$limit = $this->getLimit(3, $categ); if ($SmallClassesAppr == 1)
$status = $this-> findStatus($object->id(),3, 0, $courseActive);
$stat = intval($status);
$lim = intval($limit);
if ($stat >= $lim || $SmallClassesAppr == 1)
{ {
$prefid = intval($sdata->getperfecture()); $prefid = intval($sdata->getperfecture());
$prefectionname = $this -> entityTypeManager ->getStorage('eepal_region') ->loadByProperties(array('id' => $prefid)); $prefectionname = $this -> entityTypeManager ->getStorage('eepal_region') ->loadByProperties(array('id' => $prefid));
...@@ -1067,9 +1054,9 @@ public function getCoursesPerSchoolSmallClassesNight(Request $request, $courseAc ...@@ -1067,9 +1054,9 @@ public function getCoursesPerSchoolSmallClassesNight(Request $request, $courseAc
$list = array(); $list = array();
foreach ($schools as $object) foreach ($schools as $object)
{ {
$lala = $object->epal_id -> entity ->id(); $id_new = $object->epal_id -> entity ->id();
$this->logger->notice($lala); $this->logger->notice($id_new);
$schooldata = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $lala)); $schooldata = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $id_new));
$sdata = reset($schooldata); $sdata = reset($schooldata);
if (!$sdata){ if (!$sdata){
return $this->respondWithStatus([ return $this->respondWithStatus([
...@@ -1078,13 +1065,8 @@ public function getCoursesPerSchoolSmallClassesNight(Request $request, $courseAc ...@@ -1078,13 +1065,8 @@ public function getCoursesPerSchoolSmallClassesNight(Request $request, $courseAc
} }
else else
{ {
$categ = $sdata -> metathesis_region->value;
$SmallClassesAppr = $object -> approved_sector -> value ; $SmallClassesAppr = $object -> approved_sector -> value ;
$limit = $this->getLimit(4, $categ); if ($SmallClassesAppr == 1)
$status = $this-> findStatus($object->id(),4, 0, $courseActive);
$stat = intval($status);
$lim = intval($limit);
if ($stat >= $lim || $SmallClassesAppr == 1)
{ {
$prefid = intval($sdata->getperfecture()); $prefid = intval($sdata->getperfecture());
$prefectionname = $this -> entityTypeManager ->getStorage('eepal_region') ->loadByProperties(array('id' => $prefid)); $prefectionname = $this -> entityTypeManager ->getStorage('eepal_region') ->loadByProperties(array('id' => $prefid));
...@@ -1115,7 +1097,8 @@ public function getCoursesPerSchoolSmallClassesNight(Request $request, $courseAc ...@@ -1115,7 +1097,8 @@ public function getCoursesPerSchoolSmallClassesNight(Request $request, $courseAc
} }
} }
...@@ -470,13 +470,16 @@ class SubmitedApplications extends ControllerBase ...@@ -470,13 +470,16 @@ class SubmitedApplications extends ControllerBase
array('choice_no' array('choice_no'
)) ))
->fields('eesch', ->fields('eesch',
array('name' array('id',
'name'
)) ))
->fields('eese', ->fields('eese',
array('name', array('id',
'name'
)) ))
->fields('eesp', ->fields('eesp',
array('name', array('id',
'name',
)) ))
->fields('esc', ->fields('esc',
array('finalized', array('finalized',
...@@ -506,6 +509,7 @@ class SubmitedApplications extends ControllerBase ...@@ -506,6 +509,7 @@ class SubmitedApplications extends ControllerBase
$epalSchoolsChosen = array(); $epalSchoolsChosen = array();
foreach ($epalStudents as $es) { foreach ($epalStudents as $es) {
array_push($epalSchoolsChosen, array( array_push($epalSchoolsChosen, array(
'id' => $es->eesch_id,
'epal_id' => $es->eesch_name, 'epal_id' => $es->eesch_name,
'choice_no' => $es->choice_no, 'choice_no' => $es->choice_no,
)); ));
...@@ -576,14 +580,15 @@ class SubmitedApplications extends ControllerBase ...@@ -576,14 +580,15 @@ class SubmitedApplications extends ControllerBase
'lastschool_class' => $epalStudent->lastschool_class, 'lastschool_class' => $epalStudent->lastschool_class,
'currentclass' => $epalStudent->currentclass, 'currentclass' => $epalStudent->currentclass,
'currentsector' => $epalStudent->eese_name, 'currentsector' => $epalStudent->eese_name,
'currentsector_id' => $epalStudent->eese_id,
'currentcourse' => $epalStudent->eesp_name, 'currentcourse' => $epalStudent->eesp_name,
'currentcourse_id' => $epalStudent->eesp_id,
'regionaddress' => $regionaddress_decoded, 'regionaddress' => $regionaddress_decoded,
'regiontk' => $regiontk_decoded, 'regiontk' => $regiontk_decoded,
'regionarea' => $regionarea_decoded, 'regionarea' => $regionarea_decoded,
'telnum' => $telnum_decoded, 'telnum' => $telnum_decoded,
'relationtostudent' => $epalStudent->relationtostudent, 'relationtostudent' => $epalStudent->relationtostudent,
'birthdate' => substr($epalStudent->birthdate, 8, 2).'/'.substr($epalStudent->birthdate, 5, 2).'/'.substr($epalStudent->birthdate, 0, 4), 'birthdate' => substr($epalStudent->birthdate, 8, 2).'/'.substr($epalStudent->birthdate, 5, 2).'/'.substr($epalStudent->birthdate, 0, 4),
//'created' => date('d/m/Y H:i', $epalStudent->created),
'changed' => date('d/m/Y H:i', $epalStudent->changed), 'changed' => date('d/m/Y H:i', $epalStudent->changed),
'epalSchoolsChosen' => $epalSchoolsChosen, 'epalSchoolsChosen' => $epalSchoolsChosen,
'applicantsResultsDisabled' => $applicantsResultsDisabled, 'applicantsResultsDisabled' => $applicantsResultsDisabled,
...@@ -593,7 +598,6 @@ class SubmitedApplications extends ControllerBase ...@@ -593,7 +598,6 @@ class SubmitedApplications extends ControllerBase
'schoolAddress' => $epalStudent->street_address, 'schoolAddress' => $epalStudent->street_address,
'schoolTel' => $epalStudent->phone_number, 'schoolTel' => $epalStudent->phone_number,
'secondPeriod' => $epalStudent->second_period, 'secondPeriod' => $epalStudent->second_period,
//'secondPeriodSettingEnabled' => $secondPeriodEnabled,
); );
return $this->respondWithStatus( return $this->respondWithStatus(
......
...@@ -65,12 +65,12 @@ class WSConsumer extends ControllerBase ...@@ -65,12 +65,12 @@ class WSConsumer extends ControllerBase
->setStatusCode(Response::HTTP_OK); ->setStatusCode(Response::HTTP_OK);
} }
public function getStudentEpalPromotion($didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $level_name) public function getStudentEpalInfo($didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $registration_no)
{ {
$ts_start = microtime(true); $ts_start = microtime(true);
try { try {
$result = $this->client->getStudentEpalPromotion($didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $level_name); $result = $this->client->getStudentEpalInfo($didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $registration_no);
} catch (\Exception $e) { } catch (\Exception $e) {
return (new JsonResponse(['message' => $e->getMessage()])) return (new JsonResponse(['message' => $e->getMessage()]))
->setStatusCode(($code = $e->getCode()) == 0 ? Response::HTTP_INTERNAL_SERVER_ERROR : $code); ->setStatusCode(($code = $e->getCode()) == 0 ? Response::HTTP_INTERNAL_SERVER_ERROR : $code);
...@@ -86,12 +86,12 @@ class WSConsumer extends ControllerBase ...@@ -86,12 +86,12 @@ class WSConsumer extends ControllerBase
->setStatusCode(Response::HTTP_OK); ->setStatusCode(Response::HTTP_OK);
} }
public function getStudentEpalCertification($didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $level_name) public function getStudentEpalCertification($id)
{ {
$ts_start = microtime(true); $ts_start = microtime(true);
try { try {
$result = $this->client->getStudentEpalCertification($didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $level_name); $result = $this->client->getStudentEpalCertification($id);
} catch (\Exception $e) { } catch (\Exception $e) {
return (new JsonResponse(['message' => $e->getMessage()])) return (new JsonResponse(['message' => $e->getMessage()]))
->setStatusCode(($code = $e->getCode()) == 0 ? Response::HTTP_INTERNAL_SERVER_ERROR : $code); ->setStatusCode(($code = $e->getCode()) == 0 ? Response::HTTP_INTERNAL_SERVER_ERROR : $code);
......
...@@ -595,6 +595,68 @@ public function getperfecture() { ...@@ -595,6 +595,68 @@ public function getperfecture() {
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
$fields['approv_decision'] = BaseFieldDefinition::create('string')
->setLabel(t('Άριθμός Απόφασης'))
->setDescription(t('Δώσε τον αριθμός απόφασης έγκρισης ολιγομελούς'))
->setSettings(array(
'max_length' => 1000,
'text_processing' => 0,
))
->setRequired(false)
->setDefaultValue('')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => -4,
))
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true);
$fields['approv_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);
$fields['approvdate'] = 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') $fields['status'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Publishing status')) ->setLabel(t('Publishing status'))
->setDescription(t('A boolean indicating whether the Eepal school is published.')) ->setDescription(t('A boolean indicating whether the Eepal school is published.'))
......
...@@ -309,6 +309,67 @@ class EepalSectorsInEpal extends ContentEntityBase implements EepalSectorsInEpal ...@@ -309,6 +309,67 @@ class EepalSectorsInEpal extends ContentEntityBase implements EepalSectorsInEpal
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
$fields['approv_decision'] = BaseFieldDefinition::create('string')
->setLabel(t('Άριθμός Απόφασης'))
->setDescription(t('Δώσε τον αριθμός απόφασης έγκρισης ολιγομελούς'))
->setSettings(array(
'max_length' => 1000,
'text_processing' => 0,
))
->setRequired(false)
->setDefaultValue('')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => -4,
))
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true);
$fields['approv_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);
$fields['approvdate'] = 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') $fields['status'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Publishing status')) ->setLabel(t('Publishing status'))
->setDescription(t('A boolean indicating whether the Eepal sectors in epal is published.')) ->setDescription(t('A boolean indicating whether the Eepal sectors in epal is published.'))
......
...@@ -346,6 +346,66 @@ class EepalSpecialtiesInEpal extends ContentEntityBase implements EepalSpecialti ...@@ -346,6 +346,66 @@ class EepalSpecialtiesInEpal extends ContentEntityBase implements EepalSpecialti
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
$fields['approv_decision'] = BaseFieldDefinition::create('string')
->setLabel(t('Άριθμός Απόφασης'))
->setDescription(t('Δώσε τον αριθμός απόφασης έγκρισης ολιγομελούς'))
->setSettings(array(
'max_length' => 1000,
'text_processing' => 0,
))
->setRequired(false)
->setDefaultValue('')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => -4,
))
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true);
$fields['approv_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);
$fields['approvdate'] = BaseFieldDefinition::create('datetime')
->setLabel(t('Ημερομηνία έγκρισης ολιγομελούς'))
->setDescription(t('Δώσε την Ημερομηνία έγκρισης ολιγομελούς'))
->setSetting('datetime_type', 'date')
->setRequired(false)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',