Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
e-epal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Χάρης Παπαδόπουλος
e-epal
Commits
830874b9
Commit
830874b9
authored
Feb 19, 2017
by
Χάρης Παπαδόπουλος
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'nkatsaounos/e-epal-forms_updates' into develop
parents
a5ca925f
d3cd9c9f
Changes
43
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
1405 additions
and
272 deletions
+1405
-272
drupal/modules/epal/epal.links.action.yml
drupal/modules/epal/epal.links.action.yml
+5
-0
drupal/modules/epal/epal.links.menu.yml
drupal/modules/epal/epal.links.menu.yml
+14
-0
drupal/modules/epal/epal.links.task.yml
drupal/modules/epal/epal.links.task.yml
+22
-0
drupal/modules/epal/epal.permissions.yml
drupal/modules/epal/epal.permissions.yml
+22
-0
drupal/modules/epal/epal_student_sector_field.page.inc
drupal/modules/epal/epal_student_sector_field.page.inc
+30
-0
drupal/modules/epal/src/Entity/EpalStudent.php
drupal/modules/epal/src/Entity/EpalStudent.php
+70
-23
drupal/modules/epal/src/Entity/EpalStudentCourseField.php
drupal/modules/epal/src/Entity/EpalStudentCourseField.php
+5
-5
drupal/modules/epal/src/Entity/EpalStudentCourseFieldInterface.php
...dules/epal/src/Entity/EpalStudentCourseFieldInterface.php
+2
-2
drupal/modules/epal/src/Entity/EpalStudentInterface.php
drupal/modules/epal/src/Entity/EpalStudentInterface.php
+6
-4
drupal/modules/epal/src/Entity/EpalStudentSectorField.php
drupal/modules/epal/src/Entity/EpalStudentSectorField.php
+295
-0
drupal/modules/epal/src/Entity/EpalStudentSectorFieldInterface.php
...dules/epal/src/Entity/EpalStudentSectorFieldInterface.php
+83
-0
drupal/modules/epal/src/Entity/EpalStudentSectorFieldViewsData.php
...dules/epal/src/Entity/EpalStudentSectorFieldViewsData.php
+24
-0
drupal/modules/epal/src/EpalStudentCourseFieldListBuilder.php
...al/modules/epal/src/EpalStudentCourseFieldListBuilder.php
+2
-6
drupal/modules/epal/src/EpalStudentListBuilder.php
drupal/modules/epal/src/EpalStudentListBuilder.php
+0
-22
drupal/modules/epal/src/EpalStudentSectorFieldAccessControlHandler.php
...s/epal/src/EpalStudentSectorFieldAccessControlHandler.php
+47
-0
drupal/modules/epal/src/EpalStudentSectorFieldHtmlRouteProvider.php
...ules/epal/src/EpalStudentSectorFieldHtmlRouteProvider.php
+85
-0
drupal/modules/epal/src/EpalStudentSectorFieldListBuilder.php
...al/modules/epal/src/EpalStudentSectorFieldListBuilder.php
+65
-0
drupal/modules/epal/src/EpalStudentSectorFieldTranslationHandler.php
...les/epal/src/EpalStudentSectorFieldTranslationHandler.php
+14
-0
drupal/modules/epal/src/Form/EpalStudentSectorFieldDeleteForm.php
...odules/epal/src/Form/EpalStudentSectorFieldDeleteForm.php
+15
-0
drupal/modules/epal/src/Form/EpalStudentSectorFieldForm.php
drupal/modules/epal/src/Form/EpalStudentSectorFieldForm.php
+50
-0
drupal/modules/epal/src/Form/EpalStudentSectorFieldSettingsForm.php
...ules/epal/src/Form/EpalStudentSectorFieldSettingsForm.php
+55
-0
drupal/modules/epal/templates/epal_student_sector_field.html.twig
...odules/epal/templates/epal_student_sector_field.html.twig
+22
-0
source/actions/regionschools.actions.ts
source/actions/regionschools.actions.ts
+10
-1
source/app.settings.ts
source/app.settings.ts
+2
-2
source/components/form-controls/form3.ts
source/components/form-controls/form3.ts
+7
-2
source/components/navbar/navbar.component.html
source/components/navbar/navbar.component.html
+1
-0
source/components/student-application-form/amka-fill.ts
source/components/student-application-form/amka-fill.ts
+2
-2
source/components/student-application-form/application.form.main.html
...nents/student-application-form/application.form.main.html
+41
-29
source/components/student-application-form/application.form.main.ts
...ponents/student-application-form/application.form.main.ts
+19
-26
source/components/student-application-form/application.preview.ts
...omponents/student-application-form/application.preview.ts
+51
-90
source/components/student-application-form/application.submit.ts
...components/student-application-form/application.submit.ts
+120
-0
source/components/student-application-form/region.schools.select.ts
...ponents/student-application-form/region.schools.select.ts
+13
-17
source/components/student-application-form/schools-order-select.ts
...mponents/student-application-form/schools-order-select.ts
+123
-0
source/components/student-application-form/sector.fields.select.ts
...mponents/student-application-form/sector.fields.select.ts
+0
-18
source/components/students/student.ts
source/components/students/student.ts
+28
-5
source/constants.ts
source/constants.ts
+2
-1
source/containers/main.routes.ts
source/containers/main.routes.ts
+8
-5
source/services/helper-data-service.ts
source/services/helper-data-service.ts
+1
-1
source/store/regionschools/regionschools.reducer.ts
source/store/regionschools/regionschools.reducer.ts
+18
-3
source/store/regionschools/regionschools.transformers.ts
source/store/regionschools/regionschools.transformers.ts
+1
-1
source/store/regionschools/regionschools.types.ts
source/store/regionschools/regionschools.types.ts
+1
-0
source/store/studentdatafields/studentdatafields.transformers.ts
...store/studentdatafields/studentdatafields.transformers.ts
+10
-0
source/store/studentdatafields/studentdatafields.types.ts
source/store/studentdatafields/studentdatafields.types.ts
+14
-7
No files found.
drupal/modules/epal/epal.links.action.yml
View file @
830874b9
...
...
@@ -23,3 +23,8 @@ entity.epal_users.add_form:
title
:
'
Add
Epal
users'
appears_on
:
-
entity.epal_users.collection
entity.epal_student_sector_field.add_form
:
route_name
:
entity.epal_student_sector_field.add_form
title
:
'
Add
Epal
student
sector
field'
appears_on
:
-
entity.epal_student_sector_field.collection
drupal/modules/epal/epal.links.menu.yml
View file @
830874b9
...
...
@@ -68,3 +68,17 @@ epal_users.admin.structure.settings:
description
:
'
Configure
Epal
users
entities'
route_name
:
epal_users.settings
parent
:
system.admin_structure
# Epal student sector field menu items definition
entity.epal_student_sector_field.collection
:
title
:
'
Epal
student
sector
field
list'
route_name
:
entity.epal_student_sector_field.collection
description
:
'
List
Epal
student
sector
field
entities'
parent
:
system.admin_structure
weight
:
100
epal_student_sector_field.admin.structure.settings
:
title
:
Epal student sector field settings
description
:
'
Configure
Epal
student
sector
field
entities'
route_name
:
epal_student_sector_field.settings
parent
:
system.admin_structure
drupal/modules/epal/epal.links.task.yml
View file @
830874b9
...
...
@@ -108,3 +108,25 @@ entity.epal_users.delete_form:
title
:
Delete
weight
:
10
# Epal student sector field routing definition
epal_student_sector_field.settings_tab
:
route_name
:
epal_student_sector_field.settings
title
:
'
Settings'
base_route
:
epal_student_sector_field.settings
entity.epal_student_sector_field.canonical
:
route_name
:
entity.epal_student_sector_field.canonical
base_route
:
entity.epal_student_sector_field.canonical
title
:
'
View'
entity.epal_student_sector_field.edit_form
:
route_name
:
entity.epal_student_sector_field.edit_form
base_route
:
entity.epal_student_sector_field.canonical
title
:
'
Edit'
entity.epal_student_sector_field.delete_form
:
route_name
:
entity.epal_student_sector_field.delete_form
base_route
:
entity.epal_student_sector_field.canonical
title
:
Delete
weight
:
10
drupal/modules/epal/epal.permissions.yml
View file @
830874b9
...
...
@@ -108,3 +108,25 @@ view published epal users entities:
view unpublished epal users entities
:
title
:
'
View
unpublished
Epal
users
entities'
add epal student sector field entities
:
title
:
'
Create
new
Epal
student
sector
field
entities'
administer epal student sector field entities
:
title
:
'
Administer
Epal
student
sector
field
entities'
description
:
'
Allow
to
access
the
administration
form
to
configure
Epal
student
sector
field
entities.'
restrict access
:
true
delete epal student sector field entities
:
title
:
'
Delete
Epal
student
sector
field
entities'
edit epal student sector field entities
:
title
:
'
Edit
Epal
student
sector
field
entities'
access epal student sector field overview
:
title
:
'
Access
the
Epal
student
sector
field
overview
page'
view published epal student sector field entities
:
title
:
'
View
published
Epal
student
sector
field
entities'
view unpublished epal student sector field entities
:
title
:
'
View
unpublished
Epal
student
sector
field
entities'
drupal/modules/epal/epal_student_sector_field.page.inc
0 → 100644
View file @
830874b9
<?php
/**
* @file
* Contains epal_student_sector_field.page.inc.
*
* Page callback for Epal student sector field entities.
*/
use
Drupal\Core\Render\Element
;
/**
* Prepares variables for Epal student sector field templates.
*
* Default template: epal_student_sector_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_sector_field
(
array
&
$variables
)
{
// Fetch EpalStudentSectorField Entity Object.
$epal_student_sector_field
=
$variables
[
'elements'
][
'#epal_student_sector_field'
];
// Helpful $content variable for templates.
foreach
(
Element
::
children
(
$variables
[
'elements'
])
as
$key
)
{
$variables
[
'content'
][
$key
]
=
$variables
[
'elements'
][
$key
];
}
}
drupal/modules/epal/src/Entity/EpalStudent.php
View file @
830874b9
...
...
@@ -206,26 +206,32 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface {
return
$this
;
}
public
function
getBirthdate
()
{
return
$this
->
get
(
'birthdate'
)
->
value
;
}
public
function
setBirthdate
(
$name
)
{
$this
->
set
(
'birthdate'
,
$name
);
return
$this
;
}
/*
public function getGuardianFirstname() {
return $this->get('guardianfirstname')->value;
public
function
getFatherFirstname
()
{
return
$this
->
get
(
'fatherfirstname'
)
->
value
;
}
public function set
Guardian
Firstname($name) {
$this->set('
guardian
firstname', $name);
public
function
set
Father
Firstname
(
$name
)
{
$this
->
set
(
'
father
firstname'
,
$name
);
return
$this
;
}
public function get
Guardian
Surname() {
return $this->get('
guardian
surname')->value;
public
function
get
Mother
Surname
()
{
return
$this
->
get
(
'
mother
surname'
)
->
value
;
}
public function set
Guardian
Surname($name) {
$this->set('
guardian
surname', $name);
public
function
set
Mother
Surname
(
$name
)
{
$this
->
set
(
'
mother
surname'
,
$name
);
return
$this
;
}
*/
/**
* {@inheritdoc}
...
...
@@ -477,7 +483,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface {
->
setDisplayConfigurable
(
'form'
,
TRUE
)
->
setDisplayConfigurable
(
'view'
,
TRUE
);
/*
$fields
[
'birthdate'
]
=
BaseFieldDefinition
::
create
(
'datetime'
)
->
setLabel
(
t
(
'Ημερομηνία γέννησης μαθητή'
))
->
setDescription
(
t
(
'Δώσε την Ημερομηνία γέννησης μαθητή.'
))
...
...
@@ -493,7 +499,7 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface {
))
->
setDisplayConfigurable
(
'form'
,
TRUE
)
->
setDisplayConfigurable
(
'view'
,
TRUE
);
*/
/*
$fields['guardianADT'] = BaseFieldDefinition::create('string')
...
...
@@ -517,16 +523,15 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface {
->setDisplayConfigurable('view', TRUE);
*/
/*
$fields['guardianfirstname'] = BaseFieldDefinition::create('string')
->setLabel(t('Όνομα του κηδεμόνα'))
->setDescription(t('Δώσε το όνομα του κηδεμόνα.'))
$fields
[
'fatherfirstname'
]
=
BaseFieldDefinition
::
create
(
'string'
)
->
setLabel
(
t
(
'Όνομα του πατέρα'
))
->
setDescription
(
t
(
'Δώσε το όνομα του πατέρα.'
))
->
setSettings
(
array
(
'max_length'
=>
50
,
'text_processing'
=>
0
,
))
->setRequired(
tru
e)
->
setRequired
(
fals
e
)
->
setDefaultValue
(
''
)
->
setDisplayOptions
(
'view'
,
array
(
'label'
=>
'above'
,
...
...
@@ -540,14 +545,14 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface {
->
setDisplayConfigurable
(
'form'
,
TRUE
)
->
setDisplayConfigurable
(
'view'
,
TRUE
);
$fields['
guardian
surname'] = BaseFieldDefinition::create('string')
->setLabel(t('Επώνυμο
κηδεμόν
α'))
->setDescription(t('Δώσε το επώνυμο του
κηδεμόν
α.'))
$fields
[
'
father
surname'
]
=
BaseFieldDefinition
::
create
(
'string'
)
->
setLabel
(
t
(
'Επώνυμο
πατέρ
α'
))
->
setDescription
(
t
(
'Δώσε το επώνυμο του
πατέρ
α.'
))
->
setSettings
(
array
(
'max_length'
=>
50
,
'text_processing'
=>
0
,
))
->setRequired(
tru
e)
->
setRequired
(
fals
e
)
->
setDefaultValue
(
''
)
->
setDisplayOptions
(
'view'
,
array
(
'label'
=>
'above'
,
...
...
@@ -560,7 +565,49 @@ class EpalStudent extends ContentEntityBase implements EpalStudentInterface {
))
->
setDisplayConfigurable
(
'form'
,
TRUE
)
->
setDisplayConfigurable
(
'view'
,
TRUE
);
*/
$fields
[
'motherfirstname'
]
=
BaseFieldDefinition
::
create
(
'string'
)
->
setLabel
(
t
(
'Όνομα μητέρας'
))
->
setDescription
(
t
(
'Δώσε το όνομα της μητέρας.'
))
->
setSettings
(
array
(
'max_length'
=>
50
,
'text_processing'
=>
0
,
))
->
setRequired
(
false
)
->
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
[
'mothersurname'
]
=
BaseFieldDefinition
::
create
(
'string'
)
->
setLabel
(
t
(
'Επώνυμο μητέρας'
))
->
setDescription
(
t
(
'Δώσε το επώνυμο της μητέρας.'
))
->
setSettings
(
array
(
'max_length'
=>
50
,
'text_processing'
=>
0
,
))
->
setRequired
(
false
)
->
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
(
'ΑΜΚΑ μαθητή'
))
...
...
drupal/modules/epal/src/Entity/EpalStudentCourseField.php
View file @
830874b9
...
...
@@ -150,15 +150,15 @@ class EpalStudentCourseField extends ContentEntityBase implements EpalStudentCou
/**
* {@inheritdoc}
*/
public
function
getCourse
F
ield_id
()
{
return
$this
->
get
(
'course
F
ield_id'
)
->
getString
();
public
function
getCourse
f
ield_id
()
{
return
$this
->
get
(
'course
f
ield_id'
)
->
getString
();
}
/**
* {@inheritdoc}
*/
public
function
setCourse
F
ield_id
(
$name
)
{
$this
->
set
(
'course
F
ield_id'
,
$name
);
public
function
setCourse
f
ield_id
(
$name
)
{
$this
->
set
(
'course
f
ield_id'
,
$name
);
return
$this
;
}
...
...
@@ -256,7 +256,7 @@ class EpalStudentCourseField extends ContentEntityBase implements EpalStudentCou
->
setDisplayConfigurable
(
'view'
,
TRUE
);
$fields
[
'course
F
ield_id'
]
=
BaseFieldDefinition
::
create
(
'entity_reference'
)
$fields
[
'course
f
ield_id'
]
=
BaseFieldDefinition
::
create
(
'entity_reference'
)
->
setLabel
(
t
(
'ID ειδικότητας'
))
->
setDescription
(
t
(
'Δώσε το id ειδικότητας που επέλεξε ο μαθητής.'
))
->
setSetting
(
'target_type'
,
'eepal_specialty'
)
...
...
drupal/modules/epal/src/Entity/EpalStudentCourseFieldInterface.php
View file @
830874b9
...
...
@@ -75,8 +75,8 @@ interface EpalStudentCourseFieldInterface extends ContentEntityInterface, Entit
public
function
setPublished
(
$published
);
//get/set methods for additional fields for configuration properties.
public
function
getCourse
F
ield_id
();
public
function
setCourse
F
ield_id
(
$val
);
public
function
getCourse
f
ield_id
();
public
function
setCourse
f
ield_id
(
$val
);
public
function
getStudent_id
();
public
function
setStudent_id
(
$val
);
...
...
drupal/modules/epal/src/Entity/EpalStudentInterface.php
View file @
830874b9
...
...
@@ -81,10 +81,12 @@ interface EpalStudentInterface extends ContentEntityInterface, EntityChangedInt
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
getBirthdate
();
public
function
setBirthdate
(
$val
);
public
function
getFatherFirstname
();
public
function
setFatherFirstname
(
$val
);
public
function
getMotherSurname
();
public
function
setMotherSurname
(
$val
);
public
function
getStudentAmka
();
public
function
setStudentAmka
(
$val
);
public
function
getRegionAddress
();
...
...
drupal/modules/epal/src/Entity/EpalStudentSectorField.php
0 → 100644
View file @
830874b9
<?php
namespace
Drupal\epal\Entity
;
use
Drupal\Core\Entity\EntityStorageInterface
;
use
Drupal\Core\Field\BaseFieldDefinition
;
use
Drupal\Core\Entity\ContentEntityBase
;
use
Drupal\Core\Entity\EntityChangedTrait
;
use
Drupal\Core\Entity\EntityTypeInterface
;
use
Drupal\user\UserInterface
;
/**
* Defines the Epal student sector field entity.
*
* @ingroup epal
*
* @ContentEntityType(
* id = "epal_student_sector_field",
* label = @Translation("Epal student sector field"),
* handlers = {
* "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
* "list_builder" = "Drupal\epal\EpalStudentSectorFieldListBuilder",
* "views_data" = "Drupal\epal\Entity\EpalStudentSectorFieldViewsData",
* "translation" = "Drupal\epal\EpalStudentSectorFieldTranslationHandler",
*
* "form" = {
* "default" = "Drupal\epal\Form\EpalStudentSectorFieldForm",
* "add" = "Drupal\epal\Form\EpalStudentSectorFieldForm",
* "edit" = "Drupal\epal\Form\EpalStudentSectorFieldForm",
* "delete" = "Drupal\epal\Form\EpalStudentSectorFieldDeleteForm",
* },
* "access" = "Drupal\epal\EpalStudentSectorFieldAccessControlHandler",
* "route_provider" = {
* "html" = "Drupal\epal\EpalStudentSectorFieldHtmlRouteProvider",
* },
* },
* base_table = "epal_student_sector_field",
* data_table = "epal_student_sector_field_field_data",
* translatable = TRUE,
* admin_permission = "administer epal student sector field entities",
* entity_keys = {
* "id" = "id",
* "label" = "name",
* "uuid" = "uuid",
* "uid" = "user_id",
* "langcode" = "langcode",
* "status" = "status",
* },
* links = {
* "canonical" = "/admin/structure/epal_student_sector_field/{epal_student_sector_field}",
* "add-form" = "/admin/structure/epal_student_sector_field/add",
* "edit-form" = "/admin/structure/epal_student_sector_field/{epal_student_sector_field}/edit",
* "delete-form" = "/admin/structure/epal_student_sector_field/{epal_student_sector_field}/delete",
* "collection" = "/admin/structure/epal_student_sector_field",
* },
* field_ui_base_route = "epal_student_sector_field.settings"
* )
*/
class
EpalStudentSectorField
extends
ContentEntityBase
implements
EpalStudentSectorFieldInterface
{
use
EntityChangedTrait
;
/**
* {@inheritdoc}
*/
public
static
function
preCreate
(
EntityStorageInterface
$storage_controller
,
array
&
$values
)
{
parent
::
preCreate
(
$storage_controller
,
$values
);
$values
+=
array
(
'user_id'
=>
\
Drupal
::
currentUser
()
->
id
(),
);
}
/**
* {@inheritdoc}
*/
public
function
getName
()
{
return
$this
->
get
(
'name'
)
->
value
;
}
/**
* {@inheritdoc}
*/
public
function
setName
(
$name
)
{
$this
->
set
(
'name'
,
$name
);
return
$this
;
}
/**
* {@inheritdoc}
*/
public
function
getCreatedTime
()
{
return
$this
->
get
(
'created'
)
->
value
;
}
/**
* {@inheritdoc}
*/
public
function
setCreatedTime
(
$timestamp
)
{
$this
->
set
(
'created'
,
$timestamp
);
return
$this
;
}
/**
* {@inheritdoc}
*/
public
function
getOwner
()
{
return
$this
->
get
(
'user_id'
)
->
entity
;
}
/**
* {@inheritdoc}
*/
public
function
getOwnerId
()
{
return
$this
->
get
(
'user_id'
)
->
target_id
;
}
/**
* {@inheritdoc}
*/
public
function
setOwnerId
(
$uid
)
{
$this
->
set
(
'user_id'
,
$uid
);
return
$this
;
}
/**
* {@inheritdoc}
*/
public
function
setOwner
(
UserInterface
$account
)
{
$this
->
set
(
'user_id'
,
$account
->
id
());
return
$this
;
}
/**
* {@inheritdoc}
*/
public
function
isPublished
()
{
return
(
bool
)
$this
->
getEntityKey
(
'status'
);
}
/**
* {@inheritdoc}
*/
public
function
setPublished
(
$published
)
{
$this
->
set
(
'status'
,
$published
?
TRUE
:
FALSE
);
return
$this
;
}
/**
* {@inheritdoc}
*/
public
function
getSectorfield_id
()
{
return
$this
->
get
(
'sectorfield_id'
)
->
getString
();
}
/**
* {@inheritdoc}
*/
public
function
setSectorfield_id
(
$name
)
{
$this
->
set
(
'sectorfield_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}
*/
public
static
function
baseFieldDefinitions
(
EntityTypeInterface
$entity_type
)
{
$fields
=
parent
::
baseFieldDefinitions
(
$entity_type
);
$fields
[
'user_id'
]
=
BaseFieldDefinition
::
create
(
'entity_reference'
)
->
setLabel
(
t
(
'Δημιουργός'
))
->
setDescription
(
t
(
'Δημιουργός.'
))
->
setRevisionable
(
TRUE
)
->
setSetting
(
'target_type'
,
'user'
)
->
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
[
'name'
]
=
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
[
'student_id'
]
=
BaseFieldDefinition
::
create
(
'entity_reference'
)
->
setLabel
(
t
(
'ID Μαθητή'
))
->
setDescription
(
t
(
'Δώσε το id μαθητή.'
))
->
setSetting
(
'target_type'
,
'epal_student'
)
->
setSetting
(
'handler'
,
'default'
)
->
setTranslatable
(
TRUE
)
->
setDisplayOptions
(
'view'
,
array
(
'label'
=>
'above'
,
'type'
=>
'author'
,
'weight'
=>
-
4
,
))
->
setRequired
(
true
)
->
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
[
'sectorfield_id'
]
=
BaseFieldDefinition
::
create
(
'entity_reference'
)
->
setLabel
(
t
(
'ID τομέα'
))
->
setDescription
(
t
(
'Δώσε το id τομέα που επέλεξε ο μαθητής.'
))
->
setSetting
(
'target_type'
,
'eepal_sectors'
)
->
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
[
'status'
]
=
BaseFieldDefinition
::
create
(
'boolean'
)
->
setLabel
(
t
(
'Publishing status'
))
->
setDescription
(
t
(
'A boolean indicating whether the Epal student sector field is published.'
))
->
setDefaultValue
(
TRUE
);
$fields
[
'created'
]
=
BaseFieldDefinition
::
create
(
'created'
)