[Rt-commit] rt branch 5.0/add-disabled-articles-to-search created. rt-5.0.5-149-g0928a60c31

BPS Git Server git at git.bestpractical.com
Mon Jan 29 12:31:39 UTC 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/add-disabled-articles-to-search has been created
        at  0928a60c317e888a7ab5d3bcedc86e816b3a8d85 (commit)

- Log -----------------------------------------------------------------
commit 0928a60c317e888a7ab5d3bcedc86e816b3a8d85
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date:   Fri Jan 26 13:55:27 2024 -0300

    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.

diff --git a/share/html/Articles/Article/Elements/ShowSearchCriteria b/share/html/Articles/Article/Elements/ShowSearchCriteria
index 2497cba1fc..c2f2578e8a 100644
--- a/share/html/Articles/Article/Elements/ShowSearchCriteria
+++ b/share/html/Articles/Article/Elements/ShowSearchCriteria
@@ -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>
diff --git a/share/html/Articles/Article/Search.html b/share/html/Articles/Article/Search.html
index 8eaa92334c..7ffe65f340 100644
--- a/share/html/Articles/Article/Search.html
+++ b/share/html/Articles/Article/Search.html
@@ -267,6 +267,12 @@ if ($ARGS{'Save'}) {
 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, );
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list