Skip to content

Commit 56b6699

Browse files
committed
Adds prefix to Switchboard only in the article publication modal.
1 parent 0f25a3a commit 56b6699

File tree

5 files changed

+27
-14
lines changed

5 files changed

+27
-14
lines changed

classes/Message.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ public function addSubmissionStatusToWorkflow($hookName, $params)
109109

110110
try {
111111
$p1Pio = new P1Pio($submission);
112-
$successMessage = $this->getSubmissionAlreadyToSendMessage($submission);
112+
$successMessage = $this->getSubmissionAlreadyToSendMessage($submission, false);
113113
$smarty->assign([
114114
'submissionIsAlreadySendMessage' => $successMessage,
115115
]);
116116
} catch (P1PioException $e) {
117117
if ($e->getP1PioErrors()) {
118-
$errorMessage = $this->getMandatoryDataErrorMessage($e->getP1PioErrors(), $submission);
118+
$errorMessage = $this->getMandatoryDataErrorMessage($e->getP1PioErrors(), $submission, false);
119119
$smarty->assign([
120120
'submissionRequirementsIsPending' => $errorMessage,
121121
]);
@@ -153,9 +153,11 @@ private function sendNotification($userId, $message, $notificationType)
153153
);
154154
}
155155

156-
private function getMandatoryDataErrorMessage($p1PioErrors, $submission): string
156+
private function getMandatoryDataErrorMessage($p1PioErrors, $submission, $includePrefix = true): string
157157
{
158-
$introductionMessage = __('plugins.generic.OASwitchboard.postRequirementsError.introductionText');
158+
$introductionMessage = $includePrefix ?
159+
__('plugins.generic.OASwitchboard.includePrefix') . __('plugins.generic.OASwitchboard.postRequirementsError.introductionText') :
160+
ucfirst(__('plugins.generic.OASwitchboard.postRequirementsError.introductionText'));
159161
$message = '<div class="pkpNotification pkpNotification--information">' . $introductionMessage . '<br><br>';
160162
foreach ($p1PioErrors as $error) {
161163
$noticeMessage = __($error);
@@ -170,11 +172,13 @@ private function getMandatoryDataErrorMessage($p1PioErrors, $submission): string
170172
return $message;
171173
}
172174

173-
private function getSubmissionAlreadyToSendMessage($submission): string
175+
private function getSubmissionAlreadyToSendMessage($submission, $includePrefix = true): string
174176
{
175177
$hasRorAssociated = OASwitchboardService::isRorAssociated($submission);
176178
$messageType = $hasRorAssociated ? 'success' : 'information';
177-
$successMessage = __('plugins.generic.OASwitchboard.postRequirementsSuccess');
179+
$successMessage = $includePrefix ?
180+
__('plugins.generic.OASwitchboard.includePrefix') . __('plugins.generic.OASwitchboard.postRequirementsSuccess') :
181+
ucfirst(__('plugins.generic.OASwitchboard.postRequirementsSuccess'));
178182
$rorRecommendationMessage = $hasRorAssociated ? '' : '<br><br>' . __('plugins.generic.OASwitchboard.rorRecommendation');
179183

180184
return '<div class="pkpNotification pkpNotification--' . $messageType . '">' . $successMessage . $rorRecommendationMessage . '</div>';

locale/en/locale.po

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ msgid "plugins.generic.OASwitchboard.rorRecommendation"
5353
msgstr "It is recommended that at least one author has a ROR ID linked to their affiliation (requires the ROR plugin) to send the message to the author's institution."
5454

5555
msgid "plugins.generic.OASwitchboard.postRequirementsError.introductionText"
56-
msgstr "OA Switchboard: it will not be possible to send the P1 message as the submission does not meet the following requirements."
56+
msgstr "it will not be possible to send the P1 message as the submission does not meet the following requirements."
5757

5858
msgid "plugins.generic.OASwitchboard.postRequirementsError.familyName"
5959
msgstr "The family name of all authors must be present."
@@ -71,7 +71,10 @@ msgid "plugins.generic.OASwitchboard.postRequirementsError.conclusionText"
7171
msgstr "You may review these metadata, or proceed with the publication without sending the message to the OA Switchboard."
7272

7373
msgid "plugins.generic.OASwitchboard.postRequirementsSuccess"
74-
msgstr "OA Switchboard: the requirements have been met and the P1 message will be sent to the OA Switchboard upon publishing the submission."
74+
msgstr "the requirements have been met and the P1 message will be sent to the OA Switchboard upon publishing the submission."
75+
76+
msgid "plugins.generic.OASwitchboard.includePrefix"
77+
msgstr "OA Switchboard: "
7578

7679
msgid "plugins.generic.OASwitchboard.workflowTab.label"
7780
msgstr "OA Switchboard"

locale/es/locale.po

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ msgid "plugins.generic.OASwitchboard.rorRecommendation"
5353
msgstr "Se recomienda que al menos un autor tenga un ID ROR vinculado a su afiliación (requiere el plugin ROR) para enviar el mensaje a la institución del autor."
5454

5555
msgid "plugins.generic.OASwitchboard.postRequirementsError.introductionText"
56-
msgstr "OA Switchboard: no será posible enviar el mensaje P1, ya que la presentación no cumple con los requisitos a continuación."
56+
msgstr "no será posible enviar el mensaje P1, ya que la presentación no cumple con los requisitos a continuación."
5757

5858
msgid "plugins.generic.OASwitchboard.postRequirementsError.familyName"
5959
msgstr "El apellido de todos los autores debe estar presente."
@@ -71,7 +71,10 @@ msgid "plugins.generic.OASwitchboard.postRequirementsError.conclusionText"
7171
msgstr "Puede revisar estos metadatos o continuar con la publicación sin enviar el mensaje al OA Switchboard."
7272

7373
msgid "plugins.generic.OASwitchboard.postRequirementsSuccess"
74-
msgstr "OA Switchboard: se han cumplido los requisitos y el mensaje P1 será enviado al OA Switchboard al publicar la publicacíon."
74+
msgstr "se han cumplido los requisitos y el mensaje P1 será enviado al OA Switchboard al publicar la publicacíon."
75+
76+
msgid "plugins.generic.OASwitchboard.includePrefix"
77+
msgstr "OA Switchboard: "
7578

7679
msgid "plugins.generic.OASwitchboard.workflowTab.label"
7780
msgstr "OA Switchboard"

locale/pt_BR/locale.po

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ msgid "plugins.generic.OASwitchboard.rorRecommendation"
5151
msgstr "É recomendado que pelo menos um autor tenha um ID ROR vinculado à sua afiliação (requer o plugin ROR) para que a mensagem seja enviada à instituição do autor."
5252

5353
msgid "plugins.generic.OASwitchboard.postRequirementsError.introductionText"
54-
msgstr "OA Switchboard: não será possível enviar a mensagem P1, pois a submissão não cumpre os requisitos abaixo."
54+
msgstr "não será possível enviar a mensagem P1, pois a submissão não cumpre os requisitos abaixo."
5555

5656
msgid "plugins.generic.OASwitchboard.postRequirementsError.familyName"
5757
msgstr "O sobrenome de todos os autores precisam estar presentes."
@@ -69,7 +69,10 @@ msgid "plugins.generic.OASwitchboard.postRequirementsError.conclusionText"
6969
msgstr "Você pode rever estes metadados, ou continuar com a publicação sem o envio da mensagem para o OA Switchboard."
7070

7171
msgid "plugins.generic.OASwitchboard.postRequirementsSuccess"
72-
msgstr "OA Switchboard: os requisitos foram atendidos e a mensagem P1 será enviada ao OA Switchboard ao publicar a submissão."
72+
msgstr "os requisitos foram atendidos e a mensagem P1 será enviada ao OA Switchboard ao publicar a submissão."
73+
74+
msgid "plugins.generic.OASwitchboard.includePrefix"
75+
msgstr "OA Switchboard: "
7376

7477
msgid "plugins.generic.OASwitchboard.workflowTab.label"
7578
msgstr "OA Switchboard"

version.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
<version>
1313
<application>OASwitchboard</application>
1414
<type>plugins.generic</type>
15-
<release>2.0.1.15</release>
16-
<date>2024-12-27</date>
15+
<release>2.0.1.16</release>
16+
<date>2024-12-31</date>
1717
</version>

0 commit comments

Comments
 (0)