X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FArticles%2FElements%2FUpdatedArticles;h=4c640a2349e1fb8f34d2de864473647233cef1e9;hb=de9d037528895f7151a9aead6724ce2df95f9586;hp=f2c5226be785d4728c5f34c2164c4378904e4bd7;hpb=f3c4966ed1f6ec3db7accd6dcdd3a5a3821d72a7;p=freeside.git diff --git a/rt/share/html/Articles/Elements/UpdatedArticles b/rt/share/html/Articles/Elements/UpdatedArticles index f2c5226be..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-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -45,7 +45,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/TitleBoxStart, title => loc("[_1] most recently updated articles", $rows), bodyclass=> '' &> +<& /Widgets/TitleBoxStart, title => loc("[_1] most recently updated articles", $rows), bodyclass=> '' &> @@ -68,14 +68,24 @@ % }
<&|/l&>#
-<& /Elements/TitleBoxEnd &> +<& /Widgets/TitleBoxEnd &> <%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');