]> git.agnieray.net Git - galette.git/commitdiff
Add a preference to send emails to member by default
authorJohan Cwiklinski <johan@x-tnd.be>
Mon, 27 Sep 2021 16:59:32 +0000 (18:59 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Mon, 27 Sep 2021 16:59:32 +0000 (18:59 +0200)
closes #1481 and closes #1536

galette/lib/Galette/Core/Preferences.php
galette/templates/default/ajouter_contribution.tpl
galette/templates/default/member.tpl
galette/templates/default/preferences.tpl

index 6d707f738879458b0ba93e996b2b909338030935..6b1feb908d05440472096c8f0a1a518623c5fe18 100644 (file)
@@ -7,7 +7,7 @@
  *
  * PHP version 5
  *
- * Copyright © 2007-2014 The Galette Team
+ * Copyright © 2007-2021 The Galette Team
  *
  * This file is part of Galette (http://galette.tuxfamily.org).
  *
@@ -27,7 +27,7 @@
  * @category  Core
  * @package   Galette
  * @author    Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2007-2014 The Galette Team
+ * @copyright 2007-2021 The Galette Team
  * @license   http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
  * @link      http://galette.tuxfamily.org
  * @since     Available since 0.7dev - 2007-10-14
@@ -50,7 +50,7 @@ use Galette\Repository\Members;
  * @name      Preferences
  * @package   Galette
  * @author    Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2007-2014 The Galette Team
+ * @copyright 2007-2021 The Galette Team
  * @license   http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
  * @link      http://galette.tuxfamily.org
  * @since     Available since 0.7dev - 2007-10-14
@@ -74,6 +74,7 @@ use Galette\Repository\Members;
  * @property string $pref_email
  * @property string $pref_email_newadh
  * @property boolean $pref_bool_mailadh
+ * @property boolean $pref_bool_mailowner
  * @property boolean $pref_editor_enabled
  * @property integer $pref_mail_method Mail method, see GaletteMail::METHOD_*
  * @property string $pref_mail_smtp
@@ -202,6 +203,7 @@ class Preferences
         'pref_email'        =>    'mail@domain.com',
         'pref_email_newadh'    =>    'mail@domain.com',
         'pref_bool_mailadh'    =>    false,
+        'pref_bool_mailowner' => false,
         'pref_editor_enabled'    =>    false,
         'pref_mail_method'    =>    GaletteMail::METHOD_DISABLED,
         'pref_mail_smtp'    =>    '',
index e009d4f0157d6d5202e8fee55eb22536cc3aa99b..b7e2b84b1098b1b7ea5049a6f6303974d8f07b37 100644 (file)
     {if not $contribution->id and $pref_mail_method neq constant('Galette\Core\GaletteMail::METHOD_DISABLED')}
             <p>
                 <label for="mail_confirm">{_T string="Notify member"}</label>
-                <input type="checkbox" name="mail_confirm" id="mail_confirm" value="1" {if isset($smarty.post.mail_confirm) and $smarty.post.mail_confirm != ""}checked="checked"{/if}/>
+                <input type="checkbox" name="mail_confirm" id="mail_confirm" value="1" {if $preferences->pref_bool_mailowner || isset($smarty.post.mail_confirm) and $smarty.post.mail_confirm != ""}checked="checked"{/if}/>
                 <br/><span class="exemple">{_T string="Member will receive a notification by email, if he has an address."}</span>
             </p>
     {/if}
index e4abcbf34fa8d67259e101e224eaffd0f10d4a68..862287d647bc49f1ab021f5a5758834aa9b14be7 100644 (file)
@@ -77,7 +77,7 @@
                             {_T string="Notify member his account has been created"}
         {/if}
                         </label>
-                        <input type="checkbox" name="mail_confirm" id="mail_confirm" value="1" {if isset($smarty.post.mail_confirm) and $smarty.post.mail_confirm != ""}checked="checked"{/if}/>
+                        <input type="checkbox" name="mail_confirm" id="mail_confirm" value="1" {if $preferences->pref_bool_mailowner || isset($smarty.post.mail_confirm) and $smarty.post.mail_confirm != ""}checked="checked"{/if}/>
                         <br/><span class="exemple">
         {if $member->id}
                             {_T string="Member will be notified by email his account has been modified."}
index a7034f5d98a701391a87b4a332905cee119d464f..782cffabd440cd761c107b95e459186ca5a59b02 100644 (file)
                     <span class="tip">{_T string="Sends an email each time a new member registers online or edit his/her account"}</span>
                     <input type="checkbox" name="pref_bool_mailadh" id="pref_bool_mailadh" value="1" {if $pref.pref_bool_mailadh eq 1}checked="checked"{/if}{if isset($required.pref_bool_mailadh) and $required.pref_bool_mailadh eq 1} required="required"{/if}/>
                 </p>
+                <p>
+                    <label for="pref_bool_mailowner" class="bline tooltip">{_T string="Send email to members?"}</label>
+                    <span class="tip">{_T string="Sends an email each time a member card or a contribution has been added or edited. This can be disabled for each case."}</span>
+                    <input type="checkbox" name="pref_bool_mailowner" id="pref_bool_mailowner" value="1" {if $pref.pref_bool_mailowner eq 1}checked="checked"{/if}{if isset($required.pref_bool_mailowner) and $required.pref_bool_mailowner eq 1} required="required"{/if}/>
+                </p>
                 <p>
                     <label for="pref_bool_wrap_mails" class="bline tooltip">{_T string="Wrap emails text?"}</label>
                     <span class="tip">{_T string="Automatically wrap emails texts before sending. Make sure to wrap yourself if you disable that. Please note that current editing mailing will not be affected by a change."}</span>