Browse Source

update framadate

pull/3/head
François 2 years ago
parent
commit
8bc71d3da1
  1. 11
      dockers/framadate/Dockerfile
  2. 8
      dockers/framadate/first.sh
  3. 15
      dockers/framadate/patch/adminstuds.php.patch
  4. 17
      dockers/framadate/patch/create_classic_poll.php.patch
  5. 17
      dockers/framadate/patch/create_date_poll.php.patch
  6. 10
      dockers/framadate/patch/en.json.patch
  7. 17
      dockers/framadate/patch/find_polls.php.patch
  8. 10
      dockers/framadate/patch/fr.json.patch

11
dockers/framadate/Dockerfile

@ -14,7 +14,7 @@ RUN if [ -f /.apt-mirror-config ] ; then . /.apt-mirror-config && sed -i \
########################################
RUN apt-get update --quiet && apt-get install -y \
git wget zip \
git wget zip patch \
libicu-dev libpq-dev zlib1g-dev libicu-dev
RUN apt-get install -y locales locales-all
@ -31,6 +31,15 @@ RUN git clone https://github.com/framasoft/framadate.git .
RUN git checkout 1.1.19
RUN cp php.ini /usr/local/etc/php/
# patch bad-e-mail
COPY dockers/framadate/patch/*.patch ./
RUN patch adminstuds.php adminstuds.php.patch
RUN patch create_classic_poll.php create_classic_poll.php.patch
RUN patch create_date_poll.php create_date_poll.php.patch
RUN patch find_polls.php find_polls.php.patch
RUN patch locale/en.json en.json.patch
RUN patch locale/fr.json fr.json.patch
# install composer setup script
COPY dockers/framadate/composer-setup.sh /usr/local/bin/
COPY dockers/framadate/kazdate.png /var/framadate/images/logo-framadate.png

8
dockers/framadate/first.sh

@ -41,9 +41,7 @@ if [ ! -f "${DOCK_LIB}/volumes/framadate_dateConfig/_data/config.php" ]; then
-u "${HTTPD_USER}:${HTTPD_PASSWORD}" \
"${FRAMADATE_URL}/admin/migration.php"
sed -i "${DOCK_LIB}/volumes/framadate_dateConfig/_data/config.php" \
-e "s/'host' => '[^']*',/'host' => 'smtp',/" \
-e "s/const NOMAPPLICATION = '[^']*';/const NOMAPPLICATION = 'Sondage';/"
sed -e "s/'host'\s*=>\s*'[^']*',/'host' => 'smtp',/" \
-e "s/const\s*NOMAPPLICATION\s*=\s*'[^']*';/const NOMAPPLICATION = 'Sondage';/" \
-i "${DOCK_LIB}/volumes/framadate_dateConfig/_data/config.php"
fi

15
dockers/framadate/patch/adminstuds.php.patch

@ -0,0 +1,15 @@
--- adminstuds.php 2022-02-05 09:09:45.256310389 +0100
+++ adminstuds.php-new 2022-02-05 08:49:40.952269857 +0100
@@ -84,6 +84,12 @@
$message = new Message('success', __('adminstuds', 'The poll is created.'));
}
+$messageBadEmail = $sessionService->get("Framadate", "messageBadEmail", FALSE);
+if ($messageBadEmail) {
+ $sessionService->remove("Framadate", "messageBadEmail");
+ $message = new Message('danger', __('adminstuds', "Bad e-mail. Can't send links"));
+}
+
// -------------------------------
// Update poll info
// -------------------------------

17
dockers/framadate/patch/create_classic_poll.php.patch

@ -0,0 +1,17 @@
--- create_classic_poll.php 2022-02-05 09:09:45.256310389 +0100
+++ create_classic_poll.php-new 2022-02-05 09:03:08.924297050 +0100
@@ -83,8 +83,12 @@
$message_admin .= sprintf(' :<br/><br/><a href="%1$s">%1$s</a>', Utils::getUrlSondage($admin_poll_id, true));
if ($mailService->isValidEmail($form->admin_mail)) {
- $mailService->send($form->admin_mail, '[' . NOMAPPLICATION . '][' . __('Mail', 'Author\'s message') . '] ' . __('Generic', 'Poll') . ': ' . Utils::htmlEscape($form->title), $message_admin);
- $mailService->send($form->admin_mail, '[' . NOMAPPLICATION . '][' . __('Mail', 'For sending to the polled users') . '] ' . __('Generic', 'Poll') . ': ' . Utils::htmlEscape($form->title), $message);
+ try {
+ $mailService->send($form->admin_mail, '[' . NOMAPPLICATION . '][' . __('Mail', 'Author\'s message') . '] ' . __('Generic', 'Poll') . ': ' . Utils::htmlEscape($form->title), $message_admin);
+ $mailService->send($form->admin_mail, '[' . NOMAPPLICATION . '][' . __('Mail', 'For sending to the polled users') . '] ' . __('Generic', 'Poll') . ': ' . Utils::htmlEscape($form->title), $message);
+ } catch (Exception $e) {
+ $sessionService->set("Framadate", "messageBadEmail", TRUE);
+ }
}
}

17
dockers/framadate/patch/create_date_poll.php.patch

@ -0,0 +1,17 @@
--- create_date_poll.php 2022-02-05 09:09:45.256310389 +0100
+++ create_date_poll.php-new 2022-02-05 08:47:40.708265810 +0100
@@ -210,8 +210,12 @@
$message_admin = sprintf($message_admin, Utils::getUrlSondage($admin_poll_id, true));
if ($mailService->isValidEmail($form->admin_mail)) {
- $mailService->send($form->admin_mail, '[' . NOMAPPLICATION . '][' . __('Mail', 'Author\'s message') . '] ' . __('Generic', 'Poll') . ': ' . Utils::htmlEscape($form->title), $message_admin);
- $mailService->send($form->admin_mail, '[' . NOMAPPLICATION . '][' . __('Mail', 'For sending to the polled users') . '] ' . __('Generic', 'Poll') . ': ' . Utils::htmlEscape($form->title), $message);
+ try {
+ $mailService->send($form->admin_mail, '[' . NOMAPPLICATION . '][' . __('Mail', 'Author\'s message') . '] ' . __('Generic', 'Poll') . ': ' . Utils::htmlEscape($form->title), $message_admin);
+ $mailService->send($form->admin_mail, '[' . NOMAPPLICATION . '][' . __('Mail', 'For sending to the polled users') . '] ' . __('Generic', 'Poll') . ': ' . Utils::htmlEscape($form->title), $message);
+ } catch (Exception $e) {
+ $sessionService->set("Framadate", "messageBadEmail", TRUE);
+ }
}
}

10
dockers/framadate/patch/en.json.patch

@ -0,0 +1,10 @@
--- locale/en.json 2022-02-05 09:09:45.256310389 +0100
+++ locale/en.json-new 2022-02-05 08:52:37.688275805 +0100
@@ -439,6 +439,7 @@
"Remove the comments": "Remove the comments",
"Remove the votes": "Remove the votes",
"The poll is created.": "The poll was created.",
+ "Bad e-mail. Can't send links": "Bad e-mail. Can't send links",
"Vote added": "Vote added",
"Vote deleted": "Vote deleted",
"Vote updated": "Vote updated",

17
dockers/framadate/patch/find_polls.php.patch

@ -0,0 +1,17 @@
--- find_polls.php 2022-02-05 09:09:45.256310389 +0100
+++ find_polls.php-new 2022-02-05 09:07:28.072305772 +0100
@@ -43,8 +43,12 @@
$smarty->assign('polls', $polls);
$body = $smarty->fetch('mail/find_polls.tpl');
- $mailService->send($mail, __('FindPolls', 'List of your polls') . ' - ' . NOMAPPLICATION, $body, 'SEND_POLLS');
- $message = new Message('success', __('FindPolls', 'Polls sent'));
+ try {
+ $mailService->send($mail, __('FindPolls', 'List of your polls') . ' - ' . NOMAPPLICATION, $body, 'SEND_POLLS');
+ $message = new Message('success', __('FindPolls', 'Polls sent'));
+ } catch (Exception $e) {
+ $message = new Message('warning', __('Error', 'No polls found'));
+ }
} else {
$message = new Message('warning', __('Error', 'No polls found'));
}

10
dockers/framadate/patch/fr.json.patch

@ -0,0 +1,10 @@
--- locale/fr.json 2022-02-05 09:09:45.256310389 +0100
+++ locale/fr.json-new 2022-02-05 08:57:14.468285120 +0100
@@ -435,6 +435,7 @@
"Remove the comments": "Supprimer les commentaires",
"Remove the votes": "Supprimer les votes",
"The poll is created.": "Le sondage a été créé.",
+ "Bad e-mail. Can't send links": "Mauvais mèl. Les liens n'ont pu être envoyés.",
"Vote added": "Vote ajouté",
"Vote deleted": "Vote supprimé",
"Vote updated": "Vote mis à jour",
Loading…
Cancel
Save