updated controllers, added fields in entities regarding second period applications

parent 7bbac3f9
...@@ -99,6 +99,7 @@ class MinisterSettings extends ControllerBase { ...@@ -99,6 +99,7 @@ class MinisterSettings extends ControllerBase {
$directorViewDisabled = $epalConfig->lock_school_students_view->getString(); $directorViewDisabled = $epalConfig->lock_school_students_view->getString();
$applicantsLoginDisabled = $epalConfig->lock_application->getString(); $applicantsLoginDisabled = $epalConfig->lock_application->getString();
$applicantsResultsDisabled = $epalConfig->lock_results->getString(); $applicantsResultsDisabled = $epalConfig->lock_results->getString();
$secondPeriodEnabled = $epalConfig->activate_second_period->getString();
} }
$config_storage->resetCache(); $config_storage->resetCache();
...@@ -109,6 +110,7 @@ class MinisterSettings extends ControllerBase { ...@@ -109,6 +110,7 @@ class MinisterSettings extends ControllerBase {
'directorViewDisabled' => $directorViewDisabled, 'directorViewDisabled' => $directorViewDisabled,
'applicantsLoginDisabled' => $applicantsLoginDisabled, 'applicantsLoginDisabled' => $applicantsLoginDisabled,
'applicantsResultsDisabled' => $applicantsResultsDisabled, 'applicantsResultsDisabled' => $applicantsResultsDisabled,
'secondPeriodEnabled' => $secondPeriodEnabled,
], Response::HTTP_OK); ], Response::HTTP_OK);
} //end try } //end try
...@@ -125,7 +127,7 @@ class MinisterSettings extends ControllerBase { ...@@ -125,7 +127,7 @@ class MinisterSettings extends ControllerBase {
} }
public function storeSettings(Request $request, $capacityDisabled, $directorViewDisabled, $applicantsLoginDisabled, $applicantsResultsDisabled ) { public function storeSettings(Request $request, $capacityDisabled, $directorViewDisabled, $applicantsLoginDisabled, $applicantsResultsDisabled, $secondPeriodEnabled ) {
try { try {
if (!$request->isMethod('GET')) { if (!$request->isMethod('GET')) {
...@@ -171,6 +173,8 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView ...@@ -171,6 +173,8 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
$epalConfig->set('lock_school_students_view', $directorViewDisabled); $epalConfig->set('lock_school_students_view', $directorViewDisabled);
$epalConfig->set('lock_application', $applicantsLoginDisabled); $epalConfig->set('lock_application', $applicantsLoginDisabled);
$epalConfig->set('lock_results', $applicantsResultsDisabled); $epalConfig->set('lock_results', $applicantsResultsDisabled);
$epalConfig->set('activate_second_period', $secondPeriodEnabled);
$epalConfig->save(); $epalConfig->save();
} }
$config_storage->resetCache(); $config_storage->resetCache();
...@@ -182,6 +186,7 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView ...@@ -182,6 +186,7 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
'directorViewDisabled' => $directorViewDisabled, 'directorViewDisabled' => $directorViewDisabled,
'applicantsLoginDisabled' => $applicantsLoginDisabled, 'applicantsLoginDisabled' => $applicantsLoginDisabled,
'applicantsResultsDisabled' => $applicantsResultsDisabled, 'applicantsResultsDisabled' => $applicantsResultsDisabled,
'secondPeriodEnabled' => $secondPeriodEnabled,
], Response::HTTP_OK); ], Response::HTTP_OK);
} //end try } //end try
...@@ -198,8 +203,6 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView ...@@ -198,8 +203,6 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
} }
private function respondWithStatus($arr, $s) { private function respondWithStatus($arr, $s) {
$res = new JsonResponse($arr); $res = new JsonResponse($arr);
$res->setStatusCode($s); $res->setStatusCode($s);
......
...@@ -531,9 +531,8 @@ private function createSchoolChoices($student) { ...@@ -531,9 +531,8 @@ private function createSchoolChoices($student) {
$this->pdf->Cell($width, $height, $this->prepareString('Σειρά προτίμησης'), 0, 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString('Σειρά προτίμησης'), 0, 0, 'L');
$this->pdf->multiCell($width, $height, $this->prepareString('ΕΠΑΛ επιλογής'), 0, 'L'); $this->pdf->multiCell($width, $height, $this->prepareString('ΕΠΑΛ επιλογής'), 0, 'L');
//$this->pdf->Ln();
//$x=$this->pdf->GetX(); $y=$this->pdf->GetY();
/*
$epalSchools = $this->entityTypeManager->getStorage('epal_student_epal_chosen')->loadByProperties(array('student_id'=> $student->id->value)); $epalSchools = $this->entityTypeManager->getStorage('epal_student_epal_chosen')->loadByProperties(array('student_id'=> $student->id->value));
foreach ($epalSchools as $epalSchool) { foreach ($epalSchools as $epalSchool) {
...@@ -545,26 +544,21 @@ private function createSchoolChoices($student) { ...@@ -545,26 +544,21 @@ private function createSchoolChoices($student) {
$this->pdf->Cell($width, $height, $this->prepareString($epalSchool->choice_no->value), 0, 0, 'C'); $this->pdf->Cell($width, $height, $this->prepareString($epalSchool->choice_no->value), 0, 0, 'C');
$this->pdf->multiCell(4*width, $height, $this->prepareString($epalSchoolName->name->value), 0, 'L'); $this->pdf->multiCell(4*width, $height, $this->prepareString($epalSchoolName->name->value), 0, 'L');
//$this->pdf->Ln();
}
*/
//.... for ($i = 0; $i < 3; $i++) {
/* $epalSchools = $this->entityTypeManager->getStorage('epal_student_epal_chosen')->loadByProperties(array('student_id'=> $student->id->value, 'choice_no'=> $i+1 ));
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular); if ($epalSchools) {
$this->pdf->Cell($width, $height, $this->prepareString('Όνομα μαθητή:'), 0, 'L'); $epalSchool = reset($epalSchools);
$x=$this->pdf->GetX(); $y=$this->pdf->GetY(); $epalSchoolNames = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id'=> $epalSchool->epal_id->getString()));
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular); $epalSchoolName = reset($epalSchoolNames);
$this->pdf->multiCell($width, $height, $this->prepareString($student->name->value), 0, 'L');
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->SetXY($x+$width,$y);
$this->pdf->Cell($width, $height, $this->prepareString('Επώνυμο μαθητή:'), 0, 'L');
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->multiCell($width, $height, $this->prepareString($student->studentsurname->value), 0, 'L');
*/
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->Cell($width, $height, $this->prepareString($epalSchool->choice_no->value), 0, 0, 'C');
$this->pdf->multiCell(4*width, $height, $this->prepareString($epalSchoolName->name->value), 0, 'L');
}
} }
} }
......
...@@ -280,6 +280,26 @@ class EpalConfig extends ContentEntityBase implements EpalConfigInterface { ...@@ -280,6 +280,26 @@ class EpalConfig extends ContentEntityBase implements EpalConfigInterface {
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
$fields['activate_second_period'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Activate second periods of applications'))
->setDescription(t('Activate second periods of applications.'))
->setSettings(array(
'text_processing' => 0,
))
->setRequired(FALSE)
->setDefaultValue(FALSE)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'boolean',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'boolean',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['status'] = BaseFieldDefinition::create('boolean') $fields['status'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Publishing status')) ->setLabel(t('Publishing status'))
->setDescription(t('A boolean indicating whether the Epal config is published.')) ->setDescription(t('A boolean indicating whether the Epal config is published.'))
......
...@@ -1034,6 +1034,26 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface ...@@ -1034,6 +1034,26 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setDisplayConfigurable('form', true) ->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true); ->setDisplayConfigurable('view', true);
$fields['second_period'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Δεύτερη περίοδος αιτήσεων'))
->setDescription(t('Δεύτερη περίοδος αιτήσεων.'))
->setSettings(array(
'text_processing' => 0,
))
->setRequired(false)
->setDefaultValue(false)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'boolean',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'boolean',
'weight' => -4,
))
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true);
$fields['guardian_name'] = BaseFieldDefinition::create('string') $fields['guardian_name'] = BaseFieldDefinition::create('string')
->setLabel(t('Όνομα κηδεμόνα')) ->setLabel(t('Όνομα κηδεμόνα'))
->setDescription(t('Δώσε το όνομα κηδεμόνα.')) ->setDescription(t('Δώσε το όνομα κηδεμόνα.'))
...@@ -1218,6 +1238,8 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface ...@@ -1218,6 +1238,8 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setDisplayConfigurable('form', true) ->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', 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 EPAL Student is published.')) ->setDescription(t('A boolean indicating whether the EPAL Student is published.'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment