summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-04-30 16:28:49 +0200
committerYorhel <git@yorhel.nl>2011-04-30 16:28:49 +0200
commit76b970a49e1d6374a3ec351debcf846ee00b78c0 (patch)
treef4dcd24cfb0ddc4e94ad13db055563d0501444fe /lib
parent28cf4e0e79487d82a325238105f670713b20bf85 (diff)
Added "All except characters" filter to history browser
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/DB/Misc.pm3
-rw-r--r--lib/VNDB/Handler/Misc.pm5
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/VNDB/DB/Misc.pm b/lib/VNDB/DB/Misc.pm
index 2f98abe2..3155ca56 100644
--- a/lib/VNDB/DB/Misc.pm
+++ b/lib/VNDB/DB/Misc.pm
@@ -64,6 +64,7 @@ sub dbRevisionGet {
# what types should we join?
my @types = (
!$o{type} ? ('v', 'r', 'p', 'c') :
+ ref($o{type}) ? @{$o{type}} :
$o{type} ne 'v' ? $o{type} :
$o{releases} ? ('v', 'r') : 'v'
);
@@ -73,7 +74,7 @@ sub dbRevisionGet {
q{((h.type = 'v' AND vr.vid = ?) OR (h.type = 'r' AND h.id = ANY(ARRAY(SELECT rv.rid FROM releases_vn rv WHERE rv.vid = ?))))} => [$o{iid}, $o{iid}],
) : (
$o{type} ? (
- 'h.type = ?' => $o{type} ) : (),
+ 'h.type IN(!l)' => [ ref($o{type})?$o{type}:[$o{type}] ] ) : (),
$o{iid} ? (
'!sr.!sid = ?' => [ $o{type}, $o{type}, $o{iid} ] ) : (),
),
diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm
index 8f5b4949..167cc152 100644
--- a/lib/VNDB/Handler/Misc.pm
+++ b/lib/VNDB/Handler/Misc.pm
@@ -196,7 +196,7 @@ sub history {
{ get => 'p', required => 0, default => 1, template => 'int' },
{ get => 'm', required => 0, default => !$type, enum => [ 0, 1 ] },
{ get => 'h', required => 0, default => 0, enum => [ -1..1 ] },
- { get => 't', required => 0, default => '', enum => [qw|v r p c|] },
+ { get => 't', required => 0, default => '', enum => [qw|v r p c a|] },
{ get => 'e', required => 0, default => 0, enum => [ -1..1 ] },
{ get => 'r', required => 0, default => 0, enum => [ 0, 1 ] },
);
@@ -216,7 +216,7 @@ sub history {
what => 'item user',
$type && $type ne 'u' ? ( type => $type, iid => $id ) : (),
$type eq 'u' ? ( uid => $id ) : (),
- $f->{t} ? ( type => $f->{t} ) : (),
+ $f->{t} ? ( type => $f->{t} eq 'a' ? [qw|v r p|] : $f->{t} ) : (),
page => $f->{p},
results => 50,
auto => $f->{m},
@@ -262,6 +262,7 @@ sub history {
a $f->{t} eq 'r' ? (class => 'optselected') : (), href => $u->(t => 'r'), mt '_hist_filter_onlyreleases';
a $f->{t} eq 'p' ? (class => 'optselected') : (), href => $u->(t => 'p'), mt '_hist_filter_onlyproducers';
a $f->{t} eq 'c' ? (class => 'optselected') : (), href => $u->(t => 'c'), mt '_hist_filter_onlychars';
+ a $f->{t} eq 'a' ? (class => 'optselected') : (), href => $u->(t => 'a'), mt '_hist_filter_nochars';
end;
p class => 'browseopts';
a !$f->{e} ? (class => 'optselected') : (), href => $u->(e => 0), mt '_hist_filter_allactions';