Skip to content

Commit ef15ea3

Browse files
Merge branch 'main' into 2025_09_11_project_size_chart
2 parents d5e805c + 00ee1f9 commit ef15ea3

File tree

22 files changed

+838
-429
lines changed

22 files changed

+838
-429
lines changed

locale/ja/LC_MESSAGES/loris.po

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@ msgstr "詳細フィルターを非表示"
232232
msgid "Language"
233233
msgstr "言語"
234234

235+
msgid "Ethnicity"
236+
msgstr "民族"
237+
235238
# Data table strings
236239
msgid "{{pageCount}} rows displayed of {{totalCount}}."
237240
msgstr "{{totalCount}}行中{{pageCount}}行を表示"
@@ -332,3 +335,8 @@ msgstr "{{months}}ヶ月"
332335

333336
msgid "{{years}} years old"
334337
msgstr "{{years}}歳"
338+
339+
# Other generic terms
340+
msgid "Loading..."
341+
msgstr "読み込み中..."
342+

locale/loris.pot

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ msgstr ""
231231
msgid "Language"
232232
msgstr ""
233233

234+
msgid "Ethnicity"
235+
msgstr ""
236+
234237
# Data table strings
235238
msgid "{{pageCount}} rows displayed of {{totalCount}}."
236239
msgstr ""
@@ -331,3 +334,8 @@ msgstr ""
331334

332335
msgid "{{years}} years old"
333336
msgstr ""
337+
338+
# Other generic terms
339+
msgid "Loading..."
340+
msgstr ""
341+

modules/dashboard/test/DashboardTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,17 +409,17 @@ public function testDashboardRecruitmentView()
409409
)
410410
)->getText();
411411

412-
$this->assertStringContainsString("Recruitment - overall", $assertText1);
412+
$this->assertStringContainsString("Recruitment — Overall", $assertText1);
413413
$this->assertStringContainsString(
414-
"Recruitment - site breakdown",
414+
"Recruitment — Site Breakdown",
415415
$assertText2
416416
);
417417
$this->assertStringContainsString(
418-
"Recruitment - project breakdown",
418+
"Recruitment — Project Breakdown",
419419
$assertText3
420420
);
421421
$this->assertStringContainsString(
422-
"Recruitment - cohort breakdown",
422+
"Recruitment — Cohort Breakdown",
423423
$assertText4
424424
);
425425
}

modules/instrument_list/templates/instrument_list_controlpanel.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
<li>
102102
<span class="fa-li"><i class="{$bvl_qc_status_complete.icon|default:'far fa-square'}"></i></span>
103103
{if $bvl_qc_status_complete.showlink|default}
104-
<a href="?candID={$candID}&sessionID={$sessionID}&setBVLQCStatus=Complete">Complete</a>
104+
<a href="?candID={$candID}&sessionID={$sessionID}&setBVLQCStatus=Complete">{dgettext("timepoint_list", "Complete")}</a>
105105
{else}
106106
{dgettext("timepoint_list", "Complete")}
107107
{/if}

modules/redcap/php/client/models/records/redcaprecord.class.inc

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ use LORIS\redcap\client\RedcapProps;
2626
class RedcapRecord
2727
{
2828
/**
29-
* The date at which the record was completed if it was completed using a
30-
* survey.
29+
* The REDCap record ID.
3130
*/
32-
public readonly ?\DateTimeImmutable $datetime;
31+
public readonly string $record_id;
32+
33+
/**
34+
* The REDCap unique event name.
35+
*/
36+
public readonly string $unique_event_name;
3337

3438
/**
3539
* The record completion status.
@@ -39,6 +43,12 @@ class RedcapRecord
3943
*/
4044
public readonly int $complete;
4145

46+
/**
47+
* The date and time at which the record was completed. This is an undocumented
48+
* field in the REDCap API.
49+
*/
50+
public readonly ?\DateTimeImmutable $datetime;
51+
4252
private string $_form_name;
4353

4454
private array $_props;
@@ -67,8 +77,10 @@ class RedcapRecord
6777
$datetime = null;
6878
}
6979

