mirror of https://github.com/itflow-org/itflow
Organized Config Vars, fixed missing vars in alerts, switch from int to tinyint in settings table as this is much more efficient to parse
This commit is contained in:
parent
83cf223cb5
commit
ca8405f39d
14
db.sql
14
db.sql
|
|
@ -699,20 +699,20 @@ CREATE TABLE `settings` (
|
|||
`config_invoice_footer` text DEFAULT NULL,
|
||||
`config_quote_footer` text DEFAULT NULL,
|
||||
`config_invoice_next_number` int(11) DEFAULT NULL,
|
||||
`config_recurring_auto_send_invoice` int(1) DEFAULT NULL,
|
||||
`config_recurring_auto_send_invoice` tinyint(1) DEFAULT NULL,
|
||||
`config_api_key` varchar(200) DEFAULT NULL,
|
||||
`config_aes_key` varchar(250) DEFAULT NULL,
|
||||
`config_invoice_prefix` varchar(200) DEFAULT NULL,
|
||||
`config_send_invoice_reminders` int(1) DEFAULT NULL,
|
||||
`config_send_invoice_reminders` tinyint(1) DEFAULT NULL,
|
||||
`config_invoice_overdue_reminders` varchar(200) DEFAULT NULL,
|
||||
`config_quote_next_number` int(11) DEFAULT NULL,
|
||||
`config_quote_prefix` varchar(200) DEFAULT NULL,
|
||||
`config_ticket_prefix` varchar(200) DEFAULT NULL,
|
||||
`config_ticket_next_number` int(11) DEFAULT NULL,
|
||||
`config_enable_cron` int(1) DEFAULT NULL,
|
||||
`enable_alert_domain_expire` int(1) DEFAULT NULL,
|
||||
`enable_alert_low_balance` int(1) DEFAULT NULL,
|
||||
`config_stripe_enable` int(1) DEFAULT NULL,
|
||||
`config_enable_cron` tinyint(1) DEFAULT NULL,
|
||||
`config_enable_alert_domain_expire` tinyint(1) DEFAULT NULL,
|
||||
`config_enable_alert_low_balance` tinyint(1) DEFAULT NULL,
|
||||
`config_stripe_enable` tinyint(1) DEFAULT NULL,
|
||||
`config_stripe_publishable` varchar(255) DEFAULT NULL,
|
||||
`config_stripe_secret` varchar(255) DEFAULT NULL,
|
||||
`config_base_url` varchar(200) DEFAULT NULL,
|
||||
|
|
@ -927,4 +927,4 @@ CREATE TABLE `vendors` (
|
|||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2021-02-02 19:10:13
|
||||
-- Dump completed on 2021-02-04 12:41:19
|
||||
|
|
|
|||
|
|
@ -1,10 +1,15 @@
|
|||
<?php
|
||||
|
||||
//General Settings
|
||||
|
||||
//Query Settings
|
||||
$sql_settings = mysqli_query($mysqli,"SELECT * FROM settings WHERE company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_settings);
|
||||
|
||||
//General
|
||||
$config_api_key = $row['config_api_key'];
|
||||
$config_aes_key = $row['config_aes_key'];
|
||||
$config_base_url = $row['config_base_url'];
|
||||
|
||||
//Company Info
|
||||
$config_company_name = $row['config_company_name'];
|
||||
$config_company_country = $row['config_company_country'];
|
||||
$config_company_address = $row['config_company_address'];
|
||||
|
|
@ -18,11 +23,7 @@ if(strlen($config_company_phone)>2){
|
|||
$config_company_country = $row['config_company_country'];
|
||||
$config_company_site = $row['config_company_site'];
|
||||
|
||||
$config_quote_footer = $row['config_quote_footer'];
|
||||
$config_quote_next_number = $row['config_quote_next_number'];
|
||||
$config_quote_prefix = $row['config_quote_prefix'];
|
||||
|
||||
|
||||
//Mail
|
||||
$config_smtp_host = $row['config_smtp_host'];
|
||||
$config_smtp_username = $row['config_smtp_username'];
|
||||
$config_smtp_password = $row['config_smtp_password'];
|
||||
|
|
@ -30,18 +31,6 @@ $config_smtp_port = $row['config_smtp_port'];
|
|||
$config_mail_from_email = $row['config_mail_from_email'];
|
||||
$config_mail_from_name = $row['config_mail_from_name'];
|
||||
|
||||
$config_account_balance_threshold = $row['config_account_balance_threshold'];
|
||||
|
||||
$config_send_invoice_reminders = $row['config_send_invoice_reminders'];
|
||||
$config_invoice_logo = $row['config_invoice_logo'];
|
||||
$config_invoice_footer = $row['config_invoice_footer'];
|
||||
$config_invoice_overdue_reminders = $row['config_invoice_overdue_reminders'];
|
||||
$config_invoice_next_number = $row['config_invoice_next_number'];
|
||||
$config_invoice_prefix = $row['config_invoice_prefix'];
|
||||
|
||||
$config_ticket_next_number = $row['config_ticket_next_number'];
|
||||
$config_ticket_prefix = $row['config_ticket_prefix'];
|
||||
|
||||
//Defaults
|
||||
$config_default_expense_account = $row['config_default_expense_account'];
|
||||
$config_default_payment_account = $row['config_default_payment_account'];
|
||||
|
|
@ -53,19 +42,34 @@ $config_default_expense_payment_method = $row['config_default_expense_payment_me
|
|||
$config_default_net_terms = $row['config_default_net_terms'];
|
||||
$config_records_per_page = $row['config_records_per_page'];
|
||||
|
||||
$config_recurring_auto_send_invoice = $row['config_recurring_auto_send_invoice'];
|
||||
//Invoice/Quote
|
||||
$config_invoice_logo = $row['config_invoice_logo'];
|
||||
$config_invoice_footer = $row['config_invoice_footer'];
|
||||
$config_invoice_next_number = $row['config_invoice_next_number'];
|
||||
$config_invoice_prefix = $row['config_invoice_prefix'];
|
||||
|
||||
$config_quote_footer = $row['config_quote_footer'];
|
||||
$config_quote_next_number = $row['config_quote_next_number'];
|
||||
$config_quote_prefix = $row['config_quote_prefix'];
|
||||
|
||||
//Tickets
|
||||
$config_ticket_next_number = $row['config_ticket_next_number'];
|
||||
$config_ticket_prefix = $row['config_ticket_prefix'];
|
||||
|
||||
//Alerts
|
||||
$config_enable_cron = $row['config_enable_cron'];
|
||||
$config_account_balance_threshold = $row['config_account_balance_threshold'];
|
||||
$config_send_invoice_reminders = $row['config_send_invoice_reminders'];
|
||||
$config_recurring_auto_send_invoice = $row['config_recurring_auto_send_invoice'];
|
||||
$config_invoice_overdue_reminders = $row['config_invoice_overdue_reminders'];
|
||||
$config_enable_alert_domain_expire = $row['config_enable_alert_domain_expire'];
|
||||
$config_enable_alert_low_balance = $row['config_enable_alert_low_balance'];
|
||||
|
||||
//Online Payment
|
||||
$config_stripe_enable = $row['config_stripe_enable'];
|
||||
$config_stripe_publishable = $row['config_stripe_publishable'];
|
||||
$config_stripe_secret = $row['config_stripe_secret'];
|
||||
|
||||
$config_api_key = $row['config_api_key'];
|
||||
$config_aes_key = $row['config_aes_key'];
|
||||
$config_base_url = $row['config_base_url'];
|
||||
$config_enable_cron = $row['config_enable_cron'];
|
||||
|
||||
|
||||
|
||||
$net_terms_array = array(
|
||||
'0'=>'On Reciept',
|
||||
'7'=>'7 Days',
|
||||
|
|
|
|||
4
post.php
4
post.php
|
|
@ -396,10 +396,12 @@ if(isset($_POST['edit_default_settings'])){
|
|||
if(isset($_POST['edit_alert_settings'])){
|
||||
|
||||
$config_enable_cron = intval($_POST['config_enable_cron']);
|
||||
$config_enable_alert_domain_expire = intval('config_enable_alert_domain_expire');
|
||||
$config_enable_alert_low_balance = intval('config_enable_alert_low_balance');
|
||||
$config_send_invoice_reminders = intval($_POST['config_send_invoice_reminders']);
|
||||
$config_invoice_overdue_reminders = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_invoice_overdue_reminders']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE settings SET config_send_invoice_reminders = $config_send_invoice_reminders, config_invoice_overdue_reminders = '$config_invoice_overdue_reminders', config_enable_cron = $config_enable_cron WHERE company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"UPDATE settings SET config_send_invoice_reminders = $config_send_invoice_reminders, config_invoice_overdue_reminders = '$config_invoice_overdue_reminders', config_enable_cron = $config_enable_cron, config_enable_alert_domain_expire = $config_enable_alert_domain_expire, config_enable_alert_low_balance = $config_enable_alert_low_balance WHERE company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modified', log_description = 'Alerts', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@
|
|||
</div>
|
||||
|
||||
<div class="custom-control custom-switch mb-2">
|
||||
<input type="checkbox" class="custom-control-input" name="config_alerts_domains" <?php if($config_alerts_low_balance == 1){ echo "checked"; } ?> value="1" id="customSwitch2">
|
||||
<input type="checkbox" class="custom-control-input" name="config_enable_alert_low_balance" <?php if($config_enable_alert_low_balance == 1){ echo "checked"; } ?> value="1" id="customSwitch2">
|
||||
<label class="custom-control-label" for="customSwitch2">Enable Low Balance Alerts</label>
|
||||
</div>
|
||||
|
||||
<?php if($config_alert_low_balance == 1){ ?>
|
||||
<?php if($config_enable_alert_low_balance == 1){ ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Threshold</label>
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
<?php } ?>
|
||||
|
||||
<div class="custom-control custom-switch mb-2">
|
||||
<input type="checkbox" class="custom-control-input" name="config_alerts_domains" <?php if($config_alert_domain_expire == 1){ echo "checked"; } ?> value="1" id="customSwitch3">
|
||||
<input type="checkbox" class="custom-control-input" name="config_enable_alert_domain_expire" <?php if($config_enable_alert_domain_expire == 1){ echo "checked"; } ?> value="1" id="customSwitch3">
|
||||
<label class="custom-control-label" for="customSwitch3">Enable Domain Expiration Alerts</label>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue