Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.1] - 2026-11-08

### Fixed

- The tick and the More-menu entry were missing when the ticket view was opened by number (`scp/tickets.php?number=…`); the plugin now finds the ticket the way osTicket does, by ID or by number.

## [0.2.0] - 2026-11-08

### Added
Expand Down Expand Up @@ -45,7 +51,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Retention: rows are deleted after 24 months; the IP is stored only as a keyed hash.
- Mail in the style of a brand line over an accent rule, buttons as table cells, a grey footer with an AI notice; texts editable, German (informal) and English built in.

[Unreleased]: https://github.com/studio-prisma/osticket-plugin-feedback/compare/v0.2.0...HEAD
[Unreleased]: https://github.com/studio-prisma/osticket-plugin-feedback/compare/v0.2.1...HEAD
[0.2.1]: https://github.com/studio-prisma/osticket-plugin-feedback/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/studio-prisma/osticket-plugin-feedback/compare/v0.1.1...v0.2.0
[0.1.1]: https://github.com/studio-prisma/osticket-plugin-feedback/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/studio-prisma/osticket-plugin-feedback/releases/tag/v0.1.0
2 changes: 1 addition & 1 deletion class.FeedbackPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
class FeedbackPlugin extends Plugin
{
/** Mirrors plugin.php. */
public const VERSION = '0.2.0';
public const VERSION = '0.2.1';

/** Route bases, relative to the help desk root. */
public const CLIENT_BASE = 'ajax.php/feedback';
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

return array(
'id' => 'studio-prisma:feedback',
'version' => '0.2.0',
'version' => '0.2.1',
'ost_version' => '1.18',
'name' => 'Feedback',
'author' => 'Studio Prisma',
Expand Down
18 changes: 16 additions & 2 deletions src/FeedbackUi.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,26 @@ public static function maybeStart(array $s): void
return;
}
$script = str_replace('\\', '/', (string) ($_SERVER['SCRIPT_NAME'] ?? ''));
if (preg_match('#/scp/tickets\.php$#', $script) !== 1 || !isset($_GET['id'])) {
if (preg_match('#/scp/tickets\.php$#', $script) !== 1 || (!isset($_REQUEST['id']) && !isset($_REQUEST['number']))) {
return;
}
ob_start(array(__CLASS__, 'inject'));
}

/** The ticket the view shows, found the way scp/tickets.php finds it: by ID, else by number. */
private static function viewedTicket(): ?Ticket
{
$id = $_REQUEST['id'] ?? null;
if (is_scalar($id) && ctype_digit((string) $id)) {
return Ticket::lookup((int) $id) ?: null;
}
$number = $_REQUEST['number'] ?? null;
if (is_scalar($number) && preg_match('/^[A-Za-z0-9_-]{1,32}$/', (string) $number) === 1) {
return Ticket::lookup(array('number' => (string) $number)) ?: null;
}
return null;
}

/** Output-buffer callback: adds the script to a ticket view (full page or PJAX fragment). */
public static function inject($buffer)
{
Expand All @@ -40,7 +54,7 @@ public static function inject($buffer)
return $buffer;
}
$staff = $GLOBALS['thisstaff'] ?? null;
$ticket = Ticket::lookup((int) ($_GET['id'] ?? 0));
$ticket = self::viewedTicket();
if (!$staff instanceof Staff || !$ticket || !$ticket->checkStaffPerm($staff)) {
return $buffer;
}
Expand Down
10 changes: 10 additions & 0 deletions tests/e2e/9-decide.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@ test('UI: status dialog carries the tick; removing it closes without a question'
expect(errors).toEqual([]);
});

test('UI: also on a view opened by ticket number (tickets.php?number=)', async ({ page }) => {
const id = newTicket('0.2.1 ui number');
reply(id, 'admin', 'Antwort.');
const num = sql(`SELECT number FROM ost_ticket WHERE ticket_id=${id}`);
await staffLogin(page, 'admin');
await page.goto(`/scp/tickets.php?number=${num}`);
await expect(page.locator('form#reply .spf-ask')).toHaveCount(1);
await expect(page.locator('#action-dropdown-more li.spf-menu')).toHaveCount(1);
});

test('UI: no tick and no menu entry where the rules never ask (Alerts)', async ({ page }) => {
const id = newTicket('0.2 ui alert', { dept: seed.depts.alerts });
reply(id, 'admin', 'Gesehen.');
Expand Down
Loading