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
cbbf1ee7
Commit
cbbf1ee7
authored
Mar 03, 2017
by
Χάρης Παπαδόπουλος
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://git.minedu.gov.gr/itminedu/e-epal
into login_procedure
Updates necessary
parents
22170516
68c3ed02
Changes
71
Hide whitespace changes
Inline
Side-by-side
Showing
71 changed files
with
2745 additions
and
170 deletions
+2745
-170
drupal/modules/epal/epal.links.action.yml
drupal/modules/epal/epal.links.action.yml
+15
-0
drupal/modules/epal/epal.links.menu.yml
drupal/modules/epal/epal.links.menu.yml
+42
-0
drupal/modules/epal/epal.links.task.yml
drupal/modules/epal/epal.links.task.yml
+66
-0
drupal/modules/epal/epal.permissions.yml
drupal/modules/epal/epal.permissions.yml
+66
-0
drupal/modules/epal/epal_class_limits.page.inc
drupal/modules/epal/epal_class_limits.page.inc
+30
-0
drupal/modules/epal/epal_criteria.page.inc
drupal/modules/epal/epal_criteria.page.inc
+30
-0
drupal/modules/epal/epal_student_moria.page.inc
drupal/modules/epal/epal_student_moria.page.inc
+30
-0
drupal/modules/epal/src/Entity/EpalClassLimits.php
drupal/modules/epal/src/Entity/EpalClassLimits.php
+272
-0
drupal/modules/epal/src/Entity/EpalClassLimitsInterface.php
drupal/modules/epal/src/Entity/EpalClassLimitsInterface.php
+77
-0
drupal/modules/epal/src/Entity/EpalClassLimitsViewsData.php
drupal/modules/epal/src/Entity/EpalClassLimitsViewsData.php
+24
-0
drupal/modules/epal/src/Entity/EpalCriteria.php
drupal/modules/epal/src/Entity/EpalCriteria.php
+248
-0
drupal/modules/epal/src/Entity/EpalCriteriaInterface.php
drupal/modules/epal/src/Entity/EpalCriteriaInterface.php
+77
-0
drupal/modules/epal/src/Entity/EpalCriteriaViewsData.php
drupal/modules/epal/src/Entity/EpalCriteriaViewsData.php
+24
-0
drupal/modules/epal/src/Entity/EpalStudent.php
drupal/modules/epal/src/Entity/EpalStudent.php
+21
-52
drupal/modules/epal/src/Entity/EpalStudentClass.php
drupal/modules/epal/src/Entity/EpalStudentClass.php
+69
-42
drupal/modules/epal/src/Entity/EpalStudentMoria.php
drupal/modules/epal/src/Entity/EpalStudentMoria.php
+298
-0
drupal/modules/epal/src/Entity/EpalStudentMoriaInterface.php
drupal/modules/epal/src/Entity/EpalStudentMoriaInterface.php
+77
-0
drupal/modules/epal/src/Entity/EpalStudentMoriaViewsData.php
drupal/modules/epal/src/Entity/EpalStudentMoriaViewsData.php
+24
-0
drupal/modules/epal/src/EpalClassLimitsAccessControlHandler.php
.../modules/epal/src/EpalClassLimitsAccessControlHandler.php
+47
-0
drupal/modules/epal/src/EpalClassLimitsHtmlRouteProvider.php
drupal/modules/epal/src/EpalClassLimitsHtmlRouteProvider.php
+85
-0
drupal/modules/epal/src/EpalClassLimitsListBuilder.php
drupal/modules/epal/src/EpalClassLimitsListBuilder.php
+45
-0
drupal/modules/epal/src/EpalCriteriaAccessControlHandler.php
drupal/modules/epal/src/EpalCriteriaAccessControlHandler.php
+47
-0
drupal/modules/epal/src/EpalCriteriaHtmlRouteProvider.php
drupal/modules/epal/src/EpalCriteriaHtmlRouteProvider.php
+85
-0
drupal/modules/epal/src/EpalCriteriaListBuilder.php
drupal/modules/epal/src/EpalCriteriaListBuilder.php
+45
-0
drupal/modules/epal/src/EpalStudentMoriaAccessControlHandler.php
...modules/epal/src/EpalStudentMoriaAccessControlHandler.php
+47
-0
drupal/modules/epal/src/EpalStudentMoriaHtmlRouteProvider.php
...al/modules/epal/src/EpalStudentMoriaHtmlRouteProvider.php
+85
-0
drupal/modules/epal/src/EpalStudentMoriaListBuilder.php
drupal/modules/epal/src/EpalStudentMoriaListBuilder.php
+45
-0
drupal/modules/epal/src/Form/EpalClassLimitsDeleteForm.php
drupal/modules/epal/src/Form/EpalClassLimitsDeleteForm.php
+15
-0
drupal/modules/epal/src/Form/EpalClassLimitsForm.php
drupal/modules/epal/src/Form/EpalClassLimitsForm.php
+50
-0
drupal/modules/epal/src/Form/EpalClassLimitsSettingsForm.php
drupal/modules/epal/src/Form/EpalClassLimitsSettingsForm.php
+55
-0
drupal/modules/epal/src/Form/EpalCriteriaDeleteForm.php
drupal/modules/epal/src/Form/EpalCriteriaDeleteForm.php
+15
-0
drupal/modules/epal/src/Form/EpalCriteriaForm.php
drupal/modules/epal/src/Form/EpalCriteriaForm.php
+50
-0
drupal/modules/epal/src/Form/EpalCriteriaSettingsForm.php
drupal/modules/epal/src/Form/EpalCriteriaSettingsForm.php
+55
-0
drupal/modules/epal/src/Form/EpalStudentMoriaDeleteForm.php
drupal/modules/epal/src/Form/EpalStudentMoriaDeleteForm.php
+15
-0
drupal/modules/epal/src/Form/EpalStudentMoriaForm.php
drupal/modules/epal/src/Form/EpalStudentMoriaForm.php
+50
-0
drupal/modules/epal/src/Form/EpalStudentMoriaSettingsForm.php
...al/modules/epal/src/Form/EpalStudentMoriaSettingsForm.php
+55
-0
drupal/modules/epal/templates/epal_class_limits.html.twig
drupal/modules/epal/templates/epal_class_limits.html.twig
+22
-0
drupal/modules/epal/templates/epal_criteria.html.twig
drupal/modules/epal/templates/epal_criteria.html.twig
+22
-0
drupal/modules/epal/templates/epal_student_moria.html.twig
drupal/modules/epal/templates/epal_student_moria.html.twig
+22
-0
drupal/modules/epaldeploysystem/config/install/rest.resource.entity.eepal_admin_area.yml
.../config/install/rest.resource.entity.eepal_admin_area.yml
+1
-1
drupal/modules/epaldeploysystem/config/install/rest.resource.entity.eepal_prefecture.yml
.../config/install/rest.resource.entity.eepal_prefecture.yml
+1
-1
drupal/modules/epaldeploysystem/config/install/rest.resource.entity.eepal_region.yml
...stem/config/install/rest.resource.entity.eepal_region.yml
+1
-1
drupal/modules/epaldeploysystem/config/install/rest.resource.entity.eepal_school.yml
...stem/config/install/rest.resource.entity.eepal_school.yml
+1
-1
drupal/modules/epaldeploysystem/config/install/rest.resource.entity.eepal_specialties_in_epal.yml
...nstall/rest.resource.entity.eepal_specialties_in_epal.yml
+1
-1
drupal/modules/epaldeploysystem/config/install/rest.resource.entity.eepal_specialty.yml
...m/config/install/rest.resource.entity.eepal_specialty.yml
+1
-1
drupal/modules/epaldeploysystem/config/install/rest.resource.entity.epal_student.yml
...stem/config/install/rest.resource.entity.epal_student.yml
+1
-1
drupal/modules/epaldeploysystem/config/install/rest.resource.entity.epal_student_class.yml
...onfig/install/rest.resource.entity.epal_student_class.yml
+1
-1
drupal/modules/epaldeploysystem/config/install/rest.resource.entity.epal_student_course_field.yml
...nstall/rest.resource.entity.epal_student_course_field.yml
+1
-1
drupal/modules/epaldeploysystem/config/install/rest.resource.entity.epal_student_epal_chosen.yml
...install/rest.resource.entity.epal_student_epal_chosen.yml
+1
-1
drupal/modules/epaldeploysystem/config/install/rest.resource.entity.epal_users.yml
...system/config/install/rest.resource.entity.epal_users.yml
+1
-1
drupal/modules/epaldeploysystem/config/install/views.view.coursefields.yml
...aldeploysystem/config/install/views.view.coursefields.yml
+0
-1
drupal/modules/epaldeploysystem/config/install/views.view.coursesectorlist.yml
...ploysystem/config/install/views.view.coursesectorlist.yml
+0
-1
drupal/modules/epaldeploysystem/config/install/views.view.coursesperschool.yml
...ploysystem/config/install/views.view.coursesperschool.yml
+0
-1
drupal/modules/epaldeploysystem/config/install/views.view.regional_epal.yml
...ldeploysystem/config/install/views.view.regional_epal.yml
+0
-1
drupal/modules/epaldeploysystem/config/install/views.view.sectorlist.yml
...epaldeploysystem/config/install/views.view.sectorlist.yml
+0
-1
drupal/modules/epaldeploysystem/config/install/views.view.sectorsperschool.yml
...ploysystem/config/install/views.view.sectorsperschool.yml
+0
-1
drupal/modules/epalreadydata/src/Entity/EepalSchool.php
drupal/modules/epalreadydata/src/Entity/EepalSchool.php
+27
-7
source/actions/criteria.actions.ts
source/actions/criteria.actions.ts
+20
-0
source/actions/index.ts
source/actions/index.ts
+5
-1
source/app.settings.ts
source/app.settings.ts
+5
-2
source/components/student-application-form/application.form.main.html
...nents/student-application-form/application.form.main.html
+74
-35
source/components/student-application-form/application.form.main.ts
...ponents/student-application-form/application.form.main.ts
+81
-11
source/components/student-application-form/epal.class.select.ts
.../components/student-application-form/epal.class.select.ts
+2
-2
source/constants.ts
source/constants.ts
+2
-0
source/store/criteria/criteria.initial-state.ts
source/store/criteria/criteria.initial-state.ts
+5
-0
source/store/criteria/criteria.reducer.ts
source/store/criteria/criteria.reducer.ts
+23
-0
source/store/criteria/criteria.transformers.ts
source/store/criteria/criteria.transformers.ts
+12
-0
source/store/criteria/criteria.types.ts
source/store/criteria/criteria.types.ts
+14
-0
source/store/criteria/index.ts
source/store/criteria/index.ts
+10
-0
source/store/index.ts
source/store/index.ts
+3
-1
source/store/store.ts
source/store/store.ts
+4
-0
No files found.
drupal/modules/epal/epal.links.action.yml
View file @
cbbf1ee7
...
...
@@ -28,3 +28,18 @@ entity.epal_student_sector_field.add_form:
title
:
'
Add
Epal
student
sector
field'
appears_on
:
-
entity.epal_student_sector_field.collection
entity.epal_criteria.add_form
:
route_name
:
entity.epal_criteria.add_form
title
:
'
Add
Epal
criteria'
appears_on
:
-
entity.epal_criteria.collection
entity.epal_student_moria.add_form
:
route_name
:
entity.epal_student_moria.add_form
title
:
'
Add
Epal
student
moria'
appears_on
:
-
entity.epal_student_moria.collection
entity.epal_class_limits.add_form
:
route_name
:
entity.epal_class_limits.add_form
title
:
'
Add
Epal
class
limits'
appears_on
:
-
entity.epal_class_limits.collection
drupal/modules/epal/epal.links.menu.yml
View file @
cbbf1ee7
...
...
@@ -82,3 +82,45 @@ epal_student_sector_field.admin.structure.settings:
description
:
'
Configure
Epal
student
sector
field
entities'
route_name
:
epal_student_sector_field.settings
parent
:
system.admin_structure
# Epal criteria menu items definition
entity.epal_criteria.collection
:
title
:
'
Epal
criteria
list'
route_name
:
entity.epal_criteria.collection
description
:
'
List
Epal
criteria
entities'
parent
:
system.admin_structure
weight
:
100
epal_criteria.admin.structure.settings
:
title
:
Epal criteria settings
description
:
'
Configure
Epal
criteria
entities'
route_name
:
epal_criteria.settings
parent
:
system.admin_structure
# Epal student moria menu items definition
entity.epal_student_moria.collection
:
title
:
'
Epal
student
moria
list'
route_name
:
entity.epal_student_moria.collection
description
:
'
List
Epal
student
moria
entities'
parent
:
system.admin_structure
weight
:
100
epal_student_moria.admin.structure.settings
:
title
:
Epal student moria settings
description
:
'
Configure
Epal
student
moria
entities'
route_name
:
epal_student_moria.settings
parent
:
system.admin_structure
# Epal class limits menu items definition
entity.epal_class_limits.collection
:
title
:
'
Epal
class
limits
list'
route_name
:
entity.epal_class_limits.collection
description
:
'
List
Epal
class
limits
entities'
parent
:
system.admin_structure
weight
:
100
epal_class_limits.admin.structure.settings
:
title
:
Epal class limits settings
description
:
'
Configure
Epal
class
limits
entities'
route_name
:
epal_class_limits.settings
parent
:
system.admin_structure
drupal/modules/epal/epal.links.task.yml
View file @
cbbf1ee7
...
...
@@ -130,3 +130,69 @@ entity.epal_student_sector_field.delete_form:
title
:
Delete
weight
:
10
# Epal criteria routing definition
epal_criteria.settings_tab
:
route_name
:
epal_criteria.settings
title
:
'
Settings'
base_route
:
epal_criteria.settings
entity.epal_criteria.canonical
:
route_name
:
entity.epal_criteria.canonical
base_route
:
entity.epal_criteria.canonical
title
:
'
View'
entity.epal_criteria.edit_form
:
route_name
:
entity.epal_criteria.edit_form
base_route
:
entity.epal_criteria.canonical
title
:
'
Edit'
entity.epal_criteria.delete_form
:
route_name
:
entity.epal_criteria.delete_form
base_route
:
entity.epal_criteria.canonical
title
:
Delete
weight
:
10
# Epal student moria routing definition
epal_student_moria.settings_tab
:
route_name
:
epal_student_moria.settings
title
:
'
Settings'
base_route
:
epal_student_moria.settings
entity.epal_student_moria.canonical
:
route_name
:
entity.epal_student_moria.canonical
base_route
:
entity.epal_student_moria.canonical
title
:
'
View'
entity.epal_student_moria.edit_form
:
route_name
:
entity.epal_student_moria.edit_form
base_route
:
entity.epal_student_moria.canonical
title
:
'
Edit'
entity.epal_student_moria.delete_form
:
route_name
:
entity.epal_student_moria.delete_form
base_route
:
entity.epal_student_moria.canonical
title
:
Delete
weight
:
10
# Epal class limits routing definition
epal_class_limits.settings_tab
:
route_name
:
epal_class_limits.settings
title
:
'
Settings'
base_route
:
epal_class_limits.settings
entity.epal_class_limits.canonical
:
route_name
:
entity.epal_class_limits.canonical
base_route
:
entity.epal_class_limits.canonical
title
:
'
View'
entity.epal_class_limits.edit_form
:
route_name
:
entity.epal_class_limits.edit_form
base_route
:
entity.epal_class_limits.canonical
title
:
'
Edit'
entity.epal_class_limits.delete_form
:
route_name
:
entity.epal_class_limits.delete_form
base_route
:
entity.epal_class_limits.canonical
title
:
Delete
weight
:
10
drupal/modules/epal/epal.permissions.yml
View file @
cbbf1ee7
...
...
@@ -130,3 +130,69 @@ view published epal student sector field entities:
view unpublished epal student sector field entities
:
title
:
'
View
unpublished
Epal
student
sector
field
entities'
add epal criteria entities
:
title
:
'
Create
new
Epal
criteria
entities'
administer epal criteria entities
:
title
:
'
Administer
Epal
criteria
entities'
description
:
'
Allow
to
access
the
administration
form
to
configure
Epal
criteria
entities.'
restrict access
:
true
delete epal criteria entities
:
title
:
'
Delete
Epal
criteria
entities'
edit epal criteria entities
:
title
:
'
Edit
Epal
criteria
entities'
access epal criteria overview
:
title
:
'
Access
the
Epal
criteria
overview
page'
view published epal criteria entities
:
title
:
'
View
published
Epal
criteria
entities'
view unpublished epal criteria entities
:
title
:
'
View
unpublished
Epal
criteria
entities'
add epal student moria entities
:
title
:
'
Create
new
Epal
student
moria
entities'
administer epal student moria entities
:
title
:
'
Administer
Epal
student
moria
entities'
description
:
'
Allow
to
access
the
administration
form
to
configure
Epal
student
moria
entities.'
restrict access
:
true
delete epal student moria entities
:
title
:
'
Delete
Epal
student
moria
entities'
edit epal student moria entities
:
title
:
'
Edit
Epal
student
moria
entities'
access epal student moria overview
:
title
:
'
Access
the
Epal
student
moria
overview
page'
view published epal student moria entities
:
title
:
'
View
published
Epal
student
moria
entities'
view unpublished epal student moria entities
:
title
:
'
View
unpublished
Epal
student
moria
entities'
add epal class limits entities
:
title
:
'
Create
new
Epal
class
limits
entities'
administer epal class limits entities
:
title
:
'
Administer
Epal
class
limits
entities'
description
:
'
Allow
to
access
the
administration
form
to
configure
Epal
class
limits
entities.'
restrict access
:
true
delete epal class limits entities
:
title
:
'
Delete
Epal
class
limits
entities'
edit epal class limits entities
:
title
:
'
Edit
Epal
class
limits
entities'
access epal class limits overview
:
title
:
'
Access
the
Epal
class
limits
overview
page'
view published epal class limits entities
:
title
:
'
View
published
Epal
class
limits
entities'
view unpublished epal class limits entities
:
title
:
'
View
unpublished
Epal
class
limits
entities'
drupal/modules/epal/epal_class_limits.page.inc
0 → 100644
View file @
cbbf1ee7
<?php
/**
* @file
* Contains epal_class_limits.page.inc.
*
* Page callback for Epal class limits entities.
*/
use
Drupal\Core\Render\Element
;
/**
* Prepares variables for Epal class limits templates.
*
* Default template: epal_class_limits.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_class_limits
(
array
&
$variables
)
{
// Fetch EpalClassLimits Entity Object.
$epal_class_limits
=
$variables
[
'elements'
][
'#epal_class_limits'
];
// Helpful $content variable for templates.
foreach
(
Element
::
children
(
$variables
[
'elements'
])
as
$key
)
{
$variables
[
'content'
][
$key
]
=
$variables
[
'elements'
][
$key
];
}
}
drupal/modules/epal/epal_criteria.page.inc
0 → 100644
View file @
cbbf1ee7
<?php
/**
* @file
* Contains epal_criteria.page.inc.
*
* Page callback for Epal criteria entities.
*/
use
Drupal\Core\Render\Element
;
/**
* Prepares variables for Epal criteria templates.
*
* Default template: epal_criteria.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_criteria
(
array
&
$variables
)
{
// Fetch EpalCriteria Entity Object.
$epal_criteria
=
$variables
[
'elements'
][
'#epal_criteria'
];
// Helpful $content variable for templates.
foreach
(
Element
::
children
(
$variables
[
'elements'
])
as
$key
)
{
$variables
[
'content'
][
$key
]
=
$variables
[
'elements'
][
$key
];
}
}
drupal/modules/epal/epal_student_moria.page.inc
0 → 100644
View file @
cbbf1ee7
<?php
/**
* @file
* Contains epal_student_moria.page.inc.
*
* Page callback for Epal student moria entities.
*/
use
Drupal\Core\Render\Element
;
/**
* Prepares variables for Epal student moria templates.
*
* Default template: epal_student_moria.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_moria
(
array
&
$variables
)
{
// Fetch EpalStudentMoria Entity Object.
$epal_student_moria
=
$variables
[
'elements'
][
'#epal_student_moria'
];
// Helpful $content variable for templates.
foreach
(
Element
::
children
(
$variables
[
'elements'
])
as
$key
)
{
$variables
[
'content'
][
$key
]
=
$variables
[
'elements'
][
$key
];
}
}
drupal/modules/epal/src/Entity/EpalClassLimits.php
0 → 100644
View file @
cbbf1ee7
<?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 class limits entity.
*
* @ingroup epal
*
* @ContentEntityType(
* id = "epal_class_limits",
* label = @Translation("Epal class limits"),
* handlers = {
* "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
* "list_builder" = "Drupal\epal\EpalClassLimitsListBuilder",
* "views_data" = "Drupal\epal\Entity\EpalClassLimitsViewsData",
*
* "form" = {
* "default" = "Drupal\epal\Form\EpalClassLimitsForm",
* "add" = "Drupal\epal\Form\EpalClassLimitsForm",
* "edit" = "Drupal\epal\Form\EpalClassLimitsForm",
* "delete" = "Drupal\epal\Form\EpalClassLimitsDeleteForm",
* },
* "access" = "Drupal\epal\EpalClassLimitsAccessControlHandler",
* "route_provider" = {
* "html" = "Drupal\epal\EpalClassLimitsHtmlRouteProvider",
* },
* },
* base_table = "epal_class_limits",
* admin_permission = "administer epal class limits entities",
* entity_keys = {
* "id" = "id",
* "label" = "name",
* "uuid" = "uuid",
* "uid" = "user_id",
* "langcode" = "langcode",
* "status" = "status",
* },
* links = {
* "canonical" = "/admin/structure/epal_class_limits/{epal_class_limits}",
* "add-form" = "/admin/structure/epal_class_limits/add",
* "edit-form" = "/admin/structure/epal_class_limits/{epal_class_limits}/edit",
* "delete-form" = "/admin/structure/epal_class_limits/{epal_class_limits}/delete",
* "collection" = "/admin/structure/epal_class_limits",
* },
* field_ui_base_route = "epal_class_limits.settings"
* )
*/
class
EpalClassLimits
extends
ContentEntityBase
implements
EpalClassLimitsInterface
{
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
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 class limits entity.'
))
->
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'
=>
80
,
'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
[
'category'
]
=
BaseFieldDefinition
::
create
(
'string'
)
->
setLabel
(
t
(
'Κατηγορία σύμφωνα με την περιοχή μετάθεσης'
))
->
setDescription
(
t
(
'Κατηγορία σύμφωνα με την περιοχή μετάθεσης.'
))
->
setSettings
(
array
(
'max_length'
=>
80
,
'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
[
'limit_down'
]
=
BaseFieldDefinition
::
create
(
'integer'
)
->
setLabel
(
t
(
'Κατώτατο όριο μαθητών'
))
->
setDescription
(
t
(
'Κατώτατο όριο μαθητών.'
))
->
setSettings
(
array
(
'max_length'
=>
2
,
'text_processing'
=>
0
,
))
//->setDefaultValue(25)
->
setDisplayOptions
(
'view'
,
array
(
'label'
=>
'above'
,
'type'
=>
'integer'
,
'weight'
=>
-
4
,
))
->
setDisplayOptions
(
'form'
,
array
(
'type'
=>
'integer'
,
'weight'
=>
-
4
,
))
->
setDisplayConfigurable
(
'form'
,
TRUE
)
->
setDisplayConfigurable
(
'view'
,
TRUE
);
$fields
[
'limit_up'
]
=
BaseFieldDefinition
::
create
(
'integer'
)
->
setLabel
(
t
(
'Ανώτατο όριο μαθητών'
))
->
setDescription
(
t
(
'Ανώτατο όριο μαθητών.'
))
->
setSettings
(
array
(
'max_length'
=>
2
,
'text_processing'
=>
0
,
))
//->setDefaultValue(30)
->
setDisplayOptions
(
'view'
,
array
(
'label'
=>
'above'
,
'type'
=>
'integer'
,
'weight'
=>
-
4
,
))
->
setDisplayOptions
(
'form'
,
array
(
'type'
=>
'integer'
,
'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 class limits 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
;
}
}
drupal/modules/epal/src/Entity/EpalClassLimitsInterface.php
0 → 100644
View file @
cbbf1ee7
<?php
namespace
Drupal\epal\Entity
;
use
Drupal\Core\Entity\ContentEntityInterface
;
use
Drupal\Core\Entity\EntityChangedInterface
;
use
Drupal\user\EntityOwnerInterface
;
/**
* Provides an interface for defining Epal class limits entities.
*
* @ingroup epal
*/
interface
EpalClassLimitsInterface
extends
ContentEntityInterface
,
EntityChangedInterface
,
EntityOwnerInterface
{
// Add get/set methods for your configuration properties here.
/**
* Gets the Epal class limits name.
*
* @return string
* Name of the Epal class limits.
*/
public
function
getName
();