%# BEGIN LICENSE BLOCK %# %# Copyright (c) 2002-2003 Jesse Vincent %# %# 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 % if ($ARGS{'Delete'}) { <& /RTFM/Article/Elements/Tabs, Title => $title &> <%$title%> <& /Elements/ListActions, actions => \@results &> % } else { <& /RTFM/Article/Elements/Tabs, Article => $ArticleObj, current_subtab => "RTFM/Article/Delete.html?id=".$ArticleObj->Id , id => $id, Title => $title &> <&|/l&>Are you sure you want to delete this article?
% } <%INIT> my @results; my $title; my $ArticleObj = RT::FM::Article->new( $session{'CurrentUser'} ); $ArticleObj->Load($id); unless ( $ArticleObj->id ) { $m->comp("/RTFM/Elements/Error", Why => loc("Unable to load article") ); } unless ( $ArticleObj->CurrentUserHasRight('ModifyArticle') ) { $m->comp("/RTFM/Elements/Error", Why => "No permission to modify article"); } if ($ARGS{'Delete'} eq 'yes') { $ArticleObj->Delete(); $title = loc('Article #[_1] deleted', $ArticleObj->Id); } else { $title = loc('Delete article #[_1]', $ArticleObj->Id); } <%ARGS> $id => undef