X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FArticles%2FElements%2FNewestArticles;h=7e105af3a28977d58029b3c2c2038e8d8fb2b020;hb=187086c479a09629b7d180eec513fb7657f4e291;hp=5b44a992847843e11d4fb4f836a34ab554bd1326;hpb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;p=freeside.git diff --git a/rt/share/html/Articles/Elements/NewestArticles b/rt/share/html/Articles/Elements/NewestArticles index 5b44a9928..7e105af3a 100644 --- a/rt/share/html/Articles/Elements/NewestArticles +++ b/rt/share/html/Articles/Elements/NewestArticles @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2018 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] newest articles", $rows), bodyclass=> '' &> +<& /Widgets/TitleBoxStart, title => loc("[_1] newest articles", $rows), bodyclass=> '' &> @@ -67,13 +67,22 @@ % }
<&|/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->UnLimit; +$MyArticles->Limit(FIELD => 'Class', OPERATOR => 'IN', VALUE => \@classes) + if @classes; $MyArticles->RowsPerPage($rows); $MyArticles->OrderBy(FIELD => 'LastUpdated', ORDER => 'DESC');