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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ locales:
msgfmt -o modules/module_manager/locale/ja/LC_MESSAGES/module_manager.mo modules/module_manager/locale/ja/LC_MESSAGES/module_manager.po
msgfmt -o modules/mri_violations/locale/ja/LC_MESSAGES/mri_violations.mo modules/mri_violations/locale/ja/LC_MESSAGES/mri_violations.po
msgfmt -o modules/next_stage/locale/ja/LC_MESSAGES/next_stage.mo modules/next_stage/locale/ja/LC_MESSAGES/next_stage.po
msgfmt -o modules/next_stage/locale/es/LC_MESSAGES/next_stage.mo modules/next_stage/locale/es/LC_MESSAGES/next_stage.po
msgfmt -o modules/oidc/locale/ja/LC_MESSAGES/oidc.mo modules/oidc/locale/ja/LC_MESSAGES/oidc.po
msgfmt -o modules/publication/locale/ja/LC_MESSAGES/publication.mo modules/publication/locale/ja/LC_MESSAGES/publication.po
msgfmt -o modules/schedule_module/locale/ja/LC_MESSAGES/schedule_module.mo modules/schedule_module/locale/ja/LC_MESSAGES/schedule_module.po
Expand Down
59 changes: 59 additions & 0 deletions modules/next_stage/locale/es/LC_MESSAGES/next_stage.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Default LORIS strings to be translated (English).
# 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 <[email protected]>, 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: LANGUAGE <[email protected]>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: modules/new_profile/php/module.class.inc:60
msgid "Next Stage"
msgstr "Próxima Etapa"

msgid "Start Next Stage"
msgstr "Comenzar próxima etapa"

msgid "Date of %s"
msgstr "Fecha de %s"

msgid "Retype Date of %s"
msgstr "Confirme la fecha de %s"

msgid "Start %s"
msgstr "Comenzar %s"

msgid "CohortID:"
msgstr "Identificador del Cohorte:"

msgid "Date is required."
msgstr "La fecha es requerida."

msgid "Both date fields are required."
msgstr "Los dos campos de fecha son requeridos."

msgid "Both Date fields must match."
msgstr "Las dos fechas deben coincidir."

msgid "Date of Visit is less than Date of Screening."
msgstr "Las dos fechas deben coincidir."

msgid "Date of Visit is less than Date of Birth/EDC."
msgstr "Las dos fechas deben coincidir."

msgid "Next stage started."
msgstr "Próxima etapa iniciada."

msgid "Click here to continue."
msgstr "Click aquí para continuar."
33 changes: 33 additions & 0 deletions modules/next_stage/locale/next_stage.pot
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,36 @@ msgstr ""

msgid "Start Next Stage"
msgstr ""

msgid "Date of %s"
msgstr ""

msgid "Retype Date of %s"
msgstr ""

msgid "Start %s"
msgstr ""

msgid "CohortID:"
msgstr ""

msgid "Date is required."
msgstr ""

msgid "Both date fields are required."
msgstr ""

msgid "Both Date fields must match."
msgstr ""

msgid "Date of Visit is less than Date of Screening."
msgstr ""

msgid "Date of Visit is less than Date of Birth/EDC."
msgstr ""

msgid "Next stage started."
msgstr ""

msgid "Click here to continue."
msgstr ""
35 changes: 24 additions & 11 deletions modules/next_stage/php/next_stage.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,16 @@ class Next_Stage extends \NDB_Form
}

// add date rules
$this->addRule('date1', 'Date is required', 'required');
$this->addRule(['date1', 'date2'], 'Date fields must match', 'compare');

$this->addRule(
'date1',
dgettext("next_stage", "Date is required."),
'required'
);
$this->addRule(
['date1', 'date2'],
dgettext("next_stage", "Date fields must match."),
'compare'
);
$this->form->addFormRule([&$this, '_validate']);
}

Expand All @@ -211,16 +218,18 @@ class Next_Stage extends \NDB_Form
|| is_null($values['date1'])
|| is_null($values['date2'])
) {
$errors['date1'] .= "Both date fields are required.";
$errors['date1']
.= dgettext("next_stage", "Both date fields are required.");
return $errors;
}
// check date pairs
if (empty($values['date1'])) {
$errors['date1'] .= "Date is required. \n";
$errors['date1']
.= dgettext("next_stage", "Date is required.")."\n";
}

if ($values['date1'] != $values['date2']) {
$errors['date1'] .= "Both Date fields must match. \n";
$errors['date1']
.= dgettext("next_stage", "Both Date fields must match.");
}

// get candidate's DOB or EDC according to CohortID
Expand All @@ -237,14 +246,18 @@ class Next_Stage extends \NDB_Form
&& $config->getSetting('screeningAfterVisit')!="true"
&& strcmp($date, $timePoint->getData('Date_screening')) < 0
) {
$errors['date1'] .= "Date of Visit is less than".
" Date of Screening. \n";
$errors['date1'] .= dgettext(
"next_stage",
"Date of Visit is less than Date of Screening."
);
}
if ($config->getSetting('allowPrenatalTimepoints')!="true"
&& strcmp($date, $candidateBirthDate) < 1
) {
$errors['date1'] .= "Date of Visit is less than ".
"Date of Birth/EDC. \n";
$errors['date1'] .= dgettext(
"next_stage",
"Date of Visit is less than Date of Birth/EDC."
);
}
}

Expand Down
10 changes: 5 additions & 5 deletions modules/next_stage/templates/form_next_stage.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{if $success}

<p>Next stage started. <a href="{$baseURL}/instrument_list/?candID={$candID}&sessionID={$sessionID}">Click here to continue</a>.</p>
<p>{dgettext("next_stage", "Next stage started.")} <a href="{$baseURL}/instrument_list/?candID={$candID}&sessionID={$sessionID}">{dgettext("next_stage", "Click here to continue.")}</a>.</p>

{else}

Expand All @@ -12,22 +12,22 @@
</div>
{/foreach}
<div class="form-group row">
<label class="col-sm-2">Date of {$stage}</label>
<label class="col-sm-2">{sprintf(dgettext("next_stage", "Date of %s"), dgettext("loris", $stage))}</label>
<div class="col-sm-4 col-md-3">{$form.date1.html}</div>
</div>
<div class="form-group row">
<label class="col-sm-2">Retype Date of {$stage}</label>
<label class="col-sm-2">{sprintf(dgettext("next_stage", "Retype Date of %s"), dgettext("loris", $stage))}</label>
<div class="col-sm-4 col-md-3">{$form.date2.html}</div>
</div>
{if $form.CohortID.html != ""}
<div class="form-group row">
<label class="col-sm-2">CohortID:</label>
<label class="col-sm-2">{dgettext("next_stage", "CohortID:")}</label>
<div class="col-sm-4 col-md-3">{$form.CohortID.html}</div>
</div>
{/if}

<div class="form-group row">
<div class="col-sm-offset-2 col-sm-4 col-md-3"><input class="btn btn-primary col-xs-12" type="submit" name="fire_away" value="Start {$stage}" onClick="this.form.submit(); this.disabled=true;"/></div>
<div class="col-sm-offset-2 col-sm-4 col-md-3"><input class="btn btn-primary col-xs-12" type="submit" name="fire_away" value="{sprintf(dgettext("next_stage", "Start %s"), dgettext("loris", $stage))}" onClick="this.form.submit(); this.disabled=true;"/></div>
</div>

{$form.hidden}
Expand Down
Loading