Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[timepoint_list] Candidate Info button appears with proper permissions #9696

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions modules/timepoint_list/php/timepoint_list_controlpanel.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ 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(
[
Expand All @@ -76,6 +78,13 @@ Class TimePoint_List_ControlPanel extends \Candidate
]
);

$this->tpl_data['hasCandidateParameterAccess'] = $user->hasAnyPermission(
[
'candidate_parameter_view',
'candidate_parameter_edit'
]
);

//set the baseurl of the tpl_data
$factory = \NDB_Factory::singleton();
$settings = $factory->settings();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{if $isDataEntryPerson || $isImagingPerson}
{if $isDataEntryPerson || $isImagingPerson ||$isCandidatePerson}
<!-- <div class="col-xs-1"> -->
<h3>Actions:&nbsp&nbsp</h3>
<!-- </div> -->
<!-- <div class="col-xs-4"> -->
{if $isDataEntryPerson}
<a class="btn btn-default" role="button" href="{$baseurl}/create_timepoint/?candID={$candID}&identifier={$candID}">Create time point</a>
<a class="btn btn-default" role="button" href="{$baseurl}/candidate_parameters/?candID={$candID}&identifier={$candID}">Candidate Info</a>
{/if}
{if $isImagingPerson}
<a class="btn btn-default" role="button" href="{$baseurl}/imaging_browser/?DCCID={$candID}">View Imaging datasets</a>
{/if}
{if $hasCandidateParameterAccess}
<a class="btn btn-default" role="button" href="{$baseurl}/candidate_parameters/?candID={$candID}&identifier={$candID}">Candidate Info</a>
{/if}
<!-- </div> -->
{/if}
Loading