Commit Graph

308 Commits

Author SHA1 Message Date
fs
c6c5d06936 feat(audit): harden API audit log redaction and schema
- Change query_json column from TEXT to JSON, ip/user_agent to CHAR(64)
  for PII redaction compliance
- Update repository, service, and views for hardened schema
- Add architecture contract test for security logging redaction
- Add search resource provider test coverage
- Include DB migration script for existing installs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 23:20:55 +02:00
fs
c2a7d6b789 fix(helpdesk): remove redundant margin-left from file preview and link
The timeline indent is handled by the parent activity container,
not individual file elements.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 23:09:31 +02:00
fs
2d016afb1f fix(helpdesk): add data-type=image hint for FsLightbox cache reuse
FsLightbox uses data-type to skip content detection. Combined with
Cache-Control: max-age=3600 on the proxy, the browser should serve
the lightbox image from cache instead of making a second SOAP call.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 23:05:47 +02:00
fs
8187c9b4dd feat(helpdesk): add skeleton loader and lightbox for image previews
- Skeleton shimmer placeholder shown while SOAP image loads
- onload hides skeleton, onerror hides entire preview
- data-fslightbox="ticket-files" on image link enables FsLightbox
  overlay (auto-detected by global MutationObserver)
- cursor: zoom-in on preview images
- Gallery name "ticket-files" groups all images in the feed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 23:03:13 +02:00
fs
5730a9a7b7 feat(helpdesk): add inline image preview for ticket file attachments
Proxy endpoint supports ?inline=1 parameter that serves images with
correct Content-Type and Content-Disposition: inline. Uses fpassthru
via php://memory stream to bypass MintyPHP Analyzer restrictions.

