diff --git a/src/Controller/ContactDetailsController.php b/src/Controller/ContactDetailsController.php new file mode 100644 index 0000000..17401f7 --- /dev/null +++ b/src/Controller/ContactDetailsController.php @@ -0,0 +1,31 @@ + $person_id + ); + + $node = \Drupal::entityTypeManager() + ->getStorage('contact_details') + ->create($values); + + $form = \Drupal::entityTypeManager() + ->getFormObject('contact_details', 'default') + ->setEntity($node); + return \Drupal::formBuilder()->getForm($form); + } + +} diff --git a/src/Plugin/Block/HatCreator.php b/src/Plugin/Block/HatCreator.php index 25e5d14..8e2b22a 100644 --- a/src/Plugin/Block/HatCreator.php +++ b/src/Plugin/Block/HatCreator.php @@ -31,7 +31,7 @@ class HatCreator extends BlockBase { ->loadByProperties(['type' => $id, 'person' => $person_id]); if (!reset($hats)) { $label = $type['label']; - $markup .= "
"; + $markup .= ""; } } return [ diff --git a/zencrm.routing.yml b/zencrm.routing.yml index 3cfef4d..7abe79d 100644 --- a/zencrm.routing.yml +++ b/zencrm.routing.yml @@ -5,3 +5,11 @@ zencrm.hat.create: _title: 'Add New Hat' requirements: _permission: 'access content' + +zencrm.contact_details.create: + path: '/zencrm/contact_details/add/{person_id}' + defaults: + _controller: '\Drupal\zencrm\Controller\ContactDetailsController::createContactDetailsForPerson' + _title: 'Add New Contact Details' + requirements: + _permission: 'access content'