diff --git a/app/plugins/EnvSource/src/View/Cell/EnvSourceCollectorsCell.php b/app/plugins/EnvSource/src/View/Cell/EnvSourceCollectorsCell.php index fed70617..207b3c09 100644 --- a/app/plugins/EnvSource/src/View/Cell/EnvSourceCollectorsCell.php +++ b/app/plugins/EnvSource/src/View/Cell/EnvSourceCollectorsCell.php @@ -70,14 +70,13 @@ public function initialize(): void */ public function display(int $petitionId): void { - $EnvSourceCollectors = $this->fetchTable('EnvSourceCollectors'); + $PetitionEnvIdentities = $this->fetchTable('EnvSource.PetitionEnvIdentities'); - $this->set('vv_petition_env_identities', $EnvSourceCollectors - ->PetitionEnvIdentities + $this->set('vv_petition_env_identities', $PetitionEnvIdentities ->find() ->where(['PetitionEnvIdentities.petition_id' => $petitionId]) ->contain(['EnvSourceIdentities']) - ->firstOrFail()); + ->first()); $this->set('vv_step', $this->vv_step); $this->set('vv_obj', $this->vv_obj); diff --git a/app/plugins/EnvSource/templates/cell/EnvSourceCollectors/display.php b/app/plugins/EnvSource/templates/cell/EnvSourceCollectors/display.php index 4990a5aa..ffe95799 100644 --- a/app/plugins/EnvSource/templates/cell/EnvSourceCollectors/display.php +++ b/app/plugins/EnvSource/templates/cell/EnvSourceCollectors/display.php @@ -27,6 +27,13 @@ declare(strict_types = 1); +if (empty($vv_petition_env_identities)) { + print $this->element('emptyPetitionFlowStep', [], [ + 'cache' => '_html_elements', + ]); + return; +} + $env_attributes = json_decode($vv_petition_env_identities->env_source_identity->env_attributes); ?> diff --git a/app/resources/locales/en_US/information.po b/app/resources/locales/en_US/information.po index d9460126..5340a501 100644 --- a/app/resources/locales/en_US/information.po +++ b/app/resources/locales/en_US/information.po @@ -150,6 +150,9 @@ msgstr "{0} successfully {1} to {2}" msgid "record" msgstr "Record" +msgid "no.records" +msgstr "No Records" + msgid "report.for" msgstr "Report for " diff --git a/app/templates/element/emptyPetitionFlowStep.php b/app/templates/element/emptyPetitionFlowStep.php new file mode 100644 index 00000000..98d19595 --- /dev/null +++ b/app/templates/element/emptyPetitionFlowStep.php @@ -0,0 +1,34 @@ + + + \ No newline at end of file diff --git a/app/templates/element/subnavigation.php b/app/templates/element/subnavigation.php deleted file mode 100644 index cd453a96..00000000 --- a/app/templates/element/subnavigation.php +++ /dev/null @@ -1,488 +0,0 @@ -request->getParam('controller'); -$curAction = $this->request->getParam('action'); -$navController = $curController; - -if(!empty($vv_primary_link) && !empty($this->request->getQuery($vv_primary_link))) { - // This will work for most top-level index views - $curId = $this->request->getQuery($vv_primary_link); - $linkFilter = [$vv_primary_link => $curId]; - // For top-level nav - if(!empty($vv_mvea_person_id)) { - $curId = $vv_mvea_person_id; - $linkFilter = ['person_id' => $vv_mvea_person_id]; - } -} elseif (!empty($vv_obj)) { - // This will work for most top-level edit views - // XXX we might produce the $vv_primary_link for edit views so the approach below could be deprecated - // XXX $vv_primary_link_obj is the equivalent for plugins however - $curId = $vv_obj->id; - if(!empty($tabsId) && !empty($tabsController)) { - // these have been explicitly set in the $subnav array in fields-nav.inc, so just use them. - $curId = $tabsId; - $navController = $tabsController; - } elseif(!empty($vv_mvea_person_id)) { - $curId = $vv_mvea_person_id; - } elseif( - ($active == 'plugin' || (!empty($vv_primary_link) && $vv_primary_link == 'enrollment_flow_id')) - && !empty($vv_primary_link_obj) - && !empty($vv_primary_link_model) - ) { - $curId = $vv_primary_link_obj->id; - $navController = $vv_primary_link_model; - } elseif(!empty($vv_primary_link_id)) { - $curId = $vv_primary_link_id; - } - - // For top-level nav while in edit pages. - if ($name == 'person') { - $linkFilter = ['person_id' => $curId]; - } elseif ($name == 'group') { - $linkFilter = ['group_id' => $curId]; - } elseif ($name == 'enrollment_flow') { - $linkFilter = ['enrollment_flow_id' => $curId]; - } -} elseif(!empty($vv_bc_title_links)) { - // All else fails? Use the breadcrumb which has figured this out. - // XXX We might just be able to do this and skip all the above after breadcrumbs have been refactored - $curId = end($vv_bc_title_links[0]['target']); -} - -if(!empty($vv_obj)) { - // Set the badge style for Person Status - $statusBadgeClass = 'bg-warning'; - if($vv_obj['status'] == 'A') { - $statusBadgeClass = 'bg-outline-secondary primary'; - } elseif (in_array($vv_obj['status'], ['D','N','S','X','XP'])) { - $statusBadgeClass = 'bg-danger'; - } -} - -$supertitle = __d('information','global.title.none'); -if(!empty($tabsSupertitle)) { - // this has been explicitly set in the $subnav array in fields-nav.inc, so just use it. - $supertitle = $tabsSupertitle; -} elseif($active == 'plugin' && !empty($vv_bc_parent_obj)) { - $supertitle = $vv_bc_parent_obj->$vv_bc_parent_displayfield; -} elseif(!empty($vv_person_name)) { - $supertitle = $vv_person_name->full_name; -} elseif(!empty($vv_supertitle)) { - $supertitle = $vv_supertitle; -} elseif(!empty($vv_obj)) { - $supertitle = $vv_obj->$vv_display_field; -} elseif(!empty($vv_bc_parent_obj)) { - $supertitle = $vv_bc_parent_obj->$vv_bc_parent_displayfield; -} elseif(!empty($vv_primary_link_obj)) { - $supertitle = $vv_primary_link_obj->name; -} elseif(!empty($vv_bc_title_links)) { - // All else fails? Use the breadcrumb which has figured this out. - // XXX We might just be able to do this and skip all the above after breadcrumbs have been refactored - $supertitle = $vv_bc_title_links[0]['label']; -} -?> - -