CSS for Accreditation Count form, and some other changes
This commit is contained in:
parent
48e6ae4196
commit
78b8371be9
@ -3,6 +3,12 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* MOVE THIS INTO GNO! */
|
||||||
|
#block-accreditationcount {
|
||||||
|
position: absolute;
|
||||||
|
right: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
@ -40,6 +40,9 @@ view published case entities:
|
|||||||
view unpublished case entities:
|
view unpublished case entities:
|
||||||
title: 'View unpublished Case entities'
|
title: 'View unpublished Case entities'
|
||||||
|
|
||||||
|
view unpublished actor entities:
|
||||||
|
title: 'View unpublished Actor entities'
|
||||||
|
|
||||||
view all case revisions:
|
view all case revisions:
|
||||||
title: 'View all Case revisions'
|
title: 'View all Case revisions'
|
||||||
|
|
||||||
|
@ -58,7 +58,11 @@ class OCActorForm extends ContentEntityForm {
|
|||||||
'%label' => $entity->label(),
|
'%label' => $entity->label(),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
$form_state->setRedirect('entity.oc_actor.canonical', ['oc_actor' => $entity->id()]);
|
// If you have unpublished the entity and you can't see unpublished entities, redirect to a more informative message than just "Access Denied".
|
||||||
|
if (!$form_state->getValue('status')['value'] && !\Drupal::currentUser()->hasPermission('view unpublished actor entities')) {
|
||||||
|
$form_state->setRedirect('entity.node.canonical', ['node' => 1]);
|
||||||
|
} else {
|
||||||
|
$form_state->setRedirect('entity.oc_actor.canonical', ['oc_actor' => $entity->id()]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class OCActorAccessControlHandler extends EntityAccessControlHandler {
|
|||||||
case 'view':
|
case 'view':
|
||||||
if (!$entity->isPublished()) {
|
if (!$entity->isPublished()) {
|
||||||
return AccessResult::allowedIf(
|
return AccessResult::allowedIf(
|
||||||
$account->hasPermission("view unpublished $bundle entities")
|
$account->hasPermission("view unpublished actor entities")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return AccessResult::allowedIf(
|
return AccessResult::allowedIf(
|
||||||
|
@ -135,7 +135,6 @@ function opencase_entity_field_access($operation, \Drupal\Core\Field\FieldDefini
|
|||||||
function opencase_form_alter(&$form, &$form_state, $form_id) {
|
function opencase_form_alter(&$form, &$form_state, $form_id) {
|
||||||
if (preg_match('/oc_organisation_relation_.*_delete_form/', $form_id) or (preg_match('/oc_organisation_relation_.*_add_form/', $form_id))) {
|
if (preg_match('/oc_organisation_relation_.*_delete_form/', $form_id) or (preg_match('/oc_organisation_relation_.*_add_form/', $form_id))) {
|
||||||
$form['actions']['submit']['#submit'][] = '_opencase_organisation_relation_redirect';
|
$form['actions']['submit']['#submit'][] = '_opencase_organisation_relation_redirect';
|
||||||
// $form['actions']['cancel']['#url'] = $form_state->getFormObject()->getEntity()->toUrl();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user