Skip to content

Commit

Permalink
Add option to find disabled articles in search
Browse files Browse the repository at this point in the history
Previously, the search would only find enabled articles. This adds an
option to the search to include disabled articles in the results.
  • Loading branch information
richieri-bps committed Jan 30, 2024
1 parent 77539f7 commit 5f3de52
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions share/html/Articles/Article/Elements/ShowSearchCriteria
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@
</div>
</div>

<div class="form-row">
<div class="label col-3"></div>
<div class="value col-9">
<div class="custom-control custom-checkbox">
<input type="checkbox" id="FindDisabledArticles" name="FindDisabledArticles" class="custom-control-input" <% $ARGS{'FindDisabledArticles'} ? 'checked="checked"' : "" %> />
<label class="custom-control-label" for="FindDisabledArticles"><&|/l&>Include disabled articles in listing.</&></label>
</div>
</div>
</div>

<div class="form-row label">
<h5><&|/l&>Content</&></h5>
</div>
Expand Down
2 changes: 2 additions & 0 deletions share/html/Articles/Article/Search.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@
my $customfields = RT::CustomFields->new( $session{'CurrentUser'} );
my %dates;

$articles->FindAllRows if $ARGS{FindDisabledArticles};

$articles->Search( %ARGS, CustomFields => $customfields, Dates => \%dates,
OrderBy => \@OrderBy, Order => \@Order, );

Expand Down

0 comments on commit 5f3de52

Please sign in to comment.