Fixed MAJOR bugs, currently at a semi-stable state

This commit is contained in:
2025-09-05 11:08:56 -04:00
parent 19f436a17c
commit e05434137c
14 changed files with 1559 additions and 1106 deletions

View File

@ -34,7 +34,7 @@
<div class="ticket-id">UUID <?php echo $ticket['ticket_id']; ?></div>
<div class="header-controls">
<div class="status-priority-group">
<span id="statusDisplay" class="status-<?php echo $ticket["status"]; ?>"><?php echo $ticket["status"]; ?></span>
<span id="statusDisplay" class="status-<?php echo str_replace(' ', '-', $ticket["status"]); ?>"><?php echo $ticket["status"]; ?></span>
<span class="priority-indicator priority-<?php echo $ticket["priority"]; ?>">P<?php echo $ticket["priority"]; ?></span>
</div>
<button id="editButton" class="btn" onclick="toggleEditMode()">Edit Ticket</button>
@ -86,14 +86,16 @@
foreach ($comments as $comment) {
echo "<div class='comment'>";
echo "<div class='comment-header'>";
echo "<span class='comment-user'>{$comment['user_name']}</span>";
echo "<span class='comment-user'>" . htmlspecialchars($comment['user_name']) . "</span>";
echo "<span class='comment-date'>" . date('M d, Y H:i', strtotime($comment['created_at'])) . "</span>";
echo "</div>";
echo "<div class='comment-text'>";
if ($comment['markdown_enabled']) {
// For markdown comments, use JavaScript to render
echo "<script>document.write(marked.parse(" . json_encode($comment['comment_text']) . "))</script>";
} else {
echo htmlspecialchars($comment['comment_text']);
// For non-markdown comments, convert line breaks to <br> and escape HTML
echo nl2br(htmlspecialchars($comment['comment_text']));
}
echo "</div>";
echo "</div>";
@ -103,7 +105,7 @@
</div>
</div>
<div class="ticket-footer">
<button onclick="window.location.href='<?php echo $GLOBALS['config']['BASE_URL']; ?>'" class="btn back-btn">Back to Dashboard</button>
<button onclick="window.location.href='/'" class="btn back-btn">Back to Dashboard</button>
</div>
</div>
<script>
@ -116,5 +118,17 @@
}
});
</script>
<script>
// Make ticket data available to JavaScript
window.ticketData = {
id: <?php echo json_encode($ticket['ticket_id']); ?>,
status: <?php echo json_encode($ticket['status']); ?>,
priority: <?php echo json_encode($ticket['priority']); ?>,
category: <?php echo json_encode($ticket['category']); ?>,
type: <?php echo json_encode($ticket['type']); ?>,
title: <?php echo json_encode($ticket['title']); ?>
};
console.log('Ticket data loaded:', window.ticketData);
</script>
</body>
</html>