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
......@@ -244,16 +244,8 @@ epal.svc.getdidacticyears:
_controller: '\Drupal\epal\Controller\WSConsumer::getAllDidactiYear'
requirements:
_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:
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:
_auth: [ 'basic_auth' ]
defaults:
......@@ -444,3 +436,11 @@ epal.getcoursesperschoolsmallclasses_night:
_controller: '\Drupal\epal\Controller\SmallClassDistribution::getCoursesPerSchoolSmallClassesNight'
requirements:
_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'
......@@ -32,7 +32,7 @@ class Client
$this->_settings = array_merge($this->_settings, $settings);
$this->_settings['ws_endpoint_token'] = "{$this->_settings['ws_endpoint']}/oauth2/token";
$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_alldidactiyear'] = "{$this->_settings['ws_endpoint']}/api/general/GetAllDidactiYear";
}
......@@ -135,14 +135,52 @@ class Client
* @return boolean|null
* @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);
if (($parts === false) || count($parts) != 3 || checkdate(intval($parts[1]), intval($parts[0]), intval($parts[2])) === false) {
$this->log(__METHOD__ . " Mallformed birthdate", "error");
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");
throw new Exception('Όλες οι παράμετροι είναι υποχρεωτικοί', Response::HTTP_BAD_REQUEST);
}
......@@ -155,7 +193,7 @@ class Client
'MotherFirstname' => $mother_firstname,
'BirthDate' => $birthdate,
'RegistryNo' => $registry_no,
'LevelName' => $level_name
'RegistrationNo' => $registration_no
];
$headers = [
......@@ -190,16 +228,16 @@ class Client
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__);
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__);
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)
......
......@@ -887,13 +887,9 @@ public function GetRegions(Request $request)
if ($schools) {
$list = array();
foreach ($schools as $object)
{ $SmallClassesAppr = $object -> approved_a -> value ;
$categ = $object->metathesis_region->value;
$limit = $this->getLimit(1, $categ);
$status = $this-> findStatus($object->id(),1, 0, 0);
$stat = intval($status);
$lim = intval($limit);
if ($stat >= $lim || $SmallClassesAppr == 1)
{
$SmallClassesAppr = $object -> approved_a -> value ;
if ( $SmallClassesAppr == 1)
{
$prefid = intval($object->getperfecture());
$prefectionname = $this -> entityTypeManager ->getStorage('eepal_region') ->loadByProperties(array('id' => $prefid));
......@@ -936,9 +932,8 @@ public function GetSectorsperschool(Request $request, $courseActive )
$list = array();
foreach ($schools as $object)
{
$lala = $object->epal_id -> entity ->id();
$this->logger->notice($lala);
$schooldata = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $lala));
$id_new = $object->epal_id -> entity ->id();
$schooldata = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $id_new));
$sdata = reset($schooldata);
if (!$sdata){
return $this->respondWithStatus([
......@@ -947,13 +942,9 @@ public function GetSectorsperschool(Request $request, $courseActive )
}
else
{
$categ = $sdata -> metathesis_region->value;
$SmallClassesAppr = $object -> approved_sector -> value ;
$limit = $this->getLimit(2, $categ);
$status = $this-> findStatus($object->id(),2, $courseActive, 0);
$stat = intval($status);
$lim = intval($limit);
if ($stat >= $lim || $SmallClassesAppr == 1)
if ( $SmallClassesAppr == 1)
{
$prefid = intval($sdata->getperfecture());
$prefectionname = $this -> entityTypeManager ->getStorage('eepal_region') ->loadByProperties(array('id' => $prefid));
......@@ -1002,9 +993,9 @@ public function getCoursesPerSchoolSmallClasses(Request $request, $courseActive
$list = array();
foreach ($schools as $object)
{
$lala = $object->epal_id -> entity ->id();
$this->logger->notice($lala);
$schooldata = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $lala));
$id_new = $object->epal_id -> entity ->id();
$this->logger->notice($id_new);
$schooldata = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $id_new));
$sdata = reset($schooldata);
if (!$sdata){
return $this->respondWithStatus([
......@@ -1013,13 +1004,9 @@ public function getCoursesPerSchoolSmallClasses(Request $request, $courseActive
}
else
{
$categ = $sdata -> metathesis_region->value;
$SmallClassesAppr = $object -> approved_sector -> value ;
$limit = $this->getLimit(3, $categ);
$status = $this-> findStatus($object->id(),3, 0, $courseActive);
$stat = intval($status);
$lim = intval($limit);
if ($stat >= $lim || $SmallClassesAppr == 1)
if ($SmallClassesAppr == 1)
{
$prefid = intval($sdata->getperfecture());
$prefectionname = $this -> entityTypeManager ->getStorage('eepal_region') ->loadByProperties(array('id' => $prefid));
......@@ -1067,9 +1054,9 @@ public function getCoursesPerSchoolSmallClassesNight(Request $request, $courseAc
$list = array();
foreach ($schools as $object)
{
$lala = $object->epal_id -> entity ->id();
$this->logger->notice($lala);
$schooldata = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $lala));
$id_new = $object->epal_id -> entity ->id();
$this->logger->notice($id_new);
$schooldata = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $id_new));
$sdata = reset($schooldata);
if (!$sdata){
return $this->respondWithStatus([
......@@ -1078,13 +1065,8 @@ public function getCoursesPerSchoolSmallClassesNight(Request $request, $courseAc
}
else
{
$categ = $sdata -> metathesis_region->value;
$SmallClassesAppr = $object -> approved_sector -> value ;
$limit = $this->getLimit(4, $categ);
$status = $this-> findStatus($object->id(),4, 0, $courseActive);
$stat = intval($status);
$lim = intval($limit);
if ($stat >= $lim || $SmallClassesAppr == 1)
if ($SmallClassesAppr == 1)
{
$prefid = intval($sdata->getperfecture());
$prefectionname = $this -> entityTypeManager ->getStorage('eepal_region') ->loadByProperties(array('id' => $prefid));
......@@ -1118,4 +1100,5 @@ public function getCoursesPerSchoolSmallClassesNight(Request $request, $courseAc
}
......@@ -470,13 +470,16 @@ class SubmitedApplications extends ControllerBase
array('choice_no'
))
->fields('eesch',
array('name'
array('id',
'name'
))
->fields('eese',
array('name',
array('id',
'name'
))
->fields('eesp',
array('name',
array('id',
'name',
))
->fields('esc',
array('finalized',
......@@ -506,6 +509,7 @@ class SubmitedApplications extends ControllerBase
$epalSchoolsChosen = array();
foreach ($epalStudents as $es) {
array_push($epalSchoolsChosen, array(
'id' => $es->eesch_id,
'epal_id' => $es->eesch_name,
'choice_no' => $es->choice_no,
));
......@@ -576,14 +580,15 @@ class SubmitedApplications extends ControllerBase
'lastschool_class' => $epalStudent->lastschool_class,
'currentclass' => $epalStudent->currentclass,
'currentsector' => $epalStudent->eese_name,
'currentsector_id' => $epalStudent->eese_id,
'currentcourse' => $epalStudent->eesp_name,
'currentcourse_id' => $epalStudent->eesp_id,
'regionaddress' => $regionaddress_decoded,
'regiontk' => $regiontk_decoded,
'regionarea' => $regionarea_decoded,
'telnum' => $telnum_decoded,
'relationtostudent' => $epalStudent->relationtostudent,
'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),
'epalSchoolsChosen' => $epalSchoolsChosen,
'applicantsResultsDisabled' => $applicantsResultsDisabled,
......@@ -593,7 +598,6 @@ class SubmitedApplications extends ControllerBase
'schoolAddress' => $epalStudent->street_address,
'schoolTel' => $epalStudent->phone_number,
'secondPeriod' => $epalStudent->second_period,
//'secondPeriodSettingEnabled' => $secondPeriodEnabled,
);
return $this->respondWithStatus(
......
......@@ -65,12 +65,12 @@ class WSConsumer extends ControllerBase
->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);
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) {
return (new JsonResponse(['message' => $e->getMessage()]))
->setStatusCode(($code = $e->getCode()) == 0 ? Response::HTTP_INTERNAL_SERVER_ERROR : $code);
......@@ -86,12 +86,12 @@ class WSConsumer extends ControllerBase
->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);
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) {
return (new JsonResponse(['message' => $e->getMessage()]))
->setStatusCode(($code = $e->getCode()) == 0 ? Response::HTTP_INTERNAL_SERVER_ERROR : $code);
......
......@@ -595,6 +595,68 @@ public function getperfecture() {
->setDisplayConfigurable('form', 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')
->setLabel(t('Publishing status'))
->setDescription(t('A boolean indicating whether the Eepal school is published.'))
......
......@@ -309,6 +309,67 @@ class EepalSectorsInEpal extends ContentEntityBase implements EepalSectorsInEpal
->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')
->setLabel(t('Publishing status'))
->setDescription(t('A boolean indicating whether the Eepal sectors in epal is published.'))
......
......@@ -346,6 +346,66 @@ class EepalSpecialtiesInEpal extends ContentEntityBase implements EepalSpecialti
->setDisplayConfigurable('form', 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['approved_speciality_d'] = BaseFieldDefinition::create('boolean')
......@@ -368,6 +428,66 @@ class EepalSpecialtiesInEpal extends ContentEntityBase implements EepalSpecialti
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['approv_decision_d'] = 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_d'] = 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_d'] = 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'))
......
......@@ -38,13 +38,14 @@ export class RegionSchoolsActions {
});
};
saveRegionSchoolsSelected = (checked, i, j) => {
saveRegionSchoolsSelected = (checked, i, j, orderId: number) => {
return this._ngRedux.dispatch({
type: REGIONSCHOOLS_SELECTED_SAVE,
payload: {
checked: checked,
rIndex: i,
sIndex: j
sIndex: j,
orderId: orderId
}
});
};
......
......@@ -134,14 +134,13 @@ import { IAppState } from "../../store/store";
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-1 ">
<input type="checkbox" [checked]="smallClassApproved" formControlName="smallClassApproved"
(click)="toggleSmallClassesFilter()" >
</div>
<div class="col-md-9">
<label for="smallClassApproved">Ενεργοποίηση της επιλογής για περιορισμό των μη εγκεκριμένων ολιγομελών τμημάτων</label>
<label for="smallClassApproved">Ενεργοποίηση μη διαθεσιμότητας μη εγκεκριμένων τμημάτων</label>
</div>
</div>
<br>
......
......@@ -136,14 +136,50 @@ import {
ngOnInit() {
(<any>$("#applicationFormNotice")).appendTo("body");
window.scrollTo(0, 0);
//new
//this.showLoader.next(true);
this.epalUserDataSub = this.hds.getApplicantUserData().subscribe(x => {
this.epalUserData$.next(x);
this.numAppSelf.next(Number(x.numAppSelf));
this.numAppChildren.next(Number(x.numAppChildren));
this.numChildren.next(Number(x.numChildren));
this.studentDataFieldsSub = this._ngRedux.select("studentDataFields")
.subscribe(studentDataFields => {
let sdfds = <IStudentDataFieldRecords>studentDataFields;
if (sdfds.size > 0) {
sdfds.reduce(({}, studentDataField) => {
//if (this.appUpdate.getValue() && !this.dataEdit.getValue())
this.lastSchName.next((studentDataField.get("lastschool_schoolname")).name);
if (typeof this.lastSchName.getValue() === "undefined" )
this.lastSchName.next("");
this.studentDataGroup.controls["name"].setValue(studentDataField.get("name"));
this.studentDataGroup.controls["studentsurname"].setValue(studentDataField.get("studentsurname"));
this.studentDataGroup.controls["fatherfirstname"].setValue(studentDataField.get("fatherfirstname"));
this.studentDataGroup.controls["motherfirstname"].setValue(studentDataField.get("motherfirstname"));
this.studentDataGroup.controls["regionaddress"].setValue(studentDataField.get("regionaddress"));
this.studentDataGroup.controls["regiontk"].setValue(studentDataField.get("regiontk"));
this.studentDataGroup.controls["regionarea"].setValue(studentDataField.get("regionarea"));
this.studentDataGroup.controls["lastschool_schoolname"].setValue(studentDataField.get("lastschool_schoolname"));
this.studentDataGroup.controls["lastschool_schoolyear"].setValue(studentDataField.get("lastschool_schoolyear"));
this.studentDataGroup.controls["lastschool_class"].setValue(studentDataField.get("lastschool_class"));
this.studentDataGroup.controls["relationtostudent"].setValue(studentDataField.get("relationtostudent"));