...
 
Commits (10)
......@@ -7,7 +7,7 @@ deploysystem.ministry.retrievesettings:
requirements:
_user_is_logged_in: 'TRUE'
deploysystem.ministry.storesettings:
path: '/ministry/store-settings/{capacityDisabled}/{directorViewDisabled}/{applicantsLoginDisabled}/{applicantsAppModifyDisabled}/{applicantsAppDeleteDisabled}/{applicantsResultsDisabled}/{secondPeriodEnabled}/{dateStart}/{smallClass}/{ws}/{gsis}/{guardian}'
path: '/ministry/store-settings/{capacityDisabled}/{directorViewDisabled}/{applicantsLoginDisabled}/{applicantsAppModifyDisabled}/{applicantsAppDeleteDisabled}/{applicantsResultsDisabled}/{secondPeriodEnabled}/{dateStart}/{dateFinal}/{ws}/{gsis}/{guardian}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -23,7 +23,7 @@ deploysystem.ministry.retrievesettings.gel:
requirements:
_user_is_logged_in: 'TRUE'
deploysystem.ministry.storesettings.gel:
path: '/ministry/store-settings-gel/{distr}/{capac}/{directorViewDisabled}/{applicantsLoginDisabled}/{applicantsAppModifyDisabled}/{applicantsAppDeleteDisabled}/{applicantsResultsDisabled}/{secondPeriodEnabled}/{dateStart}/{smallClass}/{ws}/{gsis}/{guardian}'
path: '/ministry/store-settings-gel/{distr}/{capac}/{directorViewDisabled}/{applicantsLoginDisabled}/{applicantsAppModifyDisabled}/{applicantsAppDeleteDisabled}/{applicantsResultsDisabled}/{secondPeriodEnabled}/{dateStart}/{dateFinal}/{ws}/{gsis}/{guardian}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -101,4 +101,20 @@ deploysystem.store_applicantuser:
defaults:
_controller: '\Drupal\deploysystem\Controller\MinisterAdmin::storeApplicantUser'
requirements:
_user_is_logged_in: 'TRUE'
\ No newline at end of file
_user_is_logged_in: 'TRUE'
deploysystem.store_recoveryapplication:
path: '/deploysystem/storerecoveryapplication/{schooltype}/{appid}/{cancelflag}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\deploysystem\Controller\MinisterAdmin::storeRecoveryApplication'
requirements:
_user_is_logged_in: 'TRUE'
deploysystem.get_dde_list:
path: '/deploysystem/getDDElist/{schsearch}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\deploysystem\Controller\CustomViews::getDDElist'
requirements:
_user_is_logged_in: 'TRUE'
......@@ -58,8 +58,7 @@ class MinisterAdmin extends ControllerBase {
}
public function getApplicantUser(Request $request, $taxisuserid)
{
public function getApplicantUser(Request $request, $taxisuserid){
//\Drupal::logger('deploysystem')->info($taxisuserid);
try {
......@@ -96,11 +95,13 @@ class MinisterAdmin extends ControllerBase {
$hashId = hash("sha256", $taxisuserid);
$applicantUsers = $this->entityTypeManager->getStorage('applicant_users')
->loadByProperties(array('taxis_userid' => $hashId ));
$applicantUsers = $this->entityTypeManager->getStorage('applicant_users')->loadByProperties(array('taxis_userid' => $hashId ));
$applicantUser = reset($applicantUsers);
if ($applicantUser) {
$applicantEmails = $this->entityTypeManager->getStorage('user')->load($applicantUser->user_id->target_id);
$applicantEmail = reset($applicantEmails);
$userId = $applicantUser->id->value;
$userNumchildren = $applicantUser->numchildren->value;
$userRepresentative = $applicantUser->representative->value;
......@@ -127,6 +128,7 @@ class MinisterAdmin extends ControllerBase {
'surname' => $userSurname ,
'fathername' => $userFathername ,
'mothername' => $userMothername ,
'email' => $applicantEmail->mail->value,
'numchildren'=> $userNumchildren,
'representative'=> $userRepresentative
], Response::HTTP_OK);
......@@ -135,27 +137,7 @@ class MinisterAdmin extends ControllerBase {
'message' => t("applicant user not found"),
], Response::HTTP_FORBIDDEN);
}
/*
$list = array();
$sCon = $this->connection->select('applicant_users', 'eApplicant');
$sCon->fields('eApplicant', array('id','name', 'surname', 'fathername', 'mothername', 'numchildren', 'representative' ))
->condition('eApplicant.taxis_userid', $taxisuserid , '=');
$applicantuser = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($applicantuser as $object) {
$list[] = array(
'id' => $object -> id,
'name' => $object -> name,
'surname' => $object -> surname,
'fathername' => $object -> fathername,
'mothername' => $object -> mothername,
'numchildren' => $object -> numchildren,
'representative' => $object -> representative
);
}
return $this->respondWithStatus($list, Response::HTTP_OK);
*/
} //end try
......@@ -168,8 +150,7 @@ class MinisterAdmin extends ControllerBase {
}
public function storeApplicantUser(Request $request, $userid, $representative, $numchildren)
{
public function storeApplicantUser(Request $request, $userid, $representative, $numchildren){
try {
if (!$request->isMethod('GET')) {
......@@ -234,4 +215,84 @@ class MinisterAdmin extends ControllerBase {
}
}
public function storeRecoveryApplication(Request $request, $schooltype, $appid, $cancelflag){
//\Drupal::logger('deploysystem storeRecoveryApplication')->info($cancelflag);
try {
if (!$request->isMethod('GET')) {
return $this->respondWithStatus([
"message" => t("Method Not Allowed")
], Response::HTTP_METHOD_NOT_ALLOWED);
}
//user validation
$authToken = $request->headers->get('PHP_AUTH_USER');
$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken));
$user = reset($users);
if (!$user) {
return $this->respondWithStatus([
'message' => t("User not found"),
], Response::HTTP_FORBIDDEN);
}
//user role validation
$roles = $user->getRoles();
$validRole = false;
foreach ($roles as $role)
if ($role === "ministry") {
$validRole = true;
break;
}
if (!$validRole) {
return $this->respondWithStatus([
'message' => t("User Invalid Role"),
], Response::HTTP_FORBIDDEN);
}
if ($schooltype === 'epal') {
$config_storage = $this->entityTypeManager->getStorage('epal_student');
$applications = $config_storage->loadByProperties(array('id' => $appid));
$application = reset($applications);
if (!$application) {
return $this->respondWithStatus([
'message' => t("applicant_users Entity not found"),
], Response::HTTP_FORBIDDEN);
} else {
if ($cancelflag==1) {
$application->set('delapp', 0);
$application->set('delapp_role', NULL);
$application->set('delapp_changed', NULL);
$application->set('delapp_epalid', NULL);
$application->set('delapp_studentid', NULL);
}else{
$application->set('delapp', 1);
$application->set('delapp_role', 'ministry');
$timestamp = strtotime(date("Y-m-d"));
$application->set('delapp_changed', $timestamp);
$application->set('delapp_epalid', NULL);
$application->set('delapp_studentid', NULL);
}
$application->save();
}
}
$config_storage->resetCache();
return $this->respondWithStatus([
'cancelFlag' => ($cancelflag==1?0:1),
'delapp_role' => ($cancelflag==1?'':'ministry')
], Response::HTTP_OK);
} //end try
catch (\Exception $e) {
$this->logger->warning($e->getMessage());
return $this->respondWithStatus([
"message" => t("An unexpected problem occured during storeRecoveryApplication Method ")
], Response::HTTP_INTERNAL_SERVER_ERROR);
}
}
}//end MinisterAdmin
......@@ -103,7 +103,8 @@ class MinisterSettings extends ControllerBase {
$applicantsResultsDisabled = $eggrafesConfig->lock_results->getString();
$secondPeriodEnabled = $eggrafesConfig->activate_second_period->getString();
$dateStart = $eggrafesConfig->date_start_b_period->getString();
$smallClassApproved = $eggrafesConfig->lock_small_classes->getString();
//$smallClassApproved = $eggrafesConfig->lock_small_classes->getString();
$dateAppFinal = $eggrafesConfig->date_app_final->getString();
$wsIdentEnabled = $eggrafesConfig->ws_ident->getString();
$gsisIdentEnabled = $eggrafesConfig->gsis_ident->getString();
$guardianIdentEnabled = $eggrafesConfig->guardian_ident->getString();
......@@ -120,7 +121,8 @@ class MinisterSettings extends ControllerBase {
'applicantsResultsDisabled' => $applicantsResultsDisabled,
'secondPeriodEnabled' => $secondPeriodEnabled,
'dateStart' => $dateStart,
'smallClassApproved' => $smallClassApproved,
//'smallClassApproved' => $smallClassApproved,
'dateFinal' => $dateAppFinal,
'wsIdentEnabled' => $wsIdentEnabled,
'gsisIdentEnabled' => $gsisIdentEnabled,
'guardianIdentEnabled' => $guardianIdentEnabled
......@@ -142,7 +144,7 @@ class MinisterSettings extends ControllerBase {
//refers to EPAL
public function storeSettings(Request $request, $capacityDisabled, $directorViewDisabled, $applicantsLoginDisabled, $applicantsAppModifyDisabled,
$applicantsAppDeleteDisabled, $applicantsResultsDisabled, $secondPeriodEnabled,
$dateStart, $smallClass, $ws, $gsis, $guardian ) {
$dateStart, $dateFinal, $ws, $gsis, $guardian ) {
try {
if (!$request->isMethod('GET')) {
......@@ -192,7 +194,8 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
$eggrafesConfig->set('lock_results', $applicantsResultsDisabled);
$eggrafesConfig->set('activate_second_period', $secondPeriodEnabled);
$eggrafesConfig->set('date_start_b_period', $dateStart);
$eggrafesConfig->set('lock_small_classes', $smallClass);
//$eggrafesConfig->set('lock_small_classes', $smallClass);
$eggrafesConfig->set('date_app_final', $dateFinal);
$eggrafesConfig->set('ws_ident', $ws);
$eggrafesConfig->set('gsis_ident', $gsis);
$eggrafesConfig->set('guardian_ident', $guardian);
......@@ -228,7 +231,8 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
'applicantsResultsDisabled' => $applicantsResultsDisabled,
'secondPeriodEnabled' => $secondPeriodEnabled,
'dateStart' => $dateStart,
'smallClassApproved' =>$smallClass,
//'smallClassApproved' =>$smallClass,
'dateFinal' => $dateFinal,
'$wsIdentEnabled' =>$ws,
'$gsisIdentEnabled' =>$gsis,
'$guardianIdentEnabled' =>$guardian
......@@ -301,7 +305,8 @@ public function retrieveSettingsGel(Request $request) {
$applicantsResultsDisabled = $eggrafesConfig->lock_results->getString();
$secondPeriodEnabled = $eggrafesConfig->activate_second_period->getString();
$dateStart = $eggrafesConfig->date_start_b_period->getString();
$smallClassApproved = $eggrafesConfig->lock_small_classes->getString();
//$smallClassApproved = $eggrafesConfig->lock_small_classes->getString();
$dateAppFinal = $eggrafesConfig->date_app_final->getString();
$wsIdentEnabled = $eggrafesConfig->ws_ident->getString();
$gsisIdentEnabled = $eggrafesConfig->gsis_ident->getString();
$guardianIdentEnabled = $eggrafesConfig->guardian_ident->getString();
......@@ -318,7 +323,8 @@ public function retrieveSettingsGel(Request $request) {
'applicantsResultsDisabled' => $applicantsResultsDisabled,
'secondPeriodEnabled' => $secondPeriodEnabled,
'dateStart' => $dateStart,
'smallClassApproved' => $smallClassApproved,
//'smallClassApproved' => $smallClassApproved,
'dateFinal' => $dateAppFinal,
'wsIdentEnabled' => $wsIdentEnabled,
'gsisIdentEnabled' => $gsisIdentEnabled,
'guardianIdentEnabled' => $guardianIdentEnabled
......@@ -340,7 +346,7 @@ public function retrieveSettingsGel(Request $request) {
public function storeSettingsGel(Request $request, $distr, $capac, $directorViewDisabled, $applicantsLoginDisabled, $applicantsAppModifyDisabled,
$applicantsAppDeleteDisabled, $applicantsResultsDisabled, $secondPeriodEnabled,
$dateStart, $smallClass, $ws, $gsis, $guardian ) {
$dateStart, $dateFinal, $ws, $gsis, $guardian ) {
try {
......@@ -392,7 +398,8 @@ public function storeSettingsGel(Request $request, $distr, $capac, $directorView
$eggrafesConfig->set('lock_results', $applicantsResultsDisabled);
$eggrafesConfig->set('activate_second_period', $secondPeriodEnabled);
$eggrafesConfig->set('date_start_b_period', $dateStart);
$eggrafesConfig->set('lock_small_classes', $smallClass);
//$eggrafesConfig->set('lock_small_classes', $smallClass);
$eggrafesConfig->set('date_app_final', $dateFinal);
$eggrafesConfig->set('ws_ident', $ws );
$eggrafesConfig->set('gsis_ident', $gsis );
$eggrafesConfig->set('guardian_ident', $guardian );
......@@ -427,7 +434,8 @@ public function storeSettingsGel(Request $request, $distr, $capac, $directorView
'applicantsResultsDisabled' => $applicantsResultsDisabled,
'secondPeriodEnabled' => $secondPeriodEnabled,
'dateStart' => $dateStart,
'smallClassApproved' =>$smallClass,
//'smallClassApproved' =>$smallClass,
'dateFinal' => $dateFinal,
'$wsIdentEnabled' =>$ws,
'$gsisIdentEnabled' =>$gsis,
'$guardianIdentEnabled' =>$guardian
......
......@@ -449,6 +449,22 @@ class EggrafesConfig extends ContentEntityBase implements EggrafesConfigInterfac
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['date_app_final'] = 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 Eggrafes config is published.'))
......
......@@ -56,6 +56,8 @@ class CreateEncodedData extends ControllerBase {
public function createData() {
echo date("Y-m-d H:i:s", 1545387433);
$crypt = new Crypt();
//test
......@@ -71,7 +73,7 @@ class CreateEncodedData extends ControllerBase {
//print_r("string to be coded: " . "<br>");
$name_encoded = $crypt->encrypt("*****");
$name_encoded = $crypt->decrypt("def50200b198095553d711e1e7b9679be90aed20b9fe4c9e0a63b1674e7ab541adf68b4b4318229edf3743927ae0e9dc6ecd72d14b36e0c4543c57babe2523e4631b6a7cc68986080759c31a0aa7fdec164690daa7a8949b422fd48c8ad238bc422a7416eb27a2ae");
print_r("Encrypted: " . $name_encoded);
print_r("<br>");
......
......@@ -912,7 +912,14 @@ public function GetRegions(Request $request)
$authToken = $request->headers->get('PHP_AUTH_USER');
$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken));
$user = reset($users);
if (!$user) {
$roles = $user->getRoles();
$validRole = false;
foreach ($roles as $role) {
if ($role === "ministry" || $role === "applicant") $validRole = true;
}
if (!$validRole) {
return $this->respondWithStatus([
'message' => t("User not found"),
], Response::HTTP_FORBIDDEN);
......
......@@ -419,10 +419,28 @@ class SubmitedApplications extends ControllerBase
public function getApplicationDetails(Request $request, $studentId)
{
// \Drupal::logger('epal')->info($studentId);
$authToken = $request->headers->get('PHP_AUTH_USER');
$epalUsers = $this->entityTypeManager->getStorage('applicant_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if ($epalUser) {
$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken));
$user = reset($users);
$roles = $user->getRoles();
$validRole = false;
foreach ($roles as $role) {
if ($role === "ministry") $validRole = true;
if ($role === "applicant"){
$validRole = true;
$epalUsers = $this->entityTypeManager->getStorage('applicant_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
}
}
if ($validRole) {
$config_storage = $this->entityTypeManager->getStorage('eggrafes_config');
$eggrafesConfigs = $config_storage->loadByProperties(array('name' => 'eggrafes_config_epal'));
......@@ -484,6 +502,11 @@ class SubmitedApplications extends ControllerBase
'changed',
'second_period',
'myschool_promoted',
'delapp',
'delapp_changed',
'delapp_role',
'delapp_epalid',
'delapp_studentid'
))
->fields('esec',
array('choice_no'
......@@ -519,7 +542,9 @@ class SubmitedApplications extends ControllerBase
$esQuery->addJoin('left outer', 'epal_student_class', 'esc', 'es.id=esc.student_id');
$esQuery->addJoin('left outer', 'eepal_school_field_data', 'eeschfin', 'esc.epal_id=eeschfin.id');
$esQuery->condition('es.id', intval($studentId), '=');
$esQuery->condition('es.epaluser_id', $epalUser->id(), '=');
if ( $role === "applicant") {
$esQuery->condition('es.epaluser_id', $epalUser->id(), '=');
}
$esQuery->orderBy('esec.choice_no');
$epalStudents = $esQuery->execute()->fetchAll(\PDO::FETCH_OBJ);
......@@ -631,39 +656,39 @@ class SubmitedApplications extends ControllerBase
}
if ($epalStudent->changed != 1529867143)
$appchanged = $epalStudent->changed;
else
$appchanged = $epalStudent->created;
$list[] = array(
'applicationId' => $epalStudent->id,
'am' => $am_decoded,
'name' => $name_decoded,
'studentsurname' => $studentsurname_decoded,
'fatherfirstname' => $fatherfirstname_decoded,
'motherfirstname' => $motherfirstname_decoded,
'guardian_name' => $guardian_name_decoded,
'guardian_surname' => $guardian_surname_decoded,
'guardian_fathername' => $guardian_fathername_decoded,
'guardian_mothername' => $guardian_mothername_decoded,
'lastschool_schoolname' => $epalStudent->lastschool_schoolname,
'lastschool_registrynumber' => $epalStudent->lastschool_registrynumber,
'lastschool_unittypeid' => $epalStudent->lastschool_unittypeid,
'lastschool_schoolyear' => $epalStudent->lastschool_schoolyear,
'lastschool_class' => $epalStudent->lastschool_class,
'am' => ($role === "applicant")?$am_decoded:'',
'name' => ($role === "applicant")?$name_decoded:'',
'studentsurname' => ($role === "applicant")?$studentsurname_decoded:'',
'fatherfirstname' => ($role === "applicant")?$fatherfirstname_decoded:'',
'motherfirstname' => ($role === "applicant")?$motherfirstname_decoded:'',
'guardian_name' => ($role === "applicant")?$guardian_name_decoded:'',
'guardian_surname' => ($role === "applicant")?$guardian_surname_decoded:'',
'guardian_fathername' => ($role === "applicant")?$guardian_fathername_decoded:'',
'guardian_mothername' => ($role === "applicant")?$guardian_mothername_decoded:'',
'lastschool_schoolname' => ($role === "applicant")?$epalStudent->lastschool_schoolname:'',
'lastschool_registrynumber' => ($role === "applicant")?$epalStudent->lastschool_registrynumber:'',
'lastschool_unittypeid' => ($role === "applicant")?$epalStudent->lastschool_unittypeid:'',
'lastschool_schoolyear' => ($role === "applicant")?$epalStudent->lastschool_schoolyear:'',
'lastschool_class' => ($role === "applicant")?$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),
'regionaddress' => ($role === "applicant")?$regionaddress_decoded:'',
'regiontk' => ($role === "applicant")?$regiontk_decoded:'',
'regionarea' => ($role === "applicant")?$regionarea_decoded:'',
'telnum' => ($role === "applicant")?$telnum_decoded:'',
'relationtostudent' => ($role === "applicant")?$epalStudent->relationtostudent:'',
'birthdate' => ($role === "applicant")?substr($epalStudent->birthdate, 8, 2).'/'.substr($epalStudent->birthdate, 5, 2).'/'.substr($epalStudent->birthdate, 0, 4):'',
//'changed' => date('d/m/Y H:i', $epalStudent->changed),
'changed' => date('d/m/Y H:i', $appchanged),
'epalSchoolsChosen' => $epalSchoolsChosen,
......@@ -674,6 +699,11 @@ class SubmitedApplications extends ControllerBase
'schoolAddress' => $epalStudent->street_address,
'schoolTel' => $epalStudent->phone_number,
'secondPeriod' => $epalStudent->second_period,
'delapp' => $epalStudent->delapp,
'delapp_changed' => date('d/m/Y', $epalStudent->delapp_changed),
'delapp_role' => $epalStudent->delapp_role,
'delapp_epalid' => $epalStudent->delapp_epalid,
'delapp_studentid' => $epalStudent->delapp_studentid
);
return $this->respondWithStatus(
......
......@@ -87,11 +87,11 @@ class WSConsumer extends ControllerBase
'custodianFirstName' => 'ΑΝΑΣΤΑΣΙΟΣ',
'birthDate' => '1997-01-04T00:00:00',
'addressStreet' => 'ΧΑΤΖΗ Β. 16',
'addressPostCode' => '26334',
'addressPostCode' => '26333',
'addressArea' => 'ΜΠΕΓΟΥΛΑΚΙ',
'unitTypeDescription' => 'Ημερήσιο ΕΠΑΛ',
'levelName' => 'Γ',
'sectionName' => 'Τεχνικός Μηχανοσυνθέτης Αεροσκαφών',
'unitTypeDescription' => 'Εσπερινό ΕΠΑΛ',
'levelName' => 'Α-ΛΥΚ',
'sectionName' => 'Τεχνικός Μηχανοσυνθέτης',
'promoted' => 1
)
......@@ -162,6 +162,47 @@ class WSConsumer extends ControllerBase
}
public function getStudentEpalPromotion($lastschool_schoolyear,$myschool_id){
$ts_start = microtime(true);
$testmode = true;
$didactic_year_id=$this->getdidacticyear($lastschool_schoolyear);
if ($testmode) {
$obj = array(
'message' => 'Επιτυχία',
'data' => 1
);
return (new JsonResponse($obj))->setStatusCode(Response::HTTP_OK);
}
$ts_start = microtime(true);
try {
$result = $this->client->getStudentEpalPromotion(didactic_year_id,$id);
} catch (\Exception $e) {
return (new JsonResponse(['message' => $e->getMessage()]))
->setStatusCode(($code = $e->getCode()) == 0 ? Response::HTTP_INTERNAL_SERVER_ERROR : $code);
}
$duration = microtime(true) - $ts_start;
$this->logger->info(__METHOD__ . " :: timed [{$duration}]");
return (new JsonResponse([
'message' => 'Επιτυχία',
'data' => $result
]))
->setStatusCode(Response::HTTP_OK);
}
public function getAllStudentEpalPromotion()
{
......@@ -300,6 +341,7 @@ class WSConsumer extends ControllerBase
->setStatusCode(Response::HTTP_OK);
}
/*
public function getStudentEpalPromotion($id)
{
$ts_start = microtime(true);
......@@ -320,6 +362,7 @@ class WSConsumer extends ControllerBase
]))
->setStatusCode(Response::HTTP_OK);
}
*/
public function transitionToBPeriod() {
......
......@@ -47,7 +47,7 @@ gel.applicationdetails:
requirements:
_user_is_logged_in: 'TRUE'
gel.applicant.creationpdf:
path: '/gel/pdf-application/{studentId}/{status}/{schname}/{schaddress}/{schtel}'
path: '/gel/pdf-application/{studentId}/{status}/{schname}/{schaddress}/{schtel}/{schdide}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -79,7 +79,7 @@ gel.gethighschoolsmart:
requirements:
_user_is_logged_in: 'TRUE'
gel.getstudentsperschool:
path: '/gel/getstudentsperschool/{schoolid}/{type}/{addressfilter}/{amfilter}'
path: '/gel/getstudentsperschool/{schoolid}/{class_selected}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -213,4 +213,4 @@ gel.savehighscoolselectionforIDIWT:
defaults:
_controller: '\Drupal\gel\Controller\SdeDistribution::SaveIdiwtStudentHighSchhool'
requirements:
_user_is_logged_in: 'TRUE'
\ No newline at end of file
_user_is_logged_in: 'TRUE'
......@@ -309,23 +309,30 @@ class GelApplicationSubmit extends ControllerBase
//απόφαση: αυτοδίκαια ή μέσω ΔΔΕ τοποθέτηση
list ($gelId, $gelDde, $gelLastSchoolExtraType) = $this->getSchoolIdFromRegNo($applicationForm[0]['lastschool_registrynumber']);
$changeSchType = 0; //η πληροφορία αίτησης για αλλαγή τύπου σχολείου θα βρίσκεται σε νέο πεδίο στη φόρμα αίτησης, έστω $applicationForm[0]['changeschtype']
//η πληροφορία αίτησης για αλλαγή τύπου σχολείου βρίσκεται σε νέο πεδίο στη φόρμα αίτησης, $applicationForm[0]['special_type'],με τιμές ΑΛΛΟ / ΓΕΛ
$distrType = $this->calcDistributionType(
//$applicationForm[0]['lastschool_class'],
$applicationForm[0]['nextclass'],
$applicationForm[0]['lastschool_unittypeid'],
$gelLastSchoolExtraType,
$changeSchType
$applicationForm[0]['special_type']
);
if ($distrType == "dide")
$gelId = null;
if ($applicationForm[0]['assigned_dde'] != null && $applicationForm[0]['assigned_dde'] != '')
$gelDde = $applicationForm[0]['assigned_dde'];
$myschool_promoted = $applicationForm[0]['promoted'];
if ($applicationForm[0]['lastschool_schoolyear'] < self::LIMIT_SCHOOL_YEAR && ($applicationForm[0]['promoted'] == 0 || $applicationForm[0]['promoted'] == null) ) {
if ($applicationForm[0]['app_prom'] == 'Όχι')
$myschool_promoted = 6;
/*
else if ($applicationForm[0]['app_prom'] == 'Ναι' && $applicationForm[0]['lastschool_class'] == '3' &&
($applicationForm[0]['lastschool_unittypeid'] == 3 || $applicationForm[0]['lastschool_unittypeid'] == 6 /*??? ΝΑ ΔΙΕΡΕΥΝΗΘΕΙ: ΠΩΣ ΟΡΙΖΕΤΑΙ Η Γ' ΓΥΜΝΑΣΙΟΥ'*/) )
($applicationForm[0]['lastschool_unittypeid'] == 3 || $applicationForm[0]['lastschool_unittypeid'] == 6 ) )
*/
//αιτήσεις από Γ' Γυμνασίου
else if ($applicationForm[0]['app_prom'] == 'Ναι' && $applicationForm[0]['lastschool_class'] == '33')
$myschool_promoted = 2;
else
$myschool_promoted = 1;
......@@ -342,15 +349,10 @@ class GelApplicationSubmit extends ControllerBase
'myschool_promoted' => $myschool_promoted,
);
$entity_storage_gelresult = $this->entityTypeManager->getStorage('gel_student_class');
$entity_object = $entity_storage_gelresult->create($gelresult);
$entity_storage_gelresult->save($entity_object);
return $this->respondWithStatus([
"error_code" => 0
], Response::HTTP_OK);
......@@ -376,7 +378,7 @@ class GelApplicationSubmit extends ControllerBase
//από Πρότυπο Λύκειο / Πειραματικό Λύκειο / Λύκειο Ειδικής Αγωγής / Λύκειο Διαπολιτισμικής Εκπαίδευσης /
//Μουσικό Γενικό Λύκειο / Εκκλησιαστικό Γενικό Λύκειο ΣΕ ΓΕΛ με αίτησή τους
|| ($last_sch_extratype >= 42 && $last_sch_extratype <= 47 && $change_sch_type == 1)
|| ($last_sch_extratype >= 42 && $last_sch_extratype <= 47 && $change_sch_type == "ΓΕΛ")
//από Ιδιωτικό Λύκειο / Ιδιωτικό Εσπερινό Λύκειο σε ΓΕΛ
|| ($last_sch_extratype == 48 || $last_sch_extratype == 49)
......@@ -398,11 +400,14 @@ class GelApplicationSubmit extends ControllerBase
// Γυμνάσιο Ειδικής Αγωγής με Λυκειακές Τάξεις / Γυμνάσιο Διαπολιτισμικής Εκπαίδευσης με Λυκειακές Τάξεις
// Γυμνάσιο Μειονοτικής Εκπαίδευσης με Λυκειακές Τάξεις /Ειδικό Επαγγελματικό Γυμνάσιο - Λύκειο
//σε ΓΕΛ
|| ($last_sch_extratype >= 662 && $last_sch_extratype <= 669 && $change_sch_type == 1)
|| ($last_sch_extratype >= 662 && $last_sch_extratype <= 669 && $change_sch_type == "ΓΕΛ")
//από Ιδιωτικό Γυμνάσιο με Λυκειακές Τάξεις / Γενικό Εκκλησιαστικό Λύκειο - Γυμνάσιο /Ιεροσπουδαστήριο, σε ΓΕΛ
|| ($last_sch_extratype >= 670 && $last_sch_extratype <= 672)
//από ΣΔΕ / εξωτερικό κλπ
|| ($last_sch_type == 40)
)
$distType = "dide";
......@@ -712,23 +717,30 @@ class GelApplicationSubmit extends ControllerBase
//δημιουργία εγγραφής σε πίνακα αποτελεσμάτων
//απόφαση: αυτοδίκαια ή μέσω ΔΔΕ τοποθέτηση
list ($gelId, $gelDde, $gelLastSchoolExtraType) = $this->getSchoolIdFromRegNo($applicationForm[0]['lastschool_registrynumber']);
$changeSchType = 0; //η πληροφορία αίτησης για αλλαγή τύπου σχολείου θα βρίσκεται σε νέο πεδίο στη φόρμα αίτησης, έστω $applicationForm[0]['changeschtype']
//η πληροφορία αίτησης για αλλαγή τύπου σχολείου βρίσκεται σε νέο πεδίο στη φόρμα αίτησης, $applicationForm[0]['special_type'], με τιμές ΑΛΛΟ / ΓΕΛ
$distrType = $this->calcDistributionType(
//$applicationForm[0]['lastschool_class'],
$applicationForm[0]['nextclass'],
$applicationForm[0]['lastschool_unittypeid'],
$gelLastSchoolExtraType,
$changeSchType
$applicationForm[0]['special_type']
);
if ($distrType == "dide")
$gelId = null;
if ($applicationForm[0]['assigned_dde'] != null && $applicationForm[0]['assigned_dde'] != '')
$gelDde = $applicationForm[0]['assigned_dde'];
$myschool_promoted = $applicationForm[0]['promoted'];
if ($applicationForm[0]['lastschool_schoolyear'] < self::LIMIT_SCHOOL_YEAR && ($applicationForm[0]['promoted'] == 0 || $applicationForm[0]['promoted'] == null) ) {
if ($applicationForm[0]['app_prom'] == 'Όχι')
$myschool_promoted = 6;
/*
else if ($applicationForm[0]['app_prom'] == 'Ναι' && $applicationForm[0]['lastschool_class'] == '3' &&
($applicationForm[0]['lastschool_unittypeid'] == 3 || $applicationForm[0]['lastschool_unittypeid'] == 6 /*??? ΝΑ ΔΙΕΡΕΥΝΗΘΕΙ: ΠΩΣ ΟΡΙΖΕΤΑΙ Η Γ' ΓΥΜΝΑΣΙΟΥ'*/) )
($applicationForm[0]['lastschool_unittypeid'] == 3 || $applicationForm[0]['lastschool_unittypeid'] == 6 ) )
*/
//αιτήσεις από Γ' Γυμνασίου
else if ($applicationForm[0]['app_prom'] == 'Ναι' && $applicationForm[0]['lastschool_class'] == '33')
$myschool_promoted = 2;
else
$myschool_promoted = 1;
......@@ -953,7 +965,7 @@ class GelApplicationSubmit extends ControllerBase
if ($retCode === 0)
return 1026;
// check if application exists in eithe gel_student or epal_student entity
// check if application exists in either gel_student or epal_student entity
if (/*$student['second_period'] == 1 &&*/ $applicantUser !== null && $appUpdate == false) {
$retCode = $this->existApp("gel_student", "gel_userid", $applicantUser, $student);
if ($retCode === -1) {
......@@ -1019,6 +1031,15 @@ class GelApplicationSubmit extends ControllerBase
)
return 1;
//απόφοιτοι ΣΔΕ κλπ
else if (
($last_class == "33")
&& ($next_class == 1 || $next_class == 4 )
&& ($last_sch_type == "40")
&& $validation_type == "NEXTCLASS"
)
return 1;
//ποιοι πάνε στην B' ΓΕΛ
//ΦΕΚ: Στη Β ́ τάξη εγγράφονται οι προαγόμενοι/ες από την A ́τάξη ημερήσιου ή εσπερινού ΓΕ.Λ.,
//όσοι/ες έχουν απορριφθεί στη Β ́ ημερήσιου ή εσπερινού ΓΕ.Λ.
......@@ -1179,4 +1200,4 @@ class GelApplicationSubmit extends ControllerBase
}
}
}
\ No newline at end of file
......@@ -363,8 +363,8 @@ class SdeDistribution extends ControllerBase
->fields('gSchool', array('id', 'name','edu_admin_id', 'registry_no','extra_unitid'))
->condition('gStudent.delapp', 0, '=')
//->condition('gStudent.id', $invalid_ids, 'IN')
->condition(db_or()->condition('gStudent.id', $invalid_ids, 'IN')->condition(db_and()->condition('gStudent.created', 1535662800,">")->condition('gStudent.created', 1544313600,"<")))
->condition(db_or()->condition('gSchool.extra_unitid', 300 , '=') ->condition('gSchool.extra_unitid',1300,'='));
//->condition(db_or()->condition('gStudent.id', $invalid_ids, 'IN')->condition(db_and()->condition('gStudent.created', 1535662800,">")->condition('gStudent.created', 1544313600,"<")))
->condition(db_or()->condition('gSchool.extra_unitid', 48 , '=') ->condition('gSchool.extra_unitid',49,'=')->condition('gSchool.extra_unitid',54,'=')->condition('gSchool.extra_unitid',57,'=')->condition('gSchool.extra_unitid',340,'='));
//->condition('gSchool.extra_unitid',300,'=');
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......
......@@ -315,7 +315,7 @@ class GelStudentClass extends ContentEntityBase implements GelStudentClassInterf
->setLabel(t('Κατάσταση αποτελέσματος'))
->setDescription(t('Κατάσταση αποτελέσματος'))
->setSettings(array(
'max_length' => 15,
'max_length' => 20,
'text_processing' => 0,
))
->setRequired(FALSE)
......
......@@ -10,11 +10,10 @@ import { ILoginInfoRecords } from "../../store/logininfo/logininfo.types";
import { IAppState } from "../../store/store";
@Component({
selector: "admin-minister-settings",
selector: "admin-minister-authorize",
template: `
<div
class = "loading" *ngIf="(dataRetrieved == -1 || (showLoader | async) === true)" >
<div class = "loading" *ngIf="(dataRetrieved == -1 || (showLoader | async) === true)" >
</div>
......@@ -40,7 +39,7 @@ import { IAppState } from "../../store/store";
<div *ngIf="(loginInfo$ | async).size !== 0">
<form novalidate [formGroup]="formSearch">
<h5> >Εξουσιοδότηση Διευθυντή </h5><br><br>
<h5> Εξουσιοδότηση Διευθυντή </h5><br><br>
<div class="row">
<div class="col-md-9">
......@@ -73,7 +72,7 @@ import { IAppState } from "../../store/store";
<p *ngIf="surname"><b>Επώνυμο:</b> {{surname}} </p>
<p *ngIf="fathername"><b>Όνομα Πατέρα:</b> {{fathername}} </p>
<p *ngIf="mothername"><b>Όνομα Μητέρας:</b> {{mothername}} </p>
<p *ngIf="email"><b>E-mail:</b> {{email}} </p>
<p>
<label>Ενεργοποίηση Εξουσιοδότησης Υποβολής Αίτησης</label>
<input type="checkbox" formControlName="representative" (click)="toggleRepresentative()" >
......@@ -127,6 +126,7 @@ import { IAppState } from "../../store/store";
private surname: string;
private mothername: string;
private fathername: string;
private email: string;
private numchildren: number;
private representative: boolean;
......@@ -254,9 +254,6 @@ import { IAppState } from "../../store/store";
}
toggleRepresentative(){
this.representative = !this.representative;
}
retrieveApplicantUser(taxisid) {
......@@ -270,6 +267,7 @@ import { IAppState } from "../../store/store";
this.surname = this.settings$.value["surname"];
this.mothername = this.settings$.value["mothername"];
this.fathername = this.settings$.value["fathername"];
this.email = this.settings$.value["email"];
this.numchildren = Number(this.settings$.value["numchildren"]);
this.representative = Boolean(Number(this.settings$.value["representative"]));
......
This diff is collapsed.
......@@ -145,15 +145,23 @@ import { IAppState } from "../../store/store";
</div>
</div>
</div>
<div class="row">
<div class="col-md-1 ">
<input type="checkbox" [checked]="smallClassApproved" formControlName="smallClassApproved"
(click)="toggleSmallClassesFilter()" >
<div class="col-md-1"></div>
<div class="col-md-9">
<label for="appfinaldate">Ημερομηνία οριστικοποίησης αιτήσεων(<span style="color: #ff0000;">*</span>)</label>
</div>
</div>
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-9">
<label for="smallClassApproved">Ενεργοποίηση μη διαθεσιμότητας μη εγκεκριμένων τμημάτων</label>
<my-date-picker name="appfinaldate" [options]="myDatePickerOptions" formControlName="appfinaldate" locale="el"></my-date-picker>
<div class="alert alert-danger" *ngIf="formGroup.get('appfinaldate').touched && formGroup.get('appfinaldate').hasError('required')">
Συμπληρώστε την ημερομηνία οριστικοποίησης!
</div>
</div>
</div>
<br>
<div class="row">
......@@ -189,9 +197,10 @@ import { IAppState } from "../../store/store";
</div>
<br>
<button type="submit" class="btn btn-md pull-right" (click)="storeSettings()" [disabled] = "secondPeriodEnabled && formGroup.get('distributionstartdate').hasError('required')" >
<button type="submit" class="btn btn-md pull-right" (click)="storeSettings()"
[disabled] = "(secondPeriodEnabled && formGroup.get('distributionstartdate').hasError('required') ) || formGroup.get('appfinaldate').hasError('required')" >
Εφαρμογή
</button>
</button>
</form>
......@@ -221,8 +230,8 @@ import { IAppState } from "../../store/store";
private applicantsResultsDisabled: boolean;
private secondPeriodEnabled: boolean;
private dateStartBPeriod: string;
private dateAppFinal: string;
private dataRetrieved: number;
private smallClassApproved: boolean;
private wsIdentEnabled: boolean;
private gsisIdentEnabled: boolean;
private guardianIdentEnabled: boolean;
......@@ -253,13 +262,12 @@ import { IAppState } from "../../store/store";
applicantsResultsDisabled: ["", []],
secondPeriodEnabled: ["", []],
distributionstartdate:["", [Validators.required]],
smallClassApproved:["",[]],
appfinaldate:["", [Validators.required]],
wsIdentEnabled:["",[]],
gsisIdentEnabled:["",[]],
guardianIdentEnabled:["",[]],
});
this.formGroup.get("smallClassApproved").disable();
this.formGroup.get("capacityDisabled").disable();
this.loginInfo$ = new BehaviorSubject(LOGININFO_INITIAL_STATE);
......@@ -336,8 +344,14 @@ import { IAppState } from "../../store/store";
let dateparts = this.dateStartBPeriod.split("-",3);
this.formGroup.controls["distributionstartdate"].setValue( {date: {year: Number(dateparts[2]), month: Number(dateparts[1]), day: Number(dateparts[0])}} );
}
//this.formGroup.controls["distributionstartdate"].setValue(this.populateDate(this.dateStartBPeriod));
this.smallClassApproved = Boolean(Number(this.settings$.value["smallClassApproved"]));
this.dateAppFinal = this.settings$.value["dateFinal"];
//this.dateAppFinal = ''; //temporary
if (this.dateAppFinal != '') {
let dateparts = this.dateAppFinal.split("-",3);
this.formGroup.controls["appfinaldate"].setValue( {date: {year: Number(dateparts[2]), month: Number(dateparts[1]), day: Number(dateparts[0])}} );
}
this.wsIdentEnabled = Boolean(Number(this.settings$.value["wsIdentEnabled"]));
this.gsisIdentEnabled = Boolean(Number(this.settings$.value["gsisIdentEnabled"]));
this.guardianIdentEnabled = Boolean(Number(this.settings$.value["guardianIdentEnabled"]));
......@@ -363,10 +377,14 @@ import { IAppState } from "../../store/store";
else
this.dateStartBPeriod = "0-0-0000";
this.dateAppFinal = this.formGroup.controls["appfinaldate"].value.date.day + "-" +
this.formGroup.controls["appfinaldate"].value.date.month + "-" +
this.formGroup.controls["appfinaldate"].value.date.year;
this.settingsSub = this._hds.storeAdminSettings("gel", this.minedu_userName, this.minedu_userPassword, this.distribDisabled,
this.capacityDisabled, this.directorViewDisabled, this.applicantsLoginDisabled,
this.applicantsAppModifyDisabled, this.applicantsAppDeleteDisabled, this.applicantsResultsDisabled,
this.secondPeriodEnabled, this.dateStartBPeriod, this.smallClassApproved,
this.secondPeriodEnabled, this.dateStartBPeriod, this.dateAppFinal,
this.wsIdentEnabled, this.gsisIdentEnabled, this.guardianIdentEnabled)
.subscribe(data => {
this.settings$.next(data);
......@@ -420,29 +438,6 @@ import { IAppState } from "../../store/store";
this.secondPeriodEnabled = !this.secondPeriodEnabled;
}
toggleSmallClassesFilter(){
/*
if (this.smallClassApproved == false)
{
this.showLoader.next(true);
this.OffLineCalculationSub = this._hds.OffLinecalculationofSmallClasses(this.minedu_userName, this.minedu_userPassword)
.subscribe(data => {
this.showLoader.next(false);
this.OffLineCalculation$.next(data);
},
error => {
this.showLoader.next(false);
console.log("Error for the offlineCalculation");
});
}
this.smallClassApproved =!this.smallClassApproved;
*/
}
toggleWsIdent(){
this.wsIdentEnabled =!this.wsIdentEnabled;
}
......
......@@ -155,15 +155,23 @@ import { IAppState } from "../../store/store";
</div>
</div>
</div>
<div class="row">
<div class="col-md-1 ">
<input type="checkbox" [checked]="smallClassApproved" formControlName="smallClassApproved"
(click)="toggleSmallClassesFilter()" >
</div>
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-9">
<label for="smallClassApproved">Ενεργοποίηση μη διαθεσιμότητας μη εγκεκριμένων τμημάτων</label>
</div>
</div>
<label for="appfinaldate">Ημερομηνία οριστικοποίησης αιτήσεων(<span style="color: #ff0000;">*</span>)</label>
</div>
</div>
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-9">
<my-date-picker name="appfinaldate" [options]="myDatePickerOptions" formControlName="appfinaldate" locale="el"></my-date-picker>
<div class="alert alert-danger" *ngIf="formGroup.get('appfinaldate').touched && formGroup.get('appfinaldate').hasError('required')">
Συμπληρώστε την ημερομηνία οριστικοποίησης!
</div>
</div>
</div>
<br>
<div class="row">
......@@ -199,7 +207,8 @@ import { IAppState } from "../../store/store";
</div>
<br>
<button type="submit" class="btn btn-md pull-right" (click)="storeSettings()" [disabled] = "secondPeriodEnabled && formGroup.get('distributionstartdate').hasError('required')" >
<button type="submit" class="btn btn-md pull-right" (click)="storeSettings()"
[disabled] = "(secondPeriodEnabled && formGroup.get('distributionstartdate').hasError('required')) " >
Εφαρμογή
</button>
......@@ -230,8 +239,8 @@ import { IAppState } from "../../store/store";
private applicantsResultsDisabled: boolean;
private secondPeriodEnabled: boolean;
private dateStartBPeriod: string;
private dateAppFinal: string;
private dataRetrieved: number;
private smallClassApproved: boolean;
private wsIdentEnabled: boolean;
private gsisIdentEnabled: boolean;
private guardianIdentEnabled: boolean;
......@@ -261,14 +270,12 @@ import { IAppState } from "../../store/store";
applicantsResultsDisabled: ["", []],
secondPeriodEnabled: ["", []],
distributionstartdate:["", [Validators.required]],
smallClassApproved:["",[]],
appfinaldate:["", [Validators.required]],
wsIdentEnabled:["",[]],
gsisIdentEnabled:["",[]],
guardianIdentEnabled:["",[]],
});
this.formGroup.get("smallClassApproved").disable();
this.loginInfo$ = new BehaviorSubject(LOGININFO_INITIAL_STATE);
this.settings$ = new BehaviorSubject([{}]);
this.modalTitle = new BehaviorSubject("");
......@@ -277,6 +284,8 @@ import { IAppState } from "../../store/store";
this.OffLineCalculation$ = new BehaviorSubject([{}]);
this.showLoader = new BehaviorSubject(false);
this.formGroup.controls["appfinaldate"].disable();
}
public showModal(popupMsgId): void {
......@@ -344,8 +353,13 @@ import { IAppState } from "../../store/store";
let dateparts = this.dateStartBPeriod.split("-",3);
this.formGroup.controls["distributionstartdate"].setValue( {date: {year: Number(dateparts[2]), month: Number(dateparts[1]), day: Number(dateparts[0])}} );
}
//this.formGroup.controls["distributionstartdate"].setValue(this.populateDate(this.dateStartBPeriod));
this.smallClassApproved = Boolean(Number(this.settings$.value["smallClassApproved"]));
this.dateAppFinal = this.settings$.value["dateFinal"];
if (this.dateAppFinal != '') {
let dateparts = this.dateAppFinal.split("-",3);
this.formGroup.controls["appfinaldate"].setValue( {date: {year: Number(dateparts[2]), month: Number(dateparts[1]), day: Number(dateparts[0])}} );
}
this.wsIdentEnabled = Boolean(Number(this.settings$.value["wsIdentEnabled"]));
this.gsisIdentEnabled = Boolean(Number(this.settings$.value["gsisIdentEnabled"]));
this.guardianIdentEnabled = Boolean(Number(this.settings$.value["guardianIdentEnabled"]));
......@@ -371,11 +385,14 @@ import { IAppState } from "../../store/store";
else
this.dateStartBPeriod = "0-0-0000";
this.dateAppFinal = this.formGroup.controls["appfinaldate"].value.date.day + "-" +
this.formGroup.controls["appfinaldate"].value.date.month + "-" +
this.formGroup.controls["appfinaldate"].value.date.year;
this.settingsSub = this._hds.storeAdminSettings("epal", this.minedu_userName, this.minedu_userPassword, null,
this.capacityDisabled, this.directorViewDisabled, this.applicantsLoginDisabled,
this.applicantsAppModifyDisabled, this.applicantsAppDeleteDisabled, this.applicantsResultsDisabled,
this.secondPeriodEnabled, this.dateStartBPeriod, this.smallClassApproved,
this.secondPeriodEnabled, this.dateStartBPeriod, this.dateAppFinal,
this.wsIdentEnabled, this.gsisIdentEnabled, this.guardianIdentEnabled)
.subscribe(data => {
this.settings$.next(data);
......@@ -426,6 +443,7 @@ import { IAppState } from "../../store/store";
this.secondPeriodEnabled = !this.secondPeriodEnabled;
}
/*
toggleSmallClassesFilter(){
if (this.smallClassApproved == false)
......@@ -447,6 +465,7 @@ import { IAppState } from "../../store/store";
this.smallClassApproved =!this.smallClassApproved;
}
*/
toggleWsIdent(){
this.wsIdentEnabled =!this.wsIdentEnabled;
......
......@@ -98,7 +98,7 @@ export default class MinistryHome implements OnInit, OnDestroy {
else if (this.mineduUsername.slice(-1) === "2")
this.router.navigate(["/ministry/minister-settings"]);
else if (this.mineduUsername.slice(-1) === "3")
this.router.navigate(["/ministry/admin-minister-settings"]);
this.router.navigate(["/ministry/admin-minister-authorize"]);
}
return loginInfoObj;
}, {});
......
......@@ -53,7 +53,7 @@
<div *ngIf="(loginInfo$ | async).size > 0 && (userType | async) === 'epal'" class="nav-item">
<li *ngIf="authRole=='supervisor'" class="nav-item">
<a class="nav-link" [routerLink]="['/ministry/minister-settings']" [routerLinkActive]="['active']"><b>Ρυθμίσεις</b></a>
<a class="nav-link" [routerLink]="['/ministry/minister-authorize']" [routerLinkActive]="['active']"><b>Ρυθμίσεις</b></a>
</li>
</div>
<div *ngIf="(loginInfo$ | async).size > 0 && (userType | async) === 'epal'" class="nav-item">
......@@ -123,7 +123,12 @@
<div *ngIf="(loginInfo$ | async).size > 0 && (userType | async) === 'admin'" class="nav-item">
<li *ngIf="authRole=='supervisor'" class="nav-item">
<a class="nav-link" [routerLink]="['/ministry/admin-minister-settings']" [routerLinkActive]="['active']"><b>Εξουσιοδότηση Δ/ντή</b></a>
<a class="nav-link" [routerLink]="['/ministry/admin-minister-authorize']" [routerLinkActive]="['active']"><b>Εξουσιοδότηση Δ/ντή</b></a>
</li>
</div>
<div *ngIf="(loginInfo$ | async).size > 0 && (userType | async) === 'admin'" class="nav-item">
<li *ngIf="authRole=='supervisor'" class="nav-item">
<a class="nav-link" [routerLink]="['/ministry/admin-minister-recovery']" [routerLinkActive]="['active']"><b>Ανάκτηση Αίτησης</b></a>
</li>
</div>
......
......@@ -64,6 +64,7 @@ import {
private numChildren: BehaviorSubject<number>;
private representativeRole: BehaviorSubject<boolean>;
private wsEnabled: BehaviorSubject<number>;
private bypassGuardianVer: number;
private myDatePickerOptions: IMyDpOptions = {
......@@ -136,6 +137,7 @@ import {
this.numChildren = new BehaviorSubject(0);
this.representativeRole = new BehaviorSubject(false);
this.wsEnabled = new BehaviorSubject(-1);
this.bypassGuardianVer = 0;
this.studentDataFields$ = new BehaviorSubject(STUDENT_DATA_FIELDS_INITIAL_STATE);
this.studentDataGroup = this.fb.group({
......@@ -169,7 +171,7 @@ import {
this.numAppRepresent.next(Number(x.numAppRepresent));
this.numChildren.next(Number(x.numChildren));
if (Number(x.representRole) == 1) {
//this.bypassGuardianVer = 1;
this.bypassGuardianVer = 1;
this.representativeRole.next(true);
}
else
......
......@@ -37,7 +37,7 @@ import {
private loginInfo$: BehaviorSubject<ILoginInfoRecords>;
private studentDataFields$: BehaviorSubject<IGelStudentDataFieldRecords>;
private DDE$: BehaviorSubject<any[]>;
//private DDE$: BehaviorSubject<any[]>;
//private datamode$: BehaviorSubject<IDataModeRecords>;
......@@ -200,7 +200,7 @@ import {
this.isAppPromDisabled = new BehaviorSubject(true);
this.school_special_type = new BehaviorSubject(false);
this.specials = new Set([42,43,46,662,664,665]);
this.DDE$ = new BehaviorSubject(null);
//this.DDE$ = new BehaviorSubject(null);
this.lastDDEName = new BehaviorSubject("");
this.isDDEDisabled = new BehaviorSubject(true);
this.isStudentDataDisabled = new BehaviorSubject(true);
......@@ -409,16 +409,34 @@ import {
this.studentDataGroup.controls["am"].updateValueAndValidity();
}
else {
this.studentDataGroup.controls["regionaddress"].setValidators(null);
this.studentDataGroup.controls["regiontk"].setValidators(null);
this.studentDataGroup.controls["regionarea"].setValidators(null);
this.studentDataGroup.controls["lastschool_class"].setValidators(null);
this.studentDataGroup.controls["lastschool_class"].updateValueAndValidity();
this.studentDataGroup.controls["regionaddress"].updateValueAndValidity();
this.studentDataGroup.controls["regiontk"].updateValueAndValidity();
this.studentDataGroup.controls["regionarea"].updateValueAndValidity();
//Προσοχή: να μεταφερθούν τα data από το store στα controls, διαφορετικά χάνονται στο edit (πχ διευθύνσεις κατοικίας!!!)
//this.studentDataGroup.controls["regionaddress"].setValidators(null);
//this.studentDataGroup.controls["regiontk"].setValidators(null);
//this.studentDataGroup.controls["regionarea"].setValidators(null);
//Προσοχή: να μεταφερθούν τα data από το store στα controls, διαφορετικά χάνονται στο edit (πχ διευθύνσεις κατοικίας!!!)
//this.studentDataGroup.controls["lastschool_class"].setValidators(null);
//this.studentDataGroup.controls["lastschool_class"].updateValueAndValidity();
//this.studentDataGroup.controls["regionaddress"].updateValueAndValidity();
//this.studentDataGroup.controls["regiontk"].updateValueAndValidity();
//this.studentDataGroup.controls["regionarea"].updateValueAndValidity();
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["am"].setValue(studentDataField.get("am"));
this.studentDataGroup.controls["lastschool_class"].setValue(studentDataField.get("lastschool_class"));
this.studentDataGroup.controls["myschool_studentid"].setValue(studentDataField.get("myschool_studentid"));
this.studentDataGroup.controls["myschool_unit_type_description"].setValue(studentDataField.get("myschool_unit_type_description"));
this.studentDataGroup.controls["myschool_level_name"].setValue(studentDataField.get("myschool_level_name"));
this.studentDataGroup.controls["myschool_section_name"].setValue(studentDataField.get("myschool_section_name"));
this.studentDataGroup.controls["myschool_promoted"].setValue(studentDataField.get("myschool_promoted"));
this.studentDataGroup.controls["am"].setValue(studentDataField.get("am"));
}
}
......@@ -705,7 +723,9 @@ import {
this.studentDataGroup.controls["lastschool_class"].updateValueAndValidity();
}
}
else{
//case web service = disabled is obsolete!
/*
else {
this.studentDataGroup.controls["regionaddress"].setValidators([Validators.pattern(VALID_ADDRESS_PATTERN), Validators.required]);
this.studentDataGroup.controls["regiontk"].setValidators([Validators.pattern(VALID_ADDRESSTK_PATTERN), Validators.required]);
......@@ -726,6 +746,7 @@ import {
this.studentDataGroup.controls["am"].updateValueAndValidity();
}
}
*/
if (this.specials.has(Number(this.studentDataGroup.controls["lastschool_schoolname"].value.extra_unitid)) && this.studentDataGroup.controls["lastschool_class"].value != "33"){
......@@ -740,29 +761,6 @@ import {
}
this.studentDataGroup.controls["special_type"].updateValueAndValidity();
/*
if (this.studentDataGroup.controls["lastschool_schoolname"].value.unit_type_id == 40){
this.DDESub = this.hds.getDDE().subscribe(dde => {
let dieyth=dde;
let retArr = <any>Array();
for (let i = 0; i < dde.length; i++) {
retArr[i] = {};
retArr[i].id = dde[i].id;
retArr[i].name = dde[i].name;
}
this.DDE$.next(retArr);
});
this.studentDataGroup.controls["assigned_dde"].setValidators(this.checkChoice);
}
else{
this.studentDataGroup.controls["assigned_dde"].setValue("");
this.studentDataGroup.controls["assigned_dde"].setValidators(null);
}
this.studentDataGroup.controls["assigned_dde"].updateValueAndValidity();
*/
if ( (this.studentDataGroup.controls["lastschool_schoolyear"].value == this.currentSchYear || this.studentDataGroup.controls["lastschool_schoolyear"].value == "")
&& this.studentDataGroup.controls["lastschool_schoolname"].value.unit_type_id != 40) {
this.studentDataGroup.controls["app_prom"].setValue("");
......@@ -788,7 +786,10 @@ import {
this.studentDataGroup.controls["assigned_dde"].updateValueAndValidity();
//make student personal data enabled or disabled
if ( this.studentDataGroup.controls["lastschool_schoolyear"].value < this.limitSchoolYear) {
if (
this.studentDataGroup.controls["lastschool_schoolyear"].value < this.limitSchoolYear
|| this.studentDataGroup.controls["lastschool_schoolname"].value.unit_type_id == 40
) {
this.isStudentDataDisabled.next(false);
this.enableStudentData();
}
......
......@@ -429,3 +429,8 @@ label {
pointer-events:none;
opacity:0.6;
}
.studentsDDE {
max-height: 800px;
overflow: scroll;
}
\ No newline at end of file
......@@ -19,7 +19,8 @@ import UpdatePromotion from "../components/minister/minister-updatepromotion";
import MinisterReports from "../components/minister/minister-reports";
import MinisterSettings from "../components/minister/minister-settings";
import GelMinisterSettings from "../components/minister/gel-minister-settings";
import AdminMinisterSettings from "../components/minister/admin-minister-settings";
import AdminMinisterAuthorize from "../components/minister/admin-minister-authorize";
import AdminMinisterRecovery from "../components/minister/admin-minister-recovery";
import MinisterView from "../components/minister/minister-view";
import ReportAllStat from "../components/minister/report-all-stat";
import ReportGeneral from "../components/minister/report-general";
......@@ -86,6 +87,9 @@ import ReportCapacity from "../components/director/report-capacity";
import ReportEpalApplications from "../components/director/report-epal-applications";
import ReportGelApplications from "../components/director/report-gel-applications";
import ReportGelChoices from "../components/director/report-gel-choices";
import { SortingStudentsPipe } from "../pipes/sortingstudents";
import { FilterAddressPipe } from "../pipes/filteraddress";
export const MainRoutes: Routes = [
......@@ -133,7 +137,8 @@ export const MainRoutes: Routes = [
{ path: "ministry/minister-updatepromotion", component: UpdatePromotion, canActivate: [MinistryAuthGuard] },
{ path: "ministry/minister-settings", component: MinisterSettings, canActivate: [MinistryAuthGuard] },
{ path: "ministry/gel-minister-settings", component: GelMinisterSettings, canActivate: [MinistryAuthGuard] },
{ path: "ministry/admin-minister-settings", component: AdminMinisterSettings, canActivate: [MinistryAuthGuard] },
{ path: "ministry/admin-minister-authorize", component: AdminMinisterAuthorize, canActivate: [MinistryAuthGuard] },
{ path: "ministry/admin-minister-recovery", component: AdminMinisterRecovery, canActivate: [MinistryAuthGuard] },
{ path: "school/perfecture-view", component: PerfectureView, canActivate: [RegionEduAuthGuard] },
{ path: "school/eduadmin-view", component: EduadminView, canActivate: [EduAdminAuthGuard] },
{ path: "school/mergeschools", component: MergeSchools, canActivate: [DidepdeAuthGuard] },
......@@ -164,6 +169,8 @@ export const MainRoutes: Routes = [
];
export const MainDeclarations = [
FilterAddressPipe,
SortingStudentsPipe,
CamelCasePipe,
RemoveSpaces,
Home,
......@@ -200,7 +207,8 @@ export const MainDeclarations = [
UpdatePromotion,
MinisterSettings,
GelMinisterSettings,
AdminMinisterSettings,
AdminMinisterAuthorize,
AdminMinisterRecovery,
PerfectureView,
Breadcrumbs,
DirectorButtons,
......@@ -233,4 +241,4 @@ export const MainDeclarations = [
DirectorViewGel,
EduadminGelView,
DirectorViewGym,
];
];
\ No newline at end of file
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'filteraddress'
})
export class FilterAddressPipe implements PipeTransform {
transform(items: any[], searchText: string): any[] {
console.log(items);
console.log(searchText);
//if(!items) return [];
if(searchText=="") return items;
//console.log(searchText.value);
//searchText = searchText.toString().toLowerCase();
return items.filter( it => {
//return it.toString().toLowerCase().includes(searchText);
console.log(it.regionaddress);
if (it.regionaddress && it.regionarea){
return (it.regionaddress.toLowerCase().includes(searchText.toLowerCase()) || it.regionarea.toLowerCase().includes(searchText.toLowerCase()));
}
else if (it.regionaddress){
return it.regionaddress.toLowerCase().includes(searchText.toLowerCase());
}
else if (it.regionarea){
return it.regionarea.toLowerCase().includes(searchText.toLowerCase());
}
else{
return false;
}
});
}
}
\ No newline at end of file
import { Pipe, PipeTransform } from "@angular/core";
@Pipe({
name: "sortingstudents"
})
export class SortingStudentsPipe implements PipeTransform {
transform(students: Array<any>, path: string, order: number): Array<any> {
// Check if is not null
console.log(students);
if (!students || !path || !order) return students;
if (path==='id'){
return students.sort((a: number, b: number) => {
// We go for each property followed by path
//path.forEach(property => {
a = a[path];
b = b[path];
//})
// Order * (-1): We change our order
//return a > b ? order : order * (- 1);
return a-b > 0 ? order : order * (- 1);
})
}
else{
return students.sort((a: Array<any>, b: Array<any>) => {
// We go for each property followed by path
//path.forEach(property => {
a = a[path];
b = b[path];
//})
// Order * (-1): We change our order
return a > b ? order : order * (- 1);
//return a-b > 0 ? order : order * (- 1);
})
}
}
}
\ No newline at end of file
This diff is collapsed.