%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2015 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)
%# 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=> '' &>
<table border="0" cellspacing="0" cellpadding="1" width="100%">
<tr>
<th align="right"><&|/l&>#</&></th>
</tr>
% }
</table>
-<& /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');
</%INIT>