[TikiWiki-commits] [Git][tikiwiki/tiki][30.x] [BP][ENH] Calendar: add send reminder notifications option
"Adrien Mbuya Maloba \(@adrienmaloba\) via TikiWiki-cvs" <[email protected]> Tue, 07 Jul 2026 22:19:28 +0000
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a4d7b708d8c6_3719b4a0576c5@gitlab-sidekiq-low-urgency-cpu-bound-v2-bd857b597-ff8kp.mail> |
Adrien Mbuya Maloba pushed to branch 30.x at Tiki Wiki CMS Groupware / Tiki
Commits:
aa2fcdff by Adrien Mbuya Maloba at 2026-07-08T01:12:46+03:00
[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
- - - - -
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
=====================================
@@ -693,7 +693,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`";
@@ -902,7 +902,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
=====================================
@@ -27,6 +27,7 @@ class CalRecurrence extends TikiLib
private $lang;
private $name;
private $description;
+ private $sendReminder;
private $daily;
private $days;
private $weekly;
@@ -77,7 +78,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 = ?";
@@ -98,6 +99,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);
@@ -142,6 +144,7 @@ class CalRecurrence extends TikiLib
$this->setLang('');
$this->setName('');
$this->setDescription('');
+ $this->setSendReminder(1);
$this->setDaily(0);
$this->setDays(1);
$this->setWeekly(0);
@@ -207,6 +210,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']);
}
@@ -375,10 +381,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(),
@@ -395,6 +401,7 @@ class CalRecurrence extends TikiLib
$this->getLang(),
$this->getName(),
$this->getDescription(),
+ $this->getSendReminder(),
$this->isDaily() ? 1 : 0,
$this->getDays(),
$this->isWeekly() ? 1 : 0,
@@ -442,7 +449,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 = [
@@ -460,6 +467,7 @@ class CalRecurrence extends TikiLib
$this->getLang(),
$this->getName(),
$this->getDescription(),
+ $this->getSendReminder(),
$this->isDaily() ? 1 : 0,
$this->getDays(),
$this->isWeekly() ? 1 : 0,
@@ -529,6 +537,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(),
@@ -577,7 +586,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()];
@@ -641,6 +650,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(),
@@ -707,7 +717,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()];
@@ -765,6 +775,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";
}
@@ -997,6 +1010,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()];
@@ -1346,6 +1364,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
=====================================
@@ -279,6 +279,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);
@@ -886,6 +889,7 @@ class Services_Calendar_Controller extends Services_Calendar_BaseController
}
$client = new \Tiki\SabreDav\CaldavClient();
+
$client->saveCalendarObject($calitem);
if (! empty($calitem['calitemId'])) {
$calitemId = $calitem['calitemId'];
@@ -901,7 +905,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(),
@@ -980,6 +984,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
=====================================
@@ -351,6 +351,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) {
@@ -625,6 +628,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,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/aa2fcdff44ac4e3833e034c6fea90dc99b28b6b0
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/aa2fcdff44ac4e3833e034c6fea90dc99b28b6b0
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