From 0928a60c317e888a7ab5d3bcedc86e816b3a8d85 Mon Sep 17 00:00:00 2001 From: Ronaldo Richieri Date: Fri, 26 Jan 2024 13:55:27 -0300 Subject: [PATCH] Add option to find disabled articles in search Previously, the search would only find enabled articles. This adds an option to the search to include disabled articles in the results. --- .../html/Articles/Article/Elements/ShowSearchCriteria | 10 ++++++++++ share/html/Articles/Article/Search.html | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/share/html/Articles/Article/Elements/ShowSearchCriteria b/share/html/Articles/Article/Elements/ShowSearchCriteria index 2497cba1fc3..c2f2578e8af 100644 --- a/share/html/Articles/Article/Elements/ShowSearchCriteria +++ b/share/html/Articles/Article/Elements/ShowSearchCriteria @@ -99,6 +99,16 @@ +
+
+
+
+ /> + +
+
+
+
<&|/l&>Content
diff --git a/share/html/Articles/Article/Search.html b/share/html/Articles/Article/Search.html index 8eaa92334c5..7ffe65f3400 100644 --- a/share/html/Articles/Article/Search.html +++ b/share/html/Articles/Article/Search.html @@ -267,6 +267,12 @@ my $customfields = RT::CustomFields->new( $session{'CurrentUser'} ); my %dates; +if ( $ARGS{FindDisabledArticles} ) { + $articles->FindAllRows; +} else { + $articles->LimitToEnabled; +} + $articles->Search( %ARGS, CustomFields => $customfields, Dates => \%dates, OrderBy => \@OrderBy, Order => \@Order, );