From 1aa919cc08707d70f23042f11e9b257c5000cf32 Mon Sep 17 00:00:00 2001 From: Mike Ng Date: Fri, 22 Dec 2017 16:04:02 +0400 Subject: [PATCH] porting PHRAS-1589 to 4.1 --- .../Controller/Prod/ExportController.php | 8 ++++---- resources/locales/messages.de.xlf | 7 ++++++- resources/locales/messages.en.xlf | 19 ++++++++++++------- resources/locales/messages.fr.xlf | 17 +++++++++++------ resources/locales/messages.nl.xlf | 7 ++++++- resources/locales/validators.de.xlf | 2 +- resources/locales/validators.en.xlf | 2 +- resources/locales/validators.fr.xlf | 2 +- resources/locales/validators.nl.xlf | 2 +- templates/web/common/dialog_export.html.twig | 3 ++- 10 files changed, 45 insertions(+), 24 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Prod/ExportController.php b/lib/Alchemy/Phrasea/Controller/Prod/ExportController.php index 7cd11305b6..df6f2a9f19 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/ExportController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/ExportController.php @@ -168,11 +168,11 @@ class ExportController extends Controller $request->request->get('businessfields') ); - $separator = preg_split('//', ' ;,', -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); - $separator = '/\\' . implode('|\\', $separator) . '/'; - $list['export_name'] = sprintf("%s.zip", $download->getExportName()); - $list['email'] = implode(';', preg_split($separator, $request->request->get("destmail", ""))); + + $separator = '/\ |\;|\,/'; + // add PREG_SPLIT_NO_EMPTY to only return non-empty values + $list['email'] = implode(';', preg_split($separator, $request->request->get("destmail", ""), -1, PREG_SPLIT_NO_EMPTY)); $destMails = []; //get destination mails diff --git a/resources/locales/messages.de.xlf b/resources/locales/messages.de.xlf index c2aacbe27e..683125ea4a 100644 --- a/resources/locales/messages.de.xlf +++ b/resources/locales/messages.de.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. @@ -9475,6 +9475,11 @@ web/common/dialog_export.html.twig web/common/dialog_export.html.twig + + export::export-email: email-invalid + export::export-email: email-invalid + web/common/dialog_export.html.twig + export::ftp: reglages manuels manuelle Einstellungen diff --git a/resources/locales/messages.en.xlf b/resources/locales/messages.en.xlf index 4638d71a8b..e9a99d365b 100644 --- a/resources/locales/messages.en.xlf +++ b/resources/locales/messages.en.xlf @@ -1,14 +1,14 @@ - + - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.
- - + + Form/Configuration/EmailFormType.php Form/Login/PhraseaAuthenticationForm.php @@ -2232,7 +2232,7 @@ prod/results/entry.html.twig prod/results/feeds_entry.html.twig
- + Derniers envois Last sent web/developers/application.html.twig @@ -4625,7 +4625,7 @@ Past year WorkZone/Browser/Browser.html.twig - + Pause Pause Controller/Prod/LanguageController.php @@ -6995,7 +6995,7 @@ Users suggestion prod/actions/Push.html.twig - + Utilisation prevue: Intended use: prod/orders/order_item.html.twig @@ -9476,6 +9476,11 @@ web/common/dialog_export.html.twig web/common/dialog_export.html.twig + + export::export-email: email-invalid + export::export-email: email-invalid + web/common/dialog_export.html.twig + export::ftp: reglages manuels Manual settings diff --git a/resources/locales/messages.fr.xlf b/resources/locales/messages.fr.xlf index 3c131fe38e..9268651cf4 100644 --- a/resources/locales/messages.fr.xlf +++ b/resources/locales/messages.fr.xlf @@ -1,14 +1,14 @@ - + - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.
- - + + Form/Configuration/EmailFormType.php Form/Login/PhraseaAuthenticationForm.php @@ -6296,7 +6296,7 @@ Pour les utilisateurs authentifiés, la demande de validation est également dis web/login/cgus.html.twig login/layout/base-layout.html.twig
- + The Phraseanet Web API allows other web application to rely on this instance L'API Web Phraseanet permet à d'autres applications web de se reposer sur cette instance Form/Configuration/APIClientsFormType.php @@ -6997,7 +6997,7 @@ Pour les utilisateurs authentifiés, la demande de validation est également dis Suggestion d'utilisateurs prod/actions/Push.html.twig - + Utilisation prevue: Utilisation prévue: prod/orders/order_item.html.twig @@ -9479,6 +9479,11 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le web/common/dialog_export.html.twig web/common/dialog_export.html.twig + + export::export-email: email-invalid + export::export-email: email-invalid + web/common/dialog_export.html.twig + export::ftp: reglages manuels Réglages manuels diff --git a/resources/locales/messages.nl.xlf b/resources/locales/messages.nl.xlf index f368872247..5b6946f4b8 100644 --- a/resources/locales/messages.nl.xlf +++ b/resources/locales/messages.nl.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. @@ -9479,6 +9479,11 @@ web/common/dialog_export.html.twig web/common/dialog_export.html.twig + + export::export-email: email-invalid + export::export-email: email-invalid + web/common/dialog_export.html.twig + export::ftp: reglages manuels Manuele instellingen diff --git a/resources/locales/validators.de.xlf b/resources/locales/validators.de.xlf index e9542f0cc8..cc710eca61 100644 --- a/resources/locales/validators.de.xlf +++ b/resources/locales/validators.de.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. diff --git a/resources/locales/validators.en.xlf b/resources/locales/validators.en.xlf index 324bce198f..a47995a853 100644 --- a/resources/locales/validators.en.xlf +++ b/resources/locales/validators.en.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. diff --git a/resources/locales/validators.fr.xlf b/resources/locales/validators.fr.xlf index 6446b7e611..a35a9feb75 100644 --- a/resources/locales/validators.fr.xlf +++ b/resources/locales/validators.fr.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. diff --git a/resources/locales/validators.nl.xlf b/resources/locales/validators.nl.xlf index 7077d6f7e7..93a25a623b 100644 --- a/resources/locales/validators.nl.xlf +++ b/resources/locales/validators.nl.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. diff --git a/templates/web/common/dialog_export.html.twig b/templates/web/common/dialog_export.html.twig index 83d6dbea17..a7b1abc21b 100644 --- a/templates/web/common/dialog_export.html.twig +++ b/templates/web/common/dialog_export.html.twig @@ -506,7 +506,8 @@ fileTooLargeAlt: '{{ 'You can alternatively receive an email when the download is ready.' | trans | e('js') }}', fileTooLargeEmail: '{{ 'Would you like to receive an e-mail when your download is ready ?' | trans | e('js') }}', success: '{{ "Success" | trans | e('js') }}', - warning: '{{ "Warning !" | trans | e('js') }}' + warning: '{{ "Warning !" | trans | e('js') }}', + invalidEmail: '{{ 'export::export-email: email-invalid' | trans }}' }, user: { email: '{{app.getAuthenticatedUser().getEmail() | e('js')}}'