diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2017-08-06 10:11:28 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2017-08-06 10:11:28 -0700 |
| commit | de9d037528895f7151a9aead6724ce2df95f9586 (patch) | |
| tree | 3ba47a923a1d6033605ffc5586ed1af439d8c141 /rt/share/html/Articles/Elements/UpdatedArticles | |
| parent | b226bc6bd81f999176cdbfa53a799033ff0a0307 (diff) | |
rt 4.2.14 (#13852)
Diffstat (limited to 'rt/share/html/Articles/Elements/UpdatedArticles')
| -rw-r--r-- | rt/share/html/Articles/Elements/UpdatedArticles | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/rt/share/html/Articles/Elements/UpdatedArticles b/rt/share/html/Articles/Elements/UpdatedArticles index 1a365eeef..4c640a234 100644 --- a/rt/share/html/Articles/Elements/UpdatedArticles +++ b/rt/share/html/Articles/Elements/UpdatedArticles @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -72,10 +72,20 @@ <%INIT> my $rows = 10; my $i; + +my $Classes = RT::Classes->new($session{'CurrentUser'}); +$Classes->LimitToEnabled; +my @classes; +while (my $Class = $Classes->Next) { + push @classes, $Class->id if $Class->CurrentUserHasRight('ShowArticle'); +} + my $MyArticles; $MyArticles = RT::Articles->new($session{'CurrentUser'}); -$MyArticles->RowsPerPage($rows); +$MyArticles->Limit(FIELD => 'Class', OPERATOR => 'IN', VALUE => \@classes) + if @classes; $MyArticles->Limit(FIELD => 'Created', OPERATOR => '!=', VALUE => 'LastUpdated', QUOTEVALUE => 0 ); +$MyArticles->RowsPerPage($rows); $MyArticles->OrderBy(FIELD => 'Created', ORDER => 'DESC'); </%INIT> |
