[TikiWiki-commits] [Git][tikiwiki/tiki][master] [ENH] Add Timezone Synchronization to User preferences page

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69a5be8e6422_3b187ae06828d@gitlab-sidekiq-low-urgency-cpu-bound-v2-768fff574d-h2r9m.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
f070f143 by Alain Cisirika at 2026-03-02T16:37:09+00:00
[ENH] Add Timezone Synchronization to User preferences page
---
* [ENH] Add TImezone Synchronization to User preferences page

See merge request tikiwiki/tiki!8529

- - - - -


3 changed files:

- lib/prefs/user.php
- templates/tiki-user_preferences.tpl
- tiki-user_preferences.php


Changes:

=====================================
lib/prefs/user.php
=====================================
@@ -371,7 +371,7 @@ function prefs_user_list($partial = false)
             'description' => tr('Allow user to manage timezone incoherence.'),
             'help' => 'User-Preferences',
             'type' => 'flag',
-            'default' => 'y',
+            'default' => 'n',
             'tags' => ['basic'],
         ],
         'user_default_avatar_style' => [


=====================================
templates/tiki-user_preferences.tpl
=====================================
@@ -439,6 +439,22 @@
                         </div>
                     </div>
 
+                    <div class="tiki-form-group row">
+                        <label class="col-form-label col-md-4" for="user_localtimezonesync">
+                            {tr}Show a synchronization pop-up when I move to a different timezone.{/tr}
+                        </label>
+                        <div class="col-md-8">
+                            <select id="user_localtimezonesync" name="user_localtimezonesync" class="form-control" >
+                                <option value="n" {if $prefs.user_localtimezonesync eq "n"}selected="selected"{/if}>
+                                    {tr}no{/tr}
+                                </option>
+                                <option value="y" {if $prefs.user_localtimezonesync eq "y"}selected="selected"{/if}>
+                                    {tr}yes{/tr}
+                                </option>
+                            </select>
+                        </div>
+                    </div>
+
                     <div class="form-check">
                         <input class="form-check-input" type="checkbox" name="display_12hr_clock" id="display_12hr_clock" {if $user_prefs.display_12hr_clock eq 'y'}checked="checked"{/if}>
                         <label class="form-check-label" for="display_12hr_clock">


=====================================
tiki-user_preferences.php
=====================================
@@ -274,7 +274,13 @@ if ($prefs['feature_userPreferences'] == 'y' && isset($_POST["new_prefs"]) && $a
     if (isset($_POST['display_timezone'])) {
         $tikilib->set_user_preference($userwatch, 'display_timezone', $_POST['display_timezone']);
     }
-
+    if (array_key_exists('user_localtimezonesync', $_POST)) {
+        $tikilib->set_user_preference(
+            $userwatch,
+            'user_localtimezonesync',
+            $_POST['user_localtimezonesync'] === 'y' ? 'y' : 'n'
+        );
+    }
     if (isset($_POST['display_12hr_clock']) && $_POST['display_12hr_clock'] == 'on') {
         $tikilib->set_user_preference($userwatch, 'display_12hr_clock', 'y');
         $smarty->assign('display_12hr_clock', 'y');



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f070f14319485b6f9034c13e6ed61f84ddc8bf01

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f070f14319485b6f9034c13e6ed61f84ddc8bf01
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.