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
1 change: 1 addition & 0 deletions modules/media/jsx/mediaIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ class MediaIndex extends Component {
{label: t('Visit Label', {ns: 'loris'}), show: true, filter: {
name: 'visitLabel',
type: 'select',
sortByValue: false,
options: options.visits,
}},
{label: t('Language', {ns: 'loris'}), show: true, filter: {
Expand Down
3 changes: 3 additions & 0 deletions modules/media/php/mediafileprovisioner.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ class MediaFileProvisioner extends \LORIS\Data\Provisioners\DBRowProvisioner
}
$row['fullName'] = $this->_instrumentnames[$testname] ?? null;

if (isset($row['visitLabel'])) {
$row['visitLabel'] = dgettext("visit", $row['visitLabel']);
}
return new MediaFile($row);
}
}
12 changes: 8 additions & 4 deletions php/libraries/Utility.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,15 @@ class Utility
AND s.CenterID!= '1'
$ExtraProject_Criteria ORDER BY Visit_label";
$result = $db->pselect($query, $qparams);
// The result has several columns; we only want the visit labels.
$visitLabels = array_column(iterator_to_array($result), 'Visit_label');

// Generates an array where the keys are equal to the values.
$cache[$projStr] = array_combine($visitLabels, $visitLabels);
$visitLabels = [];
foreach ($result as $row) {
$vl = $row['Visit_label'];

$visitLabels[$vl] = dgettext("visit", $vl);
}

$cache[$projStr] = $visitLabels;
return $cache[$projStr];
}

Expand Down
Loading