Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Χάρης Παπαδόπουλος
e-epal
Commits
7ee3620d
Commit
7ee3620d
authored
Jan 27, 2017
by
Χάρης Παπαδόπουλος
Browse files
Merge branch 'epalmodule' into 'develop'
Epalmodule See merge request !8
parents
79ab1c50
a8cfdd7c
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
drupal/modules/epal/epal.info.yml
View file @
7ee3620d
...
...
@@ -3,3 +3,5 @@ type: module
description
:
EPAL Registration
core
:
8.x
package
:
EPAL
dependencies
:
-
epalreadydata
\ No newline at end of file
drupal/modules/epal/epal_module_description.md
deleted
100644 → 0
View file @
79ab1c50
This diff is collapsed.
Click to expand it.
drupal/modules/epal/src/Entity/EpalStudent.php
View file @
7ee3620d
This diff is collapsed.
Click to expand it.
drupal/modules/epal/src/Entity/EpalStudentCourseField.php
View file @
7ee3620d
...
...
@@ -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'
,
...
...
drupal/modules/epal/src/Entity/EpalStudentCourseFieldInterface.php
View file @
7ee3620d
...
...
@@ -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
);
}
drupal/modules/epal/src/Entity/EpalStudentEpalChosen.php
View file @
7ee3620d
...
...
@@ -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.'
))
...
...
drupal/modules/epal/src/Entity/EpalStudentEpalChosenInterface.php
View file @
7ee3620d
...
...
@@ -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
);
}
drupal/modules/epal/src/Entity/EpalStudentInterface.php
View file @
7ee3620d
...
...
@@ -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
);