Added case provider role to opencase config
This commit is contained in:
parent
167166b898
commit
614293c114
@ -0,0 +1,8 @@
|
|||||||
|
uuid: 85aacc47-8df9-4309-b7f4-f58be70f83d0
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies: { }
|
||||||
|
name: 'Case Provider Roles'
|
||||||
|
vid: oc_case_provider_role
|
||||||
|
description: ''
|
||||||
|
weight: 0
|
@ -8,6 +8,8 @@ declare(strict_types = 1);
|
|||||||
|
|
||||||
use Drupal\Core\Routing\RouteMatchInterface;
|
use Drupal\Core\Routing\RouteMatchInterface;
|
||||||
|
|
||||||
|
use function PHPUnit\Framework\isEmpty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements hook_help().
|
* Implements hook_help().
|
||||||
*/
|
*/
|
||||||
@ -94,7 +96,8 @@ function opencase_cases_get_activities(Drupal\opencase_cases\entity\OCCase $case
|
|||||||
}
|
}
|
||||||
|
|
||||||
function opencase_cases_get_amount(Drupal\opencase_cases\entity\OCCaseFee $case_fee): string {
|
function opencase_cases_get_amount(Drupal\opencase_cases\entity\OCCaseFee $case_fee): string {
|
||||||
return $case_fee->amount->first()->value;
|
if (!isEmpty($case_fee->amount)) return $case_fee->amount->first()->value;
|
||||||
|
else return '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
function opencase_cases_get_case(Drupal\opencase_cases\entity\OCCaseFee $case_fee): Drupal\opencase_cases\entity\OCCase {
|
function opencase_cases_get_case(Drupal\opencase_cases\entity\OCCaseFee $case_fee): Drupal\opencase_cases\entity\OCCase {
|
||||||
|
@ -272,10 +272,8 @@ class OCCaseFee extends EditorialContentEntityBase implements OCCaseFeeInterface
|
|||||||
->setTranslatable(TRUE)
|
->setTranslatable(TRUE)
|
||||||
->setCardinality(1)
|
->setCardinality(1)
|
||||||
->setDefaultValueCallback('opencase_cases_default_case_id') // defined in opencase_cases.module
|
->setDefaultValueCallback('opencase_cases_default_case_id') // defined in opencase_cases.module
|
||||||
->setDisplayOptions('view', [
|
->setDisplayConfigurable("view", true)
|
||||||
'type' => 'string',
|
->setDisplayConfigurable("form", true)
|
||||||
'weight' => 0,
|
|
||||||
])
|
|
||||||
->setRequired(TRUE);
|
->setRequired(TRUE);
|
||||||
|
|
||||||
$fields['oc_fee_category'] = \Drupal\Core\Field\BaseFieldDefinition::create('entity_reference')
|
$fields['oc_fee_category'] = \Drupal\Core\Field\BaseFieldDefinition::create('entity_reference')
|
||||||
|
@ -246,10 +246,14 @@ class OCCaseProvision extends EditorialContentEntityBase implements OCCaseProvis
|
|||||||
->setDisplayConfigurable('view', TRUE)
|
->setDisplayConfigurable('view', TRUE)
|
||||||
->setRequired(TRUE);
|
->setRequired(TRUE);
|
||||||
|
|
||||||
$fields['status']->setDescription(t('A boolean indicating whether the Case Provision is published.'))
|
|
||||||
->setDisplayConfigurable('form', TRUE)
|
$fields['status'] = BaseFieldDefinition::create('boolean')
|
||||||
->setDisplayConfigurable('view', TRUE);
|
->setLabel(t('Visible'))
|
||||||
|
->setDescription('If this box is not ticked this record will be hidden from view for most users. Users with access to unpublished entities will be able to restore it if needed.')
|
||||||
|
->setRevisionable(TRUE)
|
||||||
|
->setDisplayConfigurable('form', TRUE)
|
||||||
|
->setDefaultValue(TRUE);
|
||||||
|
|
||||||
|
|
||||||
$fields['created'] = BaseFieldDefinition::create('created')
|
$fields['created'] = BaseFieldDefinition::create('created')
|
||||||
->setLabel(t('Created'))
|
->setLabel(t('Created'))
|
||||||
@ -273,10 +277,8 @@ class OCCaseProvision extends EditorialContentEntityBase implements OCCaseProvis
|
|||||||
->setTranslatable(TRUE)
|
->setTranslatable(TRUE)
|
||||||
->setCardinality(1)
|
->setCardinality(1)
|
||||||
->setDefaultValueCallback('opencase_cases_default_case_id') // defined in opencase_cases.module
|
->setDefaultValueCallback('opencase_cases_default_case_id') // defined in opencase_cases.module
|
||||||
->setDisplayOptions('view', [
|
->setDisplayConfigurable('form', TRUE)
|
||||||
'type' => 'string',
|
->setDisplayConfigurable('view', TRUE)
|
||||||
'weight' => 0,
|
|
||||||
])
|
|
||||||
->setRequired(TRUE);
|
->setRequired(TRUE);
|
||||||
|
|
||||||
$fields['oc_provider'] = \Drupal\Core\Field\BaseFieldDefinition::create('entity_reference')
|
$fields['oc_provider'] = \Drupal\Core\Field\BaseFieldDefinition::create('entity_reference')
|
||||||
|
@ -68,14 +68,14 @@ opencase.manage_case_fee_types:
|
|||||||
description: 'Configure types of case fees and their fields'
|
description: 'Configure types of case fees and their fields'
|
||||||
menu_name: opencase
|
menu_name: opencase
|
||||||
parent: opencase.opencase_admin_menu
|
parent: opencase.opencase_admin_menu
|
||||||
url: internal:/admin/opencase/oc_case_fee_type
|
url: internal:/opencase/oc_case_fee_type
|
||||||
weight: 3
|
weight: 3
|
||||||
opencase.manage_case_provision_types:
|
opencase.manage_case_provision_types:
|
||||||
title: 'Manage case provision types'
|
title: 'Manage case provision types'
|
||||||
description: 'Configure types of case provisions and their fields'
|
description: 'Configure types of case provisions and their fields'
|
||||||
menu_name: opencase
|
menu_name: opencase
|
||||||
parent: opencase.opencase_admin_menu
|
parent: opencase.opencase_admin_menu
|
||||||
url: internal:/admin/opencase/oc_case_provision_type
|
url: internal:/opencase/oc_case_provision_type
|
||||||
weight: 3
|
weight: 3
|
||||||
opencase.manage_event_types:
|
opencase.manage_event_types:
|
||||||
title: 'Manage event types'
|
title: 'Manage event types'
|
||||||
|
Reference in New Issue
Block a user