Commit 8f295f68 authored by Νίκος Κατσαούνος's avatar Νίκος Κατσαούνος

Merge branch 'adminVersion' into 'develop'

Admin version

See merge request itminedu/e-eggrafes!122
parents d17ebd7e 894d78f8
......@@ -373,8 +373,10 @@ class ApplicationSubmit extends ControllerBase
], Response::HTTP_FORBIDDEN);
}
//έλεγχος πληρότητας τμήματος
if ( $eggrafesConfig->lock_small_classes->value === "1")
//if ( $eggrafesConfig->lock_small_classes->value === "1")
if ( $eggrafesConfig->activate_second_period->value == "1")
{
$classIdChecked = $applicationForm[0]['currentclass'];
$secIdChecked = "-1";
......@@ -389,6 +391,7 @@ class ApplicationSubmit extends ControllerBase
//αν δεν βρει το σχολείο στη λίστα που είναι προς μη έλεγχο πληρότητας)
if (strpos($schNonCheckOccup, "$" . $epalIdChecked . "$") === false)
{
$this->logger->error("Trace2 update.. " );
$retval = $this->isFull($epalIdChecked, $classIdChecked, $secIdChecked);
if ($retval !== self::NON_FULL_CLASS) {
if ($retval === self::FULL_CLASS) {
......@@ -1000,6 +1003,7 @@ class ApplicationSubmit extends ControllerBase
public function isFull($epalId, $classId, $secId)
{
$schoolCapacity = $this->retrieveSchoolCapacity($epalId, $classId, $secId);
//$this->logger->error($schoolCapacity);
if ($schoolCapacity === self::ERROR_DB)
return self::ERROR_DB;
......
......@@ -2548,19 +2548,16 @@ class ReportsCreator extends ControllerBase
$gelStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($gelStudents as $gelStudent) {
array_push($idColumn, $gelStudent->id);
/*
if ($gelStudent->nextclass != 1 && $gelStudent->nextclass != 4 && $gelStudent->nextclass != 5) {
$sCon = $this->connection
$sCon = $this->connection
->select('gel_student_choices', 'eChoices')
->fields('eChoices', array('choice_id'))
->condition('eChoices.student_id', $gelStudent->id , '=')
->condition('eChoices.choice_id', 15 , '>=')
->condition('eChoices.choice_id', 17 , '<=');
$stChoices = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$stChoice = reset($stChoices);
array_push($opColumn, $stChoice->choice_id);
}
*/
$stChoices = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$stChoice = reset($stChoices);
//να αλλαχθεί σε ανάκτηση του ονόματος της ΟΠ από τη βάση με INNER JOIN
array_push($opColumn, $this->retrieveOPName($stChoice->choice_id));
array_push($classColumn, $classLogos[$l]);
array_push($firstnameColumn, $crypt->decrypt($gelStudent->name));
array_push($surnameColumn, $crypt->decrypt($gelStudent->studentsurname));
......@@ -2615,24 +2612,18 @@ class ReportsCreator extends ControllerBase
foreach ($gelStudents as $gelStudent) {
if (!in_array($gelStudent->id, $hgids)) {
array_push($idColumn, $gelStudent->id);
//if ($gelStudent->nextclass != '1' && $gelStudent->nextclass != '4' && $gelStudent->nextclass != '5') {
/*
$sCon = $this->connection
$sCon = $this->connection
->select('gel_student_choices', 'eChoices')
->fields('eChoices', array('choice_id'))
->condition('eChoices.student_id', $gelStudent->id , '=')
->condition('eChoices.choice_id', 15 , '>=')
->condition('eChoices.choice_id', 17 , '<=');
$stChoices = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$stChoice = reset($stChoices);
array_push($opColumn, $stChoice->choice_id);
*/
//}
$stChoices = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$stChoice = reset($stChoices);
//να αλλαχθεί σε ανάκτηση του ονόματος της ΟΠ από τη βάση με INNER JOIN
array_push($opColumn, $this->retrieveOPName($stChoice->choice_id));
//$this->logger->warning("Trace.. " . $gelStudent->id . " " . $stChoice->choice_id);
array_push($classColumn, $this->retrieveGelClassName($k) . " (αυτοδίκαια) ");
array_push($firstnameColumn, $crypt->decrypt($gelStudent->name));
array_push($surnameColumn, $crypt->decrypt($gelStudent->studentsurname));
......@@ -3019,6 +3010,18 @@ class ReportsCreator extends ControllerBase
return $fullAddress;
}
private function retrieveOPName($opid) {
if ($opid == 15)
return "Ανθρωπιστικών Σπουδών";
else if ($opid == 16)
return "Θετικών Σπουδών";
else if ($opid == 17)
return "Σπουδών Οικονομίας και Πληροφορικής";
else
return "";
}
......
......@@ -275,6 +275,11 @@ class WSConsumer extends ControllerBase
public function transitionToBPeriod() {
return (new JsonResponse([
'message' => "no code",
]))
->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);
//μετάπτωση σε δεύτερη περίοδο όλων των αιτήσεων για ΕΠΑΛ που οι μαθητές δεν προάχθηκαν
$sCon = $this->connection
->select('epal_student', 'eStudent')
......
......@@ -2027,7 +2027,7 @@ public function getStudentPerSchoolGel(Request $request, $classId)
//$this->logger->warning($gelId."kvdikos sxoleiou".$classId);
$schools = $this->entityTypeManager->getStorage('gel_school')->loadByProperties(array('id' => $gelId));
$school = reset($schools);
$operation_shift = $schools->operation_shift->value;
$operation_shift = $school->operation_shift->value;
if ( $operation_shift != 'ΗΜΕΡΗΣΙΟ')
{
......@@ -2092,7 +2092,7 @@ public function getStudentPerSchoolGel(Request $request, $classId)
$existingstudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
}
//$this->logger->warning($sCon."existingstudents");
$this->logger->warning($sCon."existingstudents");
}
......
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