mirror of https://github.com/itflow-org/itflow
Set Timezone in the CRON files as well as the command line PHP doesn't always respect the system timezone
This commit is contained in:
parent
2f4ddd85ca
commit
5266f126cb
4
cron.php
4
cron.php
|
|
@ -32,6 +32,7 @@ $config_invoice_from_email = sanitizeInput($row['config_invoice_from_email']);
|
|||
$config_invoice_from_name = sanitizeInput($row['config_invoice_from_name']);
|
||||
$config_invoice_late_fee_enable = intval($row['config_invoice_late_fee_enable']);
|
||||
$config_invoice_late_fee_percent = floatval($row['config_invoice_late_fee_percent']);
|
||||
$config_timezone = sanitizeInput($row['config_timezone']);
|
||||
|
||||
// Mail Settings
|
||||
$config_smtp_host = $row['config_smtp_host'];
|
||||
|
|
@ -67,6 +68,9 @@ $config_send_invoice_reminders = intval($row['config_send_invoice_reminders']);
|
|||
// Set Currency Format
|
||||
$currency_format = numfmt_create($company_locale, NumberFormatter::CURRENCY);
|
||||
|
||||
// Set Timezone
|
||||
date_default_timezone_set($config_timezone);
|
||||
|
||||
$argv = $_SERVER['argv'];
|
||||
|
||||
// Check cron is enabled
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ $row = mysqli_fetch_array($sql_settings);
|
|||
// Company Settings
|
||||
$config_enable_cron = intval($row['config_enable_cron']);
|
||||
$config_cron_key = $row['config_cron_key'];
|
||||
$config_timezone = sanitizeInput($row['config_timezone']);
|
||||
|
||||
// Set Timezone
|
||||
date_default_timezone_set($config_timezone);
|
||||
|
||||
$argv = $_SERVER['argv'];
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ $row = mysqli_fetch_array($sql_settings);
|
|||
// Company Settings
|
||||
$config_enable_cron = intval($row['config_enable_cron']);
|
||||
$config_cron_key = $row['config_cron_key'];
|
||||
$config_timezone = sanitizeInput($row['config_timezone']);
|
||||
|
||||
// Set Timezone
|
||||
date_default_timezone_set($config_timezone);
|
||||
|
||||
$argv = $_SERVER['argv'];
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@ $config_smtp_username = $row['config_smtp_username'];
|
|||
$config_smtp_password = $row['config_smtp_password'];
|
||||
$config_smtp_port = intval($row['config_smtp_port']);
|
||||
$config_smtp_encryption = $row['config_smtp_encryption'];
|
||||
$config_timezone = sanitizeInput($row['config_timezone']);
|
||||
|
||||
// Set Timezone
|
||||
date_default_timezone_set($config_timezone);
|
||||
|
||||
$argv = $_SERVER['argv'];
|
||||
|
||||
|
|
|
|||
|
|
@ -26,11 +26,15 @@ require_once "get_settings.php";
|
|||
$config_ticket_prefix = sanitizeInput($config_ticket_prefix);
|
||||
$config_ticket_from_name = sanitizeInput($config_ticket_from_name);
|
||||
|
||||
// Get company name & phone
|
||||
$sql = mysqli_query($mysqli, "SELECT company_name, company_phone FROM companies WHERE company_id = 1");
|
||||
// Get company name & phone & timezone
|
||||
mysqli_query($mysqli, "SELECT * FROM companies, settings WHERE companies.company_id = settings.company_id AND companies.company_id = 1");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$company_name = sanitizeInput($row['company_name']);
|
||||
$company_phone = sanitizeInput(formatPhoneNumber($row['company_phone']));
|
||||
$config_timezone = sanitizeInput($row['config_timezone']);
|
||||
|
||||
// Set Timezone
|
||||
date_default_timezone_set($config_timezone);
|
||||
|
||||
// Check setting enabled
|
||||
if ($config_ticket_email_parse == 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue