diff --git a/client_add_modal.php b/client_add_modal.php
index 6131c104..3df00748 100644
--- a/client_add_modal.php
+++ b/client_add_modal.php
@@ -227,6 +227,7 @@
+
+
+
+
+
+
+
diff --git a/client_edit_modal.php b/client_edit_modal.php
index 58ce626c..68322a67 100644
--- a/client_edit_modal.php
+++ b/client_edit_modal.php
@@ -87,7 +87,8 @@
-
+
+
+
+
+
+
+
+
diff --git a/client_side_nav.php b/client_side_nav.php
index df7bcfea..269471fb 100644
--- a/client_side_nav.php
+++ b/client_side_nav.php
@@ -148,6 +148,7 @@
+
- 2){ ?>
+ 2 AND $config_module_enable_accounting == 1){ ?>
@@ -305,13 +307,15 @@
">
diff --git a/clients.php b/clients.php
index dd0d4cad..562fc091 100644
--- a/clients.php
+++ b/clients.php
@@ -167,7 +167,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
Name |
Address |
Contact |
- Billing |
+ Billing |
Action |
@@ -309,8 +309,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
?>
-
-
+
+
Balance
diff --git a/database_updates.php b/database_updates.php
index 28949d9a..23d188fb 100644
--- a/database_updates.php
+++ b/database_updates.php
@@ -12,24 +12,24 @@ if(!defined("LATEST_DATABASE_VERSION") || !defined("CURRENT_DATABASE_VERSION") |
exit();
}
-
// Check if we need an update
if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
// We need updates!
-
if(CURRENT_DATABASE_VERSION == '0.0.1'){
// Insert queries here required to update to DB version 0.0.2
// mysqli_query($mysqli, "ALTER TABLE .....");
-
-
+ ALTER TABLE `settings` ADD `config_module_enable_itdoc` TINYINT(1) DEFAULT 1 AFTER `config_backup_path `;
+ ALTER TABLE `settings` ADD `config_module_enable_ticketing` TINYINT(1) DEFAULT 1 AFTER `config_module_enable_itdoc`;
+ ALTER TABLE `settings` ADD `config_module_enable_accounting` TINYINT(1) DEFAULT 1 AFTER `config_module_enable_ticketing`;
+
// Then, update the database to the next sequential version
//mysqli_query($mysqli, "UPDATE settings SET config_current_database_version = '0.0.2' WHERE company_id = '1'");
+ UPDATE `settings` SET `config_current_database_version` = '0.0.2';
}
-
if(CURRENT_DATABASE_VERSION == '0.0.2'){
// Insert queries here required to update to DB version 0.0.3
// mysqli_query($mysqli, "ALTER TABLE .....");
diff --git a/database_version.php b/database_version.php
index 290242b2..f0f59d6c 100644
--- a/database_version.php
+++ b/database_version.php
@@ -5,4 +5,4 @@
* It is used in conjunction with database_updates.php
*/
-DEFINE("LATEST_DATABASE_VERSION", "0.0.1");
\ No newline at end of file
+DEFINE("LATEST_DATABASE_VERSION", "0.0.2");
\ No newline at end of file
diff --git a/db.sql b/db.sql
index 36abb54a..6c02b03b 100644
--- a/db.sql
+++ b/db.sql
@@ -1134,6 +1134,9 @@ CREATE TABLE `settings` (
`config_azure_client_secret` varchar(200) DEFAULT NULL,
`config_backup_enable` tinyint(1) NOT NULL DEFAULT 0,
`config_backup_path` varchar(250) DEFAULT NULL,
+ `config_module_enable_itdoc` tinyint(1) NOT NULL DEFAULT 1,
+ `config_module_enable_accounting` tinyint(1) NOT NULL DEFAULT 1,
+ `config_module_enable_ticketing` tinyint(1) NOT NULL DEFAULT 1,
PRIMARY KEY (`company_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -1487,4 +1490,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2022-04-02 16:01:13
+-- Dump completed on 2022-04-14 22:58:14
diff --git a/get_settings.php b/get_settings.php
index 4de43807..9d67ccbb 100644
--- a/get_settings.php
+++ b/get_settings.php
@@ -79,6 +79,11 @@ $config_stripe_secret = $row['config_stripe_secret'];
$config_backup_enable = $row['config_backup_enable'];
$config_backup_path = $row['config_backup_path'];
+// Modules
+$config_module_enable_itdoc = $row['config_module_enable_itdoc'];
+$config_module_enable_ticketing = $row['config_module_enable_ticketing'];
+$config_module_enable_accounting = $row['config_module_enable_accounting'];
+
// Currency
$config_currency_format = "US_en";
diff --git a/post.php b/post.php
index 2d1de423..0432295e 100644
--- a/post.php
+++ b/post.php
@@ -1119,6 +1119,30 @@ if(isset($_POST['edit_backup_settings'])){
}
+if(isset($_POST['edit_module_settings'])){
+
+ if($session_user_role != 3){
+ $_SESSION['alert_type'] = "danger";
+ $_SESSION['alert_message'] = "You are not permitted to do that!";
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
+ exit();
+ }
+
+ $config_module_enable_itdoc = intval($_POST['config_module_enable_itdoc']);
+ $config_module_enable_ticketing = intval($_POST['config_module_enable_ticketing']);
+ $config_module_enable_accounting = intval($_POST['config_module_enable_accounting']);
+
+ mysqli_query($mysqli,"UPDATE settings SET config_module_enable_itdoc = $config_module_enable_itdoc, config_module_enable_ticketing = $config_module_enable_ticketing, config_module_enable_accounting = $config_module_enable_accounting 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 module settings', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_created_at = NOW(), log_user_id = $session_user_id, company_id = $session_company_id");
+
+ $_SESSION['alert_message'] = "Module Settings updated";
+
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
+
+}
+
if(isset($_POST['enable_2fa'])){
$token = mysqli_real_escape_string($mysqli,$_POST['token']);
diff --git a/settings-modules.php b/settings-modules.php
new file mode 100644
index 00000000..e893f5b2
--- /dev/null
+++ b/settings-modules.php
@@ -0,0 +1,33 @@
+
+
+
+
+
- = 2){ ?>
+ = 2 && $config_module_enable_ticketing == 1){ ?>
@@ -105,7 +105,7 @@
-
+
diff --git a/ticket.php b/ticket.php
index 60410f64..d7152550 100644
--- a/ticket.php
+++ b/ticket.php
@@ -578,8 +578,9 @@ if(isset($_GET['ticket_id'])){
+
|