~bestpractical/rt/master

« back to all changes in this revision

Viewing changes to lib/RT/Interface/Web.pm

  • Committer: sunnavy
  • Date: 2023-10-19 19:45:11 UTC
  • mfrom: (8471.1.577)
  • Revision ID: git-v1:9fca83d11d15fb8034308194b9c9052d5df7d454
Merge branch '5.0-trunk'

Show diffs side-by-side

added added

removed removed

Lines of Context:
4439
4439
        MaybeRedirectForResults(
4440
4440
            Actions   => \@results,
4441
4441
            Path      => $path,
 
4442
            $params{PassArguments} ? ( Arguments => $params{PassArguments} ) : (),
4442
4443
        );
4443
4444
    }
4444
4445
 
5387
5388
            push @results, loc("Please enter your current password correctly.");
5388
5389
        }
5389
5390
        else {
 
5391
            my $expires;
 
5392
            if ( defined $args_ref->{'Expires'} and $args_ref->{'Expires'} =~ /\S/ ) {
 
5393
                $expires = RT::Date->new( $session{CurrentUser} );
 
5394
                $expires->Set( Format => 'unknown', Value => $args_ref->{'Expires'} );
 
5395
            }
5390
5396
            my ( $ok, $msg, $auth_string ) = $token->Create(
5391
5397
                Owner       => $args_ref->{Owner},
5392
5398
                Description => $args_ref->{Description},
 
5399
                $expires ? ( Expires => $expires->ISO ) : (),
5393
5400
            );
5394
5401
            if ($ok) {
5395
5402
                push @results, $msg;
5912
5919
    return undef;
5913
5920
}
5914
5921
 
 
5922
sub PreprocessTransactionSearchQuery {
 
5923
    my %args = (
 
5924
        Query      => undef,
 
5925
        ObjectType => 'RT::Ticket',
 
5926
        @_
 
5927
    );
 
5928
 
 
5929
    my @limits;
 
5930
    if ( $args{ObjectType} eq 'RT::Ticket' ) {
 
5931
        @limits = (
 
5932
            q{TicketType = 'ticket'},
 
5933
            qq{ObjectType = '$args{ObjectType}'},
 
5934
            $args{Query} =~ /^\s*\(.*\)$/ ? $args{Query} : "($args{Query})"
 
5935
        );
 
5936
    }
 
5937
    else {
 
5938
        # Other ObjectTypes are not supported for now
 
5939
        @limits = 'id = 0';
 
5940
    }
 
5941
    return join ' AND ', @limits;
 
5942
}
 
5943
 
5915
5944
package RT::Interface::Web;
5916
5945
RT::Base->_ImportOverlays();
5917
5946