From f102c196920bcc393c9b770a7855ce1c6f949dbe Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sun, 27 Feb 2022 16:55:57 -0500 Subject: [PATCH] DB Update Added Null Default to new meshcentral vars so it doesnt break when adding records, Added Service History #384 Thank you @aftechro for the idea. This has been added to asset list and ticket details and some UI updates to ticket details as well --- client_asset_tickets_modal.php | 37 +++++++++++++++++ client_assets.php | 7 ++++ db.sql | 12 +++--- ticket.php | 75 +++++++++++++++++++++++++++++----- trip_add_modal.php | 2 +- 5 files changed, 116 insertions(+), 17 deletions(-) create mode 100644 client_asset_tickets_modal.php diff --git a/client_asset_tickets_modal.php b/client_asset_tickets_modal.php new file mode 100644 index 00000000..8fd33a46 --- /dev/null +++ b/client_asset_tickets_modal.php @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/client_assets.php b/client_assets.php index 43d68d81..d7708b51 100644 --- a/client_assets.php +++ b/client_assets.php @@ -268,6 +268,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); $login_id = $row['login_id']; $login_username = $row['login_username']; $login_password = decryptLoginEntry($row['login_password']); + + $sql_tickets = mysqli_query($mysqli,"SELECT * FROM tickets WHERE ticket_asset_id = $asset_id ORDER BY ticket_number DESC"); + $ticket_count = mysqli_num_rows($sql_tickets); ?> @@ -337,6 +340,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); @@ -347,6 +353,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); diff --git a/db.sql b/db.sql index 37834561..90e86c61 100644 --- a/db.sql +++ b/db.sql @@ -77,7 +77,7 @@ CREATE TABLE `assets` ( `asset_install_date` date DEFAULT NULL, `asset_reciept` varchar(200) DEFAULT NULL, `asset_notes` text DEFAULT NULL, - `asset_meshcentral_id` varchar(200) NOT NULL, + `client_meshcentral_group` varchar(200) DEFAULT NULL, `asset_created_at` datetime NOT NULL, `asset_updated_at` datetime DEFAULT NULL, `asset_archived_at` datetime DEFAULT NULL, @@ -239,7 +239,7 @@ CREATE TABLE `clients` ( `client_currency_code` varchar(200) NOT NULL, `client_net_terms` int(10) NOT NULL, `client_notes` text DEFAULT NULL, - `client_meshcentral_group` varchar(200) NOT NULL, + `client_meshcentral_group` varchar(200) DEFAULT NULL, `client_created_at` datetime NOT NULL, `client_updated_at` datetime DEFAULT NULL, `client_archived_at` datetime DEFAULT NULL, @@ -1116,9 +1116,9 @@ CREATE TABLE `settings` ( `config_stripe_enable` tinyint(1) DEFAULT NULL, `config_stripe_publishable` varchar(255) DEFAULT NULL, `config_stripe_secret` varchar(255) DEFAULT NULL, - `config_meshcentral_uri` varchar(200) NOT NULL, - `config_meshcentral_user` varchar(200) NOT NULL, - `config_meshcentral_secret` varchar(200) NOT NULL, + `config_meshcentral_uri` varchar(200) DEFAULT NULL, + `config_meshcentral_user` varchar(200) DEFAULT NULL, + `config_meshcentral_secret` varchar(200) DEFAULT NULL, PRIMARY KEY (`company_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1456,4 +1456,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-02-26 11:19:56 +-- Dump completed on 2022-02-27 16:53:14 diff --git a/ticket.php b/ticket.php index ab894a71..9deb0537 100644 --- a/ticket.php +++ b/ticket.php @@ -179,7 +179,7 @@ if(isset($_GET['ticket_id'])){
-

Ticket

+

Ticket

@@ -367,7 +367,7 @@ if(isset($_GET['ticket_id'])){
- Related tickets: Open | Closed | Total + Related tickets: Open | Closed | Total
- +
Closed by:
-
Total time worked:
+
Total time worked:
@@ -430,30 +430,30 @@ if(isset($_GET['ticket_id'])){

Asset

- Asset name: +
- OS: +
- IP: +
- Model: + Model:
- Service Tag: + Service Tag:
- Warranty expires: + Warranty expires:
+ + 0 ){ + ?> + + + + + + + +
diff --git a/trip_add_modal.php b/trip_add_modal.php index 7b2d20db..2625c08d 100644 --- a/trip_add_modal.php +++ b/trip_add_modal.php @@ -72,7 +72,7 @@