From 06de349fac742367559e3be7556f980f8878209c Mon Sep 17 00:00:00 2001 From: johnnyq Date: Wed, 19 Mar 2025 15:35:02 -0400 Subject: [PATCH] Expanded the Redact tool into ticket details area, generalized it to allow redaction in other areas as well --- ajax/ajax_ticket_reply_redact.php | 54 ++++++++++++++++++++++++++++ js/app.js | 59 ++++++++++++++++++++++++++++--- post/ai.php | 2 +- ticket.php | 56 +++++++++++++++++------------ 4 files changed, 143 insertions(+), 28 deletions(-) create mode 100644 ajax/ajax_ticket_reply_redact.php diff --git a/ajax/ajax_ticket_reply_redact.php b/ajax/ajax_ticket_reply_redact.php new file mode 100644 index 00000000..e38c2bf1 --- /dev/null +++ b/ajax/ajax_ticket_reply_redact.php @@ -0,0 +1,54 @@ + + + +
+ + + + + + + + + +
+ +[REDACTED]'; + + // Replace selected content with the new content + editor.selection.setContent(newContent); + } else { + alert('Please select a word to redact'); + } + } + }); + } +}); + + + // DateTime $('.datetimepicker').datetimepicker({ }); diff --git a/post/ai.php b/post/ai.php index 089b82af..a304c2e1 100644 --- a/post/ai.php +++ b/post/ai.php @@ -14,7 +14,7 @@ if (isset($_GET['ai_reword'])) { $inputJSON = file_get_contents('php://input'); $input = json_decode($inputJSON, TRUE); // Convert JSON into array. - $promptText = "reword with html format"; + $promptText = "reword"; $userText = $input['text']; // Preparing the data for the OpenAI Chat API request. diff --git a/ticket.php b/ticket.php index 4894a530..3f671946 100644 --- a/ticket.php +++ b/ticket.php @@ -792,30 +792,40 @@ if (isset($_GET['ticket_id'])) {
- -
- +
+ +