]> git.agnieray.net Git - galette.git/commitdiff
Add option to disable social networks on members
authorGuillaume AGNIERAY <dev@agnieray.net>
Fri, 8 Mar 2024 11:49:42 +0000 (12:49 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Sat, 9 Mar 2024 08:07:56 +0000 (09:07 +0100)
fixes #1802

galette/lib/Galette/Core/Preferences.php
galette/templates/default/components/form.html.twig
galette/templates/default/elements/edit_socials.html.twig
galette/templates/default/pages/member_show.html.twig

index a9d0a7504ec008cffa333b26df33b2ceeef25ff9..71a8437cfa7b84199a2c968addbf3ebec0a9e2d2 100644 (file)
@@ -50,6 +50,7 @@ use Galette\Repository\Members;
  * @property string $pref_pays Country
  * @property integer $pref_postal_adress Postal adress to use, one of self::POSTAL_ADDRESS*
  * @property integer $pref_postal_staff_member Staff member ID from which retrieve postal address
+ * @property boolean $pref_disable_members_socials
  * @property string $pref_lang Default instance language
  * @property integer $pref_numrows Default number of rows in lists
  * @property integer $pref_log History, one of self::LOG_*
@@ -194,6 +195,7 @@ class Preferences
         'pref_pays'        =>    '',
         'pref_postal_adress'  => self::POSTAL_ADDRESS_FROM_PREFS,
         'pref_postal_staff_member' => '',
+        'pref_disable_members_socials' => false,
         'pref_lang'        =>    I18n::DEFAULT_LANG,
         'pref_numrows'        =>    30,
         'pref_log'        =>    self::LOG_ENABLED,
index 132112dd4b434e8f01043ec7f84f3f7b68a8689f..f551917a00a5edac9ae0e9dd55c7f6ae73f1c9db 100644 (file)
             </div>
 
                 {# Social networks attached to the contact information fieldset #}
-                {% if fieldset.id == 3 and not (masschange ?? false) %}
+                {% if fieldset.id == 3 and not (masschange ?? false) and preferences.pref_disable_members_socials != 1 %}
                     {% include "elements/edit_socials.html.twig" with {socials: member.socials} %}
                 {% endif %}
             {% endfor %}
index 10b7318a83a247bf8568dadb4d552b58a034d065..3f7194526bb8e2bf2d2495f43429de172c9913f3 100644 (file)
@@ -20,6 +20,8 @@
 #}
 {% if tabbed ?? false == true %}
 <div id="social" class="ui{{ tab == 'social' ? ' active' }} tab segment" data-tab="social">
+    <div class="ui stackable two column grid">
+        <div class="ten wide column">
     {% block social_edit %}
         {% for social in socials %}
             <div class="inline field stored">
                 </a>
             </div>
     {% endblock %}
+        </div>
+        <div class="six wide column">
+            <div class="field inline">
+                <div class="ui right aligned toggle checkbox">
+                    <input type="checkbox" name="pref_disable_members_socials" id="pref_disable_members_socials" value="1" {% if preferences.pref_disable_members_socials %} checked="checked"{% endif %}/>
+                    <label for="pref_disable_members_socials">{{ _T("Disable social networks on member form") }}</label>
+                </div>
+            </div>
+        </div>
+    </div>
 </div>
 {% else %}
     <div id="social" class="ui styled fluid accordion field">
index 1fb8b6f8c456800c0a84960ca28c6b15a80fd7a5..08ff5ad1d79cb573bdf9a32e543ea1781fda58d4 100644 (file)
                 </div>
             </div>
     {# Social networks attached to the contact information fieldset #}
-    {% if display_element.id == '3'  %}
+    {% if display_element.id == '3' and preferences.pref_disable_members_socials != 1 %}
             {% include "elements/display_socials.html.twig" with {socials: member.socials} %}
     {% endif %}
 {% endfor %}