Add custom actions for sessions
This commit is contained in:
parent
2da4ecc893
commit
bfe73f8e22
|
@ -0,0 +1,11 @@
|
||||||
|
uuid: 6628c7ca-bb05-487d-8953-1f935f424ccf
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- node
|
||||||
|
id: dtc_sessions_accept_session
|
||||||
|
label: 'Accept session'
|
||||||
|
type: node
|
||||||
|
plugin: dtc_sessions_accept_session
|
||||||
|
configuration: { }
|
|
@ -0,0 +1,11 @@
|
||||||
|
uuid: 8e092524-f8ca-45f1-b093-bae311fa3694
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- node
|
||||||
|
id: dtc_sessions_reject_session
|
||||||
|
label: 'Reject session'
|
||||||
|
type: node
|
||||||
|
plugin: dtc_sessions_reject_session
|
||||||
|
configuration: { }
|
|
@ -0,0 +1,10 @@
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- node
|
||||||
|
id: dtc_sessions_accept_session
|
||||||
|
label: 'Accept session'
|
||||||
|
type: node
|
||||||
|
plugin: dtc_sessions_accept_session
|
||||||
|
configuration: { }
|
|
@ -0,0 +1,10 @@
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- node
|
||||||
|
id: dtc_sessions_reject_session
|
||||||
|
label: 'Reject session'
|
||||||
|
type: node
|
||||||
|
plugin: dtc_sessions_reject_session
|
||||||
|
configuration: { }
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Drupal\dtc_sessions\Plugin\Action;
|
||||||
|
|
||||||
|
use Drupal\Core\Field\FieldUpdateActionBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accepts a session.
|
||||||
|
*
|
||||||
|
* @Action(
|
||||||
|
* id = "dtc_sessions_accept_session",
|
||||||
|
* label = @Translation("Accept session"),
|
||||||
|
* type = "node"
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
class AcceptSession extends FieldUpdateActionBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function getFieldsToUpdate() {
|
||||||
|
return ['field_session_status' => 'accepted'];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Drupal\dtc_sessions\Plugin\Action;
|
||||||
|
|
||||||
|
use Drupal\Core\Field\FieldUpdateActionBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rejects a session.
|
||||||
|
*
|
||||||
|
* @Action(
|
||||||
|
* id = "dtc_sessions_reject_session",
|
||||||
|
* label = @Translation("Reject session"),
|
||||||
|
* type = "node"
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
class RejectSession extends FieldUpdateActionBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function getFieldsToUpdate() {
|
||||||
|
return ['field_session_status' => 'rejected'];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue