mirror of
https://github.com/itflow-org/itflow
synced 2026-12-02 00:59:03 +00:00
29 lines
1.5 KiB
PHP
29 lines
1.5 KiB
PHP
<?php
|
|
|
|
/*
|
|
* ITFlow - Database update to version 4.3.3 (from 4.3.2)
|
|
* Included by admin/database_updates.php - do not access directly
|
|
*
|
|
* Sending an agent's reply (functions/ticket_reply_send.php), set in Admin > Settings > Tickets:
|
|
* settings.config_ticket_reply_undo_seconds - how long an emailed or texted reply waits on the ticket page, with
|
|
* Undo, before it goes: 0 (at once), 5, 10, 20 or 30 seconds - 10 to start
|
|
* settings.config_ticket_reply_to_read - a ticket's email from another address than the mailbox ITFlow reads asks
|
|
* for replies at that mailbox (Reply-To) - on to start
|
|
*
|
|
* Re-runnable: each column is added only where it isn't there.
|
|
*/
|
|
|
|
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
|
|
|
|
$itflow_reply_send_columns = [
|
|
['config_ticket_reply_undo_seconds', "tinyint(3) NOT NULL DEFAULT 10 AFTER `config_ticket_email_relay`"],
|
|
['config_ticket_reply_to_read', "tinyint(1) NOT NULL DEFAULT 1 AFTER `config_ticket_reply_undo_seconds`"],
|
|
];
|
|
foreach ($itflow_reply_send_columns as [$itflow_column, $itflow_definition]) {
|
|
$itflow_column_exists = mysqli_query($mysqli, "SELECT 1 FROM information_schema.COLUMNS
|
|
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'settings' AND COLUMN_NAME = '$itflow_column' LIMIT 1");
|
|
if (!$itflow_column_exists || mysqli_num_rows($itflow_column_exists) === 0) {
|
|
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `$itflow_column` $itflow_definition");
|
|
}
|
|
}
|