Skip to content
Closed
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
3 changes: 2 additions & 1 deletion modules/dataquery/test/TestPlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
1. Ensure the module loads only for a user that has the `dataquery_view` permission. They must also have access to the dictionary module.
2. Assert that: `Instructions` panel, `Recent Queries` panel, and `Next Steps` panel (bottom-right corner) collapse as expected.
3. Assert that: `Continue to Define Fields` button in the main panel, and `Choose Fields` button in the `Next Steps` panel are redirecting to the same page.
4. `Recent Queries` panel
4. Ensure the pinning icon only appears for users that have the `dataquery_admin` (Data Query Tool: Admin dataquery queries) permission. Users without it should not be able to pin queries.
5. `Recent Queries` panel
1. If not queries are available, make some so they will be added to this section.
2. Assert that: queries you made have their parameters correctly displayed (i.e. fields and filters).
3. Assert that: `text filter` immediately filter the queries.
Expand Down
14 changes: 10 additions & 4 deletions modules/survey_accounts/ajax/ValidateEmailSubmitInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
if ($numSessions != 1) {
echo json_encode(
[
'error_msg' => dgettext('loris', 'Visit').' '. $_REQUEST['VL'].' '.
'error_msg' => dgettext('survey_accounts', 'Visit').' '.
$_REQUEST['VL'].' '.
dgettext('survey_accounts', 'does not exist for given candidate'),
]
);
Expand All @@ -78,7 +79,7 @@

if (empty($_REQUEST['TN'])) {
echo json_encode(
['error_msg' => dgettext('survey_accounts', 'Please choose an instrument')]
['error_msg' => dgettext('survey_accounts', 'Please choose an instrument.')]
);
exit(0);
}
Expand All @@ -100,8 +101,13 @@
if ($_REQUEST['TN'] == $instrument['Test_name']) {
echo json_encode(
[
'error_msg' => dgettext('loris', 'Instrument').' '. $_REQUEST['TN']
.' ' .dgettext(
'error_msg' => dcngettext(
'survey_accounts',
'Instrument',
'Instruments',
1,
LC_MESSAGES
).' '. $_REQUEST['TN'].' ' .dgettext(
'survey_accounts',
'already exists for given candidate for visit'
).' '. $_REQUEST['VL'],
Expand Down
6 changes: 4 additions & 2 deletions modules/survey_accounts/js/survey_accounts_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ $(document).ready(function () {
}
if (email.length > 0 && email2.length > 0 && email !== email2)
{
$("#email-error").show().html("Emails do not match");
$("#email-error")
.show()
.html($("#email-error").data("email-mismatch"));
}
} );
$("#emailData").click(function(){
Expand All @@ -60,7 +62,7 @@ $(document).ready(function () {
}).appendTo("#participant_accounts_form");
$("#participant_accounts_form").submit();
});
$("input[type=submit]").click(function (e) {
$("input[type=submit], button[type=submit]").click(function (e) {
if(e.currentTarget.classList.contains('email')) {
$.get(loris.BaseURL + "/survey_accounts/ajax/ValidateEmailSubmitInput.php", {
dccid: $("input[name=CandID]").val(),
Expand Down
23 changes: 16 additions & 7 deletions modules/survey_accounts/jsx/surveyAccountsIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import Loader from 'Loader';
import FilterableDataTable from 'FilterableDataTable';

import hiStrings from '../locale/hi/LC_MESSAGES/survey_accounts.json';
import jaStrings from '../locale/ja/LC_MESSAGES/survey_accounts.json';
import frCAStrings from '../locale/fr_CA/LC_MESSAGES/survey_accounts.json';
import zhStrings from '../locale/zh/LC_MESSAGES/survey_accounts.json';
/**
* Survey Account React Component
*/
Expand Down Expand Up @@ -73,7 +76,7 @@ class SurveyAccountsIndex extends Component {
const url = loris.BaseURL + '/survey.php?key=' + row.URL;
result = <td><a href={url}>{cell}</a></td>;
break;
case t('Instrument', {ns: 'loris', count: 1}):
case t('Instrument', {ns: 'survey_accounts', count: 1}):
result = <td>{this.state.data.fieldOptions.instruments[cell]}</td>;
break;
}
Expand Down Expand Up @@ -110,20 +113,22 @@ class SurveyAccountsIndex extends Component {
const options = this.state.data.fieldOptions;
const fields = [
{
label: t('PSCID', {ns: 'loris'}), show: true, filter: {
label: t('PSCID', {ns: 'survey_accounts'}), show: true, filter: {
name: 'pscid',
type: 'text',
},
},
{
label: t('Visit', {ns: 'loris'}), show: true, filter: {
label: t('Visit', {ns: 'survey_accounts'}), show: true, filter: {
name: 'visit',
type: 'select',
options: options.visits,
},
},
{
label: t('Instrument', {ns: 'loris', count: 1}), show: true, filter: {
label: t('Instrument', {ns: 'survey_accounts', count: 1}),
show: true,
filter: {
name: 'instrument',
type: 'select',
options: options.instruments,
Expand All @@ -139,7 +144,10 @@ class SurveyAccountsIndex extends Component {
},
];
const addSurvey = () => {
location.href = '/survey_accounts/addSurvey/';
const params = new URLSearchParams(window.location.search);
const lang = params.get('lang');
const query = lang ? `?lang=${encodeURIComponent(lang)}` : '';
location.href = `${loris.BaseURL}/survey_accounts/addSurvey/${query}`;
};
const actions = [
{label: t('Add Survey', {ns: 'survey_accounts'}), action: addSurvey},
Expand Down Expand Up @@ -167,8 +175,9 @@ SurveyAccountsIndex.propTypes = {
window.addEventListener(
'load', () => {
i18n.addResourceBundle('hi', 'survey_accounts', hiStrings);
i18n.addResourceBundle('ja', 'survey_accounts', {});
i18n.addResourceBundle('zh', 'survey_accounts', {});
i18n.addResourceBundle('ja', 'survey_accounts', jaStrings);
i18n.addResourceBundle('fr_CA', 'survey_accounts', frCAStrings);
i18n.addResourceBundle('zh', 'survey_accounts', zhStrings);
const Index = withTranslation(
['survey_accounts']
)(SurveyAccountsIndex);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"Survey Accounts": "Comptes de sondage",
"Survey was added successfully.": "Le sondage a été ajouté avec succès.",
"Click here to go back to view the list of survey's created": "Cliquez ici pour revenir à la liste des sondages créés",
"Survey List": "Liste des sondages",
"Usage": "Utilisation",
"Use this form to create a link for a study participant to use in order to directly enter a form/data into Loris.": "Utilisez ce formulaire pour créer un lien permettant à un participant à l'étude de saisir directement un formulaire/des données dans LORIS.",
"Add Survey": "Ajouter un sondage",
"Create survey": "Créer un sondage",
"Email survey": "Envoyer le sondage par courriel",
"Close": "Fermer",
"Email to Study Participant": "Courriel au participant à l'étude",
"Optionally enter a customized message here. A default email will be sent if left blank.": "Saisissez éventuellement un message personnalisé ici. Un courriel par défaut sera envoyé si ce champ est laissé vide.",
"This is where your message goes.": "Votre message s'inscrit ici.",
"Email": "Adresse courriel",
"DCCID": "DCCID",
"PSCID": "PSCID",
"Visit": "Visite",
"Visit Label": "Libellé de visite",
"Email address": "Adresse courriel",
"Instrument": "Instrument",
"Instrument_plural": "Instruments",
"URL": "URL",
"Status": "Statut",
"Created": "Créé",
"Sent": "Envoyé",
"In Progress": "En cours",
"Complete": "Complété",
"PSCID and DCCID do not match or candidate does not exist.": "Le PSCID et le DCCID ne correspondent pas ou le candidat n'existe pas.",
"does not exist for given candidate": "n'existe pas pour le candidat donné",
"Please choose an instrument.": "Veuillez choisir un instrument.",
"already exists for given candidate for visit": "existe déjà pour le candidat donné pour la visite",
"The email address is not valid.": "L'adresse courriel n'est pas valide.",
"Please confirm the email address.": "Veuillez confirmer l'adresse courriel.",
"The email addresses do not match.": "Les adresses courriel ne correspondent pas.",
"You must specify a valid Visit Label.": "Vous devez préciser un libellé de visite valide.",
"You are not affiliated with this session's project": "Vous n'êtes pas affilié au projet de cette session",
"Confirm Email address": "Confirmer l'adresse courriel"
}
129 changes: 129 additions & 0 deletions modules/survey_accounts/locale/fr_CA/LC_MESSAGES/survey_accounts.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Default LORIS strings to be translated (French Canadian).
# Copy this to a language specific file and add translations to the
# new file.
# Copyright (C) 2025
# This file is distributed under the same license as the LORIS package.
# Dave MacFarlane <dave.macfarlane@mcin.ca>, 2025.
#
msgid ""
msgstr ""
"Project-Id-Version: LORIS 27\n"
"Report-Msgid-Bugs-To: https://github.com/aces/Loris/issues\n"
"POT-Creation-Date: 2025-04-08 14:37-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: French Canadian <fr_CA@li.org>\n"
"Language: fr_CA\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "Survey Accounts"
msgstr "Comptes de sondage"

msgid "Survey was added successfully."
msgstr "Le sondage a été ajouté avec succès."

msgid "Click here to go back to view the list of survey's created"
msgstr "Cliquez ici pour revenir à la liste des sondages créés"

msgid "Survey List"
msgstr "Liste des sondages"

msgid "Usage"
msgstr "Utilisation"

msgid "Use this form to create a link for a study participant to use in order to directly enter a form/data into Loris."
msgstr "Utilisez ce formulaire pour créer un lien permettant à un participant à l'étude de saisir directement un formulaire/des données dans LORIS."

msgid "Add Survey"
msgstr "Ajouter un sondage"

msgid "Create survey"
msgstr "Créer un sondage"

msgid "Email survey"
msgstr "Envoyer le sondage par courriel"

msgid "Close"
msgstr "Fermer"

msgid "Email to Study Participant"
msgstr "Courriel au participant à l'étude"

msgid "Optionally enter a customized message here. A default email will be sent if left blank."
msgstr "Saisissez éventuellement un message personnalisé ici. Un courriel par défaut sera envoyé si ce champ est laissé vide."

msgid "This is where your message goes."
msgstr "Votre message s'inscrit ici."

msgid "Email"
msgstr "Adresse courriel"

msgid "DCCID"
msgstr "DCCID"

msgid "PSCID"
msgstr "PSCID"

msgid "Visit"
msgstr "Visite"

msgid "Visit Label"
msgstr "Libellé de visite"

msgid "Email address"
msgstr "Adresse courriel"

msgid "Instrument"
msgid_plural "Instruments"
msgstr[0] "Instrument"
msgstr[1] "Instruments"

msgid "URL"
msgstr "URL"

msgid "Status"
msgstr "Statut"

msgid "Created"
msgstr "Créé"

msgid "Sent"
msgstr "Envoyé"

msgid "In Progress"
msgstr "En cours"

msgid "Complete"
msgstr "Complété"

msgid "PSCID and DCCID do not match or candidate does not exist."
msgstr "Le PSCID et le DCCID ne correspondent pas ou le candidat n'existe pas."

msgid "does not exist for given candidate"
msgstr "n'existe pas pour le candidat donné"

msgid "Please choose an instrument."
msgstr "Veuillez choisir un instrument."

msgid "already exists for given candidate for visit"
msgstr "existe déjà pour le candidat donné pour la visite"

msgid "The email address is not valid."
msgstr "L'adresse courriel n'est pas valide."

msgid "Please confirm the email address."
msgstr "Veuillez confirmer l'adresse courriel."

msgid "The email addresses do not match."
msgstr "Les adresses courriel ne correspondent pas."

msgid "You must specify a valid Visit Label."
msgstr "Vous devez préciser un libellé de visite valide."

msgid "You are not affiliated with this session's project"
msgstr "Vous n'êtes pas affilié au projet de cette session"

msgid "Confirm Email address"
msgstr "Confirmer l'adresse courriel"
33 changes: 29 additions & 4 deletions modules/survey_accounts/locale/survey_accounts.pot
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,43 @@ msgstr ""
msgid "Email"
msgstr ""

msgid "Instrument"
msgid "DCCID"
msgstr ""

msgid "PSCID"
msgstr ""

msgid "Visit"
msgstr ""

msgid "Visit Label"
msgstr ""

msgid "Email address"
msgstr ""

msgid "Instrument"
msgid_plural "Instruments"
msgstr[0] ""

msgid "URL"
msgstr ""

msgid "Status"
msgstr ""

msgid "Created"
msgstr ""

msgid "Sent"
msgstr ""

msgid "In Progress"
msgstr ""

msgid "Complete"
msgstr ""

msgid "PSCID and DCCID do not match or candidate does not exist."
msgstr ""

Expand Down Expand Up @@ -96,8 +124,5 @@ msgstr ""
msgid "You are not affiliated with this session's project"
msgstr ""

msgid "Email is not valid."
msgstr ""

msgid "Confirm Email address"
msgstr ""
Loading
Loading