mirror of https://github.com/itflow-org/itflow
Added Telemetry settings option
This commit is contained in:
parent
2429127ed1
commit
27ae1afa69
|
|
@ -67,9 +67,9 @@ if (isset($_GET['contact_id'])) {
|
|||
<img class="img-fluid img-circle p-3" alt="contact_photo" src="<?php echo "uploads/clients/$session_company_id/$client_id/$contact_photo"; ?>">
|
||||
<?php } else { ?>
|
||||
<span class="fa-stack fa-4x">
|
||||
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
||||
<span class="fa fa-stack-1x text-white"><?php echo $contact_initials; ?></span>
|
||||
</span>
|
||||
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
||||
<span class="fa fa-stack-1x text-white"><?php echo $contact_initials; ?></span>
|
||||
</span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<hr>
|
||||
|
|
@ -181,7 +181,7 @@ if (isset($_GET['contact_id'])) {
|
|||
$asset_vendor_id = $row['asset_vendor_id'];
|
||||
$asset_location_id = $row['asset_location_id'];
|
||||
$asset_network_id = $row['asset_network_id'];
|
||||
|
||||
$asset_contact_id = $row['asset_contact_id'];
|
||||
if ($asset_type == 'Laptop') {
|
||||
$device_icon = "laptop";
|
||||
} elseif ($asset_type == 'Desktop') {
|
||||
|
|
@ -213,7 +213,8 @@ if (isset($_GET['contact_id'])) {
|
|||
?>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-2"></i><?php echo $asset_name; ?>
|
||||
<i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-2"></i>
|
||||
<a class="text-secondary" href="#" data-toggle="modal" data-target="#editAssetModal<?php echo $asset_id; ?>"><?php echo $asset_name; ?></a>
|
||||
</th>
|
||||
<td><?php echo $asset_type; ?></td>
|
||||
<td><?php echo "$asset_make $asset_model"; ?></td>
|
||||
|
|
@ -360,6 +361,7 @@ if (isset($_GET['contact_id'])) {
|
|||
<?php
|
||||
|
||||
include("client_contact_edit_modal.php");
|
||||
include("share_modal.php");
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
|||
|
|
@ -768,11 +768,17 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
|||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.3'");
|
||||
}
|
||||
|
||||
//if(CURRENT_DATABASE_VERSION == '0.3.3'){
|
||||
// Insert queries here required to update to DB version 0.3.4
|
||||
if(CURRENT_DATABASE_VERSION == '0.3.3'){
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_telemetry` TINYINT(1) DEFAULT 0 AFTER `config_theme`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.4'");
|
||||
}
|
||||
|
||||
//if(CURRENT_DATABASE_VERSION == '0.3.4'){
|
||||
// Insert queries here required to update to DB version 0.3.5
|
||||
|
||||
// Then, update the database to the next sequential version
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.4'");
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.5'");
|
||||
//}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,4 +5,4 @@
|
|||
* It is used in conjunction with database_updates.php
|
||||
*/
|
||||
|
||||
DEFINE("LATEST_DATABASE_VERSION", "0.3.3");
|
||||
DEFINE("LATEST_DATABASE_VERSION", "0.3.4");
|
||||
3
db.sql
3
db.sql
|
|
@ -1080,6 +1080,7 @@ CREATE TABLE `settings` (
|
|||
`config_module_enable_accounting` tinyint(1) NOT NULL DEFAULT 1,
|
||||
`config_module_enable_ticketing` tinyint(1) NOT NULL DEFAULT 1,
|
||||
`config_theme` varchar(200) DEFAULT 'blue',
|
||||
`config_telemetry` tinyint(1) DEFAULT 0,
|
||||
PRIMARY KEY (`company_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
|
@ -1518,4 +1519,4 @@ CREATE TABLE `vendors` (
|
|||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2023-01-24 16:19:14
|
||||
-- Dump completed on 2023-01-24 19:27:29
|
||||
|
|
|
|||
|
|
@ -79,13 +79,15 @@ $config_module_enable_ticketing = $row['config_module_enable_ticketing'];
|
|||
$config_module_enable_accounting = $row['config_module_enable_accounting'];
|
||||
|
||||
// Currency
|
||||
|
||||
$config_currency_format = "US_en";
|
||||
|
||||
// Theme
|
||||
$config_theme = $row['config_theme'];
|
||||
$config_theme_mode = "dark_mode";
|
||||
|
||||
// Telemetry
|
||||
$config_telemetry = intval($row['config_telemetry']);
|
||||
|
||||
$colors_array = array(
|
||||
'blue',
|
||||
'green',
|
||||
|
|
|
|||
17
post.php
17
post.php
|
|
@ -1108,6 +1108,23 @@ if(isset($_POST['edit_module_settings'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_POST['edit_telemetry_settings'])){
|
||||
|
||||
validateAdminRole();
|
||||
|
||||
$config_telemetry = intval($_POST['config_telemetry']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE settings SET config_telemetry = $config_telemetry WHERE company_id = $session_company_id");
|
||||
|
||||
// Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modify', log_description = '$session_name modified telemetry settings', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id, company_id = $session_company_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Telemetry settings updated";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['enable_2fa'])){
|
||||
|
||||
// CSRF Check
|
||||
|
|
|
|||
|
|
@ -152,6 +152,14 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_telemetry.php") { echo "active"; } ?>"
|
||||
href="settings_telemetry.php">
|
||||
<i class="nav-icon fas fa-broadcast-tower"></i>
|
||||
<p>Telemetry</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">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
<?php require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-broadcast-tower"></i> Telemetry</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Telemery</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-broadcast-tower"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="config_telemetry">
|
||||
<option <?php if ($config_telemetry == '0') { echo "selected"; } ?> value="0">Disabled</option>
|
||||
<option <?php if ($config_telemetry == '1') { echo "selected"; } ?> value="1">Basic</option>
|
||||
<option <?php if ($config_telemetry == '2') { echo "selected"; } ?> value="2">Detailed</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_telemetry_settings" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
Loading…
Reference in New Issue