Merge branch 'epalmodule' into 'develop'

Epalmodule

See merge request !8
parents 79ab1c50 a8cfdd7c
......@@ -3,3 +3,5 @@ type: module
description: EPAL Registration
core: 8.x
package: EPAL
dependencies:
- epalreadydata
\ No newline at end of file
This diff is collapsed.
......@@ -45,6 +45,8 @@ use Drupal\user\UserInterface;
* "uid" = "user_id",
* "langcode" = "langcode",
* "status" = "status",
* "student_id" = "student_id",
* "courseField_id" = "courseField_id",
* },
* links = {
* "canonical" = "/admin/structure/epal_student_course_field/{epal_student_course_field}",
......@@ -145,6 +147,38 @@ class EpalStudentCourseField extends ContentEntityBase implements EpalStudentCou
return $this;
}
/**
* {@inheritdoc}
*/
public function getCourseField_id() {
return $this->get('courseField_id')->getString();
}
/**
* {@inheritdoc}
*/
public function setCourseField_id($name) {
$this->set('courseField_id', $name);
return $this;
}
/**
* {@inheritdoc}
*/
public function getStudent_id() {
return $this->get('student_id')->getString();
}
/**
* {@inheritdoc}
*/
public function setStudent_id($name) {
$this->set('student_id', $name);
return $this;
}
/**
* {@inheritdoc}
*/
......@@ -152,14 +186,14 @@ class EpalStudentCourseField extends ContentEntityBase implements EpalStudentCou
$fields = parent::baseFieldDefinitions($entity_type);
$fields['user_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Authored by'))
->setDescription(t('The user ID of author of the Epal student course field entity.'))
->setLabel(t('Δημιουργός'))
->setDescription(t('Δημιουργός.'))
->setRevisionable(TRUE)
->setSetting('target_type', 'user')
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setDisplayOptions('view', array(
'label' => 'hidden',
'label' => 'above',
'type' => 'author',
'weight' => 0,
))
......@@ -177,8 +211,8 @@ class EpalStudentCourseField extends ContentEntityBase implements EpalStudentCou
->setDisplayConfigurable('view', TRUE);
$fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Name'))
->setDescription(t('The name of the Epal student course field entity.'))
->setLabel(t('Όνομα'))
->setDescription(t('Όνομα.'))
->setSettings(array(
'max_length' => 50,
'text_processing' => 0,
......@@ -197,19 +231,20 @@ class EpalStudentCourseField extends ContentEntityBase implements EpalStudentCou
->setDisplayConfigurable('view', TRUE);
$fields['student_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Student id'))
->setLabel(t('ID Μαθητή'))
->setDescription(t('Δώσε το id μαθητή.'))
->setSetting('target_type', 'epal_student')
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setDisplayOptions('view', array(
'label' => 'hidden',
'label' => 'above',
'type' => 'author',
'weight' => 0,
'weight' => -4,
))
->setRequired(true)
->setDisplayOptions('form', array(
'type' => 'entity_reference_autocomplete',
'weight' => 5,
'weight' => -4,
'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
......@@ -222,19 +257,20 @@ class EpalStudentCourseField extends ContentEntityBase implements EpalStudentCou
$fields['courseField_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Specialty id'))
->setLabel(t('ID ειδικότητας'))
->setDescription(t('Δώσε το id ειδικότητας που επέλεξε ο μαθητής.'))
->setSetting('target_type', 'eepal_specialty')
->setSetting('handler', 'default')
->setRequired(true)
->setTranslatable(TRUE)
->setDisplayOptions('view', array(
'label' => 'hidden',
'label' => 'above',
'type' => 'author',
'weight' => 0,
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'entity_reference_autocomplete',
'weight' => 5,
'weight' => -4,
'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
......
......@@ -74,4 +74,10 @@ interface EpalStudentCourseFieldInterface extends ContentEntityInterface, Entit
*/
public function setPublished($published);
//get/set methods for additional fields for configuration properties.
public function getCourseField_id();
public function setCourseField_id($val);
public function getStudent_id();
public function setStudent_id($val);
}
......@@ -45,6 +45,13 @@ use Drupal\user\UserInterface;
* "uid" = "user_id",
* "langcode" = "langcode",
* "status" = "status",
* "student_id" = "student_id",
* "epal_id" = "epal_id",
* "choice_no" = "choice_no",
* "status" = "status",
* "created" = "created",
* "changed" = "changed",
* "default_langcode" = "default_langcode",
* },
* links = {
* "canonical" = "/admin/structure/epal_student_epal_chosen/{epal_student_epal_chosen}",
......@@ -145,6 +152,62 @@ class EpalStudentEpalChosen extends ContentEntityBase implements EpalStudentEpal
return $this;
}
//get / set methods for additional fields
public function getStudent_id() {
return $this->get('student_id')->getString();
}
public function setStudent_id($name) {
$this->set('student_id', $name);
return $this;
}
public function getEpal_id() {
//return $this->get('epal_id')->getString();
return $this->get('epal_id')->target_id;
}
public function setEpal_id($name) {
$this->set('epal_id', $name);
return $this;
}
public function getChoice_no() {
return $this->get('choice_no')->value;
}
public function setChoice_no($name) {
$this->set('choice_no', $name);
return $this;
}
public function getPoints_for_order() {
return $this->get('points_for_order')->value;
}
public function setPoints_for_order($name) {
$this->set('points_for_order', $name);
return $this;
}
public function getDistance_from_epal() {
return $this->get('distance_from_epal')->value;
}
public function setDistance_from_epal($name) {
$this->set('distance_from_epal', $name);
return $this;
}
public function getPoints_for_distance() {
return $this->get('points_for_distance')->value;
}
public function setPoints_for_distance($name) {
$this->set('points_for_distance', $name);
return $this;
}
/**
* {@inheritdoc}
*/
......@@ -152,20 +215,20 @@ class EpalStudentEpalChosen extends ContentEntityBase implements EpalStudentEpal
$fields = parent::baseFieldDefinitions($entity_type);
$fields['user_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Authored by'))
->setDescription(t('The user ID of author of the Epal student epal chosen entity.'))
->setLabel(t('Δημιουργός'))
->setDescription(t('Δημιουργός.'))
->setRevisionable(TRUE)
->setSetting('target_type', 'user')
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setDisplayOptions('view', array(
'label' => 'hidden',
'label' => 'above',
'type' => 'author',
'weight' => 0,
'weight' => -6,
))
->setDisplayOptions('form', array(
'type' => 'entity_reference_autocomplete',
'weight' => 5,
'weight' => -6,
'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
......@@ -176,31 +239,9 @@ class EpalStudentEpalChosen extends ContentEntityBase implements EpalStudentEpal
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
/*
$fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Name'))
->setDescription(t('The name of the Epal student epal chosen entity.'))
->setSettings(array(
'max_length' => 50,
'text_processing' => 0,
))
->setDefaultValue('')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
*/
$fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Name'))
->setDescription(t('The name of the EpalStudentEpalChosen entity.'))
->setLabel(t('Όνομα'))
->setDescription(t('Ονομασία του EpalStudentEpalChosen entity.'))
->setSettings(array(
'max_length' => 50,
'text_processing' => 0,
......@@ -218,43 +259,21 @@ class EpalStudentEpalChosen extends ContentEntityBase implements EpalStudentEpal
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
/*
$fields['student_id'] = BaseFieldDefinition::create('string')
->setLabel(t('Student id'))
->setDescription(t('ώσε το id μαθητή.'))
->setSettings(array(
'max_length' => 50,
'text_processing' => 0,
))
->setDefaultValue('')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
*/
$fields['student_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Student id'))
->setLabel(t('Id Μαθητή'))
->setDescription(t('Δώσε το id μαθητή.'))
->setSetting('target_type', 'epal_student')
->setSetting('handler', 'default')
->setRequired(true)
->setTranslatable(TRUE)
->setDisplayOptions('view', array(
'label' => 'hidden',
'label' => 'above',
'type' => 'author',
'weight' => 0,
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'entity_reference_autocomplete',
'weight' => 5,
'weight' => -4,
'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
......@@ -265,21 +284,21 @@ class EpalStudentEpalChosen extends ContentEntityBase implements EpalStudentEpal
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['epal_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Epal id'))
->setLabel(t('Id ΕΠΑΛ'))
->setDescription(t('Δώσε το όνομα - id σχολείου που επέλεξε ο μαθητής.'))
->setSetting('target_type', 'eepal_school')
->setSetting('handler', 'default')
->setRequired(true)
->setTranslatable(TRUE)
->setDisplayOptions('view', array(
'label' => 'hidden',
'label' => 'above',
'type' => 'author',
'weight' => 0,
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'entity_reference_autocomplete',
'weight' => 5,
'weight' => -4,
'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
......@@ -290,15 +309,14 @@ class EpalStudentEpalChosen extends ContentEntityBase implements EpalStudentEpal
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['choice_no'] = BaseFieldDefinition::create('integer')
->setLabel(t('Max Number of Students'))
->setDescription(t('The maximum number of students in class.'))
->setLabel(t('Σειρά προτίμησης'))
->setDescription(t('Δώσε τη σειρά προτίμησης.'))
->setSettings(array(
'max_length' => 2,
'text_processing' => 0,
))
->setDefaultValue(25)
->setRequired(true)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'integer',
......@@ -311,7 +329,6 @@ class EpalStudentEpalChosen extends ContentEntityBase implements EpalStudentEpal
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['points_for_order'] = BaseFieldDefinition::create('integer')
->setLabel(t('Μόρια για σειρά προτίμησης'))
->setDescription(t('Μόρια για σειρά προτίμησης.'))
......@@ -319,15 +336,14 @@ class EpalStudentEpalChosen extends ContentEntityBase implements EpalStudentEpal
'max_length' => 2,
'text_processing' => 0,
))
//->setDefaultValue(25)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'integer',
//'weight' => -4,
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'integer',
//'weight' => -4,
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
......@@ -336,18 +352,16 @@ class EpalStudentEpalChosen extends ContentEntityBase implements EpalStudentEpal
->setLabel(t('Απόσταση από ΕΠΑΛ'))
->setDescription(t('Απόσταση από ΕΠΑΛ.'))
->setSettings(array(
//'max_length' => 2,
'text_processing' => 0,
))
//->setDefaultValue(25)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'float',
//'weight' => -4,
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'float',
//'weight' => -4,
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
......@@ -359,21 +373,19 @@ class EpalStudentEpalChosen extends ContentEntityBase implements EpalStudentEpal
'max_length' => 2,
'text_processing' => 0,
))
//->setDefaultValue(25)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'integer',
//'weight' => -4,
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'integer',
//'weight' => -4,
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['status'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Publishing status'))
->setDescription(t('A boolean indicating whether the Epal student epal chosen is published.'))
......
......@@ -74,4 +74,18 @@ interface EpalStudentEpalChosenInterface extends ContentEntityInterface, Entity
*/
public function setPublished($published);
//get/set methods for additional fields for configuration properties.
public function getStudent_id();
public function setStudent_id($val);
public function getEpal_id();
public function setEpal_id($val);
public function getChoice_no();
public function setChoice_no($val);
public function getPoints_for_order();
public function setPoints_for_order($val);
public function getDistance_from_epal();
public function setDistance_from_epal($val);
public function getPoints_for_distance();
public function setPoints_for_distance($val);
}
......@@ -74,63 +74,36 @@ interface EpalStudentInterface extends ContentEntityInterface, EntityChangedInt
*/
public function setPublished($published);
/**
* Gets the EPAL Student surname.
*
* @return string
* Surname of the EPAL Student.
*/
public function getSurname();
/**
* Sets the EPAL Student surname.
*
* @param string $surname
* The EPAL Student surname.
*
* @return \Drupal\epal\Entity\EpalStudentInterface
* The called EPAL Student entity.
*/
public function setSurname($surname);
/**
* Gets the EPAL Student address.
*
* @return string
* Address of the EPAL Student.
*/
public function getAddress();
/**
* Sets the EPAL Student address.
*
* @param string $address
* The EPAL Student address.
*
* @return \Drupal\epal\Entity\EpalStudentInterface
* The called EPAL Student entity.
*/
public function setAddress($address);
/**
* Gets the EPAL Student birthdate.
*
* @return string
* Birthdate of the EPAL Student.
*/
public function getBirthdate();
/**
* Sets the EPAL Student birthdate.
*
* @param string $birthdate
* The EPAL Student birthdate.
*
* @return \Drupal\epal\Entity\EpalStudentInterface
* The called EPAL Student entity.
*/
public function setBirthdate($birthdate);
//get/set methods for additional fields for configuration properties.
public function getUser_id();
public function setUser_id($val);
public function getEpaluser_id();
public function setEpaluser_id($val);
public function getStudentSurname();
public function setStudentSurname($val);
//public function getGuardianFirstname();
//public function setGuardianFirstname($val);
//public function getGuardianSurname();
//public function setGuardianSurname($val);
public function getStudentAmka();
public function setStudentAmka($val);
public function getRegionAddress();
public function setRegionAddress($val);
public function getRegionTK();
public function setRegionTK($val);
public function getRegionArea();
public function setRegionArea($val);
public function getCertificateType();
public function setCertificateType($val);
public function getCurrentclass();
public function setCurrentclass($val);
public function getCurrentepal();
public function setCurrentepal($val);
public function getCurrentsector();
public function setCurrentsector($val);
public function getTelnum();
public function setTelnum($val);
public function getRelationToStudent();
public function setRelationToStudent($val);
}
......@@ -45,6 +45,10 @@ use Drupal\user\UserInterface;
* "uid" = "user_id",
* "langcode" = "langcode",
* "status" = "status",
* "drupaluser_id" = "drupaluser_id",
* "name" = "name",
* "surname" = "surname",
* "taxis_taxid" = "taxis_taxid",
* },
* links = {
* "canonical" = "/admin/structure/epal_users/{epal_users}",
......@@ -56,6 +60,7 @@ use Drupal\user\UserInterface;
* field_ui_base_route = "epal_users.settings"
* )
*/
class EpalUsers extends ContentEntityBase implements EpalUsersInterface {
use EntityChangedTrait;
......@@ -145,21 +150,163 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface {
return $this;
}
/**
* get / set methods for aditional fields
*/
public function getDrupaluser_id() {
return $this->get('drupaluser_id')->value;
}
public function setDrupaluser_id($name) {
$this->set('drupaluser_id', $name);
return $this;
}
public function getTaxis_userid() {
return $this->get('taxis_userid')->value;
}
public function setTaxis_userid($name) {
$this->set('taxis_userid', $name);
return $this;
}
public function getTaxis_taxid() {
return $this->get('taxis_taxid')->value;
}
public function setTaxis_taxid($name) {
$this->set('taxis_taxid', $name);
return $this;
}
public function getSurname() {
return $this->get('surname')->value;
}
public function setSurname($name) {
$this->set('surname', $name);
return $this;
}
public function getFathername() {