[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][ENH] Calendar: add send reminder notifications option

"Adrien Mbuya Maloba \(@adrienmaloba\) via TikiWiki-cvs" <[email protected]> Tue, 07 Jul 2026 23:00:35 +0000
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a4d85133c7c5_389a345486815@gitlab-sidekiq-low-urgency-cpu-bound-v2-bd857b597-j6djq.mail>

Adrien Mbuya Maloba pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
51512f9b by Adrien Mbuya Maloba at 2026-07-08T01:53:42+03:00
[BP][ENH] Calendar: add send reminder notifications option
---
* [BP][ENH] Calendar: add send reminder notifications option
---
* [ENH] Calendar: add send reminder notifications option for recurring events
---
* [ENH] Calendar: add send reminder notifications option for recurring events

See merge request tikiwiki/tiki!10651

* [ENH] Calendar: add send reminder notifications option
---
* [ENH] Calendar: add send reminder notifications option

See merge request tikiwiki/tiki!10593

See merge request tikiwiki/tiki!10667

See merge request tikiwiki/tiki!10668

- - - - -


9 changed files:

- db/tiki.sql
- + installer/schema/20260626_calendar_items_add_reminder_tiki.sql
- + installer/schema/20260703_calendar_recurrence_add_reminder_tiki.sql
- lib/calendar/calendarlib.php
- lib/calendar/calrecurrence.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
=====================================
@@ -413,6 +413,7 @@ CREATE TABLE `tiki_calendar_recurrence` (
   `lang` char(16) NOT NULL default 'en',
   `name` varchar(255) NOT NULL default '',
   `description` blob,
+  `sendReminder` tinyint NOT NULL default '1',
   `daily` tinyint(1) default 0,
   `days` int default NULL,
   `weekly` tinyint(1) default '0',
@@ -459,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`;


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


=====================================
lib/calendar/calendarlib.php
=====================================
@@ -672,7 +672,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`";
 
@@ -881,7 +881,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/calendar/calrecurrence.php
=====================================
@@ -24,6 +24,7 @@ class CalRecurrence extends TikiLib
     private $lang;
     private $name;
     private $description;
+    private $sendReminder;
     private $daily;
     private $days;
     private $weekly;
@@ -74,7 +75,7 @@ class CalRecurrence extends TikiLib
     {
         $dataExists = false;
         if ($this->getId() > 0) {
-            $query = "SELECT calendarId, start, end, duration, allday, locationId, categoryId, nlId, priority, status, url, lang, name, description, daily, days,"
+            $query = "SELECT calendarId, start, end, duration, allday, locationId, categoryId, nlId, priority, status, url, lang, name, description, sendReminder, daily, days,"
                      . "weekly, weeks, weekdays, monthly, months, dayOfMonth, monthlyType, monthlyWeekdayValue, monthlyFirstlastWeekdayValue, yearly, years, yearlyType, dateOfYear,"
                      . "yearlyWeekdayValue, yearlyFirstlastWeekdayValue, yearlyWeekMonth, nbRecurrences, startPeriod, endPeriod, user, created, lastModif, uri, uid, recurrenceDstTimezone "
                      . "FROM tiki_calendar_recurrence WHERE recurrenceId = ?";
@@ -95,6 +96,7 @@ class CalRecurrence extends TikiLib
                 $this->setLang($row['lang']);
                 $this->setName($row['name']);
                 $this->setDescription($row['description']);
+                $this->setSendReminder(empty($row['sendReminder']) ? 0 : 1);
                 $this->setDaily($row['daily'] == 1);
                 $this->setDays($row['days']);
                 $this->setWeekly($row['weekly'] == 1);
@@ -139,6 +141,7 @@ class CalRecurrence extends TikiLib
             $this->setLang('');
             $this->setName('');
             $this->setDescription('');
+            $this->setSendReminder(1);
             $this->setDaily(0);
             $this->setDays(1);
             $this->setWeekly(0);
@@ -204,6 +207,9 @@ class CalRecurrence extends TikiLib
         if (isset($data['description'])) {
             $this->setDescription($data['description']);
         }
+        if (isset($data['sendReminder'])) {
+            $this->setSendReminder($data['sendReminder']);
+        }
         if (isset($data['user'])) {
             $this->setUser($data['user']);
         }
@@ -372,10 +378,10 @@ class CalRecurrence extends TikiLib
      */
     private function create()
     {
-        $query = "INSERT INTO tiki_calendar_recurrence (calendarId, start, end, duration, allday, locationId, categoryId, nlId, priority, status, url, lang, name, description, "
+        $query = "INSERT INTO tiki_calendar_recurrence (calendarId, start, end, duration, allday, locationId, categoryId, nlId, priority, status, url, lang, name, description, sendReminder, "
                  . "daily, days, weekly, weeks, weekdays, monthly, months, dayOfMonth, monthlyType, monthlyWeekdayValue, monthlyFirstlastWeekdayValue, yearly, years, yearlyType, dateOfYear, "
                  . "yearlyWeekdayValue, yearlyFirstlastWeekdayValue, yearlyWeekMonth, nbRecurrences, startPeriod, endPeriod, user, created, lastModif, uri, uid, recurrenceDstTimezone) "
-                 . "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
+                 . "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
         $now = $this->now;
         $bindvars = [
                         $this->getCalendarId(),
@@ -392,6 +398,7 @@ class CalRecurrence extends TikiLib
                         $this->getLang(),
                         $this->getName(),
                         $this->getDescription(),
+                        $this->getSendReminder(),
                         $this->isDaily() ? 1 : 0,
                         $this->getDays(),
                         $this->isWeekly() ? 1 : 0,
@@ -439,7 +446,7 @@ class CalRecurrence extends TikiLib
     private function update($updateManuallyChangedEvents = false)
     {
         $query = "UPDATE tiki_calendar_recurrence SET calendarId = ?, start = ?, end = ?, duration = ?, allday = ?, locationId = ?, categoryId = ?, nlId = ?, priority = ?, status = ?, "
-                 . "url = ?, lang = ?, name = ?, description = ?, daily = ?, days = ?, weekly = ?, weeks = ?, weekdays = ?, monthly = ?, months = ?, dayOfMonth = ?, monthlyType = ?, monthlyWeekdayValue = ?, monthlyFirstlastWeekdayValue = ?, yearly = ?, years = ?, yearlyType = ?, dateOfYear = ?, yearlyWeekdayValue = ?, yearlyFirstlastWeekdayValue = ?, yearlyWeekMonth = ?, nbRecurrences = ?, "
+                 . "url = ?, lang = ?, name = ?, description = ?, sendReminder = ?, daily = ?, days = ?, weekly = ?, weeks = ?, weekdays = ?, monthly = ?, months = ?, dayOfMonth = ?, monthlyType = ?, monthlyWeekdayValue = ?, monthlyFirstlastWeekdayValue = ?, yearly = ?, years = ?, yearlyType = ?, dateOfYear = ?, yearlyWeekdayValue = ?, yearlyFirstlastWeekdayValue = ?, yearlyWeekMonth = ?, nbRecurrences = ?, "
                  . "startPeriod = ?, endPeriod = ?, user = ?, lastModif = ?, uri = ?, uid = ?, recurrenceDstTimezone = ? WHERE recurrenceId = ?";
         $now = time();
         $bindvars = [
@@ -457,6 +464,7 @@ class CalRecurrence extends TikiLib
                         $this->getLang(),
                         $this->getName(),
                         $this->getDescription(),
+                        $this->getSendReminder(),
                         $this->isDaily() ? 1 : 0,
                         $this->getDays(),
                         $this->isWeekly() ? 1 : 0,
@@ -526,6 +534,7 @@ class CalRecurrence extends TikiLib
                 'lang'         => $this->getLang(),
                 'name'         => $this->getName(),
                 'description'  => $this->getDescription(),
+                'sendReminder'  => $this->getsendReminder(),
                 'user'         => $this->getUser(),
                 'created'      => $this->getCreated(),
                 'lastmodif'    => $this->getCreated(),
@@ -574,7 +583,7 @@ class CalRecurrence extends TikiLib
 
 
 
-        $query = "SELECT calitemId,calendarId, start, end, allday, locationId, categoryId, nlId, priority, status, url, lang, name, description, "
+        $query = "SELECT calitemId,calendarId, start, end, allday, locationId, categoryId, nlId, priority, status, url, lang, name, description, sendReminder, "
                  . "user, created, lastModif, changed, recurrenceStart "
                  . "FROM tiki_calendar_items WHERE recurrenceId = ? ORDER BY start";
         $bindvars = [(int)$this->getId()];
@@ -638,6 +647,7 @@ class CalRecurrence extends TikiLib
                     'lang'         => $this->getLang(),
                     'name'         => $this->getName(),
                     'description'  => $this->getDescription(),
+                    'sendReminder'  => $this->getSendReminder(),
                     'user'         => $this->getUser(),
                     'created'      => $this->getCreated(),
                     'lastmodif'    => $this->getCreated(),
@@ -704,7 +714,7 @@ class CalRecurrence extends TikiLib
      */
     public function getOverrides($changed = null)
     {
-        $query = "SELECT calitemId,calendarId, start, end, allday, locationId, categoryId, nlId, priority, status, url, lang, name, description, "
+        $query = "SELECT calitemId,calendarId, start, end, allday, locationId, categoryId, nlId, priority, status, url, lang, name, description, sendReminder, "
                  . "user, created, lastModif, changed, recurrenceStart "
                  . "FROM tiki_calendar_items WHERE recurrenceId = ?";
         $bindvars = [(int)$this->getId()];
@@ -762,6 +772,9 @@ class CalRecurrence extends TikiLib
         if ($this->getDescription() != $oldRec->getDescription()) {
             $result[] = "description";
         }
+        if ($this->getSendReminder() != $oldRec->getSendReminder()) {
+            $result[] = "sendReminder";
+        }
         if ($this->isDaily() && ($this->getDays() != $oldRec->getDays())) {
             $result[] = "_days";
         }
@@ -994,6 +1007,11 @@ class CalRecurrence extends TikiLib
         if (! empty($this->getDescription())) {
             $data['DESCRIPTION'] = $this->getDescription();
         }
+        if (! empty($this->getSendReminder())) {
+            $data['X-Tiki-sendReminder'] = $this->getSendReminder();
+        } else {
+            $data['X-Tiki-sendReminder'] = 0;
+        }
         $locations = TikiLib::lib('calendar')->list_locations($this->getCalendarId());
         if (! empty($locations[$this->getLocationId()])) {
             $data['LOCATION'] = $locations[$this->getLocationId()];
@@ -1343,6 +1361,19 @@ class CalRecurrence extends TikiLib
         $this->description = $value;
     }
 
+    public function getSendReminder()
+    {
+        return $this->sendReminder;
+    }
+
+    /**
+     * @param $value
+     */
+    public function setSendReminder($value)
+    {
+        $this->sendReminder = $value;
+    }
+
     public function isDaily()
     {
         return $this->daily;


=====================================
lib/core/Search/ContentSource/CalendarItemSource.php
=====================================
@@ -84,6 +84,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),
 
@@ -120,6 +121,7 @@ class Search_ContentSource_CalendarItemSource implements Search_ContentSource_In
             'participants',
             'participant_emails',
             'alert_emails',
+            'send_reminder',
             'description',
 
             'calendar_id',
@@ -151,6 +153,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
=====================================
@@ -274,6 +274,9 @@ class Services_Calendar_Controller extends Services_Calendar_BaseController
                 $calendarId = $calitem['calendarId'];
                 $calitem['calitemId'] = $calitemId;
                 $calitem['allday'] = empty($calitem['allday']) ? 0 : 1;
+                if (isset($calitem['sendReminder'])) {
+                    $calitem['sendReminder'] = (int) ! empty($calitem['sendReminder']);
+                }
                 $calitem['recurrenceId'] = $input->recurrenceId->int();
                 $calendar = $this->calendarLib->get_calendar($calendarId);
                 $calitem = $this->processParticipants($calitem);
@@ -791,6 +794,7 @@ class Services_Calendar_Controller extends Services_Calendar_BaseController
                 }
 
                 $client = new \Tiki\SabreDav\CaldavClient();
+
                 $client->saveCalendarObject($calitem);
                 if (! empty($calitem['calitemId'])) {
                     $calitemId = $calitem['calitemId'];
@@ -806,7 +810,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(),
@@ -885,6 +889,8 @@ class Services_Calendar_Controller extends Services_Calendar_BaseController
         $recurrence->setLang(strLen($calitem['lang']) > 0 ? $calitem['lang'] : 'en');
         $recurrence->setName($calitem['name']);
         $recurrence->setDescription($calitem['description']);
+
+        $recurrence->setSendReminder($calitem['sendReminder']);
         $recurrence->setRecurenceDstTimezone($input->recurrenceDstTimezone->text());
         $recurrence->setUser($calitem['user']);
         $recurrence->setOrganizers($calitem['organizers']);


=====================================
lib/core/Tiki/SabreDav/Utilities.php
=====================================
@@ -350,6 +350,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) {
@@ -624,6 +627,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
=====================================
@@ -321,21 +321,32 @@
                     </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 ! isset($calitem.sendReminder) or $calitem.sendReminder}checked{/if}>
                     </div>
                 </div>
-                {* / .mb-3.row *}
+                {* / .mb-3 *}
+            {else}
+                <input type="hidden" name="calitem[sendReminder]" value="{if $calitem.calitemId}{$calitem.sendReminder}{else}1{/if}">
             {/if}
             {if $calendar.customparticipants eq 'y'}
                 <div class="mb-3 row" id="calorg">



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

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