%# BEGIN LICENSE BLOCK
%# 
%#  Copyright (c) 2002-2003 Jesse Vincent <jesse@bestpractical.com>
%#  
%#  This program is free software; you can redistribute it and/or modify
%#  it under the terms of version 2 of the GNU General Public License 
%#  as published by the Free Software Foundation.
%# 
%#  A copy of that license should have arrived with this
%#  software, but in any event can be snarfed from www.gnu.org.
%# 
%#  This program is distributed in the hope that it will be useful,
%#  but WITHOUT ANY WARRANTY; without even the implied warranty of
%#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%#  GNU General Public License for more details.
%# 
%# END LICENSE BLOCK

<& /Elements/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>
<TH ALIGN=LEFT><&|/l&>Name</&></TH>
<TH ALIGN=LEFT WIDTH="20%"><&|/l&>Created by</&></TH>
<TH>&nbsp;</TH>
</TR>

% while (my $Article = $MyArticles->Next) {
% $i++;
<TR class="<% $i%2 ? 'oddline' : 'evenline'%>" >                                
<TD ALIGN=RIGHT>
<%$Article->Id%>
</TD>
<TD>
<A HREF="<% $RT::WebPath %>/RTFM/Article/Display.html?id=<%$Article->Id%>">
        <%$Article->Name || loc('(no Name)')%>
</A>
</TD>
<TD>
<%$Article->CreatorObj->Name%>
</TD>
<TD ALIGN=RIGHT>
[<A HREF="<% $RT::WebPath %>/RTFM/Article/Edit.html?id=<%$Article->Id%>"><&|/l&>Update</&></A>]
</TD>
</TR>
<TR class="<% $i%2 ? 'oddline' : 'evenline'%>" >                                
<TD>&nbsp;</TD>
<TD COLSPAN=3>
<SMALL><%$Article->Summary || loc('(no Summary)')%></SMALL>
</TD>
</TR>
% }
</TABLE>
<& /Elements/TitleBoxEnd &>


<%INIT>
my $rows = 10;
my $i;
my $MyArticles;
$MyArticles = new RT::FM::ArticleCollection ($session{'CurrentUser'});
$MyArticles->RowsPerPage($rows);
$MyArticles->Limit(FIELD => 'Created', OPERATOR => '!=', VALUE => 'LastUpdated', QUOTEVALUE => 0 );
$MyArticles->OrderBy(FIELD => 'Created', ORDER => 'DESC');

</%INIT>
