mirror of
https://github.com/itflow-org/itflow
synced 2026-03-24 06:25:40 +00:00
Merge branch 'master' into 0.1.8.2
This commit is contained in:
@@ -52,13 +52,12 @@ $key = randomString(156);
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Client <strong class="text-danger">*</strong></label>
|
<label>Client Access <strong class="text-danger">*</strong></label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" name="client" required>
|
<select class="form-control select2" name="client" required>
|
||||||
<option value="">- Client -</option>
|
|
||||||
<option value="0"> ALL CLIENTS </option>
|
<option value="0"> ALL CLIENTS </option>
|
||||||
<?php
|
<?php
|
||||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients ORDER BY client_name ASC");
|
$sql = mysqli_query($mysqli, "SELECT * FROM clients ORDER BY client_name ASC");
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ $session_company_currency = $row['company_currency'];
|
|||||||
$session_timezone = $row['config_timezone'];
|
$session_timezone = $row['config_timezone'];
|
||||||
|
|
||||||
// Set Timezone to the companies timezone
|
// Set Timezone to the companies timezone
|
||||||
date_default_timezone_set($session_timezone);
|
// 2024-02-08 JQ - The option to set the timezone in PHP was disabled to prevent inconsistencies with MariaDB/MySQL, which utilize the system's timezone, It is now consdered best practice to set the timezone on system itself
|
||||||
|
//date_default_timezone_set($session_timezone);
|
||||||
|
|
||||||
//Set Currency Format
|
//Set Currency Format
|
||||||
$currency_format = numfmt_create($session_company_locale, NumberFormatter::CURRENCY);
|
$currency_format = numfmt_create($session_company_locale, NumberFormatter::CURRENCY);
|
||||||
|
|||||||
@@ -50,14 +50,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="float-right">
|
<div class="btn-group float-right">
|
||||||
<div class="dropdown" id="multiActionButton" hidden>
|
<div class="dropdown ml-2" id="bulkActionButton" hidden>
|
||||||
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
|
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">
|
||||||
<i class="fas fa-fw fa-list mr-2"></i>Selected (<span id="selectedCount">0</span>)
|
<i class="fas fa-fw fa-layer-group mr-2"></i>Bulk Action (<span id="selectedCount">0</span>)
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<button class="dropdown-item text-danger text-bold"
|
<button class="dropdown-item text-danger text-bold"
|
||||||
type="submit" form="multi_actions" name="bulk_delete_certificates">
|
type="submit" form="bulkActions" name="bulk_delete_certificates">
|
||||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -70,7 +70,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<hr>
|
<hr>
|
||||||
<div class="table-responsive-sm">
|
<div class="table-responsive-sm">
|
||||||
|
|
||||||
<form id="multi_actions" action="post.php" method="post">
|
<form id="bulkActions" action="post.php" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||||
|
|
||||||
<table class="table table-striped table-borderless table-hover">
|
<table class="table table-striped table-borderless table-hover">
|
||||||
@@ -103,7 +103,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="pr-0">
|
<td class="pr-0">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox" name="certificate_ids[]" value="<?php echo $certificate_id ?>">
|
<input class="form-check-input bulk-select" type="checkbox" name="certificate_ids[]" value="<?php echo $certificate_id ?>">
|
||||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -127,11 +127,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
</a>
|
</a>
|
||||||
<?php if ($session_user_role == 3) { ?>
|
<?php if ($session_user_role == 3) { ?>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item text-danger" href="post.php?archive_certificate=<?php echo $certificate_id; ?>">
|
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_certificate=<?php echo $certificate_id; ?>">
|
||||||
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item text-danger text-bold" href="post.php?delete_certificate=<?php echo $certificate_id; ?>">
|
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_certificate=<?php echo $certificate_id; ?>">
|
||||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||||
</a>
|
</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@@ -164,7 +164,7 @@ require_once "client_certificate_export_modal.php";
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script src="js/certificate_edit_modal.js"></script>
|
<script src="js/certificate_edit_modal.js"></script>
|
||||||
<script src="js/multi_actions.js"></script>
|
<script src="js/bulk_actions.js"></script>
|
||||||
<script src="js/certificate_fetch_ssl.js"></script>
|
<script src="js/certificate_fetch_ssl.js"></script>
|
||||||
|
|
||||||
<?php require_once "footer.php";
|
<?php require_once "footer.php";
|
||||||
|
|||||||
@@ -51,14 +51,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="float-right">
|
<div class="btn-group float-right">
|
||||||
<div class="dropdown" id="multiActionButton" hidden>
|
<div class="dropdown ml-2" id="bulkActionButton" hidden>
|
||||||
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
|
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">
|
||||||
<i class="fas fa-fw fa-list mr-2"></i>Selected (<span id="selectedCount">0</span>)
|
<i class="fas fa-fw fa-layer-group mr-2"></i>Bulk Action (<span id="selectedCount">0</span>)
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<button class="dropdown-item text-danger text-bold"
|
<button class="dropdown-item text-danger text-bold"
|
||||||
type="submit" form="multi_actions" name="bulk_delete_domains">
|
type="submit" form="bulkActions" name="bulk_delete_domains">
|
||||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -71,7 +71,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<hr>
|
<hr>
|
||||||
<div class="table-responsive-sm">
|
<div class="table-responsive-sm">
|
||||||
|
|
||||||
<form id="multi_actions" action="post.php" method="post">
|
<form id="bulkActions" action="post.php" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||||
|
|
||||||
<table class="table table-striped table-borderless table-hover">
|
<table class="table table-striped table-borderless table-hover">
|
||||||
@@ -115,7 +115,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="pr-0">
|
<td class="pr-0">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox" name="domain_ids[]" value="<?php echo $domain_id ?>">
|
<input class="form-check-input bulk-select" type="checkbox" name="domain_ids[]" value="<?php echo $domain_id ?>">
|
||||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -134,13 +134,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
</a>
|
</a>
|
||||||
<?php if ($session_user_role == 2) { ?>
|
<?php if ($session_user_role == 2) { ?>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item text-danger" href="post.php?archive_domain=<?php echo $domain_id; ?>">
|
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_domain=<?php echo $domain_id; ?>">
|
||||||
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
||||||
</a>
|
</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if ($session_user_role == 3) { ?>
|
<?php if ($session_user_role == 3) { ?>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item text-danger text-bold" href="post.php?delete_domain=<?php echo $domain_id; ?>">
|
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_domain=<?php echo $domain_id; ?>">
|
||||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||||
</a>
|
</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@@ -172,7 +172,7 @@ require_once "client_domain_export_modal.php";
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script src="js/domain_edit_modal.js"></script>
|
<script src="js/domain_edit_modal.js"></script>
|
||||||
<script src="js/multi_actions.js"></script>
|
<script src="js/bulk_actions.js"></script>
|
||||||
|
|
||||||
<?php require_once "footer.php";
|
<?php require_once "footer.php";
|
||||||
|
|
||||||
|
|||||||
@@ -55,14 +55,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="float-right">
|
<div class="btn-group float-right">
|
||||||
<div class="dropdown" id="multiActionButton" hidden>
|
<div class="dropdown ml-2" id="bulkActionButton" hidden>
|
||||||
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
|
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">
|
||||||
<i class="fas fa-fw fa-list mr-2"></i>Selected (<span id="selectedCount">0</span>)
|
<i class="fas fa-fw fa-layer-group mr-2"></i>Bulk Action (<span id="selectedCount">0</span>)
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<button class="dropdown-item text-danger text-bold"
|
<button class="dropdown-item text-danger text-bold confirm-link"
|
||||||
type="submit" form="multi_actions" name="bulk_delete_networks">
|
type="submit" form="bulkActions" name="bulk_delete_networks">
|
||||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -75,7 +75,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<hr>
|
<hr>
|
||||||
<div class="table-responsive-sm">
|
<div class="table-responsive-sm">
|
||||||
|
|
||||||
<form id="multi_actions" action="post.php" method="post">
|
<form id="bulkActions" action="post.php" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||||
|
|
||||||
<table class="table table-striped table-borderless table-hover">
|
<table class="table table-striped table-borderless table-hover">
|
||||||
@@ -127,13 +127,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="pr-0">
|
<td class="pr-0">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox" name="network_ids[]" value="<?php echo $network_id ?>">
|
<input class="form-check-input bulk-select" type="checkbox" name="network_ids[]" value="<?php echo $network_id ?>">
|
||||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<th>
|
<th>
|
||||||
<i class="fa fa-fw fa-network-wired text-secondary"></i>
|
<i class="fa fa-fw fa-network-wired text-secondary mr-2"></i><a class="text-dark" href="#" data-toggle="modal" onclick="populateNetworkEditModal(<?php echo $client_id, ",", $network_id ?>)"
|
||||||
<a class="text-dark" href="#" data-toggle="modal" onclick="populateNetworkEditModal(<?php echo $client_id, ",", $network_id ?>)"
|
|
||||||
data-target="#editNetworkModal"><?php echo $network_name; ?>
|
data-target="#editNetworkModal"><?php echo $network_name; ?>
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
@@ -153,11 +152,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
</a>
|
</a>
|
||||||
<?php if ($session_user_role == 3) { ?>
|
<?php if ($session_user_role == 3) { ?>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item text-danger" href="post.php?archive_network=<?php echo $network_id; ?>">
|
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_network=<?php echo $network_id; ?>">
|
||||||
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item text-danger text-bold" href="post.php?delete_network=<?php echo $network_id; ?>">
|
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_network=<?php echo $network_id; ?>">
|
||||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||||
</a>
|
</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@@ -190,8 +189,7 @@ require_once "client_network_export_modal.php";
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script src="js/network_edit_modal.js"></script>
|
<script src="js/network_edit_modal.js"></script>
|
||||||
<script src="js/multi_actions.js"></script>
|
<script src="js/bulk_actions.js"></script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
require_once "footer.php";
|
require_once "footer.php";
|
||||||
|
|
||||||
|
|||||||
@@ -1573,16 +1573,32 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
|
|||||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.0.3'");
|
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.0.3'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CURRENT_DATABASE_VERSION == '1.0.3') {
|
||||||
|
//Insert queries here required to update to DB version 1.0.4
|
||||||
|
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_ai_enable` TINYINT(1) DEFAULT 0 AFTER `config_stripe_percentage_fee`");
|
||||||
|
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_ai_provider` VARCHAR(250) DEFAULT NULL AFTER `config_ai_enable`");
|
||||||
|
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_ai_url` VARCHAR(250) DEFAULT NULL AFTER `config_ai_provider`");
|
||||||
|
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_ai_api_key` VARCHAR(250) DEFAULT NULL AFTER `config_ai_url`");
|
||||||
|
|
||||||
|
//Then, update the database to the next sequential version
|
||||||
|
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.0.4'");
|
||||||
|
}
|
||||||
|
|
||||||
// Be sure to change database_version.php to reflect the version you are updating to here
|
// Be sure to change database_version.php to reflect the version you are updating to here
|
||||||
// Please add this same comment block to the bottom of this file, and update the version number.
|
// Please add this same comment block to the bottom of this file, and update the version number.
|
||||||
// Uncomment Below Lines, to add additional database updates
|
// Uncomment Below Lines, to add additional database updates
|
||||||
//
|
//
|
||||||
|
|
||||||
if (CURRENT_DATABASE_VERSION == '1.0.3') {
|
if (CURRENT_DATABASE_VERSION == '1.0.4') {
|
||||||
//Insert queries here required to update to DB version 1.0.4
|
//Insert queries here required to update to DB version 1.0.5
|
||||||
mysqli_query($mysqli, "ALTER TABLE `tickets` ADD `ticket_schedule` DATETIME DEFAULT NULL AFTER `ticket_billable`");
|
mysqli_query($mysqli, "ALTER TABLE `tickets` ADD `ticket_schedule` DATETIME DEFAULT NULL AFTER `ticket_billable`");
|
||||||
// // Then, update the database to the next sequential version
|
// // Then, update the database to the next sequential version
|
||||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.0.4'");
|
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.0.5'");
|
||||||
|
|
||||||
|
// if (CURRENT_DATABASE_VERSION == '1.0.5') {
|
||||||
|
// // Insert queries here required to update to DB version 1.0.6
|
||||||
|
// // Then, update the database to the next sequential version
|
||||||
|
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.0.6'");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -5,5 +5,5 @@
|
|||||||
* It is used in conjunction with database_updates.php
|
* It is used in conjunction with database_updates.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DEFINE("LATEST_DATABASE_VERSION", "1.0.3");
|
DEFINE("LATEST_DATABASE_VERSION", "1.0.4");
|
||||||
|
|
||||||
|
|||||||
6
db.sql
6
db.sql
@@ -1274,6 +1274,10 @@ CREATE TABLE `settings` (
|
|||||||
`config_stripe_expense_vendor` int(11) NOT NULL DEFAULT 0,
|
`config_stripe_expense_vendor` int(11) NOT NULL DEFAULT 0,
|
||||||
`config_stripe_expense_category` int(11) NOT NULL DEFAULT 0,
|
`config_stripe_expense_category` int(11) NOT NULL DEFAULT 0,
|
||||||
`config_stripe_percentage_fee` decimal(4,4) NOT NULL DEFAULT 0.0290,
|
`config_stripe_percentage_fee` decimal(4,4) NOT NULL DEFAULT 0.0290,
|
||||||
|
`config_ai_enable` tinyint(1) DEFAULT 0,
|
||||||
|
`config_ai_provider` varchar(250) DEFAULT NULL,
|
||||||
|
`config_ai_url` varchar(250) DEFAULT NULL,
|
||||||
|
`config_ai_api_key` varchar(250) DEFAULT NULL,
|
||||||
`config_stripe_flat_fee` decimal(15,2) NOT NULL DEFAULT 0.30,
|
`config_stripe_flat_fee` decimal(15,2) NOT NULL DEFAULT 0.30,
|
||||||
`config_stripe_client_pays_fees` tinyint(1) NOT NULL DEFAULT 0,
|
`config_stripe_client_pays_fees` tinyint(1) NOT NULL DEFAULT 0,
|
||||||
`config_azure_client_id` varchar(200) DEFAULT NULL,
|
`config_azure_client_id` varchar(200) DEFAULT NULL,
|
||||||
@@ -1761,4 +1765,4 @@ CREATE TABLE `vendors` (
|
|||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2024-01-27 23:58:10
|
-- Dump completed on 2024-02-05 21:00:37
|
||||||
|
|||||||
@@ -90,6 +90,12 @@ $config_stripe_percentage_fee = floatval($row['config_stripe_percentage_fee']);
|
|||||||
$config_stripe_flat_fee = floatval($row['config_stripe_flat_fee']);
|
$config_stripe_flat_fee = floatval($row['config_stripe_flat_fee']);
|
||||||
$config_stripe_client_pays_fees = intval($row['config_stripe_client_pays_fees']);
|
$config_stripe_client_pays_fees = intval($row['config_stripe_client_pays_fees']);
|
||||||
|
|
||||||
|
// AI Provider Details
|
||||||
|
$config_ai_enable = intval($row['config_ai_enable']);
|
||||||
|
$config_ai_provider = $row['config_ai_provider'];
|
||||||
|
$config_ai_url = $row['config_ai_url'];
|
||||||
|
$config_ai_api_key = $row['config_ai_api_key'];
|
||||||
|
|
||||||
// Modules
|
// Modules
|
||||||
$config_module_enable_itdoc = intval($row['config_module_enable_itdoc']);
|
$config_module_enable_itdoc = intval($row['config_module_enable_itdoc']);
|
||||||
$config_module_enable_ticketing = intval($row['config_module_enable_ticketing']);
|
$config_module_enable_ticketing = intval($row['config_module_enable_ticketing']);
|
||||||
|
|||||||
@@ -448,6 +448,33 @@ if (isset($_POST['edit_integrations_settings'])) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($_POST['edit_ai_settings'])) {
|
||||||
|
|
||||||
|
validateCSRFToken($_POST['csrf_token']);
|
||||||
|
|
||||||
|
validateAdminRole();
|
||||||
|
|
||||||
|
$provider = sanitizeInput($_POST['provider']);
|
||||||
|
if($provider){
|
||||||
|
$ai_enable = 1;
|
||||||
|
} else {
|
||||||
|
$ai_enable = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$url = sanitizeInput($_POST['url']);
|
||||||
|
$api_key = sanitizeInput($_POST['api_key']);
|
||||||
|
|
||||||
|
mysqli_query($mysqli,"UPDATE settings SET config_ai_enable = $ai_enable, config_ai_provider = '$provider', config_ai_url = '$url', config_ai_api_key = '$api_key' WHERE company_id = 1");
|
||||||
|
|
||||||
|
//Logging
|
||||||
|
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Edit', log_description = '$session_name edited AI settings', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
|
||||||
|
|
||||||
|
$_SESSION['alert_message'] = "You updated the AI Settings";
|
||||||
|
|
||||||
|
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($_POST['edit_module_settings'])) {
|
if (isset($_POST['edit_module_settings'])) {
|
||||||
|
|
||||||
validateAdminRole();
|
validateAdminRole();
|
||||||
@@ -574,10 +601,11 @@ if (isset($_GET['download_database'])) {
|
|||||||
$sqlScript .= "\n";
|
$sqlScript .= "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($sqlScript))
|
if (!empty($sqlScript)) {
|
||||||
{
|
|
||||||
|
$company_name = $session_company_name;
|
||||||
// Save the SQL script to a backup file
|
// Save the SQL script to a backup file
|
||||||
$backup_file_name = date('Y-m-d') . '_' . $config_company_name . '_backup.sql';
|
$backup_file_name = date('Y-m-d') . '_ITFlow_backup.sql';
|
||||||
$fileHandler = fopen($backup_file_name, 'w+');
|
$fileHandler = fopen($backup_file_name, 'w+');
|
||||||
$number_of_lines = fwrite($fileHandler, $sqlScript);
|
$number_of_lines = fwrite($fileHandler, $sqlScript);
|
||||||
fclose($fileHandler);
|
fclose($fileHandler);
|
||||||
|
|||||||
58
settings_ai.php
Normal file
58
settings_ai.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once "inc_all_settings.php";
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="card card-dark">
|
||||||
|
<div class="card-header py-3">
|
||||||
|
<h3 class="card-title"><i class="fas fa-fw fa-robot mr-2"></i>AI</h3>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
|
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>AI Provider</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-robot"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="provider">
|
||||||
|
<option value="" <?php if($config_ai_enable == 0) { echo "selected"; } ?> >Disabled</option>
|
||||||
|
<option <?php if($config_ai_provider == "Ollama") { echo "selected"; } ?> >Ollama</option>
|
||||||
|
<option <?php if($config_ai_provider == "OpenAI") { echo "selected"; } ?> >OpenAI</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>URL</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-globe"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="url" class="form-control" name="url" value="<?php echo nullable_htmlentities($config_ai_url); ?>" placeholder="ex https://ai.company.ext/api">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>API Key</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="api_key" value="<?php echo nullable_htmlentities($config_ai_api_key); ?>" placeholder="Enter API key here">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<button type="submit" name="edit_ai_settings" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
require_once "footer.php";
|
||||||
|
|
||||||
@@ -45,15 +45,17 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="dropdown float-right" id="multiActionButton" hidden>
|
<div class="btn-group float-right">
|
||||||
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
|
<div class="dropdown ml-2" id="bulkActionButton" hidden>
|
||||||
<i class="fas fa-fw fa-list mr-2"></i>Selected (<span id="selectedCount">0</span>)
|
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">
|
||||||
</button>
|
<i class="fas fa-fw fa-layer-group mr-2"></i>Bulk Action (<span id="selectedCount">0</span>)
|
||||||
<div class="dropdown-menu">
|
|
||||||
<button class="dropdown-item text-danger text-bold"
|
|
||||||
type="submit" form="multi_actions" name="bulk_delete_api_keys">
|
|
||||||
<i class="fas fa-fw fa-trash mr-2"></i>Revoke
|
|
||||||
</button>
|
</button>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<button class="dropdown-item text-danger text-bold"
|
||||||
|
type="submit" form="bulkActions" name="bulk_delete_api_keys">
|
||||||
|
<i class="fas fa-fw fa-trash mr-2"></i>Revoke
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -65,7 +67,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<div class="table-responsive-sm">
|
<div class="table-responsive-sm">
|
||||||
|
|
||||||
<form id="multi_actions" action="post.php" method="post">
|
<form id="bulkActions" action="post.php" method="post">
|
||||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||||
|
|
||||||
<table class="table table-striped table-borderless table-hover">
|
<table class="table table-striped table-borderless table-hover">
|
||||||
@@ -107,7 +109,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="pr-0">
|
<td class="pr-0">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox" name="api_key_ids[]" value="<?php echo $api_key_id ?>">
|
<input class="form-check-input bulk-select" type="checkbox" name="api_key_ids[]" value="<?php echo $api_key_id ?>">
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
@@ -149,7 +151,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="js/multi_actions.js"></script>
|
<script src="js/bulk_actions.js"></script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
require_once "api_key_add_modal.php";
|
require_once "api_key_add_modal.php";
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ require_once "inc_all_settings.php";
|
|||||||
<label>Secret key</label>
|
<label>Secret key</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="config_stripe_secret" placeholder="Stripe Secret API Key (sk_...)" value="<?php echo nullable_htmlentities($config_stripe_secret); ?>">
|
<input type="text" class="form-control" name="config_stripe_secret" placeholder="Stripe Secret API Key (sk_...)" value="<?php echo nullable_htmlentities($config_stripe_secret); ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -30,64 +30,12 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_security.php") { echo "active"; } ?>"
|
|
||||||
href="settings_security.php">
|
|
||||||
<i class="nav-icon fas fa-shield-alt"></i>
|
|
||||||
<p>Security</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="settings_mail_queue.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_mail_queue.php") { echo "active"; } ?>">
|
|
||||||
<i class="nav-icon fas fa-mail-bulk"></i>
|
|
||||||
<p>Mail Queue</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="logs.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "logs.php") { echo "active"; } ?>">
|
|
||||||
<i class="nav-icon fas fa-history"></i>
|
|
||||||
<p>Audit Logs</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_backup.php") { echo "active"; } ?>"
|
|
||||||
href="settings_backup.php">
|
|
||||||
<i class="nav-icon fas fa-cloud-upload-alt"></i>
|
|
||||||
<p>Backup</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_update.php") { echo "active"; } ?>"
|
|
||||||
href="settings_update.php">
|
|
||||||
<i class="nav-icon fas fa-download"></i>
|
|
||||||
<p>Update</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="settings_debug.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_debug.php") { echo "active"; } ?>">
|
|
||||||
<i class="nav-icon fa fa-bug"></i>
|
|
||||||
<p>Debug</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<!-- <li class="nav-item">-->
|
|
||||||
<!-- <a href="settings_maintenance.php" class="nav-link --><?php //if (basename($_SERVER["PHP_SELF"]) == "settings_maintenance.php") { echo "active"; } ?><!--">-->
|
|
||||||
<!-- <i class="nav-icon fa fa-wrench"></i>-->
|
|
||||||
<!-- <p>Maintenance</p>-->
|
|
||||||
<!-- </a>-->
|
|
||||||
<!-- </li>-->
|
|
||||||
|
|
||||||
<li class="nav-header mt-3">TAGS & CATEGORIES</li>
|
<li class="nav-header mt-3">TAGS & CATEGORIES</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="settings_taxes.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_taxes.php") { echo "active"; } ?>">
|
<a href="settings_tags.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_tags.php") { echo "active"; } ?>">
|
||||||
<i class="nav-icon fas fa-balance-scale"></i>
|
<i class="nav-icon fas fa-tags"></i>
|
||||||
<p>Taxes</p>
|
<p>Tags</p>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -105,13 +53,14 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="settings_tags.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_tags.php") { echo "active"; } ?>">
|
<a href="settings_taxes.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_taxes.php") { echo "active"; } ?>">
|
||||||
<i class="nav-icon fas fa-tags"></i>
|
<i class="nav-icon fas fa-balance-scale"></i>
|
||||||
<p>Tags</p>
|
<p>Taxes</p>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="settings_account_types.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_account_types.php") { echo "active"; } ?>">
|
<a href="settings_account_types.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_account_types.php") { echo "active"; } ?>">
|
||||||
<i class="nav-icon fas fa-money-bill-wave"></i>
|
<i class="nav-icon fas fa-money-bill-wave"></i>
|
||||||
@@ -142,6 +91,54 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-header mt-3">MAINTENANCE</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="settings_mail_queue.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_mail_queue.php") { echo "active"; } ?>">
|
||||||
|
<i class="nav-icon fas fa-mail-bulk"></i>
|
||||||
|
<p>Mail Queue</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="logs.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "logs.php") { echo "active"; } ?>">
|
||||||
|
<i class="nav-icon fas fa-history"></i>
|
||||||
|
<p>Audit Logs</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_backup.php") { echo "active"; } ?>"
|
||||||
|
href="settings_backup.php">
|
||||||
|
<i class="nav-icon fas fa-cloud-upload-alt"></i>
|
||||||
|
<p>Backup</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="settings_debug.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_debug.php") { echo "active"; } ?>">
|
||||||
|
<i class="nav-icon fa fa-bug"></i>
|
||||||
|
<p>Debug</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_update.php") { echo "active"; } ?>"
|
||||||
|
href="settings_update.php">
|
||||||
|
<i class="nav-icon fas fa-download"></i>
|
||||||
|
<p>Update</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<!-- <li class="nav-item">-->
|
||||||
|
<!-- <a href="settings_maintenance.php" class="nav-link --><?php //if (basename($_SERVER["PHP_SELF"]) == "settings_maintenance.php") { echo "active"; } ?><!--">-->
|
||||||
|
<!-- <i class="nav-icon fa fa-wrench"></i>-->
|
||||||
|
<!-- <p>Maintenance</p>-->
|
||||||
|
<!-- </a>-->
|
||||||
|
<!-- </li>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="nav-header mt-3">SETTINGS</li>
|
<li class="nav-header mt-3">SETTINGS</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
@@ -166,6 +163,14 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_security.php") { echo "active"; } ?>"
|
||||||
|
href="settings_security.php">
|
||||||
|
<i class="nav-icon fas fa-shield-alt"></i>
|
||||||
|
<p>Security</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_mail.php") { echo "active"; } ?>"
|
<a class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_mail.php") { echo "active"; } ?>"
|
||||||
href="settings_mail.php">
|
href="settings_mail.php">
|
||||||
@@ -228,6 +233,13 @@
|
|||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="settings_ai.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_ai.php") { echo "active"; } ?>">
|
||||||
|
<i class="nav-icon fas fa-robot"></i>
|
||||||
|
<p>AI</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="settings_integrations.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_integrations.php") { echo "active"; } ?>">
|
<a href="settings_integrations.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_integrations.php") { echo "active"; } ?>">
|
||||||
<i class="nav-icon fas fa-plug"></i>
|
<i class="nav-icon fas fa-plug"></i>
|
||||||
|
|||||||
Reference in New Issue
Block a user