Commit a52ded3b authored by Open Source Developer's avatar Open Source Developer

Capacity cahsnges

parents 26cd365b efb927c5
......@@ -173,7 +173,7 @@ class CASLogin extends ControllerBase
};
$umdobject = $filterAttribute("umdobject");
$physicaldeliveryofficename = $filterAttribute("physicaldeliveryofficename");
// $physicaldeliveryofficename = $filterAttribute("physicaldeliveryofficename");
/****** the following is for production : Χρήση μόνο από ΕΠΙΣΗΜΟΥΣ ΛΟΓΑΡΙΑΣΜΟΥΣ ***************************/
......@@ -186,12 +186,27 @@ class CASLogin extends ControllerBase
}
*/
phpCAS::trace($umdobject);
phpCAS::trace($physicaldeliveryofficename);
$gsnunitcodedn = $filterAttribute('edupersonorgunitdn:gsnunitcode:extended');
$gsnunitcode = substr($gsnunitcodedn, strpos($gsnunitcodedn, ";") + 1);
phpCAS::trace($gsnunitcode);
/* check if myschool account */
if (!$umdobject || $umdobject !== "ISaccount") {
return $this->redirectForbidden($configRowName, '5002');
}
if (!$gsnunitcode || $gsnunitcode !== $CASUser) {
return $this->redirectForbidden($configRowName, '5003');
}
/* end of checking myschool account */
$userAssigned = $this->assignRoleToUser($gsnunitcode);
if (sizeof($userAssigned) === 0) {
return $this->redirectForbidden($configRowName, '5004');
}
......
ws_endpoint: 'https://the.url'
ws_username: 'username'
ws_password: 'password'
verbose: true
NO_SAFE_CURL: false
......@@ -182,6 +182,14 @@ epal.ministry.massive_mail_unallocated:
_controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToUnallocatedStudents'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.massive_mail_unallocated_smallclass:
path: '/ministry/send-unallocated-sc-massive-mail'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToUnallocatedStudentsSC'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.massive_mail_located:
path: '/ministry/send-located-massive-mail'
options:
......@@ -278,3 +286,27 @@ epal.applicant.creationpdf:
_controller: '\Drupal\epal\Controller\PdfCreator::createApplicantPDF'
requirements:
_user_is_logged_in: 'TRUE'
epal.svc.getdidacticyears:
path: '/epal/get-didactic-years'
options:
_auth: [ 'basic_auth' ]
defaults:
_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}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\WSConsumer::getStudentEpalCertification'
requirements:
_user_is_logged_in: 'TRUE'
This diff is collapsed.
......@@ -559,9 +559,10 @@ public function checkCapacityAndArrange($epalId, $classId, $secCourId, $limitup,
//Αν δεν απέμειναν θέσεις (δηλαδή αν η χωρητικότητα είναι μικρότερη ή ίση από το πλήθος μαθητών που ήδη φοιτούν στο σχολείο)
//τότε διέγραψέ τους από τον προσωρινό πίνακα αποτελεσμάτων και βάλε τους στον στον πίνακα εκκρεμοτήτων
if ($newlimit <= 0) {
foreach($students as $student) {
if ($student->currentepal !== $student->epal_id) {
if ($newlimit <= 0) {
//print_r("<br>ΣΕ ΕΚΚΡΕΜΟΤΗΤΑ - ΔΙΑΓΡΑΦΗ: " . $student->student_id);
array_push($this->pendingStudents, $student->student_id);
try {
......@@ -574,9 +575,27 @@ public function checkCapacityAndArrange($epalId, $classId, $secCourId, $limitup,
$transaction->rollback();
return ERROR_DB;
}
} //end if currentepal
} //endif new limit
else { //$newlimit > 0
//NEW CODE LINES
if ($this->choice_id !== 1)
$this->removeFromPendingStudents($student->student_id);
}
//END NEW CODE LINES
} //endif currentepal
} //end foreach
} //endif newlimit
//NEW CODE LINES
/*
else {
foreach($students as $student)
if ($student->currentepal !== $student->epal_id)
if ($this->choice_id !== 1)
$this->removeFromPendingStudents($student->student_id);
}
*/
//END NEW CODE LINES
return SUCCESS;
......
......@@ -92,22 +92,122 @@ class InformUnlocatedStudents extends ControllerBase {
$cnt_success = 0;
$cnt_fail = 0;
// εύρεση μαθητών που η αίτησή τους ΔΕΝ ικανοποιήθηκε
// εύρεση μαθητών που η αίτησή τους ΔΕΝ ικανοποιήθηκε,
//(δεν κατανεμήθηκαν πουθενά)
$sCon = $this->connection->select('epal_student_class', 'eStudent')
->fields('eStudent', array('student_id'));
//->condition('eStudent.finalized', 0 , '=');
$epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$studentIds = array();
array_push($studentIds,-1);
foreach ($epalStudents as $epalStudent)
array_push($studentIds, $epalStudent->student_id);
$sCon = $this->connection->select('epal_student', 'eStudent')
->fields('eStudent', array('id', 'user_id', 'created'))
->condition('eStudent.id', $studentIds, 'NOT IN');
$epalNonLocatedStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($epalNonLocatedStudents as $epalNonLocatedStudent) {
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('user_id' => $epalNonLocatedStudent->user_id));
$epalUser = reset($epalUsers);
if ($epalUser) {
$user = $this->entityTypeManager->getStorage('user')->load($epalUser->user_id->target_id);
//$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('uid' => $epalUser->user_id));
//$user = reset($users);
if ($user) {
$langcode = $user->getPreferredLangcode();
if ($this->sendEmailToUnallocated($user->getEmail(), $epalNonLocatedStudent->id, $epalNonLocatedStudent->created, $langcode))
$cnt_success++;
}
else {
return $this->respondWithStatus([
'message' => t("user not found"),
], Response::HTTP_INTERNAL_SERVER_ERROR);
}
} else {
$cnt_fail++;
}
} //end foreach
return $this->respondWithStatus([
'message' => t("post successful"),
'num_success_mail' => $cnt_success,
'num_fail_mail' => $cnt_fail,
//'test' => $test,
], Response::HTTP_OK);
} //end try
catch (\Exception $e) {
$this->logger->warning($e->getMessage());
return $this->respondWithStatus([
"message" => t("An unexpected problem occured during sendMailToStudents Method ")
], Response::HTTP_INTERNAL_SERVER_ERROR);
}
}
public function sendMailToUnallocatedStudentsSC(Request $request) {
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);
}
$cnt_success = 0;
$cnt_fail = 0;
// εύρεση μαθητών που η αίτησή τους ΔΕΝ ικανοποιήθηκε,
//(δεν κατανεμήθηκαν πουθενά)
$sCon = $this->connection->select('epal_student_class', 'eStudent')
->fields('eStudent', array('student_id'))
->condition('eStudent.finalized', 0 , '=');
$epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$studentIds = array();
//array_push($studentIds,-1);
array_push($studentIds,-1);
foreach ($epalStudents as $epalStudent)
array_push($studentIds, $epalStudent->student_id);
$sCon = $this->connection->select('epal_student', 'eStudent')
->fields('eStudent', array('id', 'user_id', 'created'))
->condition('eStudent.id', $studentIds, 'NOT IN');
//$numNoAllocated = $sCon->countQuery()->execute()->fetchField();
->condition('eStudent.id', $studentIds, 'IN');
$epalNonLocatedStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($epalNonLocatedStudents as $epalNonLocatedStudent) {
......@@ -163,9 +263,10 @@ class InformUnlocatedStudents extends ControllerBase {
$key = 'massive_mail_unallocated'; //to be checked..
$to = $email;
$params['message'] = "Σας ενημερώνουμε ότι η αίτησή σας με Α/Α: " . $appId . " - " . date('d-m-y H:i:s', $appDate)
. " δεν ικανοποιήθηκε. Παρακαλώ επικοινωνήστε άμεσα τηλεφωνικά με τη Διεύθυνση Δευτεροβάθμιας Εκπαίδευσης / Τμήμα Επαγγελματικής Εκπαίδευσης,"
. "\r\nΤεστ1\nΤεστ2" ;//e-mail body
$params['message'] = "Σας ενημερώνουμε ότι η αίτησή σας με Α/Α: " . $appId . " / " . date('d-m-y H:i:s', $appDate)
. " δεν ικανοποιήθηκε. Παρακαλώ επικοινωνήστε άμεσα τηλεφωνικά με τη Διεύθυνση Δευτεροβάθμιας Εκπαίδευσης / Τμήμα Επαγγελματικής Εκπαίδευσης."
. "\r\n\r\n Ομάδα Διαχείρισης της εφαρμογής e-epal."
. "\r\n Προσοχή: το μήνυμα που διαβάζετε είναι αυτοματοποιημένο. Παρακαλώ μην απαντάτε σε αυτό το μήνυμα.." ;//e-mail body" ;//e-mail body
//add new lines with SENDER name - check it
//$params['subject'] = t('Μη ικανοποίηση ηλεκτρονικής αίτησης για εγγραφή σε ΕΠΑΛ');
......@@ -231,7 +332,7 @@ class InformUnlocatedStudents extends ControllerBase {
$studentIds = array();
//if sizeof(studentIds = 0..distribution has not been made!)
//array_push($studentIds, -1);
array_push($studentIds, -1);
foreach ($epalStudents as $epalStudent)
array_push($studentIds, $epalStudent->student_id);
......@@ -328,12 +429,13 @@ class InformUnlocatedStudents extends ControllerBase {
$key = 'massive_mail_located';
$to = $email;
$params['message'] = "Σας ενημερώνουμε ότι η αίτησή σας με Α/Α: " . $appId . " - " . date('d-m-y H:i:s', $appDate)
$params['message'] = "Σας ενημερώνουμε ότι η αίτησή σας με Α/Α: " . $appId . " / " . date('d-m-y H:i:s', $appDate)
. " ΙΚΑΝΟΠΟΙΗΘΗΚΕ. Έχετε επιλεγεί να γίνει η εγγραφή σας στο " . $schName .", που βρίσκεται στη διεύθυνση: " . $schStreet
. ". Παρακαλώ επικοινωνήστε άμεσα με τη Σχολική Μονάδα τοποθέτησής σας"
. ", ώστε να ενημερωθείτε για τη διαδικασία που πρέπει να ακολουθήσετε για την εγγραφή σας στο σχολείο. "
. "Τηλέφωνο επικοινωνίας σχολείου: " . $schTel
. "\r\nΤεστ1\nΤεστ2" ;//e-mail body
. "\r\n\r\n Ομάδα Διαχείρισης της εφαρμογής e-epal."
. "\r\n Προσοχή: το μήνυμα που διαβάζετε είναι αυτοματοποιημένο. Παρακαλώ μην απαντάτε σε αυτό το μήνυμα." ;//e-mail body
//$this->logger->info($params['message']);
......
......@@ -86,9 +86,27 @@ class SubmitedApplications extends ControllerBase
$i = 0;
if ($epalStudents) {
$list = array();
foreach ($epalStudents as $object) {
$sectorName = '';
$courseName = '';
if ($object->currentclass->value === '2') {
$sectors = $this->entityTypeManager->getStorage('epal_student_sector_field')->loadByProperties(array('student_id' => $object->id()));
$sector = reset($sectors);
if ($sector)
$sectorName = $this->entityTypeManager->getStorage('eepal_sectors')->load($sector->sectorfield_id->target_id)->name->value;
}
else if ($object->currentclass->value === '3' || $object->currentclass->value === '4') {
$courses = $this->entityTypeManager->getStorage('epal_student_course_field')->loadByProperties(array('student_id' => $object->id()));
$course = reset($courses);
if ($course)
$courseName = $this->entityTypeManager->getStorage('eepal_specialty')->load($course->coursefield_id->target_id)->name->value;
}
$list[] = array(
'applicationId' => $object->id(),
'name' => $object -> name ->value,
'studentsurname' => $object -> studentsurname ->value,
'fatherfirstname' => $object -> fatherfirstname ->value,
......@@ -101,7 +119,10 @@ class SubmitedApplications extends ControllerBase
'guardian_mothername' =>$object -> guardian_mothername ->value,
'lastschool_schoolname' =>$object -> lastschool_schoolname ->value,
'lastschool_schoolyear' =>$object -> lastschool_schoolyear ->value,
'lastschool_class' =>$object -> currentclass ->value,
'lastschool_class' =>$object -> lastschool_class ->value,
'currentclass' =>$object -> currentclass ->value,
'currentsector' =>$sectorName,
'currentcourse' =>$courseName,
'regionaddress' =>$object -> regionaddress ->value,
'regiontk' =>$object -> regiontk ->value,
'regionarea' =>$object -> regionarea ->value,
......@@ -109,7 +130,9 @@ class SubmitedApplications extends ControllerBase
'graduation_year' =>$object -> graduation_year ->value,
'telnum' =>$object -> telnum ->value,
'relationtostudent' =>$object -> relationtostudent ->value,
'birthdate' =>$object -> birthdate ->value,
'birthdate' => substr($object->birthdate->value, 8, 2) . '/' . substr($object->birthdate->value, 6, 2) . '/' . substr($object->birthdate->value, 0, 4),
'created' => date('d/m/Y H:i', $object -> created ->value),
);
$i++;
......
<?php
namespace Drupal\epal\Controller;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Drupal\Core\Database\Connection;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\epal\Client;
class WSConsumer extends ControllerBase
{
protected $entityTypeManager;
protected $logger;
protected $client;
protected $settings;
public function __construct(EntityTypeManagerInterface $entityTypeManager, LoggerChannelFactoryInterface $loggerChannel)
{
$config = $this->config('epal.settings');
foreach (['ws_endpoint', 'ws_username', 'ws_password', 'verbose', 'NO_SAFE_CURL'] as $setting) {
$this->settings[$setting] = $config->get($setting);
}
$this->entityTypeManager = $entityTypeManager;
$this->logger = $loggerChannel->get('epal-school');
$this->client = new Client($this->settings, $this->logger);
}
public static function create(ContainerInterface $container)
{
return new static(
$container->get('entity_type.manager'), $container->get('logger.factory')
);
}
public function getPing(Request $request)
{
return (new JsonResponse(['message' => 'Ping!!!']))
->setStatusCode(Response::HTTP_OK);
}
public function getAllDidactiYear()
{
$ts_start = microtime(true);
try {
$catalog = $this->client->getAllDidactiYear();
} 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' => $catalog
]))
->setStatusCode(Response::HTTP_OK);
}
public function getStudentEpalPromotion($didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $level_name)
{
$ts_start = microtime(true);
try {
$result = $this->client->getStudentEpalPromotion($didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $level_name);
} 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 getStudentEpalCertification($didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $level_name)
{
$ts_start = microtime(true);
try {
$result = $this->client->getStudentEpalCertification($didactic_year_id, $lastname, $firstname, $father_firstname, $mother_firstname, $birthdate, $registry_no, $level_name);
} 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);
}
private function generateRandomString($length)
{
$characters = ['Α','Β','Γ','Δ','Ε','Ζ','Η','Θ','Ι','Κ','Λ','Μ','Ν','Ξ','Ο','Π','Ρ','Σ','Τ','Υ','Φ','Χ','Ψ','Ω'];
$charactersLength = count($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
// private function respondWithStatus($arr, $s)
// {
// $res = new JsonResponse($arr);
// $res->setStatusCode($s);
// return $res;
// }
}
<?php
namespace Drupal\epal;
use Defuse\Crypto\Key;
use Defuse\Crypto\Crypto;
use \Exception;
class Crypt
{
private $fname; // store
public function __construct($fname)
{
if (is_string($fname)) {
$this->fname = $fname;
} else {
$this->fname = __DIR__ . "/../../../../../app.txt";
}
}
/**
* @throws \Exception If key is not found
* @return string The key to use
*/
protected function loadKey()
{
if (!is_readable($this->fname) || !is_file($this->fname)) {
throw new \Exception(__METHOD__ . ':: No file');
}
$keystring = file_get_contents($this->fname);
if ($keystring === false) {
throw new \Exception(__METHOD__ . ':: Cannot load file');
}
return Key::loadFromAsciiSafeString($keystring);
}
/**
* Provided a string value, encrypt and return encrypted value
*
* @throws \Defuse\Crypto\Exception\EnvironmentIsBrokenException if encryption cannot be performed
* @throws \Exception If value to encode is not string
* @return hex encoded encrypted value
*/
public function encrypt($data)
{
if (!is_string($data)) {
throw new \Exception("Data to be encoded can only be strings");
}
$key = $this->loadKey();
$dataenc = Crypto::encrypt($data, $key);
return $dataenc;
}
/**
* Provided a hex encoded encrypted value, decrypt and return original value
*
* @throws \Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException if decrypt failed!
* @return string the original value
*/
public function decrypt($dataenc)
{
$key = $this->loadKey();
$data = Crypto::decrypt($dataenc, $key);
return $data;
}
}
......@@ -527,7 +527,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('Όνομα μαθητή'))
->setDescription(t('Δώσε το μικρό μαθητή.'))
->setSettings(array(
'max_length' => 50,
'max_length' => 1000,
'text_processing' => 0,
))
->setRequired(true)
......@@ -548,7 +548,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('Επώνυμο μαθητή'))
->setDescription(t('Δώσε το επώνυμο μαθητή.'))
->setSettings(array(
'max_length' => 50,
'max_length' => 1000,
'text_processing' => 0,
))
->setRequired(true)
......@@ -604,7 +604,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('Όνομα του πατέρα'))
->setDescription(t('Δώσε το όνομα του πατέρα.'))
->setSettings(array(
'max_length' => 50,
'max_length' => 1000,
'text_processing' => 0,
))
->setRequired(true)
......@@ -646,7 +646,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('Όνομα μητέρας'))
->setDescription(t('Δώσε το όνομα της μητέρας.'))
->setSettings(array(
'max_length' => 50,
'max_length' => 1000,
'text_processing' => 0,
))
->setRequired(true)
......@@ -709,7 +709,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('Διεύθνση κηδεμόνα'))
->setDescription(t('Δώσε τη διεύθυνση κηδεμόνα.'))
->setSettings(array(
'max_length' => 100,
'max_length' => 1500,
'text_processing' => 0,
))
->setRequired(true)
......@@ -730,7 +730,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('ΤΚ περιοχής'))
->setDescription(t('Δώσε τον ΤΚ της διεύθυνσης κατοικίας.'))
->setSettings(array(
'max_length' => 10,
'max_length' => 500,
'text_processing' => 0,
))
->setRequired(true)
......@@ -750,7 +750,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('Πόλη-Κοινότητα'))
->setDescription(t('Δώσε την πόλη ή κοινότητα που διαμένεις.'))
->setSettings(array(
'max_length' => 100,
'max_length' => 1500,
'text_processing' => 0,
))
->setRequired(true)
......@@ -771,7 +771,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('Τύπος απολυτηρίου'))
->setDescription(t('Δώσε τον τύπο απολυτηρίου, πχ Απολυτήριο Γυμνασίου'))
->setSettings(array(
'max_length' => 50,
'max_length' => 1500,
'text_processing' => 0,
))
->setRequired(true)
......@@ -959,7 +959,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('Σχέση αιτούντα με μαθητή'))
->setDescription(t('Δώσε τη σχέση αιτούντα με μαθητή, πχ Γονέας - Κηδεμόνας - Μαθητής'))
->setSettings(array(
'max_length' => 50,
'max_length' => 600,
'text_processing' => 0,
))
->setRequired(true)
......@@ -980,7 +980,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('Τηλέφωνο επικοινωνίας'))
->setDescription(t('Δώσε το τηλέφωνο επικοινωνίας'))
->setSettings(array(
'max_length' => 50,
'max_length' => 600,
'text_processing' => 0,
))
->setRequired(true)
......@@ -1038,7 +1038,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('Όνομα κηδεμόνα'))
->setDescription(t('Δώσε το όνομα κηδεμόνα.'))
->setSettings(array(
'max_length' => 50,
'max_length' => 1000,
'text_processing' => 0,
))
->setRequired(true)
......@@ -1059,7 +1059,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('Επώνυμο κηδεμόνα'))
->setDescription(t('Δώσε το επώνυμο κηδεμόνα.'))
->setSettings(array(
'max_length' => 50,
'max_length' => 1000,
'text_processing' => 0,
))
->setRequired(true)
......@@ -1080,7 +1080,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('Όνομα πατέρα κηδεμόνα'))
->setDescription(t('Δώσε το όνομα πατέρα του κηδεμόνα.'))
->setSettings(array(
'max_length' => 50,
'max_length' => 1000,
'text_processing' => 0,
))
->setRequired(true)
......@@ -1101,7 +1101,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface
->setLabel(t('Όνομα μητέρας κηδεμόνα'))
->setDescription(t('Δώσε το όνομα μητέρας του κηδεμόνα.'))
->setSettings(array(
'max_length' => 50,
'max_length' => 1000,
'text_processing' => 0,
))
->setRequired(true)
......
......@@ -528,6 +528,27 @@ class EepalSchool extends ContentEntityBase implements EepalSchoolInterface {
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['students_added_class_a'] = BaseFieldDefinition::create('integer')
->setLabel(t('Επιπλέον αριθμός μαθητών για εγγραφή'))
->setDescription(t('Δώσε τον επιπλέον αριθμό μαθητών για εγγραφή.'))
->setSettings(array(
'max_length' => 2,
'text_processing' => 0,
))
->setRequired(false)
->setDefaultValue(0)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'integer',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'integer',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)