-# itu requests
-if ($itu) {
- my @expr;
- my @hint;
- $expr .= ' && ' if $expr;
- $hint .= ' && ' if $hint;
- for (split /[:,]/, $itu) {
- push @expr, "\$f8==$_";
- push @hint, "m{$_}";
- }
- $expr .= @expr > 1 ? '(' . join(' || ', @expr) . ')' : $expr[0];
- $hint .= @hint > 1 ? '(' . join(' || ', @hint) . ')' : $hint[0];
-}
-if ($byitu) {
- my @expr;
- my @hint;
- $expr .= ' && ' if $expr;
- $hint .= ' && ' if $hint;
- for (split /[:,]/, $byitu) {
- push @expr, "\$f10==$_";
- push @hint, "m{$_}";
- }
- $expr .= @expr > 1 ? '(' . join(' || ', @expr) . ')' : $expr[0];
- $hint .= @hint > 1 ? '(' . join(' || ', @hint) . ')' : $hint[0];
-}
-
-# state requests
-if ($state) {
- my @expr;
- my @hint;
- $expr .= ' && ' if $expr;
- $hint .= ' && ' if $hint;
- for (split /[:,]/, $state) {
- push @expr, "\$f12 eq '$_'";
- push @hint, "m{$_}";
- }
- if ($usesql) {
- $expr .= @expr > 1 ? '(' . join(' || ', @expr) . ')' : "$expr[0]";
- } else {
- $expr .= @expr > 1 ? '(\$f12 && (' . join(' || ', @expr) . '))' : "(\$f12 && $expr[0])";
- }
- $hint .= @hint > 1 ? '(' . join(' || ', @hint) . ')' : $hint[0];
-}
-if ($bystate) {
- my @expr;
- my @hint;
- $expr .= ' && ' if $expr;
- $hint .= ' && ' if $hint;
- for (split /[:,]/, $bystate) {
- push @expr, "\$f13 eq '$_'";
- push @hint, "m{$_}";
+ $user ||= '';
+ dbg "sh/dx user: $user expr: $expr from: $from to: $to fromday: $fromday today: $today" if isdbg('sh/dx');
+
+ # now do the search
+
+ if ($self->{_nospawn}) {
+ my @res = Spot::search($expr, $fromday, $today, $from, $to, $user, $dofilter ? $self : undef);
+ my $ref;
+ my @dx;
+ foreach $ref (@res) {
+ if ($self && $self->ve7cc) {
+ push @out, VE7CC::dx_spot($self, @$ref);
+ }
+ else {
+ if ($self && $real) {
+ push @out, DXCommandmode::format_dx_spot($self, @$ref);
+ }
+ else {
+ push @out, Spot::formatl(@$ref);
+ }
+ }
+ }