Browse Source

rev.10 Add new option

Option to configure the maximum number of recipients for one email (possibly for subscriptions).
Visman 4 years ago
parent
commit
9c9558328c

+ 1 - 0
app/Models/Pages/Admin/Install.php

@@ -1107,6 +1107,7 @@ class Install extends Admin
             'o_webmaster_email'       => $v->email,
             'o_forum_subscriptions'   => 1,
             'o_topic_subscriptions'   => 1,
+            'i_email_max_recipients'  => 1,
             'o_smtp_host'             => NULL,
             'o_smtp_user'             => NULL,
             'o_smtp_pass'             => NULL,

+ 9 - 0
app/Models/Pages/Admin/Options.php

@@ -73,6 +73,7 @@ class Options extends Admin
                     'o_webmaster_email'       => 'required|string:trim|email',
                     'o_forum_subscriptions'   => 'required|integer|in:0,1',
                     'o_topic_subscriptions'   => 'required|integer|in:0,1',
+                    'i_email_max_recipients'  => 'required|integer|min:1|max:99999',
                     'o_smtp_host'             => 'string:trim|max:255',
                     'o_smtp_user'             => 'string:trim|max:255',
                     'o_smtp_pass'             => 'string:trim|max:255', //??????
@@ -597,6 +598,14 @@ class Options extends Admin
                     'caption' => __('Topic subscriptions label'),
                     'info'    => __('Topic subscriptions help'),
                 ],
+                'i_email_max_recipients' => [
+                    'type'    => 'number',
+                    'min'     => 1,
+                    'max'     => 99999,
+                    'value'   => $config->i_email_max_recipients,
+                    'caption' => __('Email max recipients label'),
+                    'info'    => __('Email max recipients help'),
+                ],
                 'o_smtp_host' => [
                     'type'      => 'text',
                     'maxlength' => 255,

+ 13 - 1
app/Models/Pages/Admin/Update.php

@@ -17,7 +17,7 @@ class Update extends Admin
 {
     const PHP_MIN = '7.3.0';
 
-    const LATEST_REV_WITH_DB_CHANGES = 8;
+    const LATEST_REV_WITH_DB_CHANGES = 9;
 
     const LOCK_NAME = 'lock_update';
     const LOCk_TTL  = 1800;
@@ -588,4 +588,16 @@ class Update extends Admin
 
         return null;
     }
+
+    /**
+     * rev.9 to rev.10
+     */
+    protected function stageNumber9(array $args): ?int
+    {
+        $this->c->config->i_email_max_recipients = 1;
+
+        $this->c->config->save();
+
+        return null;
+    }
 }

+ 1 - 1
app/bootstrap.php

@@ -42,7 +42,7 @@ if (
 }
 $c->PUBLIC_URL = $c->BASE_URL . $forkPublicPrefix;
 
-$c->FORK_REVISION = 9;
+$c->FORK_REVISION = 10;
 $c->START         = $forkStart;
 $c->DIR_APP       = __DIR__;
 $c->DIR_PUBLIC    = $forkPublic;

+ 6 - 0
app/lang/en/admin_options.po

@@ -404,3 +404,9 @@ msgstr "Announcement message (HTML)"
 
 msgid "Announcement message help"
 msgstr ""
+
+msgid "Email max recipients label"
+msgstr "Max recipients"
+
+msgid "Email max recipients help"
+msgstr "The maximum number of recipients for one email. Depends on your mail server."

+ 6 - 0
app/lang/ru/admin_options.po

@@ -404,3 +404,9 @@ msgstr "Текст объявления (HTML)"
 
 msgid "Announcement message help"
 msgstr ""
+
+msgid "Email max recipients label"
+msgstr "Макс. получателей"
+
+msgid "Email max recipients help"
+msgstr "Максимальное количество получателей в одном письме. Зависит от вашего почтового сервера."