Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • itminedu/e-iek
  • giannisdagk/e-iek
  • ackatsaros/e-iek
3 results
Show changes
Commits on Source (21)
Showing
with 1427 additions and 188 deletions
......@@ -97,21 +97,43 @@ class AitisiEntity extends RevisionableContentEntityBase implements AitisiEntity
}
public function getStudent_id() {
public function getSchool() {
return $this->get('iek_id')->entity;
}
public function getSchoolId() {
return $this->get('iek_id')->value;
}
public function setSchoolId($studentId) {
$this->set('iek_id', $studentId);
return $this;
}
public function getStudent() {
return $this->get('student_id')->entity;
}
public function getStudentId() {
return $this->get('student_id')->value;
}
public function setStudent_id($student_id) {
public function setStudentId($student_id) {
$this->set('student_id', $student_id);
return $this;
}
public function getEidikotita() {
return $this->get('eidikotita_id')->entity;
}
public function getEidikotita_id() {
public function getEidikotitaId() {
return $this->get('eidikotita_id')->value;
}
public function setEidikotita_id($eidikotita_id) {
public function setEidikotitaId($eidikotita_id) {
$this->set('eidikotita_id', $eidikotita_id);
return $this;
}
......@@ -143,16 +165,65 @@ class AitisiEntity extends RevisionableContentEntityBase implements AitisiEntity
return $this;
}
public function getRegion_id() {
public function getRegion() {
return $this->get('region_id')->entity;
}
public function getRegionId() {
return $this->get('region_id')->value;
}
public function setRegion_id($region_id) {
public function setRegionId($region_id) {
$this->set('region_id', $region_id);
return $this;
}
/**
* {@inheritdoc}
*/
public function getState() {
return $this->get('state')->value;
}
/**
* {@inheritdoc}
*/
public function setState($state) {
$this->set('state', $state);
return $this;
}
/**
* {@inheritdoc}
*/
public function getFlagiek() {
return $this->get('flagiek')->value;
}
/**
* {@inheritdoc}
*/
public function setFlagiek($flagiek) {
$this->set('flagiek', $flagiek);
return $this;
}
/**
* {@inheritdoc}
*/
public function getFlagbank() {
return $this->get('flagbank')->value;
}
/**
* {@inheritdoc}
*/
public function setFlagbank($flagbank) {
$this->set('flagbank', $flagbank);
return $this;
}
/**
......@@ -427,7 +498,54 @@ class AitisiEntity extends RevisionableContentEntityBase implements AitisiEntity
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['state'] = BaseFieldDefinition::create('list_string')
->setLabel(t('Κατάσταση Αίτησης'))
->setDescription(t('Κατάσταση Αίτησης'))
->setRequired(TRUE)
->setSettings(array(
'max_length' => 16,
'default_value' => 'Draft',
'allowed_values' => array(
'Draft' => 'Draft',
'Pending' => 'Pending',
'Ready' => 'Ready',
),
))
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'options_select',
'weight' => -17,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['flagiek'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Έλεγχος υπεύθυνου ΙΕΚ'))
->setDefaultValue(FALSE)
->setDisplayOptions('form', array(
'type' => 'boolean_checkbox',
'settings' => array(
'display_label' => TRUE,
),
'weight' => -18,
))
->setDisplayConfigurable('form', TRUE);
$fields['flagbank'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Έλεγχος υπεύθυνου τράπεζας'))
->setDefaultValue(FALSE)
->setDisplayOptions('form', array(
'type' => 'boolean_checkbox',
'settings' => array(
'display_label' => TRUE,
),
'weight' => -18,
))
->setDisplayConfigurable('form', TRUE);
$fields['status'] = BaseFieldDefinition::create('boolean')
......
......@@ -19,11 +19,18 @@ interface AitisiEntityInterface extends RevisionableInterface, RevisionLogInterf
// Add get/set methods for your configuration properties here.
public function getStudent_id();
public function setStudent_id($student_id);
public function getSchool();
public function getSchoolId();
public function setSchoolId($studentId);
public function getStudent();
public function getStudentId();
public function setStudentId($student_id);
public function getEidikotita();
public function getEidikotitaId();
public function setEidikotitaId($eidikotita_id);
public function getEidikotita_id();
public function setEidikotita_id($eidikotita_id);
public function getPrabek();
public function setPrabek($prabek);
......@@ -34,8 +41,9 @@ interface AitisiEntityInterface extends RevisionableInterface, RevisionLogInterf
public function getRegno();
public function setRegno($regno);
public function getRegion_id();
public function setRegion_id($region_id);
public function getRegion();
public function getRegionId();
public function setRegionId($region_id);
/**
* Gets the Aitisi entity creation timestamp.
......
......@@ -87,7 +87,7 @@ class SchoolEntity extends ContentEntityBase implements SchoolEntityInterface {
* {@inheritdoc}
*/
public function getIekcode() {
return $this->get('iek_code')->value;
return $this->get('iekcode')->value;
}
/**
......
{
"name": "drupal/iek",
"type": "drupal-module",
"description": "IEK Registration",
"keywords": ["Drupal"],
"license": "GPL-2.0+",
"homepage": "https://www.drupal.org/project/iek",
"minimum-stability": "dev",
"support": {
"issues": "https://www.drupal.org/project/issues/iek",
"source": "http://cgit.drupalcode.org/iek"
},
"require": { }
}
name: iek
type: module
description: IEK user table
core: 8.x
package: IEK
dependencies:
entity.iek_users.add_form:
route_name: entity.iek_users.add_form
title: 'Add Iek users'
appears_on:
- entity.iek_users.collection
# Iek users menu items definition
entity.iek_users.collection:
title: 'Iek users list'
route_name: entity.iek_users.collection
description: 'List Iek users entities'
parent: system.admin_structure
weight: 100
iek_users.admin.structure.settings:
title: Iek users settings
description: 'Configure Iek users entities'
route_name: iek_users.settings
parent: system.admin_structure
# Iek users routing definition
iek_users.settings_tab:
route_name: iek_users.settings
title: 'Settings'
base_route: iek_users.settings
entity.iek_users.canonical:
route_name: entity.iek_users.canonical
base_route: entity.iek_users.canonical
title: 'View'
entity.iek_users.edit_form:
route_name: entity.iek_users.edit_form
base_route: entity.iek_users.canonical
title: 'Edit'
entity.iek_users.delete_form:
route_name: entity.iek_users.delete_form
base_route: entity.iek_users.canonical
title: Delete
weight: 10
<?php
/**
* @file
* Contains iek.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function iek_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the iek module.
case 'help.page.iek':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('IEK Registration') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*/
function iek_theme() {
return [
'iek' => [
'template' => 'iek',
'render element' => 'children',
],
];
}
add iek users entities:
title: 'Create new Iek users entities'
administer iek users entities:
title: 'Administer Iek users entities'
description: 'Allow to access the administration form to configure Iek users entities.'
restrict access: true
delete iek users entities:
title: 'Delete Iek users entities'
edit iek users entities:
title: 'Edit Iek users entities'
access iek users overview:
title: 'Access the Iek users overview page'
view published iek users entities:
title: 'View published Iek users entities'
view unpublished iek users entities:
title: 'View unpublished Iek users entities'
user_data:
path: '/iek/userdata'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\iek\Controller\CurrentUser::getIekUserData'
requirements:
_user_is_logged_in: 'TRUE'
current_user:
path: '/iek/curuser'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\iek\Controller\CurrentUser::getLoginInfo'
requirements:
_user_is_logged_in: 'TRUE'
iek.application_submit:
path: '/iek/appsubmit'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\iek\Controller\ApplicationSubmit::appSubmit'
requirements:
_user_is_logged_in: 'TRUE'
services:
logger.channel.oauth:
parent: 'logger.channel_base'
arguments: ['oauthost']
<?php
/**
* @file
* Contains iek_users.page.inc.
*
* Page callback for Iek users entities.
*/
use Drupal\Core\Render\Element;
/**
* Prepares variables for Iek users templates.
*
* Default template: iek_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_iek_users(array &$variables) {
// Fetch IekUsers Entity Object.
$iek_users = $variables['elements']['#iek_users'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
}
<?php
namespace Drupal\iek\Controller;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class CurrentUser extends ControllerBase
{
protected $entityTypeManager;
public function __construct(EntityTypeManagerInterface $entityTypeManager)
{
$this->entityTypeManager = $entityTypeManager;
}
public static function create(ContainerInterface $container)
{
return new static(
$container->get('entity_type.manager')
);
}
public function getLoginInfo(Request $request)
{
$authToken = $request->headers->get('PHP_AUTH_USER');
$iekUsers = $this->entityTypeManager->getStorage('iek_users')->loadByProperties(array('authtoken' => $authToken));
$iekUser = reset($iekUsers);
if ($iekUser) {
return $this->respondWithStatus([
'name' => $iekUser->name->value,
], Response::HTTP_OK);
} else {
return $this->respondWithStatus([
'message' => t("IEK user not found"),
], Response::HTTP_FORBIDDEN);
}
}
public function getIekUserData(Request $request)
{
$authToken = $request->headers->get('PHP_AUTH_USER');
$iekUsers = $this->entityTypeManager->getStorage('iek_users')->loadByProperties(array('authtoken' => $authToken));
$iekUser = reset($iekUsers);
if ($iekUser) {
$user = $this->entityTypeManager->getStorage('user')->load($iekUser->user_id->target_id);
if ($user) {
$userName = $iekUser->name->value;
$userSurname = $iekUser->surname->value;
$userFathername = $iekUser->fathername->value;
$userMothername = $iekUser->mothername->value;
$userEmail = $user->mail->value;
return $this->respondWithStatus([
'userName' => mb_substr($iekUser->name->value,0,4,'UTF-8') !== "####" ? $iekUser->name->value : '',
'userSurname' => mb_substr($iekUser->surname->value,0,4,'UTF-8') !== "####" ? $iekUser->surname->value : '',
'userFathername' => mb_substr($iekUser->fathername->value,0,4,'UTF-8') !== "####" ? $iekUser->fathername->value : '',
'userMothername' => mb_substr($iekUser->mothername->value,0,4,'UTF-8') !== "####" ? $iekUser->mothername->value : '',
'userEmail' => mb_substr($user->mail->value,0,4,'UTF-8') !== "####" ? $user->mail->value : '',
], Response::HTTP_OK);
} else {
return $this->respondWithStatus([
'message' => t("user not found"),
], Response::HTTP_INTERNAL_SERVER_ERROR);
}
} else {
return $this->respondWithStatus([
'message' => t("IEK user not found"),
], Response::HTTP_FORBIDDEN);
}
}
private function respondWithStatus($arr, $s) {
$res = new JsonResponse($arr);
$res->setStatusCode($s);
return $res;
}
}
<?php
namespace Drupal\iek\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 Iek users entity.
*
* @ingroup iek
*
* @ContentEntityType(
* id = "iek_users",
* label = @Translation("Iek users"),
* handlers = {
* "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
* "list_builder" = "Drupal\iek\IekUsersListBuilder",
* "views_data" = "Drupal\iek\Entity\IekUsersViewsData",
*
* "form" = {
* "default" = "Drupal\iek\Form\IekUsersForm",
* "add" = "Drupal\iek\Form\IekUsersForm",
* "edit" = "Drupal\iek\Form\IekUsersForm",
* "delete" = "Drupal\iek\Form\IekUsersDeleteForm",
* },
* "access" = "Drupal\iek\IekUsersAccessControlHandler",
* "route_provider" = {
* "html" = "Drupal\iek\IekUsersHtmlRouteProvider",
* },
* },
* base_table = "iek_users",
* admin_permission = "administer iek users entities",
* entity_keys = {
* "id" = "id",
* "label" = "name",
* "uuid" = "uuid",
* "uid" = "user_id",
* "langcode" = "langcode",
* "status" = "status",
* "drupaluser_id" = "drupaluser_id",
* "name" = "name",
* "surname" = "surname",
* "taxis_taxid" = "taxis_taxid",
* "requesttoken" = "requesttoken",
* "accesstoken" = "accesstoken",
* "authtoken" = "authtoken",
* },
* links = {
* "canonical" = "/admin/structure/iek_users/{iek_users}",
* "add-form" = "/admin/structure/iek_users/add",
* "edit-form" = "/admin/structure/iek_users/{iek_users}/edit",
* "delete-form" = "/admin/structure/iek_users/{iek_users}/delete",
* "collection" = "/admin/structure/iek_users",
* },
* field_ui_base_route = "iek_users.settings"
* )
*/
class IekUsers extends ContentEntityBase implements IekUsersInterface {
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;
}
/**
* 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 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;
}
public function getRequestToken() {
return $this->get('requesttoken')->value;
}
public function setRequestToken($requestToken) {
$this->set('requesttoken', $requestToken);
return $this;
}
public function getRequestTokenSecret() {
return $this->get('requesttokensecret')->value;
}
public function setRequestTokenSecret($requestTokenSecret) {
$this->set('requesttokensecret', $requestTokenSecret);
return $this;
}
public function getAccessTokenSecret() {
return $this->get('accesstokensecret')->value;
}
public function setAccessTokenSecret($accessTokenSecret) {
$this->set('accesstokensecret', $accessTokenSecret);
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' => '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['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' => '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['taxis_userid'] = BaseFieldDefinition::create('string')
->setLabel(t('User id χρήστη από taxis'))
->setDescription(t('Δώσε το user id του χρήστη από taxis.'))
->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['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',
'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('Όνομα χρήστη'))
->setDescription(t('Δώσε το όνομα χρήστη'))
->setSettings(array(
'max_length' => 80,
'text_processing' => 0,
))
->setRequired(true)
->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['surname'] = BaseFieldDefinition::create('string')
->setLabel(t('Επώνυμο χρήστη'))
->setDescription(t('Δώσε το επώνυμο του χρήστη.'))
->setSettings(array(
'max_length' => 50,
'text_processing' => 0,
))
->setRequired(true)
->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['fathername'] = 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['mothername'] = 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['accesstoken'] = BaseFieldDefinition::create('string')
->setLabel(t('Access-Token από taxis'))
->setDescription(t('Access-Token από taxis.'))
->setSettings(array(
'max_length' => 1000,
'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['accesstoken_secret'] = BaseFieldDefinition::create('string')
->setLabel(t('Access-Token Secret από taxis'))
->setDescription(t('Access-Token Secret από taxis.'))
->setSettings(array(
'max_length' => 1000,
'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['authtoken'] = BaseFieldDefinition::create('string')
->setLabel(t('Authorization Token'))
->setDescription(t('Authorization Token που δημιουργείται από την εφαρμογή.'))
->setSettings(array(
'max_length' => 1000,
'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['requesttoken'] = BaseFieldDefinition::create('string')
->setLabel(t('Oauth Request Token'))
->setDescription(t('Request Token received by service provider.'))
->setSettings(array(
'max_length' => 1000,
'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['requesttoken_secret'] = BaseFieldDefinition::create('string')
->setLabel(t('Oauth Request Token Secret'))
->setDescription(t('Request Token Secret received by service provider.'))
->setSettings(array(
'max_length' => 1000,
'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['timelogin'] = BaseFieldDefinition::create('timestamp')
->setLabel(t('timeLogin'))
->setDescription(t('timeLogin.'))
;
$fields['timeregistration'] = BaseFieldDefinition::create('timestamp')
->setLabel(t('timeRegistration'))
->setDescription(t('timeRegistration.'))
;
$fields['timetokeninvalid'] = BaseFieldDefinition::create('integer')
->setLabel(t('Χρόνος σε min'))
->setDescription(t('Χρόνος σε min μετά τον οποίο γίνεται το token ανενεργό.'))
->setSettings(array(
//'max_length' => 2,
'text_processing' => 0,
))
->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')
->setLabel(t('userIP'))
->setDescription(t('userIP.'))
->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 Iek users 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;
}
}
<?php
namespace Drupal\iek\Entity;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityChangedInterface;
use Drupal\user\EntityOwnerInterface;
/**
* Provides an interface for defining Iek users entities.
*
* @ingroup iek
*/
interface IekUsersInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface {
// Add get/set methods for your configuration properties here.
/**
* Gets the Iek users name.
*
* @return string
* Name of the Iek users.
*/
public function getName();
/**
* Sets the Iek users name.
*
* @param string $name
* The Iek users name.
*
* @return \Drupal\iek\Entity\IekUsersInterface
* The called Iek users entity.
*/
public function setName($name);
/**
* Gets the Iek users creation timestamp.
*
* @return int
* Creation timestamp of the Iek users.
*/
public function getCreatedTime();
/**
* Sets the Iek users creation timestamp.
*
* @param int $timestamp
* The Iek users creation timestamp.
*
* @return \Drupal\iek\Entity\IekUsersInterface
* The called Iek users entity.
*/
public function setCreatedTime($timestamp);
/**
* Returns the Iek users published status indicator.
*
* Unpublished Iek users are only visible to restricted users.
*
* @return bool
* TRUE if the Iek users is published.
*/
public function isPublished();
/**
* Sets the published status of a Iek users.
*
* @param bool $published
* TRUE to set this Iek users to published, FALSE to set it to unpublished.
*
* @return \Drupal\iek\Entity\IekUsersInterface
* The called Iek 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);
}
<?php
namespace Drupal\iek\Entity;
use Drupal\views\EntityViewsData;
/**
* Provides Views data for Iek users entities.
*/
class IekUsersViewsData extends EntityViewsData {
/**
* {@inheritdoc}
*/
public function getViewsData() {
$data = parent::getViewsData();
// Additional information for Views integration, such as table joins, can be
// put here.
return $data;
}
}
<?php
namespace Drupal\iek\Form;
use Drupal\Core\Entity\ContentEntityDeleteForm;
/**
* Provides a form for deleting Iek users entities.
*
* @ingroup iek
*/
class IekUsersDeleteForm extends ContentEntityDeleteForm {
}
<?php
namespace Drupal\iek\Form;
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Form\FormStateInterface;
/**
* Form controller for Iek users edit forms.
*
* @ingroup iek
*/
class IekUsersForm extends ContentEntityForm {
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
/* @var $entity \Drupal\iek\Entity\IekUsers */
$form = parent::buildForm($form, $form_state);
$entity = $this->entity;
return $form;
}
/**
* {@inheritdoc}
*/
public function save(array $form, FormStateInterface $form_state) {
$entity = &$this->entity;
$status = parent::save($form, $form_state);
switch ($status) {
case SAVED_NEW:
drupal_set_message($this->t('Created the %label Iek users.', [
'%label' => $entity->label(),
]));
break;
default:
drupal_set_message($this->t('Saved the %label Iek users.', [
'%label' => $entity->label(),
]));
}
$form_state->setRedirect('entity.iek_users.canonical', ['iek_users' => $entity->id()]);
}
}