diff --git a/module/Olcs/config/module.config.php b/module/Olcs/config/module.config.php index eb30f7230..46b310152 100644 --- a/module/Olcs/config/module.config.php +++ b/module/Olcs/config/module.config.php @@ -1081,6 +1081,13 @@ 'id' => 'dashboard-messaging', 'label' => 'dashboard-nav-messaging', 'route' => 'conversations', + 'pages' => array( + array( + 'id' => 'messaging-create-conversation', + 'label' => 'New Conversation', + 'route' => 'conversations/new', + ), + ), ), ), ), diff --git a/module/Olcs/src/Controller/ConversationsController.php b/module/Olcs/src/Controller/ConversationsController.php index 9ea7e4665..ef690ca68 100644 --- a/module/Olcs/src/Controller/ConversationsController.php +++ b/module/Olcs/src/Controller/ConversationsController.php @@ -17,6 +17,7 @@ use Dvsa\Olcs\Transfer\Query\Messaging\Conversations\ByOrganisation as ByOrganisationQuery; use Dvsa\Olcs\Utils\Translation\NiTextTranslation; use Laminas\Http\Response; +use Laminas\Navigation\Navigation; use Laminas\View\Model\ViewModel; use LmcRbacMvc\Service\AuthorizationService; use Olcs\Form\Model\Form\Message\Reply as ReplyForm; @@ -40,11 +41,13 @@ public function __construct( AuthorizationService $authService, FlashMessengerHelperService $flashMessengerHelper, TableFactory $tableFactory, - FormHelperService $formHelperService + FormHelperService $formHelperService, + Navigation $navigationService ) { $this->flashMessengerHelper = $flashMessengerHelper; $this->tableFactory = $tableFactory; $this->formHelperService = $formHelperService; + $this->navigationService = $navigationService; parent::__construct($niTextTranslationUtil, $authService); } @@ -150,6 +153,8 @@ private function mapFormDataToCommand(\Laminas\Form\Form $form): Create /** @return ViewModel|Response */ public function viewAction() { + $this->navigationService->findBy('id', 'dashboard-messaging')->setActive(); + $params = [ 'page' => $this->params()->fromQuery('page', 1), 'limit' => $this->params()->fromQuery('limit', 10), diff --git a/module/Olcs/src/Controller/Factory/ConversationsControllerFactory.php b/module/Olcs/src/Controller/Factory/ConversationsControllerFactory.php index c4f4a45b3..68ee9ccd7 100644 --- a/module/Olcs/src/Controller/Factory/ConversationsControllerFactory.php +++ b/module/Olcs/src/Controller/Factory/ConversationsControllerFactory.php @@ -25,6 +25,7 @@ public function __invoke( $flashMessengerHelper = $container->get(FlashMessengerHelperService::class); $tableFactory = $container->get(TableFactory::class); $formHelperService = $container->get(FormHelperService::class); + $navigationService = $container->get('navigation'); return new ConversationsController( $niTextTranslationUtil, @@ -32,6 +33,7 @@ public function __invoke( $flashMessengerHelper, $tableFactory, $formHelperService, + $navigationService ); } }