X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FArticles.pm;h=58ce36768fa1ef0d8394d5cbfa97ef6fc2a70014;hp=6800232969925b8864facd8bb39073ea541f4770;hb=187086c479a09629b7d180eec513fb7657f4e291;hpb=919e930aa9279b3c5cd12b593889cd6de79d67bf diff --git a/rt/lib/RT/Articles.pm b/rt/lib/RT/Articles.pm index 680023296..58ce36768 100644 --- a/rt/lib/RT/Articles.pm +++ b/rt/lib/RT/Articles.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2018 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -300,7 +300,8 @@ sub LimitCustomField { $self->Limit( ALIAS => $fields, FIELD => 'Name', VALUE => $args{'FIELD'}, - ENTRYAGGREGATOR => 'OR'); + ENTRYAGGREGATOR => 'OR', + CASESENSITIVE => 0); $self->Limit( ALIAS => $fields, FIELD => 'LookupType', @@ -388,15 +389,15 @@ sub LimitCustomField { sub LimitTopics { my $self = shift; my @topics = @_; + return unless @topics; my $topics = $self->NewAlias('ObjectTopics'); $self->Limit( - ALIAS => $topics, - FIELD => 'Topic', - VALUE => $_, - ENTRYAGGREGATOR => 'OR' - ) - for @topics; + ALIAS => $topics, + FIELD => 'Topic', + OPERATOR => 'IN', + VALUE => [ @topics ], + ); $self->Limit( ALIAS => $topics, @@ -580,16 +581,10 @@ sub Search { } - require Time::ParseDate; foreach my $date (qw(Created< Created> LastUpdated< LastUpdated>)) { next unless ( $args{$date} ); - my ($seconds, $error) = Time::ParseDate::parsedate( $args{$date}, FUZZY => 1, PREFER_PAST => 1 ); - unless ( defined $seconds ) { - $RT::Logger->warning( - "Couldn't parse date '$args{$date}' by Time::ParseDate" ); - } my $date_obj = RT::Date->new( $self->CurrentUser ); - $date_obj->Set( Format => 'unix', Value => $seconds ); + $date_obj->Set( Format => 'unknown', Value => $args{$date} ); $dates->{$date} = $date_obj; if ( $date =~ /^(.*?)<$/i ) { @@ -897,22 +892,6 @@ sub Search { return 1; } - -=head2 NewItem - -Returns an empty new RT::Article item - -=cut - -sub NewItem { - my $self = shift; - return(RT::Article->new($self->CurrentUser)); -} - - - RT::Base->_ImportOverlays(); 1; - -1;