From 6e563fd3869895e558e8cd488c95744c287db582 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Wed, 28 Jun 2023 16:42:49 -0400 Subject: [PATCH] Show subnavigation for read-only views (CFM-293) --- app/templates/Standard/add-edit-view.php | 4 ++-- app/templates/element/subnavigation.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/templates/Standard/add-edit-view.php b/app/templates/Standard/add-edit-view.php index 5ae9d0abb..520cd690a 100644 --- a/app/templates/Standard/add-edit-view.php +++ b/app/templates/Standard/add-edit-view.php @@ -42,8 +42,8 @@ // Include subnavigation structures on add/edit/view pages // XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of fields-nav.inc into fields.inc -// When subnav exists, include on all Edit views and on Add/View for items with a parent. -if($vv_action == 'edit' || !empty($vv_bc_parent_obj) || !empty($vv_primary_link_id)) { +// When subnav exists, include on all Edit/View views and on Add views for items with a parent. +if($vv_action == 'edit' || $vv_action == 'view' || !empty($vv_bc_parent_obj) || !empty($vv_primary_link_id)) { if(file_exists($templatePath . DS . "fields-nav.inc")) { include($templatePath . DS . "fields-nav.inc"); } diff --git a/app/templates/element/subnavigation.php b/app/templates/element/subnavigation.php index 311980dc2..d93593127 100644 --- a/app/templates/element/subnavigation.php +++ b/app/templates/element/subnavigation.php @@ -207,7 +207,7 @@ print $this->Html->link( __d('controller', 'People', [1]), [ 'controller' => 'people', - 'action' => 'edit', + 'action' => $curAction == 'edit' ? 'edit' : 'view', $curId ], ['class' => $linkClass] @@ -267,7 +267,7 @@ print $this->Html->link( __d('controller', 'Properties', [99]), [ 'controller' => 'groups', - 'action' => 'edit', + 'action' => $curAction == 'edit' ? 'edit' : 'view', $curId ], ['class' => $linkClass]