update epal module with new entities

parent c160894c
......@@ -2,4 +2,4 @@ name: epal
type: module
description: EPAL Registration
core: 8.x
package: epal
package: EPAL
......@@ -8,3 +8,18 @@ entity.epal_student_class.add_form:
title: 'Add EPAL Student Class'
appears_on:
- entity.epal_student_class.collection
entity.epal_student_epal_chosen.add_form:
route_name: entity.epal_student_epal_chosen.add_form
title: 'Add Epal student epal chosen'
appears_on:
- entity.epal_student_epal_chosen.collection
entity.epal_student_course_field.add_form:
route_name: entity.epal_student_course_field.add_form
title: 'Add Epal student course field'
appears_on:
- entity.epal_student_course_field.collection
entity.epal_users.add_form:
route_name: entity.epal_users.add_form
title: 'Add Epal users'
appears_on:
- entity.epal_users.collection
......@@ -26,3 +26,45 @@ epal_student_class.admin.structure.settings:
description: 'Configure EPAL Student Class entities'
route_name: epal_student_class.settings
parent: system.admin_structure
# Epal student epal chosen menu items definition
entity.epal_student_epal_chosen.collection:
title: 'Epal student epal chosen list'
route_name: entity.epal_student_epal_chosen.collection
description: 'List Epal student epal chosen entities'
parent: system.admin_structure
weight: 100
epal_student_epal_chosen.admin.structure.settings:
title: Epal student epal chosen settings
description: 'Configure Epal student epal chosen entities'
route_name: epal_student_epal_chosen.settings
parent: system.admin_structure
# Epal student course field menu items definition
entity.epal_student_course_field.collection:
title: 'Epal student course field list'
route_name: entity.epal_student_course_field.collection
description: 'List Epal student course field entities'
parent: system.admin_structure
weight: 100
epal_student_course_field.admin.structure.settings:
title: Epal student course field settings
description: 'Configure Epal student course field entities'
route_name: epal_student_course_field.settings
parent: system.admin_structure
# Epal users menu items definition
entity.epal_users.collection:
title: 'Epal users list'
route_name: entity.epal_users.collection
description: 'List Epal users entities'
parent: system.admin_structure
weight: 100
epal_users.admin.structure.settings:
title: Epal users settings
description: 'Configure Epal users entities'
route_name: epal_users.settings
parent: system.admin_structure
......@@ -42,3 +42,69 @@ entity.epal_student_class.delete_form:
title: Delete
weight: 10
# Epal student epal chosen routing definition
epal_student_epal_chosen.settings_tab:
route_name: epal_student_epal_chosen.settings
title: 'Settings'
base_route: epal_student_epal_chosen.settings
entity.epal_student_epal_chosen.canonical:
route_name: entity.epal_student_epal_chosen.canonical
base_route: entity.epal_student_epal_chosen.canonical
title: 'View'
entity.epal_student_epal_chosen.edit_form:
route_name: entity.epal_student_epal_chosen.edit_form
base_route: entity.epal_student_epal_chosen.canonical
title: 'Edit'
entity.epal_student_epal_chosen.delete_form:
route_name: entity.epal_student_epal_chosen.delete_form
base_route: entity.epal_student_epal_chosen.canonical
title: Delete
weight: 10
# Epal student course field routing definition
epal_student_course_field.settings_tab:
route_name: epal_student_course_field.settings
title: 'Settings'
base_route: epal_student_course_field.settings
entity.epal_student_course_field.canonical:
route_name: entity.epal_student_course_field.canonical
base_route: entity.epal_student_course_field.canonical
title: 'View'
entity.epal_student_course_field.edit_form:
route_name: entity.epal_student_course_field.edit_form
base_route: entity.epal_student_course_field.canonical
title: 'Edit'
entity.epal_student_course_field.delete_form:
route_name: entity.epal_student_course_field.delete_form
base_route: entity.epal_student_course_field.canonical
title: Delete
weight: 10
# Epal users routing definition
epal_users.settings_tab:
route_name: epal_users.settings
title: 'Settings'
base_route: epal_users.settings
entity.epal_users.canonical:
route_name: entity.epal_users.canonical
base_route: entity.epal_users.canonical
title: 'View'
entity.epal_users.edit_form:
route_name: entity.epal_users.edit_form
base_route: entity.epal_users.canonical
title: 'Edit'
entity.epal_users.delete_form:
route_name: entity.epal_users.delete_form
base_route: entity.epal_users.canonical
title: Delete
weight: 10
......@@ -42,3 +42,69 @@ view published epal student class entities:
view unpublished epal student class entities:
title: 'View unpublished EPAL Student Class entities'
add epal student epal chosen entities:
title: 'Create new Epal student epal chosen entities'
administer epal student epal chosen entities:
title: 'Administer Epal student epal chosen entities'
description: 'Allow to access the administration form to configure Epal student epal chosen entities.'
restrict access: true
delete epal student epal chosen entities:
title: 'Delete Epal student epal chosen entities'
edit epal student epal chosen entities:
title: 'Edit Epal student epal chosen entities'
access epal student epal chosen overview:
title: 'Access the Epal student epal chosen overview page'
view published epal student epal chosen entities:
title: 'View published Epal student epal chosen entities'
view unpublished epal student epal chosen entities:
title: 'View unpublished Epal student epal chosen entities'
add epal student course field entities:
title: 'Create new Epal student course field entities'
administer epal student course field entities:
title: 'Administer Epal student course field entities'
description: 'Allow to access the administration form to configure Epal student course field entities.'
restrict access: true
delete epal student course field entities:
title: 'Delete Epal student course field entities'
edit epal student course field entities:
title: 'Edit Epal student course field entities'
access epal student course field overview:
title: 'Access the Epal student course field overview page'
view published epal student course field entities:
title: 'View published Epal student course field entities'
view unpublished epal student course field entities:
title: 'View unpublished Epal student course field entities'
add epal users entities:
title: 'Create new Epal users entities'
administer epal users entities:
title: 'Administer Epal users entities'
description: 'Allow to access the administration form to configure Epal users entities.'
restrict access: true
delete epal users entities:
title: 'Delete Epal users entities'
edit epal users entities:
title: 'Edit Epal users entities'
access epal users overview:
title: 'Access the Epal users overview page'
view published epal users entities:
title: 'View published Epal users entities'
view unpublished epal users entities:
title: 'View unpublished Epal users entities'
<?php
/**
* @file
* Contains epal_student_course_field.page.inc.
*
* Page callback for Epal student course field entities.
*/
use Drupal\Core\Render\Element;
/**
* Prepares variables for Epal student course field templates.
*
* Default template: epal_student_course_field.html.twig.
*
* @param array $variables
* An associative array containing:
* - elements: An associative array containing the user information and any
* - attributes: HTML attributes for the containing element.
*/
function template_preprocess_epal_student_course_field(array &$variables) {
// Fetch EpalStudentCourseField Entity Object.
$epal_student_course_field = $variables['elements']['#epal_student_course_field'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
}
<?php
/**
* @file
* Contains epal_student_epal_chosen.page.inc.
*
* Page callback for Epal student epal chosen entities.
*/
use Drupal\Core\Render\Element;
/**
* Prepares variables for Epal student epal chosen templates.
*
* Default template: epal_student_epal_chosen.html.twig.
*
* @param array $variables
* An associative array containing:
* - elements: An associative array containing the user information and any
* - attributes: HTML attributes for the containing element.
*/
function template_preprocess_epal_student_epal_chosen(array &$variables) {
// Fetch EpalStudentEpalChosen Entity Object.
$epal_student_epal_chosen = $variables['elements']['#epal_student_epal_chosen'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
}
<?php
/**
* @file
* Contains epal_users.page.inc.
*
* Page callback for Epal users entities.
*/
use Drupal\Core\Render\Element;
/**
* Prepares variables for Epal users templates.
*
* Default template: epal_users.html.twig.
*
* @param array $variables
* An associative array containing:
* - elements: An associative array containing the user information and any
* - attributes: HTML attributes for the containing element.
*/
function template_preprocess_epal_users(array &$variables) {
// Fetch EpalUsers Entity Object.
$epal_users = $variables['elements']['#epal_users'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
}
......@@ -258,9 +258,57 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface {
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Name'))
->setDescription(t('The name of the EPAL Student entity.'))
$fields['name'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('EpalUsers id'))
->setDescription(t('Δώσε το id του EpalUsers.'))
->setSetting('target_type', 'epal_users')
->setSetting('handler', 'default')
->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' => '',
),
))
->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')
->setLabel(t('Όνομα μαθητή'))
->setDescription(t('Δώσε το μικρό μαθητή.'))
->setSettings(array(
'max_length' => 50,
'text_processing' => 0,
......@@ -278,22 +326,170 @@ 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['studentSurname'] = 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['changed'] = BaseFieldDefinition::create('changed')
->setLabel(t('Changed'))
->setDescription(t('The time that the entity was last edited.'));
/*
$fields['birthdate'] = BaseFieldDefinition::create('datetime')
->setLabel(t('Ημερομηνία γέννησης μαθητή'))
->setDescription(t('Δώσε την Ημερομηνία γέννησης μαθητή.'))
->setSetting('datetime_type', 'date')
->setRequired(false)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
*/
$fields['surname'] = BaseFieldDefinition::create('string')
->setLabel(t('Surname'))
->setDescription(t('The surname of the Student entity.'))
$fields['guardianSurname'] = 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['guardianFirstname'] = 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['guardianADT'] = 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['studentAmka'] = BaseFieldDefinition::create('string')
->setLabel(t('ΑΜΚΑ μαθητή'))
->setDescription(t('Δώσε το ΑΜΚΑ μαθητή.'))
->setSettings(array(
'max_length' => 20,
'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['regionAddress'] = 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['regionTK'] = BaseFieldDefinition::create('string')
->setLabel(t('ΤΚ περιοχής'))
->setDescription(t('Δώσε τον ΤΚ της διεύθυνσης κατοικίας.'))
->setSettings(array(
'max_length' => 10,
'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['regionArea'] = BaseFieldDefinition::create('string')
->setLabel(t('Πόλη-Κοινότητα'))
->setDescription(t('Δώσε την πόλη ή κοινότητα που διαμένεις.'))
->setSettings(array(
'max_length' => 100,
'text_processing' => 0,
......@@ -312,11 +508,11 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface {
->setDisplayConfigurable('view', TRUE);
$fields['address'] = BaseFieldDefinition::create('string')
->setLabel(t('Address'))
->setDescription(t('The address of the Student entity.'))
$fields['certificateType'] = BaseFieldDefinition::create('string')
->setLabel(t('Τύπος απολυτηρίου'))
->setDescription(t('Δώσε τον τύπο απολυτηρίου, πχ Απολυτήριο Γυμνασίου'))
->setSettings(array(
'max_length' => 255,
'max_length' => 50,
'text_processing' => 0,
))
->setDefaultValue('')
......@@ -332,22 +528,42 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface {
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['birthdate'] = BaseFieldDefinition::create('datetime')
->setLabel(t('Birth date'))
->setDescription(t('The birth date'))
->setSetting('datetime_type', 'date')
->setRequired(true)
$fields['relationToStudent'] = BaseFieldDefinition::create('string')
->setLabel(t('Σχέση αιτούντα με μαθητή'))
->setDescription(t('Δώσε τη σχέση αιτούντα με μαθητή, πχ Γονέας - Κηδεμόνας - Μαθητής'))
->setSettings(array(
'max_length' => 50,
'text_processing' => 0,
))
->setDefaultValue('')
->setDisplayOptions('view', array(