diff options
author | Yorhel <git@yorhel.nl> | 2020-07-25 14:03:37 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2020-07-25 14:03:37 +0200 |
commit | 025ab84a962f3c61fd4217f1518ef4928bf72bf3 (patch) | |
tree | 3c553ead5033006e51736922720af2f41568d8c7 /lib/VNWeb/Misc/History.pm | |
parent | 40ea78ddfa265daea03f9904784bc0c35980b894 (diff) |
Reports: Allow reporting DB entries
Diffstat (limited to 'lib/VNWeb/Misc/History.pm')
-rw-r--r-- | lib/VNWeb/Misc/History.pm | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/VNWeb/Misc/History.pm b/lib/VNWeb/Misc/History.pm index 26ef5f48..7ce5584f 100644 --- a/lib/VNWeb/Misc/History.pm +++ b/lib/VNWeb/Misc/History.pm @@ -170,19 +170,7 @@ sub filters_ { TUWF::get qr{/(?:([upvrcsd])([1-9]\d*)/)?hist} => sub { my($type, $id) = (tuwf->capture(1)||'', tuwf->capture(2)); - my sub dbitem { - my($table, $title) = @_; - tuwf->dbRowi('SELECT id,', $title, ' AS title, hidden AS entry_hidden, locked AS entry_locked FROM', $table, 'WHERE id =', \$id); - }; - - my $obj = !$type ? undef : - $type eq 'u' ? tuwf->dbRowi('SELECT id, ', sql_user(), 'FROM users u WHERE id =', \$id) : - $type eq 'p' ? dbitem producers => 'name' : - $type eq 'v' ? dbitem vn => 'title' : - $type eq 'r' ? dbitem releases => 'title' : - $type eq 'c' ? dbitem chars => 'name' : - $type eq 's' ? dbitem staff => '(SELECT name FROM staff_alias WHERE aid = staff.aid)' : - $type eq 'd' ? dbitem docs => 'title' : die; + my $obj = dbobj $type, $id; return tuwf->resNotFound if $type && !$obj->{id}; $obj->{title} = user_displayname $obj if $type eq 'u'; |