fix: various inline style cleanup, a11y improvements, and bind_param bug

- Replace style="text-align:center" with .lt-text-center utility class in
  WorkflowDesignerView, CustomFieldsView, error_403, error_404, DashboardView JS string
- Replace style="margin-top:..." with .lt-mt-sm utility in WorkflowDesignerView
- Switch comment-edit-raw data-store textareas to .is-hidden class (TicketView PHP
  + JS-rendered; ticket.js template literal) — these are never shown, only read via .value
- Add aria-describedby="visibilityGroupsHint" + id on hint <p> in CreateTicketView
- Fix bind_param type string bug in manage_workflows.php PUT handler: 'ssiiiii' → 'ssiiii'
  (7 type chars for 6 params caused binding error on workflow transition updates)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 22:29:52 -04:00
parent ff109a710c
commit 84b104a501
9 changed files with 16 additions and 17 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ try {
$stmt = $conn->prepare("UPDATE status_transitions SET $stmt = $conn->prepare("UPDATE status_transitions SET
from_status = ?, to_status = ?, requires_comment = ?, requires_admin = ?, is_active = ? from_status = ?, to_status = ?, requires_comment = ?, requires_admin = ?, is_active = ?
WHERE transition_id = ?"); WHERE transition_id = ?");
$stmt->bind_param('ssiiiii', $stmt->bind_param('ssiiii',
$data['from_status'], $data['from_status'],
$data['to_status'], $data['to_status'],
$data['requires_comment'] ?? 0, $data['requires_comment'] ?? 0,
+1 -1
View File
@@ -1528,7 +1528,7 @@ function submitReply(parentCommentId) {
<div class="comment-text" id="comment-text-${data.comment_id}" ${isMarkdownEnabled ? 'data-markdown' : ''}> <div class="comment-text" id="comment-text-${data.comment_id}" ${isMarkdownEnabled ? 'data-markdown' : ''}>
${displayText} ${displayText}
</div> </div>
<textarea class="comment-edit-raw" id="comment-raw-${data.comment_id}" style="display:none;">${commentText.replace(/</g, '&lt;').replace(/>/g, '&gt;')}</textarea> <textarea class="comment-edit-raw is-hidden" id="comment-raw-${data.comment_id}">${commentText.replace(/</g, '&lt;').replace(/>/g, '&gt;')}</textarea>
</div> </div>
`; `;
+2 -2
View File
@@ -185,7 +185,7 @@ include __DIR__ . '/layout_header.php';
<p id="visibilityHint" class="lt-form-hint">Everyone who is logged in can view this ticket.</p> <p id="visibilityHint" class="lt-form-hint">Everyone who is logged in can view this ticket.</p>
</div> </div>
<div id="visibilityGroupsContainer" class="lt-form-group is-hidden" aria-live="polite"> <div id="visibilityGroupsContainer" class="lt-form-group is-hidden" aria-live="polite" aria-describedby="visibilityGroupsHint">
<label class="lt-label lt-text-cyan">Allowed Groups</label> <label class="lt-label lt-text-cyan">Allowed Groups</label>
<div class="visibility-groups-list lt-flex lt-flex-wrap lt-flex-gap-sm"> <div class="visibility-groups-list lt-flex lt-flex-wrap lt-flex-gap-sm">
<?php <?php
@@ -205,7 +205,7 @@ include __DIR__ . '/layout_header.php';
<span class="lt-text-muted lt-text-sm">No groups available</span> <span class="lt-text-muted lt-text-sm">No groups available</span>
<?php endif ?> <?php endif ?>
</div> </div>
<p class="lt-form-hint lt-form-hint--warn">Select at least one group for Internal visibility.</p> <p id="visibilityGroupsHint" class="lt-form-hint lt-form-hint--warn">Select at least one group for Internal visibility.</p>
</div> </div>
</div> </div>
</div> </div>
+1 -1
View File
@@ -1269,7 +1269,7 @@ if (advForm) advForm.addEventListener('submit', performAdvancedSearch);
(age ? '<div class="lt-kv-row"><span class="lt-kv-label">Age</span><span class="lt-kv-value">' + esc(age) + '</span></div>' : '') + (age ? '<div class="lt-kv-row"><span class="lt-kv-label">Age</span><span class="lt-kv-value">' + esc(age) + '</span></div>' : '') +
'</div>' + '</div>' +
'</div>' + '</div>' +
'<p class="lt-text-muted lt-text-xs" style="text-align:center">Click "Open Full Ticket" for description, comments &amp; attachments.</p>'; '<p class="lt-text-muted lt-text-xs lt-text-center">Click "Open Full Ticket" for description, comments &amp; attachments.</p>';
lt.rightDrawer.open('ticketPreviewDrawer'); lt.rightDrawer.open('ticketPreviewDrawer');
} }
+2 -3
View File
@@ -596,9 +596,8 @@ $progressClass = $slaBreached ? 'lt-progress--red' : ($slaPct >= 75 ? 'lt-progr
? htmlspecialchars($comment['comment_text']) ? htmlspecialchars($comment['comment_text'])
: nl2br(htmlspecialchars($comment['comment_text'])) ?> : nl2br(htmlspecialchars($comment['comment_text'])) ?>
</div> </div>
<textarea class="lt-input lt-textarea comment-edit-raw" <textarea class="lt-input lt-textarea comment-edit-raw is-hidden"
id="comment-raw-<?= $commentId ?>" id="comment-raw-<?= $commentId ?>"
style="display:none"
aria-hidden="true"><?= htmlspecialchars($comment['comment_text']) ?></textarea> aria-hidden="true"><?= htmlspecialchars($comment['comment_text']) ?></textarea>
</div> </div>
<?php if (!empty($comment['replies'])): ?> <?php if (!empty($comment['replies'])): ?>
@@ -1263,7 +1262,7 @@ document.addEventListener('DOMContentLoaded', function () {
'<div class="comment-text" id="comment-text-' + commentId + '"' + (mdEnabled ? ' data-markdown data-rendered="1"' : '') + '>' + '<div class="comment-text" id="comment-text-' + commentId + '"' + (mdEnabled ? ' data-markdown data-rendered="1"' : '') + '>' +
commentText + commentText +
'</div>' + '</div>' +
'<textarea class="lt-input lt-textarea comment-edit-raw" id="comment-raw-' + commentId + '" style="display:none" aria-hidden="true">' + '<textarea class="lt-input lt-textarea comment-edit-raw is-hidden" id="comment-raw-' + commentId + '" aria-hidden="true">' +
escapedRaw + escapedRaw +
'</textarea>' + '</textarea>' +
'</div>'; '</div>';
+1 -1
View File
@@ -50,7 +50,7 @@ include __DIR__ . '/../../views/layout_header.php';
<td data-label="Label"><strong><?= htmlspecialchars($field['field_label']) ?></strong></td> <td data-label="Label"><strong><?= htmlspecialchars($field['field_label']) ?></strong></td>
<td data-label="Type" class="lt-text-xs"><?= ucfirst($field['field_type']) ?></td> <td data-label="Type" class="lt-text-xs"><?= ucfirst($field['field_type']) ?></td>
<td data-label="Category" class="lt-text-xs"><?= htmlspecialchars($field['category'] ?? 'All') ?></td> <td data-label="Category" class="lt-text-xs"><?= htmlspecialchars($field['category'] ?? 'All') ?></td>
<td data-label="Required" style="text-align:center"> <td data-label="Required" class="lt-text-center">
<?= $field['is_required'] ? '<span class="lt-text-amber">✓</span>' : '<span class="lt-text-muted">—</span>' ?> <?= $field['is_required'] ? '<span class="lt-text-amber">✓</span>' : '<span class="lt-text-muted">—</span>' ?>
</td> </td>
<td data-label="Status"> <td data-label="Status">
+6 -6
View File
@@ -31,13 +31,13 @@ include __DIR__ . '/../../views/layout_header.php';
$toCount = 0; $toCount = 0;
if (isset($workflows)) { foreach ($workflows as $w) { if ($w['from_status'] === $status) $toCount++; } } if (isset($workflows)) { foreach ($workflows as $w) { if ($w['from_status'] === $status) $toCount++; } }
?> ?>
<div class="lt-card" style="text-align:center"> <div class="lt-card lt-text-center">
<span class="lt-status lt-status-<?= $slug ?>"><?= $status ?></span> <span class="lt-status lt-status-<?= $slug ?>"><?= $status ?></span>
<div class="lt-text-xs lt-text-muted lt-mt-sm">→ <?= $toCount ?> transition<?= $toCount !== 1 ? 's' : '' ?></div> <div class="lt-text-xs lt-text-muted lt-mt-sm">→ <?= $toCount ?> transition<?= $toCount !== 1 ? 's' : '' ?></div>
</div> </div>
<?php endforeach ?> <?php endforeach ?>
</div> </div>
<p class="lt-text-xs lt-text-muted" style="margin-top:0.5rem"> <p class="lt-text-xs lt-text-muted lt-mt-sm">
Define which status transitions are allowed. This controls what options appear in the status dropdown on tickets. Define which status transitions are allowed. This controls what options appear in the status dropdown on tickets.
</p> </p>
</div> </div>
@@ -69,17 +69,17 @@ include __DIR__ . '/../../views/layout_header.php';
<td data-label="From"> <td data-label="From">
<span class="lt-status lt-status-<?= $fromSlug ?>"><?= htmlspecialchars($wf['from_status']) ?></span> <span class="lt-status lt-status-<?= $fromSlug ?>"><?= htmlspecialchars($wf['from_status']) ?></span>
</td> </td>
<td class="lt-text-amber lt-text-xs" style="text-align:center">&rarr;</td> <td class="lt-text-amber lt-text-xs lt-text-center">&rarr;</td>
<td data-label="To"> <td data-label="To">
<span class="lt-status lt-status-<?= $toSlug ?>"><?= htmlspecialchars($wf['to_status']) ?></span> <span class="lt-status lt-status-<?= $toSlug ?>"><?= htmlspecialchars($wf['to_status']) ?></span>
</td> </td>
<td data-label="Req. Comment" style="text-align:center"> <td data-label="Req. Comment" class="lt-text-center">
<?= $wf['requires_comment'] ? '<span class="lt-text-cyan">✓</span>' : '<span class="lt-text-muted">—</span>' ?> <?= $wf['requires_comment'] ? '<span class="lt-text-cyan">✓</span>' : '<span class="lt-text-muted">—</span>' ?>
</td> </td>
<td data-label="Req. Admin" style="text-align:center"> <td data-label="Req. Admin" class="lt-text-center">
<?= $wf['requires_admin'] ? '<span class="lt-text-amber">✓</span>' : '<span class="lt-text-muted">—</span>' ?> <?= $wf['requires_admin'] ? '<span class="lt-text-amber">✓</span>' : '<span class="lt-text-muted">—</span>' ?>
</td> </td>
<td data-label="Active" style="text-align:center"> <td data-label="Active" class="lt-text-center">
<?= $wf['is_active'] <?= $wf['is_active']
? '<span class="lt-text-cyan">✓</span>' ? '<span class="lt-text-cyan">✓</span>'
: '<span class="lt-text-danger">✗</span>' ?> : '<span class="lt-text-danger">✗</span>' ?>
+1 -1
View File
@@ -10,7 +10,7 @@ include __DIR__ . '/../views/layout_header.php';
<div class="lt-frame" style="max-width:32rem;margin:4rem auto"> <div class="lt-frame" style="max-width:32rem;margin:4rem auto">
<span class="lt-frame-bl">╚</span><span class="lt-frame-br">╝</span> <span class="lt-frame-bl">╚</span><span class="lt-frame-br">╝</span>
<div class="lt-section-header lt-text-danger">[ 403 ] ACCESS DENIED</div> <div class="lt-section-header lt-text-danger">[ 403 ] ACCESS DENIED</div>
<div class="lt-section-body" style="text-align:center"> <div class="lt-section-body lt-text-center">
<p class="lt-text-muted lt-mb-md">You do not have permission to access this resource.</p> <p class="lt-text-muted lt-mb-md">You do not have permission to access this resource.</p>
<a href="/" class="lt-btn lt-btn-primary">&larr; Dashboard</a> <a href="/" class="lt-btn lt-btn-primary">&larr; Dashboard</a>
</div> </div>
+1 -1
View File
@@ -10,7 +10,7 @@ include __DIR__ . '/../views/layout_header.php';
<div class="lt-frame" style="max-width:32rem;margin:4rem auto"> <div class="lt-frame" style="max-width:32rem;margin:4rem auto">
<span class="lt-frame-bl">╚</span><span class="lt-frame-br">╝</span> <span class="lt-frame-bl">╚</span><span class="lt-frame-br">╝</span>
<div class="lt-section-header lt-text-amber">[ 404 ] NOT FOUND</div> <div class="lt-section-header lt-text-amber">[ 404 ] NOT FOUND</div>
<div class="lt-section-body" style="text-align:center"> <div class="lt-section-body lt-text-center">
<p class="lt-text-muted lt-mb-md">The page you requested does not exist.</p> <p class="lt-text-muted lt-mb-md">The page you requested does not exist.</p>
<a href="/" class="lt-btn lt-btn-primary">&larr; Dashboard</a> <a href="/" class="lt-btn lt-btn-primary">&larr; Dashboard</a>
</div> </div>