diff --git a/drupal/modules/epal/epal.info.yml b/drupal/modules/epal/epal.info.yml index 8234186da53e9da86d27577bfaf73fbe95a2dfe6..2d47ffc5b7a2b641b1b3cdd1346c177a5fdf181c 100644 --- a/drupal/modules/epal/epal.info.yml +++ b/drupal/modules/epal/epal.info.yml @@ -3,3 +3,5 @@ type: module description: EPAL Registration core: 8.x package: EPAL +dependencies: + - epalreadydata \ No newline at end of file diff --git a/drupal/modules/epal/epal_module_description.md b/drupal/modules/epal/epal_module_description.md deleted file mode 100644 index 0d4d227449fc0fb69fdbd9265355d50d5de5c1b9..0000000000000000000000000000000000000000 --- a/drupal/modules/epal/epal_module_description.md +++ /dev/null @@ -1,526 +0,0 @@ - - - - - - - - - - - - - - - - -epal_module_description.md · master · Νίκος Κατσαούνος / myEPALcode · GitLab - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
- - -
- - -
-
- - -
-
-
- -
- -
- - -
-
-
- - -epal_module_description.md - - -5.53 KB - - -
-
-

module epal

Περιγραφή: δημιουργεί τα απαραίτητα content entities για τα δεδομένα που σχετίζονται με την αίτηση του μαθητή. Συγκεκριμένα δημιουργεί τα ακόλουθα content entities:

(σημείωση: στην ονοματολογία των entities έχει χρησιμοποιηθεί το πρόθεμα Epal ώστε όλα τα αντίστοιχα mysql tables που θα δημιουργηθούν να έχουν ονομασία που αρχίζει με αυτό το πρόθεμα, ώστε να είναι "ομαδοποιημένα" και να εντοπίζονται εύκολα).

(σημείωση: στο schema των παρακάτω entities αναφέρονται μόνο τα πεδία που θα χρειαστεί η εφαρμογή μας. Να σημειωθεί ότι κάθε entity έχει επιπλέον τα ακόλουθα πεδία, τα οποία δημιουργήθηκαν κατά τη διαδικασία δημιουργίας και ενημέρωσης με δεδομένα των entities: langcode, user_id, status, created, changed, default_langcode).

EpalUsers

Περιέχει το schema και τα δεδομένα για τους χρήστες. Ουσιαστικά πρόκειται για έναν πίνακα που θα αποθηκεύονται δεδομένα ταυτοποίησης των χρηστών, όπως αυτά μας επιστρέφονται από τα taxis / ΑΜΚΑ service provider. Ο πίνακας αυτός θα έχει αντιστοιχεία 1 προς 1 με τον core πίνακα users του Drupal. Η λύση αυτή προτείνεται για να αποφύγουμε να τροποποιήσουμε το κρίσιμο core entity των users.

* name              id του users (core entity του Drupal)   (entity_reference)
* userId            userid που επιστρέφει το taxis
* userTaxId         tax id που επιστρέφει το taxis (πιθανά είναι το ΑΦΜ)
* userFirstname     όνομα που επιστρέφει το taxis
* userSurname       επώνυμο που επιστρέφει το taxis
* userFatherName    όνομα πατέρα που επιστρέφει το taxis
* userAddress       διεύθυση κατοικίας που επιστρέφει το taxis / ΑΜΚΑ SP (δεν γνωρίζουμε ακόμα αν μπορεί να επιστραφεί)
* userAddressTK     ΤΚ κατοικίας που επιστρέφει το taxis / ΑΜΚΑ SP (δεν γνωρίζουμε ακόμα αν μπορεί να επιστραφεί)
* userAddressArea   Περιοχή κατοικίας που επιστρέφει το taxis / ΑΜΚΑ SP (δεν γνωρίζουμε ακόμα αν μπορεί να επιστραφεί)
* accessToken       access-token που επιστρέφει το taxis 
* offToken          off-token που δημιουργούμε 
* timeLogin         πότε έκανε login ο χρήστης
* timeRegistration  πότε έκανε registration ο χρήστης
* timeTokenInvalid  χρόνος σε min μετά την πάροδο του οποίου γίνεται invalid το token
* userIP            IP χρήστη

EpalStudent

Περιέχει το schema και τα δεδομένα για τους μαθητές για τους οποίους πρόκειται να γίνει αίτηση.

* name                  id του EpalUsers πίνακα  (entity_reference)
* studentFirstname      όνομα μαθητή
* studentSurname        επώνυμο μαθητή
* guardianFirstname     όνομα κηδεμόνα
* guardianSurname       επώνυμο κηδεμόνα
* studentAmka           ΑΜΚΑ μαθητή
* regionAddress         διεύθυνση κατοικίας
* regionTK              ΤΚ κατοικίας
* regionArea            πόλη/χωριό κατοικίας
* certificateType       τύπος απολυτηρίου (πχ "απολυτήριο Γυμνασίου")
* relationToStudent     ποιος κάνει την αίτηση (πχ  "Γονέας", "Μαθητής")

EpalStudentEpalChosen

Περιέχει το schema και τα δεδομένα για το ποια ΕΠΑΛ επέλεξαν στις προτιμήσεις τους ποιοι μαθητές

* name                  ονομασία της εγγραφής (πχ "record1")
* student_id            id μαθητή (entity reference) 
* epal_id               id σχολείου (entity reference)
* choice_no             σειρά προτίμησς (πχ 1, 2 κλπ)
* points_for_order      μόρια για σειρά προτίμησης
* distance_from_epal    απόσταση από διεύθυνση κατοικίας
* points_for_distance   μόρια για απόσταση

EpalStudentCourseField

Περιέχει το schema και τα δεδομένα για το ποιες ειδικότητες επέλεξαν στις προτιμήσεις τους ποιοι μαθητές

* name                  ονομασία της εγγραφής (πχ "record1")
* student_id            id μαθητή (entity reference) 
* courseField_id        id ειδικότητας (entity reference)

EpalStudentClass

Προσοχή: Δεν χρησιμοποιείται αυτό το entity. Εκκρεμεί: ασφαλής τρόπος διαγραφής του από το module.

