Made published field configurable on forms, and made views respect permissions
This commit is contained in:
@ -208,6 +208,7 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface {
|
||||
->setLabel(t('Publishing status'))
|
||||
->setDescription(t('A boolean indicating whether the Case is published.'))
|
||||
->setRevisionable(TRUE)
|
||||
->setDisplayConfigurable("form", TRUE)
|
||||
->setDefaultValue(TRUE);
|
||||
|
||||
$fields['user_id'] = BaseFieldDefinition::create('entity_reference')
|
||||
|
@ -240,11 +240,11 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte
|
||||
'weight' => -3,
|
||||
]);
|
||||
|
||||
// not currently in use. Will set view and form settings when ready
|
||||
$fields['status'] = BaseFieldDefinition::create('boolean')
|
||||
->setLabel(t('Publishing status'))
|
||||
->setDescription(t('A boolean indicating whether the Activity is published.'))
|
||||
->setRevisionable(TRUE)
|
||||
->setDisplayConfigurable('form', TRUE)
|
||||
->setDefaultValue(TRUE);
|
||||
|
||||
$fields['user_id'] = BaseFieldDefinition::create('entity_reference')
|
||||
|
@ -213,11 +213,11 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
|
||||
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
|
||||
$fields = parent::baseFieldDefinitions($entity_type);
|
||||
|
||||
// Currently not using this, but will add form and view settings when ready.
|
||||
$fields['status'] = BaseFieldDefinition::create('boolean')
|
||||
->setLabel(t('Publishing status'))
|
||||
->setDescription(t('Whether this record is published.'))
|
||||
->setRevisionable(TRUE)
|
||||
->setDisplayConfigurable("form", true)
|
||||
->setDefaultValue(TRUE);
|
||||
|
||||
// The name gets set on preSave, from the first middle and last
|
||||
|
@ -167,7 +167,14 @@ class OCEvent extends ContentEntityBase implements OCEventInterface {
|
||||
->setDisplayConfigurable('view', TRUE)
|
||||
->setRequired(TRUE);
|
||||
|
||||
$fields['status']->setDescription(t('A boolean indicating whether the Event is published.'));
|
||||
$fields['status'] = BaseFieldDefinition::create('boolean')
|
||||
->setLabel(t('Publishing status'))
|
||||
->setDescription(t('Whether this record is published.'))
|
||||
->setRevisionable(TRUE)
|
||||
->setDisplayConfigurable("form", true)
|
||||
->setDefaultValue(TRUE);
|
||||
|
||||
|
||||
|
||||
$fields['created'] = BaseFieldDefinition::create('created')
|
||||
->setLabel(t('Created'))
|
||||
|
@ -456,7 +456,12 @@ class OCOrganisation extends EditorialContentEntityBase implements OCOrganisatio
|
||||
->setDisplayConfigurable('view', TRUE)
|
||||
->setRequired(TRUE);
|
||||
|
||||
$fields['status']->setDescription(t('A boolean indicating whether the Organisation is published.'));
|
||||
$fields['status'] = BaseFieldDefinition::create('boolean')
|
||||
->setLabel(t('Published'))
|
||||
->setRevisionable(TRUE)
|
||||
->setDisplayConfigurable("form", true)
|
||||
->setDefaultValue(TRUE);
|
||||
|
||||
|
||||
$fields['created'] = BaseFieldDefinition::create('created')
|
||||
->setLabel(t('Created'))
|
||||
|
Reference in New Issue
Block a user