70-
$this->datetime = $datetime;
71-
$this->complete = $props->getInt("{$form_name}_complete");
80+
$this->record_id = $props->getString('record_id');
81+
$this->unique_event_name = $props->getString('redcap_event_name');
82+
$this->datetime = $datetime;
83+
$this->complete = $props->getInt("{$form_name}_complete");
7284
}
7385

7486
/**

modules/redcap/php/client/redcaphttpclient.class.inc

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class RedcapHttpClient
4646
private bool $_verbose;
4747

4848
/**
49-
* REDCap URL.
49+
* REDCap API URL.
5050
*/
5151
private string $_url;
5252

@@ -70,18 +70,20 @@ class RedcapHttpClient
7070
/**
7171
* Create a new REDCap Client for a specific REDCap instance and project.
7272
*
73-
* @param string $instance_api_url A REDCap instance API URL.
73+
* @param string $instance_url A REDCap instance URL.
7474
* @param string $project_api_token A REDCap project API token.
7575
* @param bool $verbose Verbose mode.
7676
*/
7777
public function __construct(
78-
string $instance_api_url,
78+
string $instance_url,
7979
string $project_api_token,
8080
bool $verbose = false
8181
) {
82-
$this->_url = $instance_api_url;
82+
$trimmed_url = rtrim($instance_url, '/');
83+
$api_url = "{$trimmed_url}/api/";
84+
$this->_url = $api_url;
8385
$this->_token = $project_api_token;
84-
$this->_client = new Client($instance_api_url);
86+
$this->_client = new Client($api_url);
8587
$this->_verbose = $verbose;
8688
}
8789

@@ -784,7 +786,9 @@ class RedcapHttpClient
784786
'type' => 'flat',
785787
'csvDelimiter' => '',
786788
'forms' => $instrument_names,
787-
'fields' => [],
789+
// The 'record_id' parameter adds both the 'record_id' and
790+
// 'redcap_event_name' fields to the REDCap records.
791+
'fields' => ['record_id'],
788792
'events' => $unique_event_names,
789793
'records' => $record_ids,
790794
'rawOrLabel' => 'raw',

modules/redcap/php/endpoints/notifications.class.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class Notifications extends Endpoint
162162
// get a new redcap client based on the notification info
163163
try {
164164
$redcap_client = new RedcapHttpClient(
165-
"{$config->redcap_instance_url}/api/",
165+
$config->redcap_instance_url,
166166
$config->redcap_api_token,
167167
);
168168

modules/redcap/php/redcapmapper.class.inc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,25 +89,22 @@ class RedcapMapper
8989
* session creation is enabled for that visit in the REDCap module
9090
* configuration, or throws an error if it is not.
9191
*
92-
* @param RedcapRecord $redcap_record The REDCap record.
93-
* @param string $unique_event_name The unique event name associated with
94-
* that REDCap record.
95-
* @param \Candidate $candidate The LORIS candidate associated with
96-
* that REDCap record.
92+
* @param RedcapRecord $redcap_record The REDCap record.
93+
* @param \Candidate $candidate The LORIS candidate associated with
94+
* that REDCap record.
9795
*
9896
* @return string The visit label of the relevant session.
9997
*/
10098
public function getVisitLabel(
10199
RedcapRecord $redcap_record,
102-
string $unique_event_name,
103100
\Candidate $candidate,
104101
): string {
105-
$visit_config = $this->getVisitConfig($unique_event_name);
102+
$visit_config = $this->getVisitConfig($redcap_record->unique_event_name);
106103

107104
// If no visit mappings are defined in the configuration, use the REDCap
108105
// unique event name as the visit label directly.
109106
if ($visit_config === null) {
110-
return $unique_event_name;
107+
return $redcap_record->unique_event_name;
111108
}
112109

113110
$session = $this->checkOrCreateSession($candidate, $visit_config);
@@ -140,7 +137,7 @@ class RedcapMapper
140137
// Find the REDCap event that matches the REDCap notification event.
141138
$redcap_event = array_find(
142139
$redcap_events,
143-
fn($redcap_event) => $unique_event_name === $redcap_event->unique_name,
140+
fn($redcap_event) => $redcap_event->unique_name === $unique_event_name,
144141
);
145142

146143
// There should always be a REDCap event that matches the REDCap

0 commit comments

Comments
 (0)