-
- -
-
- -
- - - - - - -
- -
-
-
-
- - - - - - diff --git a/drupal/modules/epal/src/Entity/EpalStudent.php b/drupal/modules/epal/src/Entity/EpalStudent.php index 34854a8d37be551e4f75e9008fc5225cfe3e6299..9fb911ef89894835befe81a4830ffcf50cdb4a06 100644 --- a/drupal/modules/epal/src/Entity/EpalStudent.php +++ b/drupal/modules/epal/src/Entity/EpalStudent.php @@ -45,10 +45,9 @@ use Drupal\user\UserInterface; * "uid" = "user_id", * "langcode" = "langcode", * "status" = "status", - * "surname" = "surname", - * "address" = "address", - * "birthdate" = "birthdate", - * "epalstudentclass_id" = "epalstudentclass_id", + * "epaluser_id" = "epaluser_id", + * "name" = "name", + * "studentsurname" = "studentsurname", * }, * links = { * "canonical" = "/admin/epal/epal_student/{epal_student}", @@ -74,9 +73,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { ); } - /** - * {@inheritdoc} - */ + public function getName() { return $this->get('name')->value; } @@ -89,9 +86,24 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { return $this; } + /** + * {@inheritdoc} + */ + public function getUser_id() { + return $this->get('user_id')->value; + } + /** * {@inheritdoc} */ + public function setUser_id($name) { + $this->set('user_id', $name); + return $this; + } + + /** + * {@inheritdoc} + */ public function getCreatedTime() { return $this->get('created')->value; } @@ -103,6 +115,21 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { $this->set('created', $timestamp); return $this; } + + /** + * {@inheritdoc} + */ + public function getStatus() { + return $this->get('status')->value; + } + + /** + * {@inheritdoc} + */ + public function setStatus($name) { + $this->set('status', $name); + return $this; + } /** * {@inheritdoc} @@ -110,6 +137,14 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { public function getOwner() { return $this->get('user_id')->entity; } + + /** + * {@inheritdoc} + */ + public function setOwner(UserInterface $account) { + $this->set('user_id', $account->id()); + return $this; + } /** * {@inheritdoc} @@ -129,99 +164,216 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { /** * {@inheritdoc} */ - public function setOwner(UserInterface $account) { - $this->set('user_id', $account->id()); + public function isPublished() { + return (bool) $this->getEntityKey('status'); + } + + /** + * {@inheritdoc} + */ + public function setPublished($published) { + $this->set('status', $published ? TRUE : FALSE); return $this; } + + /** + * {@inheritdoc} + */ + public function getEpaluser_id() { + return $this->get('epaluser_id')->getString(); + } /** * {@inheritdoc} */ - public function isPublished() { - return (bool) $this->getEntityKey('status'); + public function setEpaluser_id($name) { + $this->set('epaluser_id', $name); + return $this; + } + + /** + * {@inheritdoc} + */ + public function getStudentSurname() { + return $this->get('studentsurname')->value; } /** * {@inheritdoc} */ - public function setPublished($published) { - $this->set('status', $published ? TRUE : FALSE); + public function setStudentSurname($name) { + $this->set('Studentsurname', $name); + return $this; + } + + + /* + public function getGuardianFirstname() { + return $this->get('guardianfirstname')->value; + } + + public function setGuardianFirstname($name) { + $this->set('guardianfirstname', $name); + return $this; + } + + public function getGuardianSurname() { + return $this->get('guardiansurname')->value; + } + + public function setGuardianSurname($name) { + $this->set('guardiansurname', $name); return $this; } + */ + /** + * {@inheritdoc} + */ + public function getStudentAmka() { + return $this->get('studentamka')->value; + } /** * {@inheritdoc} */ - public function getSurname() { - return $this->get('surname')->value; + public function setStudentAmka($name) { + $this->set('studentamka', $name); + return $this; + } + + /** + * {@inheritdoc} + */ + public function getRegionAddress() { + return $this->get('regionaddress')->value; + } + + /** + * {@inheritdoc} + */ + public function setRegionAddress($name) { + $this->set('regionaddress', $name); + return $this; + } + + /** + * {@inheritdoc} + */ + public function getRegionTK() { + return $this->get('regiontk')->value; } /** * {@inheritdoc} */ - public function setSurname($surname) { - $this->set('surname', $surname); + public function setRegionTK($name) { + $this->set('regiontk', $name); return $this; } /** * {@inheritdoc} */ - public function getAddress() { - return $this->get('address')->value; + public function getRegionArea() { + return $this->get('regionarea')->value; } /** * {@inheritdoc} */ - public function setAddress($address) { - $this->set('address', $address); + public function setRegionArea($name) { + $this->set('regionarea', $name); return $this; } /** * {@inheritdoc} */ - public function getBirthdate() { - return $this->get('birthdate')->value; + public function getCertificateType() { + return $this->get('certificatetype')->value; + } + + /** + * {@inheritdoc} + */ + public function setCertificateType($name) { + $this->set('certificatetype', $name); + return $this; + } + + /** + * {@inheritdoc} + */ + public function getCurrentclass() { + return $this->get('currentclass')->value; } /** * {@inheritdoc} */ - public function setBirthdate($birthdate) { - $this->set('birthdate', $birthdate); + public function setCurrentclass($name) { + $this->set('currentclass', $name); return $this; } + + /** + * {@inheritdoc} + */ + public function getCurrentepal() { + return $this->get('currentepal')->value; + } /** * {@inheritdoc} */ - public function getEpalstudentclass() { - return $this->get('epalstudentclass_id')->entity; + public function setCurrentepal($name) { + $this->set('currentepal', $name); + return $this; + } + + /** + * {@inheritdoc} + */ + public function getCurrentsector() { + return $this->get('currentsector')->value; } /** * {@inheritdoc} */ - public function getEpalstudentclassId() { - return $this->get('epalstudentclass_id')->target_id; + public function setCurrentsector($name) { + $this->set('currentsector', $name); + return $this; + } + + /** + * {@inheritdoc} + */ + public function getTelnum() { + return $this->get('telnum')->value; } /** * {@inheritdoc} */ - public function setEpalstudentclassId($epalstudentclass_id) { - $this->set('epalstudentclass_id', $epalstudentclass_id); + public function setTelnum($name) { + $this->set('telnum', $name); return $this; } /** * {@inheritdoc} */ - public function setEpalstudentclass(EpalStudentClassInterface $epalstudentclass) { - $this->set('epalstudentclass_id', $epalstudentclass->id()); + public function getRelationToStudent() { + return $this->get('relationtostudent')->value; + } + + /** + * {@inheritdoc} + */ + public function setRelationToStudent($name) { + $this->set('relationtostudent', $name); return $this; } @@ -234,14 +386,14 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { $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 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, )) @@ -258,14 +410,15 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - $fields['name'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('EpalUsers id')) - ->setDescription(t('Δώσε το id του EpalUsers.')) + $fields['epaluser_id'] = BaseFieldDefinition::create('entity_reference') + ->setLabel(t('Id χρήστη ΕΠΑΛ')) + ->setDescription(t('Δώσε το id του αντίστοιχου Epal User.')) ->setSetting('target_type', 'epal_users') ->setSetting('handler', 'default') + ->setRequired(true) ->setTranslatable(TRUE) ->setDisplayOptions('view', array( - 'label' => 'hidden', + 'label' => 'above', 'type' => 'author', 'weight' => 0, )) @@ -281,38 +434,15 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - - - /* - $fields['surname'] = BaseFieldDefinition::create('string') - ->setLabel(t('Surname')) - ->setDescription(t('The surname of the Student entity.')) - ->setSettings(array( - 'max_length' => 100, - '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['studentFirstname'] = BaseFieldDefinition::create('string') + $fields['name'] = BaseFieldDefinition::create('string') ->setLabel(t('Όνομα μαθητή')) ->setDescription(t('Δώσε το μικρό μαθητή.')) ->setSettings(array( 'max_length' => 50, 'text_processing' => 0, )) + ->setRequired(true) ->setDefaultValue('') ->setDisplayOptions('view', array( 'label' => 'above', @@ -325,15 +455,15 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - - $fields['studentSurname'] = BaseFieldDefinition::create('string') + + $fields['studentsurname'] = BaseFieldDefinition::create('string') ->setLabel(t('Επώνυμο μαθητή')) ->setDescription(t('Δώσε το επώνυμο μαθητή.')) ->setSettings(array( 'max_length' => 50, 'text_processing' => 0, )) + ->setRequired(true) ->setDefaultValue('') ->setDisplayOptions('view', array( 'label' => 'above', @@ -364,10 +494,11 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); */ - - $fields['guardianSurname'] = BaseFieldDefinition::create('string') - ->setLabel(t('Επώνυμο κηδεμόνα')) - ->setDescription(t('Δώσε το επώνυμο του κηδεμόνα.')) + + /* + $fields['guardianADT'] = BaseFieldDefinition::create('string') + ->setLabel(t('Ταυτότητα κηδεμόνα')) + ->setDescription(t('Δώσε την ταυτότητα κηδεμόνα.')) ->setSettings(array( 'max_length' => 50, 'text_processing' => 0, @@ -384,14 +515,18 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['guardianFirstname'] = BaseFieldDefinition::create('string') + */ + + + /* + $fields['guardianfirstname'] = BaseFieldDefinition::create('string') ->setLabel(t('Όνομα του κηδεμόνα')) ->setDescription(t('Δώσε το όνομα του κηδεμόνα.')) ->setSettings(array( 'max_length' => 50, 'text_processing' => 0, )) + ->setRequired(true) ->setDefaultValue('') ->setDisplayOptions('view', array( 'label' => 'above', @@ -405,14 +540,14 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - /* - $fields['guardianADT'] = BaseFieldDefinition::create('string') - ->setLabel(t('Ταυτότητα κηδεμόνα')) - ->setDescription(t('Δώσε την ταυτότητα κηδεμόνα.')) + $fields['guardiansurname'] = BaseFieldDefinition::create('string') + ->setLabel(t('Επώνυμο κηδεμόνα')) + ->setDescription(t('Δώσε το επώνυμο του κηδεμόνα.')) ->setSettings(array( 'max_length' => 50, 'text_processing' => 0, )) + ->setRequired(true) ->setDefaultValue('') ->setDisplayOptions('view', array( 'label' => 'above', @@ -427,7 +562,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { ->setDisplayConfigurable('view', TRUE); */ - $fields['studentAmka'] = BaseFieldDefinition::create('string') + $fields['studentamka'] = BaseFieldDefinition::create('string') ->setLabel(t('ΑΜΚΑ μαθητή')) ->setDescription(t('Δώσε το ΑΜΚΑ μαθητή.')) ->setSettings(array( @@ -447,7 +582,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - $fields['regionAddress'] = BaseFieldDefinition::create('string') + $fields['regionaddress'] = BaseFieldDefinition::create('string') ->setLabel(t('Διεύθνση κηδεμόνα')) ->setDescription(t('Δώσε τη διεύθυνση κηδεμόνα.')) ->setSettings(array( @@ -467,7 +602,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - $fields['regionTK'] = BaseFieldDefinition::create('string') + $fields['regiontk'] = BaseFieldDefinition::create('string') ->setLabel(t('ΤΚ περιοχής')) ->setDescription(t('Δώσε τον ΤΚ της διεύθυνσης κατοικίας.')) ->setSettings(array( @@ -487,7 +622,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - $fields['regionArea'] = BaseFieldDefinition::create('string') + $fields['regionarea'] = BaseFieldDefinition::create('string') ->setLabel(t('Πόλη-Κοινότητα')) ->setDescription(t('Δώσε την πόλη ή κοινότητα που διαμένεις.')) ->setSettings(array( @@ -506,9 +641,28 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['certificateType'] = BaseFieldDefinition::create('string') + $fields['regionarea'] = BaseFieldDefinition::create('string') + ->setLabel(t('Πόλη-Κοινότητα')) + ->setDescription(t('Δώσε την πόλη ή κοινότητα που διαμένεις.')) + ->setSettings(array( + 'max_length' => 100, + '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['certificatetype'] = BaseFieldDefinition::create('string') ->setLabel(t('Τύπος απολυτηρίου')) ->setDescription(t('Δώσε τον τύπο απολυτηρίου, πχ Απολυτήριο Γυμνασίου')) ->setSettings(array( @@ -528,9 +682,9 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - $fields['relationToStudent'] = BaseFieldDefinition::create('string') - ->setLabel(t('Σχέση αιτούντα με μαθητή')) - ->setDescription(t('Δώσε τη σχέση αιτούντα με μαθητή, πχ Γονέας - Κηδεμόνας - Μαθητής')) + $fields['currentclass'] = BaseFieldDefinition::create('string') + ->setLabel(t('Τάξη παρακολούθησης')) + ->setDescription(t('Δώσε την τρέχουσα τάξη παρακολούθησης')) ->setSettings(array( 'max_length' => 50, 'text_processing' => 0, @@ -547,37 +701,21 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - - $fields['status'] = BaseFieldDefinition::create('boolean') - ->setLabel(t('Publishing status')) - ->setDescription(t('A boolean indicating whether the EPAL Student is published.')) - ->setDefaultValue(TRUE); - - $fields['created'] = BaseFieldDefinition::create('created') - ->setLabel(t('Created')) - ->setDescription(t('The time that the entity was created.')); - - $fields['changed'] = BaseFieldDefinition::create('changed') - ->setLabel(t('Changed')) - ->setDescription(t('The time that the entity was last edited.')); - - - /* - $fields['epalstudentclass_id'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('Student Class')) - ->setDescription(t('The Students class.')) - ->setSetting('target_type', 'epal_student_class') + + $fields['currentepal'] = BaseFieldDefinition::create('entity_reference') + ->setLabel(t('ΕΠΑΛ παρακολούθησης')) + ->setDescription(t('Δώσε το τρέχον ΕΠΑΛ παρακολούθησης.')) + ->setSetting('target_type', 'eepal_school') ->setSetting('handler', 'default') ->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', @@ -586,9 +724,108 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface { ), )) ->setDisplayConfigurable('form', TRUE) - ->setDisplayConfigurable('view', TRUE); + ->setDisplayConfigurable('view', TRUE); + + $fields['currentsector'] = BaseFieldDefinition::create('string') + ->setLabel(t('Τομέας παρακολούθησης')) + ->setDescription(t('Δώσε τον τομέα παρακολούθησης.')) + ->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['currentsector'] = BaseFieldDefinition::create('entity_reference') + ->setLabel(t('Τομέας παρακολούθησης')) + ->setDescription(t('Δώσε τον τομέα παρακολούθησης.')) + ->setSetting('target_type', 'eepal_sector') + ->setSetting('handler', 'default') + ->setRequired(true) + ->setTranslatable(TRUE) + ->setDisplayOptions('view', array( + 'label' => 'above', + 'type' => 'author', + 'weight' => -4, + )) + ->setDisplayOptions('form', array( + 'type' => 'entity_reference_autocomplete', + 'weight' => -4, + 'settings' => array( + 'match_operator' => 'CONTAINS', + 'size' => '60', + 'autocomplete_type' => 'tags', + 'placeholder' => '', + ), + )) + ->setDisplayConfigurable('form', TRUE) + ->setDisplayConfigurable('view', TRUE); */ + + $fields['relationtostudent'] = BaseFieldDefinition::create('string') + ->setLabel(t('Σχέση αιτούντα με μαθητή')) + ->setDescription(t('Δώσε τη σχέση αιτούντα με μαθητή, πχ Γονέας - Κηδεμόνας - Μαθητής')) + ->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['telnum'] = BaseFieldDefinition::create('string') + ->setLabel(t('Τηλέφωνο επικοινωνίας')) + ->setDescription(t('Δώσε το τηλέφωνο επικοινωνίας')) + ->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['status'] = BaseFieldDefinition::create('boolean') + ->setLabel(t('Publishing status')) + ->setDescription(t('A boolean indicating whether the EPAL Student is published.')) + ->setDefaultValue(TRUE); + + $fields['created'] = BaseFieldDefinition::create('created') + ->setLabel(t('Created')) + ->setDescription(t('The time that the entity was created.')); + $fields['changed'] = BaseFieldDefinition::create('changed') + ->setLabel(t('Changed')) + ->setDescription(t('The time that the entity was last edited.')); + return $fields; } diff --git a/drupal/modules/epal/src/Entity/EpalStudentCourseField.php b/drupal/modules/epal/src/Entity/EpalStudentCourseField.php index bbb7dfc524b45c77c2757710b7ed0af751b16bcd..29a5c29a93542db93eab09f4c1a9a6b94d0120bc 100644 --- a/drupal/modules/epal/src/Entity/EpalStudentCourseField.php +++ b/drupal/modules/epal/src/Entity/EpalStudentCourseField.php @@ -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}", @@ -84,8 +86,8 @@ class EpalStudentCourseField extends ContentEntityBase implements EpalStudentCou $this->set('name', $name); return $this; } - - /** + + /** * {@inheritdoc} */ public function getCreatedTime() { @@ -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('target_type', 'epal_student') ->setSetting('handler', 'default') ->setTranslatable(TRUE) ->setDisplayOptions('view', array( - 'label' => 'hidden', + 'label' => 'above', 'type' => 'author', - 'weight' => 0, + 'weight' => -4, )) - ->setDisplayOptions('form', array( + ->setRequired(true) + ->setDisplayOptions('form', array( 'type' => 'entity_reference_autocomplete', - 'weight' => 5, + 'weight' => -4, 'settings' => array( 'match_operator' => 'CONTAINS', 'size' => '60', @@ -217,24 +252,25 @@ class EpalStudentCourseField extends ContentEntityBase implements EpalStudentCou 'placeholder' => '', ), )) - ->setDisplayConfigurable('form', TRUE) - ->setDisplayConfigurable('view', TRUE); + ->setDisplayConfigurable('form', TRUE) + ->setDisplayConfigurable('view', TRUE); $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', diff --git a/drupal/modules/epal/src/Entity/EpalStudentCourseFieldInterface.php b/drupal/modules/epal/src/Entity/EpalStudentCourseFieldInterface.php index e4813a78e4074ca7c1b26b49f9fe14514fe8f30b..f853e917ea286cbfc48671d9c0fe893b7afb2903 100644 --- a/drupal/modules/epal/src/Entity/EpalStudentCourseFieldInterface.php +++ b/drupal/modules/epal/src/Entity/EpalStudentCourseFieldInterface.php @@ -73,5 +73,11 @@ interface EpalStudentCourseFieldInterface extends ContentEntityInterface, Entit * The called Epal student course field entity. */ 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); } diff --git a/drupal/modules/epal/src/Entity/EpalStudentEpalChosen.php b/drupal/modules/epal/src/Entity/EpalStudentEpalChosen.php index 27c6750e89bef5aa5abc5206c484247cb346c19c..d21eddeba79bc6db04ee729b4b5a6c72ce6e6b19 100644 --- a/drupal/modules/epal/src/Entity/EpalStudentEpalChosen.php +++ b/drupal/modules/epal/src/Entity/EpalStudentEpalChosen.php @@ -39,12 +39,19 @@ use Drupal\user\UserInterface; * translatable = TRUE, * admin_permission = "administer epal student epal chosen entities", * entity_keys = { - * "id" = "id", + * "id" = "id", * "label" = "name", * "uuid" = "uuid", * "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}", @@ -144,7 +151,63 @@ class EpalStudentEpalChosen extends ContentEntityBase implements EpalStudentEpal $this->set('status', $published ? TRUE : FALSE); 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', @@ -175,32 +238,10 @@ 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, @@ -217,69 +258,47 @@ 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, - 'settings' => array( + ->setDisplayOptions('form', array( + 'type' => 'entity_reference_autocomplete', + 'weight' => -4, + 'settings' => array( 'match_operator' => 'CONTAINS', 'size' => '60', 'autocomplete_type' => 'tags', 'placeholder' => '', ), )) - ->setDisplayConfigurable('form', TRUE) - ->setDisplayConfigurable('view', TRUE); - + ->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', @@ -288,17 +307,16 @@ class EpalStudentEpalChosen extends ContentEntityBase implements EpalStudentEpal ), )) ->setDisplayConfigurable('form', TRUE) - ->setDisplayConfigurable('view', 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', @@ -310,7 +328,6 @@ class EpalStudentEpalChosen extends ContentEntityBase implements EpalStudentEpal )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - $fields['points_for_order'] = BaseFieldDefinition::create('integer') ->setLabel(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.')) diff --git a/drupal/modules/epal/src/Entity/EpalStudentEpalChosenInterface.php b/drupal/modules/epal/src/Entity/EpalStudentEpalChosenInterface.php index 74a577368abe9b17d372c5e90a9bbc4b1dbc0508..f63fdd5c4c02ccf43475a398b419ddb60e06756f 100644 --- a/drupal/modules/epal/src/Entity/EpalStudentEpalChosenInterface.php +++ b/drupal/modules/epal/src/Entity/EpalStudentEpalChosenInterface.php @@ -73,5 +73,19 @@ interface EpalStudentEpalChosenInterface extends ContentEntityInterface, Entity * The called Epal student epal chosen 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); + } diff --git a/drupal/modules/epal/src/Entity/EpalStudentInterface.php b/drupal/modules/epal/src/Entity/EpalStudentInterface.php index 14253ece293569de515e40807af0a6a9dcf48e40..1bf10c8a1da075f995ba21d91731670ab9388da5 100644 --- a/drupal/modules/epal/src/Entity/EpalStudentInterface.php +++ b/drupal/modules/epal/src/Entity/EpalStudentInterface.php @@ -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); + } diff --git a/drupal/modules/epal/src/Entity/EpalUsers.php b/drupal/modules/epal/src/Entity/EpalUsers.php index 79e6029d25df4d6dac7ebac49e4395337769940e..63c95065b10a189f327a9aebd50051c4559bf3a5 100644 --- a/drupal/modules/epal/src/Entity/EpalUsers.php +++ b/drupal/modules/epal/src/Entity/EpalUsers.php @@ -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; @@ -144,22 +149,164 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { $this->set('status', $published ? TRUE : FALSE); 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() { + return $this->get('fathername')->value; + } + + public function setFathername($name) { + $this->set('fathername', $name); + return $this; + } + + public function getMothername() { + return $this->get('mothername')->value; + } + + public function setMothername($name) { + $this->set('mothername', $name); + return $this; + } + + /* + public function getAddress() { + return $this->get('address')->value; + } + + public function setAddress($name) { + $this->set('address', $name); + return $this; + } + + public function getAddresstk() { + return $this->get('addresstk')->value; + } + + public function setAddresstk($name) { + $this->set('addresstk', $name); + return $this; + } + + public function getAddressarea() { + return $this->get('addressarea')->value; + } + + public function setAddressarea($name) { + $this->set('addressarea', $name); + return $this; + } + */ + + public function getAccesstoken() { + return $this->get('accesstoken')->value; + } + + public function setAccesstoken($name) { + $this->set('accesstoken', $name); + return $this; + } + + public function getAuthtoken() { + return $this->get('authtoken')->value; + } + + public function setAuthtoken($name) { + $this->set('authtoken', $name); + return $this; + } + + public function getTimelogin() { + return $this->get('timelogin')->value; + } + + public function setTimelogin($name) { + $this->set('timelogin', $name); + return $this; + } + + public function getTimeregistration() { + return $this->get('timeregistration')->value; + } + + public function setTimeregistration($name) { + $this->set('timeregistration', $name); + return $this; + } + + public function getTimetokeninvalid() { + return $this->get('timetokeninvalid')->value; + } + + public function setTimetokeninvalid($name) { + $this->set('timetokeninvalid', $name); + return $this; + } + + public function getUserip() { + return $this->get('userip')->value; + } + + public function setUserip($name) { + $this->set('userip', $name); + return $this; + } /** * {@inheritdoc} */ + public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $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 users 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, )) @@ -176,33 +323,34 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - - $fields['name'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('User Id από Drupal Users ')) - ->setDescription(t('Δώσε το id του user από τον Drupal Users πίνακα')) + $fields['drupaluser_id'] = BaseFieldDefinition::create('entity_reference') + ->setLabel(t('Id χρήστη Drupal')) + ->setDescription(t('Δώσε το id του αντίστοιχου Drupal User.')) + ->setRevisionable(TRUE) ->setSetting('target_type', 'user') ->setSetting('handler', 'default') + ->setRequired(true) ->setTranslatable(TRUE) ->setDisplayOptions('view', array( - 'label' => 'hidden', - 'type' => 'author', - 'weight' => 0, - )) - ->setDisplayOptions('form', array( - 'type' => 'entity_reference_autocomplete', - 'weight' => 5, - 'settings' => array( - 'match_operator' => 'CONTAINS', - 'size' => '60', - 'autocomplete_type' => 'tags', - 'placeholder' => '', + 'label' => 'above', + 'type' => 'author', + 'weight' => 0, + )) + ->setDisplayOptions('form', array( + 'type' => 'entity_reference_autocomplete', + 'weight' => 5, + 'settings' => array( + 'match_operator' => 'CONTAINS', + 'size' => '60', + 'autocomplete_type' => 'tags', + 'placeholder' => '', ), )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['userId'] = BaseFieldDefinition::create('string') + + + $fields['taxis_userid'] = BaseFieldDefinition::create('string') ->setLabel(t('User id χρήστη από taxis')) ->setDescription(t('Δώσε το user id του χρήστη από taxis.')) ->setSettings(array( @@ -221,14 +369,15 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['userTaxId'] = BaseFieldDefinition::create('string') + + $fields['taxis_taxid'] = BaseFieldDefinition::create('string') ->setLabel(t('Tax id χρήστη')) ->setDescription(t('Δώσε το tax id / ΑΦΜ του χρήστη.')) ->setSettings(array( 'max_length' => 50, 'text_processing' => 0, )) + ->setRequired(true) ->setDefaultValue('') ->setDisplayOptions('view', array( 'label' => 'above', @@ -241,14 +390,15 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['userFirstname'] = BaseFieldDefinition::create('string') + + $fields['name'] = BaseFieldDefinition::create('string') ->setLabel(t('Όνομα χρήστη')) - ->setDescription(t('Δώσε το μικρό όνομα του χρήστη.')) + ->setDescription(t('Δώσε το όνομα χρήστη')) ->setSettings(array( - 'max_length' => 50, + 'max_length' => 80, 'text_processing' => 0, )) + ->setRequired(true) ->setDefaultValue('') ->setDisplayOptions('view', array( 'label' => 'above', @@ -261,14 +411,15 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['userSurname'] = BaseFieldDefinition::create('string') + + $fields['surname'] = BaseFieldDefinition::create('string') ->setLabel(t('Επώνυμο χρήστη')) ->setDescription(t('Δώσε το επώνυμο του χρήστη.')) ->setSettings(array( 'max_length' => 50, 'text_processing' => 0, )) + ->setRequired(true) ->setDefaultValue('') ->setDisplayOptions('view', array( 'label' => 'above', @@ -281,8 +432,8 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['userFatherName'] = BaseFieldDefinition::create('string') + + $fields['fathername'] = BaseFieldDefinition::create('string') ->setLabel(t('Όνομα πατέρα χρήστη')) ->setDescription(t('Δώσε το όνομα του πατέρα του χρήστη.')) ->setSettings(array( @@ -301,8 +452,8 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['userMothername'] = BaseFieldDefinition::create('string') + + $fields['mothername'] = BaseFieldDefinition::create('string') ->setLabel(t('Όνομα μητέρας χρήστη')) ->setDescription(t('Δώσε το όνομα της μητέρας χρήστη.')) ->setSettings(array( @@ -321,10 +472,9 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - - - $fields['userAddress'] = BaseFieldDefinition::create('string') + + /* + $fields['address'] = BaseFieldDefinition::create('string') ->setLabel(t('Διεύθυνση κατοικίας')) ->setDescription(t('Δώσε τη διεύθυνση κατοικίας.')) ->setSettings(array( @@ -343,8 +493,8 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['userAddressTK'] = BaseFieldDefinition::create('string') + + $fields['addresstk'] = BaseFieldDefinition::create('string') ->setLabel(t('ΤΚ')) ->setDescription(t('Δώσε τον ΤΚ κατοικίας.')) ->setSettings(array( @@ -363,8 +513,8 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['userAddressArea'] = BaseFieldDefinition::create('string') + + $fields['addressarea'] = BaseFieldDefinition::create('string') ->setLabel(t('Πόλη/Περιοχή διεύθυνσης κατοικίας')) ->setDescription(t('Δώσε την πόλη/περιοχή διεύθυνσης.')) ->setSettings(array( @@ -383,8 +533,9 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['accessToken'] = BaseFieldDefinition::create('string') + */ + + $fields['accesstoken'] = BaseFieldDefinition::create('string') ->setLabel(t('Access-Token από taxis')) ->setDescription(t('Access-Token από taxis.')) ->setSettings(array( @@ -403,10 +554,10 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['offToken'] = BaseFieldDefinition::create('string') - ->setLabel(t('Off-Token')) - ->setDescription(t('Off-Token που δημιουργείται από εμάς.')) + + $fields['authtoken'] = BaseFieldDefinition::create('string') + ->setLabel(t('Authorization Token')) + ->setDescription(t('Authorization Token που δημιουργείται από την εφαρμογή.')) ->setSettings(array( 'max_length' => 300, 'text_processing' => 0, @@ -423,18 +574,18 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['timeLogin'] = BaseFieldDefinition::create('timestamp') + + $fields['timelogin'] = BaseFieldDefinition::create('timestamp') ->setLabel(t('timeLogin')) ->setDescription(t('timeLogin.')) ; - - $fields['timeRegistration'] = BaseFieldDefinition::create('timestamp') + + $fields['timeregistration'] = BaseFieldDefinition::create('timestamp') ->setLabel(t('timeRegistration')) ->setDescription(t('timeRegistration.')) ; - $fields['timeTokenInvalid'] = BaseFieldDefinition::create('integer') + $fields['timetokeninvalid'] = BaseFieldDefinition::create('integer') ->setLabel(t('Χρόνος σε min')) ->setDescription(t('Χρόνος σε min μετά τον οποίο γίνεται το token ανενεργό.')) ->setSettings(array( @@ -444,16 +595,14 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { ->setDisplayOptions('view', array( 'label' => 'above', 'type' => 'integer', - 'weight' => -4, )) ->setDisplayOptions('form', array( 'type' => 'integer', - 'weight' => -4, )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - - $fields['userIP'] = BaseFieldDefinition::create('string') + + $fields['userip'] = BaseFieldDefinition::create('string') ->setLabel(t('userIP')) ->setDescription(t('userIP.')) ->setSettings(array( @@ -472,7 +621,7 @@ class EpalUsers extends ContentEntityBase implements EpalUsersInterface { )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE); - + $fields['status'] = BaseFieldDefinition::create('boolean') ->setLabel(t('Publishing status')) ->setDescription(t('A boolean indicating whether the Epal users is published.')) diff --git a/drupal/modules/epal/src/Entity/EpalUsersInterface.php b/drupal/modules/epal/src/Entity/EpalUsersInterface.php index 7bc087fc9adf42d6df1ce12b77618e96452df203..580b7d32f7c7a3bfa228a02d438db110d1facb9f 100644 --- a/drupal/modules/epal/src/Entity/EpalUsersInterface.php +++ b/drupal/modules/epal/src/Entity/EpalUsersInterface.php @@ -73,5 +73,38 @@ interface EpalUsersInterface extends ContentEntityInterface, EntityChangedInter * The called Epal users entity. */ public function setPublished($published); + + //get/set methods for additional fields for configuration properties. + public function getDrupaluser_id(); + public function setDrupaluser_id($val); + public function getTaxis_userid(); + public function setTaxis_userid($val); + public function getTaxis_taxid(); + public function setTaxis_taxid($val); + public function getSurname(); + public function setSurname($val); + public function getFathername(); + public function setFathername($val); + public function getMothername(); + public function setMothername($val); + //public function getAddress(); + //public function setAddress($val); + //public function getAddresstk(); + //public function setAddresstk($val); + //public function getAddressarea(); + //public function setAddressarea($val); + public function getAccesstoken(); + public function setAccesstoken($val); + public function getAuthtoken(); + public function setAuthtoken($val); + public function getTimelogin(); + public function setTimelogin($val); + public function getTimeregistration(); + public function setTimeregistration($val); + public function getTimetokeninvalid(); + public function setTimetokeninvalid($val); + public function getUserip(); + public function setUserip($val); + } diff --git a/drupal/modules/epal/src/EpalStudentCourseFieldListBuilder.php b/drupal/modules/epal/src/EpalStudentCourseFieldListBuilder.php index fb5b5f95f14953a57bacd629a4e0f3b53eb5b8da..8bbb6ee84e16e189d7b3f1fdf5ae3ce8603c7799 100644 --- a/drupal/modules/epal/src/EpalStudentCourseFieldListBuilder.php +++ b/drupal/modules/epal/src/EpalStudentCourseFieldListBuilder.php @@ -20,8 +20,10 @@ class EpalStudentCourseFieldListBuilder extends EntityListBuilder { * {@inheritdoc} */ public function buildHeader() { - $header['id'] = $this->t('Epal student course field ID'); - $header['name'] = $this->t('Name'); + $header['id'] = $this->t('ID'); + $header['name'] = $this->t('Όνομα'); + $header['student_id'] = $this->t('ID Μαθητή'); + $header['courseField_id'] = $this->t('ID Ειδικότητας'); return $header + parent::buildHeader(); } @@ -39,6 +41,27 @@ class EpalStudentCourseFieldListBuilder extends EntityListBuilder { ) ) ); + $row['student_id'] = $this->l( + $entity->getStudent_id(), + new Url( + 'entity.epal_student_course_field.edit_form', array( + 'epal_student_course_field' => $entity->id(), + ) + ) + ); + $row['courseField_id'] = $this->l( + $entity->getCourseField_id(), + new Url( + 'entity.epal_student_course_field.edit_form', array( + 'epal_student_course_field' => $entity->id(), + ) + ) + ); + + + + + return $row + parent::buildRow($entity); } diff --git a/drupal/modules/epal/src/EpalStudentEpalChosenListBuilder.php b/drupal/modules/epal/src/EpalStudentEpalChosenListBuilder.php index 11ccaa54672d3bfbe264d23a7f3f57d125b8343e..f3d2234f36d1187ef1602ed8d76decc1548f3931 100644 --- a/drupal/modules/epal/src/EpalStudentEpalChosenListBuilder.php +++ b/drupal/modules/epal/src/EpalStudentEpalChosenListBuilder.php @@ -20,8 +20,12 @@ class EpalStudentEpalChosenListBuilder extends EntityListBuilder { * {@inheritdoc} */ public function buildHeader() { - $header['id'] = $this->t('Epal student epal chosen ID'); - $header['name'] = $this->t('Name'); + $header['id'] = $this->t('ID'); + $header['name'] = $this->t('Όνομα'); + $header['student_id'] = $this->t('Id Μαθητή'); + $header['epal_id'] = $this->t('ΕΠΑΛ'); + $header['choice_no'] = $this->t('Σειρά προτίμησης'); + return $header + parent::buildHeader(); } @@ -39,6 +43,11 @@ class EpalStudentEpalChosenListBuilder extends EntityListBuilder { ) ) ); + //$entity->get('name')->getString(); + $row['student_id'] = $entity->getStudent_id(); + $row['epal_id'] = $entity->getEpal_id(); + $row['choice_no'] = $entity->getChoice_no(); + return $row + parent::buildRow($entity); } diff --git a/drupal/modules/epal/src/EpalStudentListBuilder.php b/drupal/modules/epal/src/EpalStudentListBuilder.php index 8074f411e45c71acc5354a40e6e0fdec244e35ec..2f7bac366da58acea63177222ac0a65bee90dd8f 100644 --- a/drupal/modules/epal/src/EpalStudentListBuilder.php +++ b/drupal/modules/epal/src/EpalStudentListBuilder.php @@ -20,8 +20,14 @@ class EpalStudentListBuilder extends EntityListBuilder { * {@inheritdoc} */ public function buildHeader() { - $header['id'] = $this->t('EPAL Student ID'); - $header['name'] = $this->t('Name'); + $header['id'] = $this->t('ID'); + $header['epaluser_id'] = $this->t('ID χρήστη ΕΠΑΛ'); + $header['name'] = $this->t('Όνομα'); + $header['studentsurname'] = $this->t('Επώνυμο'); + //$header['guardianfirstname'] = $this->t('Όνομα κηδεμόνα'); + //$header['guardiansurname'] = $this->t('Επώνυμο κηδεμόνα'); + $header['studentamka'] = $this->t('AMKA μαθητή'); + return $header + parent::buildHeader(); } @@ -31,14 +37,63 @@ class EpalStudentListBuilder extends EntityListBuilder { public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\epal\Entity\EpalStudent */ $row['id'] = $entity->id(); + + $row['epaluser_id'] = $this->l( + $entity->getEpaluser_id(), + new Url( + 'entity.epal_student.edit_form', array( + 'epal_student' => $entity->id(), + ) + ) + ); + $row['name'] = $this->l( - $entity->label(), + $entity->getName(), + new Url( + 'entity.epal_student.edit_form', array( + 'epal_student' => $entity->id(), + ) + ) + ); + + $row['studentsurname'] = $this->l( + $entity->getStudentSurname(), + new Url( + 'entity.epal_student.edit_form', array( + 'epal_student' => $entity->id(), + ) + ) + ); + + /* + $row['guardianfirstname'] = $this->l( + $entity->getGuardianFirstname(), + new Url( + 'entity.epal_student.edit_form', array( + 'epal_student' => $entity->id(), + ) + ) + ); + + $row['guardiansurname'] = $this->l( + $entity->getGuardianSurname(), new Url( 'entity.epal_student.edit_form', array( 'epal_student' => $entity->id(), ) ) ); + */ + + $row['studentAmka'] = $this->l( + $entity->getStudentAmka(), + new Url( + 'entity.epal_student.edit_form', array( + 'epal_student' => $entity->id(), + ) + ) + ); + return $row + parent::buildRow($entity); } diff --git a/drupal/modules/epal/src/EpalUsersListBuilder.php b/drupal/modules/epal/src/EpalUsersListBuilder.php index f624e9b6e9d06d4a59d7214d6f8eafbdb501d9d7..8e9caae9b51f0004eb4feb282efd8a699d71eea6 100644 --- a/drupal/modules/epal/src/EpalUsersListBuilder.php +++ b/drupal/modules/epal/src/EpalUsersListBuilder.php @@ -20,9 +20,26 @@ class EpalUsersListBuilder extends EntityListBuilder { * {@inheritdoc} */ public function buildHeader() { - $header['id'] = $this->t('Epal users ID'); - $header['name'] = $this->t('Name'); - return $header + parent::buildHeader(); + $header['id'] = $this->t('ID'); + $header['name'] = $this->t('Όνομα'); + $header['surname'] = $this->t('Επώνυμο'); + $header['fathername'] = $this->t('Όνομα πατέρα'); + $header['mothername'] = $this->t('Όνομα μητέρας'); + + //$header['drupaluser_id'] = $this->t('ID χρήστη Drupal'); + //$header['taxis_userid'] = $this->t('ID χρήστη από taxisnet'); + //$header['taxis_taxid'] = $this->t('TAXID χρήστη από taxisnet'); + //$header['address'] = $this->t('Διεύθυνση'); + //$header['addresstk'] = $this->t('ΤΚ'); + //$header['addressarea'] = $this->t('Περιοχή'); + //$header['accesstoken'] = $this->t('AccessToken'); + //$header['authtoken'] = $this->t('AuthToken'); + //$header['timelogin'] = $this->t('Time Login'); + //$header['timeregistration'] = $this->t('Time Registration'); + //$header['timetokeninvalid'] = $this->t('Time Token Invalid'); + //$header['userip'] = $this->t('User IP'); + + return $header + parent::buildHeader(); } /** @@ -30,8 +47,8 @@ class EpalUsersListBuilder extends EntityListBuilder { */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\epal\Entity\EpalUsers */ - $row['id'] = $entity->id(); - $row['name'] = $this->l( + $row['id'] = $entity->id(); + $row['name'] = $this->l( $entity->label(), new Url( 'entity.epal_users.edit_form', array( @@ -39,6 +56,31 @@ class EpalUsersListBuilder extends EntityListBuilder { ) ) ); + $row['surname'] = $this->l( + $entity->getSurname(), + new Url( + 'entity.epal_users.edit_form', array( + 'epal_users' => $entity->id(), + ) + ) + ); + $row['fathername'] = $this->l( + $entity->getFathername(), + new Url( + 'entity.epal_users.edit_form', array( + 'epal_users' => $entity->id(), + ) + ) + ); + $row['mothername'] = $this->l( + $entity->getMothername(), + new Url( + 'entity.epal_users.edit_form', array( + 'epal_users' => $entity->id(), + ) + ) + ); + return $row + parent::buildRow($entity); } diff --git a/source/app.settings.ts b/source/app.settings.ts index 126ba1bcb859cbba7cdfb741d4d8178304eeda2c..40da451774b073e0cfb05335e958f8b29a837030 100644 --- a/source/app.settings.ts +++ b/source/app.settings.ts @@ -1,6 +1,6 @@ export class AppSettings { public static get API_ENDPOINT(): string { - return 'http://localhost/dist'; + return 'http://localhost/drupal-8.2.5'; // return 'http://eepal.dev/drupal'; // return 'http://eduslim2.minedu.gov.gr/drupal'; }