[TikiWiki-commits] [Git][tikiwiki/tiki][master] [ENH] Calendar: add send reminder notifications option

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]> Thu, 02 Jul 2026 18:05:49 +0000
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a46a87d1be3c_3819a064463bc@gitlab-sidekiq-low-urgency-cpu-bound-v2-5fbd595658-xmjqw.mail>

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
340b18e6 by Adrien Mbuya Maloba at 2026-07-02T17:48:08+00:00
[ENH] Calendar: add send reminder notifications option
---
* [ENH] Calendar: add send reminder notifications option

See merge request tikiwiki/tiki!10593

- - - - -


7 changed files:

- db/tiki.sql
- + installer/schema/20260626_calendar_items_add_reminder_tiki.sql
- lib/calendar/calendarlib.php
- lib/core/Search/ContentSource/CalendarItemSource.php
- lib/core/Services/Calendar/Controller.php
- lib/core/Tiki/SabreDav/Utilities.php
- templates/calendar/edit_item.tpl


Changes:

=====================================
db/tiki.sql
=====================================
@@ -460,6 +460,7 @@ CREATE TABLE `tiki_calendar_items` (
   `lang` char(16) NOT NULL default 'en',
   `name` varchar(255) NOT NULL default '',
   `description` text,
+  `sendReminder` tinyint NOT NULL default '1',
   `recurrenceId` int(14),
   `changed` tinyint(1) DEFAULT '0',
   `recurrenceStart` int(14) default NULL,


=====================================
installer/schema/20260626_calendar_items_add_reminder_tiki.sql
=====================================
@@ -0,0 +1 @@
+ALTER TABLE `tiki_calendar_items` ADD COLUMN `sendReminder` tinyint NOT NULL default '1' AFTER `description`;


=====================================
lib/calendar/calendarlib.php
=====================================
@@ -694,7 +694,7 @@ class CalendarLib extends TikiLib
 
         $query = "select i.`calitemId` as `calitemId`, i.`calendarId` as `calendarId`, i.`user` as `user`, i.`start` as `start`, i.`end` as `end`, t.`name` as `calname`, ";
         $query .= "i.`locationId` as `locationId`, l.`name` as `locationName`, i.`categoryId` as `categoryId`, c.`name` as `categoryName`, c.`backgroundColor` as `categoryBackgroundColor`, i.`priority` as `priority`, i.`nlId` as `nlId`, i.`uid` as `uid`, i.`uri` as `uri`, ";
-        $query .= "i.`status` as `status`, i.`url` as `url`, i.`lang` as `lang`, i.`name` as `name`, i.`description` as `description`, i.`created` as `created`, i.`lastmodif` as `lastModif`, i.`allday` as `allday`, ";
+        $query .= "i.`status` as `status`, i.`url` as `url`, i.`lang` as `lang`, i.`name` as `name`, i.`description` as `description`, i.`sendReminder` as `sendReminder`, i.`created` as `created`, i.`lastmodif` as `lastModif`, i.`allday` as `allday`, ";
         $query .= "t.`customlocations`, t.`customcategories`, t.`customlanguages`, t.`custompriorities`, t.`customsubscription`, t.`customparticipants`, i.`recurrenceId`, i.`recurrenceStart`, r.`uid` as `recurrenceUid`, ";
         $query .= "i.`hideParticipants` as `hideParticipants`";
 
@@ -905,7 +905,7 @@ class CalendarLib extends TikiLib
         }
 
         $realcolumns = ['calitemId', 'calendarId', 'start', 'end', 'locationId', 'categoryId', 'nlId', 'priority', 'uri', 'uid',
-                     'status', 'url', 'lang', 'name', 'description', 'user', 'created', 'lastmodif', 'allday', 'recurrenceId', 'changed', 'recurrenceStart', 'hideParticipants'];
+                     'status', 'url', 'lang', 'name', 'description', 'sendReminder', 'user', 'created', 'lastmodif', 'allday', 'recurrenceId', 'changed', 'recurrenceStart', 'hideParticipants'];
         foreach ($customs as $custom) {
             $realcolumns[] = $custom;
         }


=====================================
lib/core/Search/ContentSource/CalendarItemSource.php
=====================================
@@ -86,6 +86,7 @@ class Search_ContentSource_CalendarItemSource implements Search_ContentSource_In
             // Index just participant emails. The value can be a username and not an email if 'login_is_email' pref is enabled.
             'participant_emails' => $typeFactory->multivalue(array_column($item['participants'], 'email')),
             'alert_emails' => $typeFactory->multivalue($alertEmails),
+            'send_reminder' => $typeFactory->numeric($item['sendReminder']),
             'description' => $typeFactory->plaintext($item['description']),
             'date' => $typeFactory->timestamp($item['start'], $allday),
 
@@ -123,6 +124,7 @@ class Search_ContentSource_CalendarItemSource implements Search_ContentSource_In
             'participants',
             'participant_emails',
             'alert_emails',
