From 19a6f8f42264500f27bfd73d16004e3984f62882 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Thu, 20 Mar 2025 11:39:50 -0400 Subject: [PATCH] Use nearest text area instead of a static ID for AI rewording, started adding entity creations in contact details and auto selecting the contact when in contact details page --- ajax/ajax_asset_add.php | 445 ++++++++++++++++++++ contact_details.php | 20 + functions.php | 25 ++ js/ai_reword.js | 2 +- modals/admin_ticket_template_add_modal.php | 2 +- modals/admin_ticket_template_edit_modal.php | 2 +- modals/asset_add_modal.php | 31 +- modals/client_document_add_modal.php | 35 +- modals/client_file_upload_modal.php | 25 -- modals/credential_add_modal.php | 24 +- modals/recurring_ticket_add_modal.php | 2 +- modals/ticket_add_modal.php | 14 +- ticket.php | 1 - 13 files changed, 538 insertions(+), 90 deletions(-) create mode 100644 ajax/ajax_asset_add.php diff --git a/ajax/ajax_asset_add.php b/ajax/ajax_asset_add.php new file mode 100644 index 00000000..a17e7420 --- /dev/null +++ b/ajax/ajax_asset_add.php @@ -0,0 +1,445 @@ + + + + +
+ + + + +
+ +New Recurring Ticket + + New Asset + + + + New Credential + + + + New Document + + + + Upload file(s) + + $indentation$folder_name"; + + // Recursively display subfolders + display_folder_options($folder_id, $client_id, $indent + 1); + } } \ No newline at end of file diff --git a/js/ai_reword.js b/js/ai_reword.js index 7c080fe4..ef6eb8a9 100644 --- a/js/ai_reword.js +++ b/js/ai_reword.js @@ -1,5 +1,5 @@ document.getElementById('rewordButton').addEventListener('click', function() { - var textInput = document.getElementById('textInput'); + var textInput = this.closest('form').querySelector('textarea'); var ticketDescription = document.getElementById('ticketDescription'); var rewordButton = document.getElementById('rewordButton'); var undoButton = document.getElementById('undoButton'); diff --git a/modals/admin_ticket_template_add_modal.php b/modals/admin_ticket_template_add_modal.php index 84dbb430..5408a396 100644 --- a/modals/admin_ticket_template_add_modal.php +++ b/modals/admin_ticket_template_add_modal.php @@ -31,7 +31,7 @@
- +
diff --git a/modals/admin_ticket_template_edit_modal.php b/modals/admin_ticket_template_edit_modal.php index 76678dc1..9109e4ec 100644 --- a/modals/admin_ticket_template_edit_modal.php +++ b/modals/admin_ticket_template_edit_modal.php @@ -33,7 +33,7 @@
- +
diff --git a/modals/asset_add_modal.php b/modals/asset_add_modal.php index 128ffb7d..106afeb4 100644 --- a/modals/asset_add_modal.php +++ b/modals/asset_add_modal.php @@ -15,22 +15,22 @@ @@ -38,7 +38,7 @@
-
+
@@ -149,7 +149,7 @@
-
+
@@ -243,7 +243,7 @@
-
+
@@ -293,7 +293,12 @@ $contact_id = intval($row['contact_id']); $contact_name = nullable_htmlentities($row['contact_name']); ?> - + @@ -319,7 +324,7 @@
-
+
@@ -391,7 +396,7 @@
-
+
@@ -415,7 +420,7 @@
-
+
diff --git a/modals/client_document_add_modal.php b/modals/client_document_add_modal.php index e4010942..56026510 100644 --- a/modals/client_document_add_modal.php +++ b/modals/client_document_add_modal.php @@ -16,43 +16,18 @@
- +
- +
- $indentation$folder_name"; - - // Recursively display subfolders - display_folder_options($folder_id, $client_id, $indent + 1); - } - } - // Start displaying folder options from the root (parent_folder = 0) display_folder_options(0, $client_id); ?> @@ -61,12 +36,12 @@
- +
- +
diff --git a/modals/client_file_upload_modal.php b/modals/client_file_upload_modal.php index 965f1d6a..c91de85d 100644 --- a/modals/client_file_upload_modal.php +++ b/modals/client_file_upload_modal.php @@ -31,31 +31,6 @@ @@ -145,8 +145,7 @@
-
- +
@@ -154,7 +153,7 @@
- + -
+
diff --git a/modals/recurring_ticket_add_modal.php b/modals/recurring_ticket_add_modal.php index e37b2f44..b8a651b7 100644 --- a/modals/recurring_ticket_add_modal.php +++ b/modals/recurring_ticket_add_modal.php @@ -45,7 +45,7 @@
- +
diff --git a/modals/ticket_add_modal.php b/modals/ticket_add_modal.php index db805b52..13a5c9cc 100644 --- a/modals/ticket_add_modal.php +++ b/modals/ticket_add_modal.php @@ -14,13 +14,13 @@ @@ -30,7 +30,7 @@
-
+
@@ -207,7 +207,7 @@ -
+
@@ -246,7 +246,7 @@ ?>