Frontend always attempts image preview via <img> tag. Non-image files
gracefully hide the preview via onerror handler. Download link shown
for all file types regardless.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 23:00:06 +02:00
fs
f40b23d2b0 fix(helpdesk): detect file extension from magic bytes when filename has none
OData TicketLog doesn't expose the original filename (DataText field).
When the derived filename has no extension, detect the file type from
magic bytes (PNG, JPEG, GIF, PDF, ZIP) and append the correct extension.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:58:12 +02:00
fs
f1c9c414a6 fix(helpdesk): resolve contactNo from ticket for SOAP file authorization
BC's GetTicketFile requires a valid contactNo for authorization.
The endpoint now accepts ticketNo, loads the ticket via OData to get
Current_Contact_Name, looks up the contact's No, and passes it to
the SOAP call. Frontend includes ticketNo in the file download URL.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:56:11 +02:00
fs
2b2f41ebab fix(helpdesk): extract SOAP fault detail from GetTicketFile error responses
Show the actual BC error message instead of just 'HTTP 500' to help
diagnose authentication and parameter issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:55:12 +02:00
fs
c2eba3e671 fix(helpdesk): add empty ticketNo field to GetTicketFile SOAP envelope
BC expects all four parameters in the envelope even if ticketNo is
empty. The entry number alone should be sufficient to identify the file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:54:22 +02:00
fs
f974ca4fd4 fix(helpdesk): add security headers and size limit to file proxy
- X-Content-Type-Options: nosniff prevents MIME sniffing
- Content-Security-Policy: sandbox prevents script execution
- 20 MB size limit on decoded file data (413 on exceed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:53:46 +02:00
fs
2c2392b398 fix(helpdesk): address code review findings for ticket files
- Use Router::download() instead of die() to avoid Analyzer rejection
- Add 5 PHPUnit tests for BcSoapGateway::getTicketFile() (F-001)
- Add test for file metadata on communication entries (F-002)
- Add rel=noopener noreferrer on target=_blank links (F-003)
- Add aria-hidden on download icon, aria-label on image link (F-003)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:53:17 +02:00
fs
6ce5f9a547 fix(helpdesk): use die() instead of echo for file proxy output
MintyPHP Analyzer rejects echo in action files. Use die() which is
the same pattern as Router::download() internally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:50:28 +02:00
fs
792f706d9e feat(helpdesk): add ticket file download and inline image preview
New SOAP method getTicketFile() on BcSoapGateway calls BC's
GetTicketFile to retrieve file attachments as Base64, decodes in
memory and returns binary data without writing to disk.

New proxy endpoint helpdesk/ticket-file-data streams files directly
to the browser with correct MIME type. Images served inline, other
files as download attachment.

TicketCommunicationService now attaches file_entry_no and file_name
to file-type events. Frontend renders download links with bi-download
icon and inline image previews for jpg/png/gif attachments.

Works in both ticket detail and debitor detail communication feeds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:49:01 +02:00
fs
659a6d71c5 fix(helpdesk): only resolve most recent support code on reassigned tickets
When a ticket was reassigned (multiple support codes), all codes were
mapped to the current Support_User_Name — replacing the previous
agent's name with the new one on older entries.

Now: if multiple support codes exist, only the code from the most
recent entry is mapped to the current name. Older codes remain as
abbreviations, preserving the actual history of who worked on what.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:26:25 +02:00
fs
fbe8140937 fix(helpdesk): drop redundant SOAP message entries when OData has them
When the SOAP message map is applied to OData entries, the message text
is already embedded in the OData entries. The separate SOAP message
entries then cause duplicates with different actor/timestamp metadata.

Now: when soapMessageMap was used, filter out SOAP entries with
type_variant 'message' since they are already represented in OData.
Non-message SOAP entries (status, activity) are kept.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:21:28 +02:00
fs
640da8245d feat(helpdesk): add refresh button to ticket detail titlebar
Adds 'Refresh data' button that re-fetches the communication feed
with ?refresh=1 to bypass the session cache. Shows loading skeleton
during reload.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:19:15 +02:00
fs
66be390fa9 fix(helpdesk): remove actor from dedup signature to prevent duplicate entries
SOAP entries often have an empty actor while OData entries have a code
like 'NKS'. After name resolution, one becomes 'Nikita Soldatov' and
the other stays empty — producing different signatures and causing
duplicates. The actor is not a reliable dedup field since the same
event can have different actor representations across sources.

Dedup now uses: ticket_no + timestamp_iso + type + message_hash.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:13:04 +02:00
fs
be4d89b6fe fix(helpdesk): remove 'Ticket communication' section title entirely
Remove the heading and the CSS override — communication feed starts
directly without a title in the ticket detail view.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:07:16 +02:00
fs
2bb01e1eab fix(helpdesk): hide section title divider line in ticket detail communication
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:06:28 +02:00
fs
c958f68738 fix(helpdesk): replace ticket detail KPI tiles with unified label/value list
Remove the Status and Age KPI metric tiles from the ticket aside.
Merge all information into a single definition list: Status, Description,
Company, Contact, Category, Support, Created, Last activity, Age.
Consistent with the label/value pattern used across all detail views.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:05:20 +02:00
fs
a3dedde7bf fix(helpdesk): use single continuous timeline line instead of per-item segments
The timeline line between communication entries had gaps because each
item drew its own ::before segment with fixed overlap that didn't match
the feed gap. Replace with a single continuous ::before line on the
feed container. Item dots (::after) remain per-item. Works robustly
regardless of gap size or item height.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:04:31 +02:00
fs
d6835d3b7b fix(helpdesk): remove contracts KPI section from support dashboard
The Contracts & products KPI tiles (active contracts, monthly volume,
support hours, next invoicing) distract from the ticket-focused support
view. Contract data remains available in the dedicated Sales tab.

Removes: section HTML, skeleton placeholder, JS render function + call.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:01:50 +02:00
fs
bdeb2b9970 fix(helpdesk): clicking sidebar icon opens nav panel instead of navigating
Set href to empty string so the Helpdesk sidebar icon toggles the
navigation panel open/closed without navigating to the customers page.
Same pattern as the bookmarks module.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 21:49:24 +02:00
fs
1a77c2c9b3 fix(helpdesk): remove back button from team dashboard titlebar
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 21:37:59 +02:00
fs
daab2f4999 fix(helpdesk): default period to 30 days and show trend timeframe hint
Change default period from 90 to 30 days for a more current snapshot.
Add legend footnote: '↑↓ Trend basiert auf den letzten 30 Tagen'
so the user knows what the arrows refer to.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 21:15:05 +02:00
fs
e659bd5bc5 fix(helpdesk): remove overflow:hidden from team widget to fix tooltip clipping
Move border-radius to the section title header directly instead of
relying on overflow:hidden on the parent. Tooltips on trend arrows
are no longer clipped by the card boundary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 21:12:59 +02:00
fs
be58cb4426 feat(helpdesk): add tooltip on trend arrow explaining backlog direction
Hover over ↑/↓ shows a data-tooltip explaining the delta in plain
language: 'More tickets received than resolved — backlog is growing.'

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 21:11:28 +02:00
fs
f2aa45dd2c feat(helpdesk): add trend delta indicator per agent in team dashboard
Shows a small arrow next to the ticket count in each agent card header:
↑3 (orange) = received 3 more than resolved → backlog growing
↓2 (green) = resolved 2 more than received → backlog shrinking
Hidden when delta is 0 (stable).

Delta is computed from received_in_period (tickets created in the
selected period assigned to this agent) minus resolved_in_period.
No snapshot storage needed — derived from existing ticket data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 21:09:52 +02:00
fs
671105e359 revert(helpdesk): remove queue separation from team dashboard
Revert queue detection, wait time summary, and visual separation.
All members are treated equally again — queue appears as a normal
agent entry sorted by the existing criteria.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 21:05:12 +02:00
fs
fe1a0b2f78 fix(helpdesk): match queue name 'Wartschlange' (BC spelling without e)
BC uses 'Wartschlange Customer Care' not 'Warteschlange'. Match on
common stem 'wartschlang' to cover both spellings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 21:02:52 +02:00
fs
81dc642d34 feat(helpdesk): separate queue from agents in team dashboard with wait time
Queue detection: any member with 'warteschlange' in support_user name
(or empty) is treated as queue, not as a regular agent.

Current tab: queue cards shown at top with a wait time summary
(Ø/Min/Max from open ticket ages). Agents listed below.

Historical tab: queue cards shown before agents, same performance
widget pattern.

No backend changes — purely client-side separation using existing data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:56:31 +02:00
fs
1c6bcd6ec3 fix(helpdesk): move resolution time to last column in performance grid
Reorder: Top customers | Top categories | Resolution time.
More logical flow — pick a filter on the left, see the result on the right.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:41:39 +02:00
fs
5c0364f687 feat(helpdesk): clickable top customers/categories filter resolution times
Clicking a customer or category in the Historical tab recalculates
Ø/Min/Max resolution times for only that filter. Click again to reset.
All computation is client-side from resolved_details already in the
response — no extra API calls. Active filter highlighted with primary
color, resolution values turn primary when filtered.

Backend now includes resolved_ticket_details per agent (customer_name,
category, resolution_hours) for client-side filtering.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:31:08 +02:00
fs
fc98f2684a fix(helpdesk): consolidation fixes from drift/performance/security review
- Fix docblock: getTicketsForTeam() uses PBI_FP_Tickets, not LV
- Process_Stage check now uses isset() guard — FP entity does not
  expose this field, prevents false positives from default 0
- Remove exception message from JSON error response (security)
- Remove dead JS functions: formatAge(), formatDate()
- Remove debug console.error and verbose error display from JS

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:25:51 +02:00
fs
b82cef31a6 fix(helpdesk): replace generic loading with card-shaped skeleton placeholders
Skeleton loading now mirrors the actual agent card layout: bordered card
with header (avatar circle + name bar + badge) and three table-like rows.
Removes aria-busy toggle from JS. Three skeleton cards shown during load.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:19:11 +02:00
fs
e819e235a2 fix(helpdesk): add vertical dividers between performance stat columns
Subtle border-left separates the three insight areas for better
readability. On mobile, switches to border-top between stacked items.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:17:15 +02:00
fs
82266fb289 fix(helpdesk): unify resolution time layout with ranked list pattern
Replace the custom Ø/Min/Max column layout with the same ranked list
component used for top customers and categories. All three columns
now use identical markup and styling for visual consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:13:26 +02:00
fs
4ce7a32bfc feat(helpdesk): redesign Historical tab with per-agent performance widgets
Each agent gets a card with three insight columns:
- Resolution time: Ø / Min / Max (formatted as hours or days)
- Top 3 customers by resolved ticket count (ranked list)
- Top 3 categories by resolved ticket count (ranked list)

Backend collects resolved ticket details per agent: customer names,
categories, and resolution hours. Aggregates top-3 and min/max/avg.
Replaces the old compact single-row layout with rich widget cards
matching the Current tab pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:11:44 +02:00
fs
7a574768db fix(helpdesk): rename Performance tab to Historical
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:07:08 +02:00
fs
b817ebf662 fix(helpdesk): rename navigation and title to 'Team dashboard'
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:05:09 +02:00
fs
b667ecca0c fix(helpdesk): show 'System' instead of 'Unknown user' for empty actors
Ticket log entries without Created_By (e.g. system-generated) now show
'System' instead of 'Unbekannter Benutzer'. Missing timestamps show
a dash instead of 'Unbekannte Zeit'.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:03:50 +02:00
fs
c80e317875 fix(helpdesk): fix contact name resolution when customerNo is empty
getContactsForCustomerWithMeta() returned early when customerNo OR
customerName was empty. The communication service calls it with empty
customerNo and only customerName — which always hit the early return,
preventing any contact lookup. Fix: only return early when BOTH are
empty, so the primary Company_Name query path works correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:02:05 +02:00
fs
422746d141 fix(helpdesk): resolve all support actor codes instead of requiring exactly one per ticket
The previous logic only resolved support user codes to full names when
exactly one unique support code existed per ticket. Tickets with multiple
support codes (e.g. after reassignment) left all codes unresolved,
showing abbreviations like 'NKS' or 'FA' instead of full names.

Now: every support-role actor code in a ticket is mapped to that ticket's
Support_User_Name. For the debitor feed, codes are mapped on first
encounter to avoid conflicts from reassigned tickets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:00:50 +02:00
fs
4a62ed07e9 fix(helpdesk): prevent vertical text in table headers on narrow viewports
Add white-space:nowrap + overflow:hidden on th elements. Set min-width
on table so columns never shrink below readable size — scroll wrapper
handles the overflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 19:53:37 +02:00
fs
bc0e4e64a8 fix(helpdesk): wrap team ticket tables in scroll container for responsive
Table keeps its fixed column widths and becomes horizontally scrollable
on narrow viewports instead of breaking the layout.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 19:52:52 +02:00
fs
b028ecf0be fix(helpdesk): widen ticket, category and activity columns
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 19:52:27 +02:00
fs
3c0d3bb6f4 fix(helpdesk): consistent table columns across agent cards via colgroup
Use table-layout:fixed with colgroup defining column widths in ch units.
Every agent card table gets the same colgroup, ensuring identical column
alignment across all cards. Ticket (9ch), Customer (22ch), Category
(16ch), Activity (11ch) are fixed; Description takes remaining space
with ellipsis. All cells get overflow:hidden + text-overflow:ellipsis.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 19:51:20 +02:00
fs
3123b8aa77 fix(helpdesk): edge-to-edge table in cards, larger avatar, sort by urgency
- Remove card padding, table goes full-width inside card border
- Section title gets own padding + subtle background as card header
- Avatar inline size increased from 1.6rem to 2rem
- Sort agents by critical tickets first (most urgent on top),
  then by open tickets. Unassigned queue stays last.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 19:49:40 +02:00
fs
9e94456759 feat(helpdesk): switch team query to PBI_FP_Tickets for richer data
FP entity provides Company_Contact_Name (full customer name),
Category_1_Description (readable category), and Last_Activity_By_Code.
Customer column shows name instead of number. Category shows readable
description instead of code. Debitor link only rendered when
customer_no is available (FP may not expose it).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 19:47:10 +02:00
fs
d214f08c3f feat(helpdesk): add Description and Cust_Name from LV entity to team table
PBI_LV_Tickets exposes Description and Cust_Name (not Company_Contact_Name
which is FP-only). Add both to select. Table now shows 5 columns:
Ticket (link) | Customer name (link) | Description (ellipsis) |
Category | Last activity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 19:44:53 +02:00