Add Skyetel text messaging with two-way ticket texting, text to ticket for contacts, Text reply on tickets, a Texts inbox for unmatched numbers, verification codes and spam (codes masked, limited to credential access, every reveal audited, wiped after a day), STOP/START/HELP handling, a text log with retry and cancel in Maintenance > Text Messages, the Text Messages cron job, and texts to clients about their tickets, visits, visit reminders and invoices with per-contact opt-in from the contact, by text or in the client portal, quiet hours, and new settings in Tickets and Notifications (database 3.6.0 and 3.6.1)

This commit is contained in:
johnnyq
2026-11-06 00:08:10 -05:00
parent 87cdf79b28
commit b391e2ce6c
45 changed files with 4165 additions and 31 deletions

View File

@@ -2,8 +2,8 @@
/*
* Admin > Settings > Notifications (admin/settings_notification.php):
* edit_notification_settings saves the domain alert and the emails clients
* get by themselves. Reminders aren't set here (they moved to Invoices and
* edit_notification_settings saves the domain alert, and the emails and texts
* clients get by themselves. Reminders aren't set here (they moved to Invoices and
* billing with their schedule), nor cron (Maintenance > Cron). A switch for a
* module that is off isn't on the page, so is kept as it is.
*/
@@ -14,7 +14,8 @@ if (isset($_POST['edit_notification_settings'])) {
validateCSRFToken();
$before = settingsCurrent(['config_enable_alert_domain_expire', 'config_ticket_client_general_notifications', 'config_recurring_auto_send_invoice']);
$sms_columns = smsColumnExists('settings', 'config_sms_client_tickets') ? ['config_sms_client_tickets', 'config_sms_client_visits', 'config_sms_visit_reminder_hours', 'config_sms_client_invoices'] : [];
$before = settingsCurrent(array_merge(['config_enable_alert_domain_expire', 'config_ticket_client_general_notifications', 'config_recurring_auto_send_invoice'], $sms_columns));
$after = ['config_enable_alert_domain_expire' => empty($_POST['config_enable_alert_domain_expire']) ? 0 : 1];
if ($config_module_enable_ticketing) {
@@ -23,6 +24,19 @@ if (isset($_POST['edit_notification_settings'])) {
if ($config_module_enable_accounting) {
$after['config_recurring_auto_send_invoice'] = empty($_POST['config_recurring_auto_send_invoice']) ? 0 : 1;
}
// Texts to clients - once the database has them; a choice not on the list keeps what it is
if ($sms_columns) {
if ($config_module_enable_ticketing) {
$tickets = intval($_POST['config_sms_client_tickets'] ?? $before['config_sms_client_tickets']);
$after['config_sms_client_tickets'] = in_array($tickets, [0, 1, 2], true) ? $tickets : intval($before['config_sms_client_tickets']);
$after['config_sms_client_visits'] = empty($_POST['config_sms_client_visits']) ? 0 : 1;
$hours = intval($_POST['config_sms_visit_reminder_hours'] ?? $before['config_sms_visit_reminder_hours']);
$after['config_sms_visit_reminder_hours'] = isset(smsReminderChoices()[$hours]) ? $hours : intval($before['config_sms_visit_reminder_hours']);
}
if ($config_module_enable_accounting) {
$after['config_sms_client_invoices'] = empty($_POST['config_sms_client_invoices']) ? 0 : 1;
}
}
settingsSave('notification', $before, $after);