Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ class CandidateListRowProvisioner extends \LORIS\Data\Provisioners\DBRowProvisio

$row['EntityType'] = dgettext("candidate", $row['EntityType']);

$row['RegistrationProject'] = dgettext(
"Project",
$row['RegistrationProject']
);

unset($row['RegistrationCenterID']);
unset($row['RegistrationProjectID']);
return new CandidateListRow($row, $cid, $pid);
Expand Down
9 changes: 3 additions & 6 deletions modules/candidate_list/php/options.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,7 @@ class Options extends \LORIS\Http\Endpoint
}

// get the list of projects
// $list_of_projects = \Utility::getProjectList();
$list_of_projects = $user->getProjectNames();
$project_options = [];
foreach (array_values($list_of_projects) as $name) {
$project_options[$name] = $name;
}

// get the list of cohorts
$list_of_cohorts = \Utility::getCohortList();
Expand Down Expand Up @@ -97,10 +92,12 @@ class Options extends \LORIS\Http\Endpoint
dgettext("candidate", 'Scanner') => dgettext("candidate", 'Scanner'),
];

$projects = array_combine($list_of_projects, $list_of_projects);

return [
'visitlabel' => $visit_label_options,
'site' => $site_options,
'project' => $project_options,
'project' => $projects,
'cohort' => $cohort_options,
'participantstatus' => $participant_status_options,
'useedc' => $config->getSetting("useEDC"),
Expand Down
7 changes: 6 additions & 1 deletion php/libraries/User.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,12 @@ class User extends UserPermissions implements
if ($projects === '') {
return [];
}
return explode(';', $projects);

$translated = [];
foreach (explode(';', $projects) as $project) {
$translated[$project] = dgettext("Project", $project);
}
return $translated;
}

/**
Expand Down
Loading