From a09a9a228e5edd361a54de6117760aa6e271219a Mon Sep 17 00:00:00 2001 From: adamdaudrich Date: Wed, 12 Mar 2025 15:13:43 -0400 Subject: [PATCH 1/4] Candidate Info button with permission --- .../php/timepoint_list_controlpanel.class.inc | 12 +++++++++--- .../templates/timepoint_list_controlpanel.tpl | 6 ++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/timepoint_list/php/timepoint_list_controlpanel.class.inc b/modules/timepoint_list/php/timepoint_list_controlpanel.class.inc index 448dcd86907..6e02df6e593 100644 --- a/modules/timepoint_list/php/timepoint_list_controlpanel.class.inc +++ b/modules/timepoint_list/php/timepoint_list_controlpanel.class.inc @@ -64,9 +64,8 @@ Class TimePoint_List_ControlPanel extends \Candidate $this->tpl_data['candID'] = $this->getCandID(); - $this->tpl_data['isDataEntryPerson'] - = $user->hasCenterPermission("data_entry", $cand_CenterID); - + $this->tpl_data['isDataEntryPerson'] = $user->hasCenterPermission("data_entry", $cand_CenterID); + $this->tpl_data['isImagingPerson'] = $user->hasAnyPermission( [ 'imaging_browser_view_site', @@ -76,6 +75,13 @@ Class TimePoint_List_ControlPanel extends \Candidate ] ); + $this->tpl_data['isCandidatePerson'] = $user->hasAnyPermission( + [ + 'candidate_parameter_view', + 'candidate_parameter_edit' + ] + ); + //set the baseurl of the tpl_data $factory = \NDB_Factory::singleton(); $settings = $factory->settings(); diff --git a/modules/timepoint_list/templates/timepoint_list_controlpanel.tpl b/modules/timepoint_list/templates/timepoint_list_controlpanel.tpl index f33fdc74121..7a6fd7be308 100644 --- a/modules/timepoint_list/templates/timepoint_list_controlpanel.tpl +++ b/modules/timepoint_list/templates/timepoint_list_controlpanel.tpl @@ -1,14 +1,16 @@ -{if $isDataEntryPerson || $isImagingPerson} +{if $isDataEntryPerson || $isImagingPerson ||$isCandidateParameterPerson}

Actions:  

{if $isDataEntryPerson} Create time point - Candidate Info {/if} {if $isImagingPerson} View Imaging datasets {/if} + {if $isCandidatePerson} + Candidate Info + {/if} {/if} From bbbde27764de2f2a08db634418a74b572b1a6063 Mon Sep 17 00:00:00 2001 From: adamdaudrich Date: Wed, 12 Mar 2025 15:38:06 -0400 Subject: [PATCH 2/4] typo in.tpl --- .../timepoint_list/templates/timepoint_list_controlpanel.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/timepoint_list/templates/timepoint_list_controlpanel.tpl b/modules/timepoint_list/templates/timepoint_list_controlpanel.tpl index 7a6fd7be308..9fb8ed9d143 100644 --- a/modules/timepoint_list/templates/timepoint_list_controlpanel.tpl +++ b/modules/timepoint_list/templates/timepoint_list_controlpanel.tpl @@ -1,4 +1,4 @@ -{if $isDataEntryPerson || $isImagingPerson ||$isCandidateParameterPerson} +{if $isDataEntryPerson || $isImagingPerson ||$isCandidatePerson}

Actions:  

From 0ebce6b39b94b08beb7606195e86a9cbae0655ac Mon Sep 17 00:00:00 2001 From: adamdaudrich Date: Thu, 13 Mar 2025 12:05:47 -0400 Subject: [PATCH 3/4] code width fix --- .../timepoint_list/php/timepoint_list_controlpanel.class.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/timepoint_list/php/timepoint_list_controlpanel.class.inc b/modules/timepoint_list/php/timepoint_list_controlpanel.class.inc index 6e02df6e593..30c2f14ca1b 100644 --- a/modules/timepoint_list/php/timepoint_list_controlpanel.class.inc +++ b/modules/timepoint_list/php/timepoint_list_controlpanel.class.inc @@ -64,7 +64,8 @@ Class TimePoint_List_ControlPanel extends \Candidate $this->tpl_data['candID'] = $this->getCandID(); - $this->tpl_data['isDataEntryPerson'] = $user->hasCenterPermission("data_entry", $cand_CenterID); + $this->tpl_data['isDataEntryPerson'] = $user->hasCenterPermission( + "data_entry", $cand_CenterID); $this->tpl_data['isImagingPerson'] = $user->hasAnyPermission( [ From 6ffe033ddc05ec3e5bfe5bd526481ecee4db16ea Mon Sep 17 00:00:00 2001 From: adamdaudrich Date: Thu, 13 Mar 2025 12:29:48 -0400 Subject: [PATCH 4/4] changed variable name --- .../php/timepoint_list_controlpanel.class.inc | 16 +++++++++------- .../templates/timepoint_list_controlpanel.tpl | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/timepoint_list/php/timepoint_list_controlpanel.class.inc b/modules/timepoint_list/php/timepoint_list_controlpanel.class.inc index 30c2f14ca1b..ace2f11384b 100644 --- a/modules/timepoint_list/php/timepoint_list_controlpanel.class.inc +++ b/modules/timepoint_list/php/timepoint_list_controlpanel.class.inc @@ -65,8 +65,10 @@ Class TimePoint_List_ControlPanel extends \Candidate $this->tpl_data['candID'] = $this->getCandID(); $this->tpl_data['isDataEntryPerson'] = $user->hasCenterPermission( - "data_entry", $cand_CenterID); - + "data_entry", + $cand_CenterID + ); + $this->tpl_data['isImagingPerson'] = $user->hasAnyPermission( [ 'imaging_browser_view_site', @@ -76,11 +78,11 @@ Class TimePoint_List_ControlPanel extends \Candidate ] ); - $this->tpl_data['isCandidatePerson'] = $user->hasAnyPermission( - [ - 'candidate_parameter_view', - 'candidate_parameter_edit' - ] + $this->tpl_data['hasCandidateParameterAccess'] = $user->hasAnyPermission( + [ + 'candidate_parameter_view', + 'candidate_parameter_edit' + ] ); //set the baseurl of the tpl_data diff --git a/modules/timepoint_list/templates/timepoint_list_controlpanel.tpl b/modules/timepoint_list/templates/timepoint_list_controlpanel.tpl index 9fb8ed9d143..19f1ba9f8a1 100644 --- a/modules/timepoint_list/templates/timepoint_list_controlpanel.tpl +++ b/modules/timepoint_list/templates/timepoint_list_controlpanel.tpl @@ -9,7 +9,7 @@ {if $isImagingPerson} View Imaging datasets {/if} - {if $isCandidatePerson} + {if $hasCandidateParameterAccess} Candidate Info {/if}