+            'send_reminder',
             'description',
 
             'calendar_id',
@@ -154,6 +156,7 @@ class Search_ContentSource_CalendarItemSource implements Search_ContentSource_In
             'participants' => 'nested',
             'participant_emails' => 'multivalue',
             'alert_emails' => 'multivalue',
+            'send_reminder' => 'numeric',
             'description' => 'plaintext',
 
             'calendar_id' => 'identifier',


=====================================
lib/core/Services/Calendar/Controller.php
=====================================
@@ -279,6 +279,7 @@ class Services_Calendar_Controller extends Services_Calendar_BaseController
                 $calendarId = $calitem['calendarId'];
                 $calitem['calitemId'] = $calitemId;
                 $calitem['allday'] = empty($calitem['allday']) ? 0 : 1;
+                $calitem['sendReminder'] = empty($calitem['sendReminder']) ? 0 : 1;
                 $calitem['recurrenceId'] = $input->recurrenceId->int();
                 $calendar = $this->calendarLib->get_calendar($calendarId);
                 $calitem = $this->processParticipants($calitem);
@@ -926,7 +927,7 @@ class Services_Calendar_Controller extends Services_Calendar_BaseController
                         'calendar event'
                     );
                 }
-                if ($prefs['feature_groupalert'] == 'y') {
+                if ($prefs['feature_groupalert'] == 'y' && $calitem['sendReminder']) {
                     if ($input->offsetExists('listtoalert')) {
                         TikiLib::lib('groupalert')->Notify(
                             $input->listtoalert->int(),


=====================================
lib/core/Tiki/SabreDav/Utilities.php
=====================================
@@ -353,6 +353,9 @@ class Utilities
                 $rec->setAllday(empty($convertToString($component->{'X-Tiki-Allday'})) ? 0 : 1);
             }
         }
+        if (isset($component->{'X-Tiki-sendReminder'})) {
+            $result['sendReminder'] = empty($convertToString($component->{'X-Tiki-sendReminder'})) ? 0 : 1;
+        }
         if (isset($component->{'X-Tiki-Language'})) {
             $result['lang'] = $convertToString($component->{'X-Tiki-Language'});
             if ($rec) {
@@ -630,6 +633,11 @@ class Utilities
         if (! empty($row['description'])) {
             $data['DESCRIPTION'] = $row['description'];
         }
+        if (! empty($row['sendReminder'])) {
+            $data['X-Tiki-sendReminder'] = $row['sendReminder'];
+        } else {
+            $data['X-Tiki-sendReminder'] = 0;
+        }
         if (! empty($row['location'])) {
             $data['LOCATION'] = $row['location'];
         }


=====================================
templates/calendar/edit_item.tpl
=====================================
@@ -302,21 +302,30 @@
                     </div>
                 </div> {* / .mb-3.row *}
             {/if}
-            {if !empty($groupforalert) && $showeachuser eq 'y'}
-                <div class="mb-3 row">
-                    <label class="col-form-label col-sm-3" for="listtoalert">{tr}Choose users to alert{/tr}</label>
-                    <div class="col-sm-9">
-                        {section name=idx loop=$listusertoalert}
-                            {if $showeachuser eq 'n'}
-                                <input type="hidden" name="listtoalert[]" value="{$listusertoalert[idx].user}">
-                            {else}
-                                <input type="checkbox" class="form-check-input" id="listtoalert" name="listtoalert[]" value="{$listusertoalert[idx].user}">
-                                {$listusertoalert[idx].user}
-                            {/if}
-                        {/section}
+            {if ! empty($groupforalert)}
+                {if $showeachuser eq 'y'}
+                    <div class="mb-3 row">
+                        <label class="col-form-label col-sm-3" for="listtoalert">{tr}Choose users to alert{/tr}</label>
+                        <div class="col-sm-9">
+                            {section name=idx loop=$listusertoalert}
+                                {if $showeachuser eq 'n'}
+                                    <input type="hidden" name="listtoalert[]" value="{$listusertoalert[idx].user}">
+                                {else}
+                                    <input type="checkbox" class="form-check-input" id="listtoalert" name="listtoalert[]" value="{$listusertoalert[idx].user}">
+                                    {$listusertoalert[idx].user}
+                                {/if}
+                            {/section}
+                        </div>
+                    </div>
+                    {* / .mb-3.row *}
+                {/if}
+                <div class="mb-3 row clearfix">
+                    <label class="col-form-label col-sm-3">{tr}Send reminder notifications{/tr}</label>
+                    <div class="col-sm-2">
+                        <input type="checkbox" class="form-check-input" name="calitem[sendReminder]" id="sendReminder" value="1" {if $calitem.sendReminder} checked="checked"{/if}>
                     </div>
                 </div>
-                {* / .mb-3.row *}
+                {* / .mb-3 *}
             {/if}
             {if $calendar.customparticipants eq 'y'}
                 <div class="mb-3 row" id="calorg">



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/340b18e6fc586553a8ea053d4645e71aa3cf13fe
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