%# 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 <& /Admin/RTFM/Elements/ClassTabs, current_tab => 'Admin/RTFM/Classes/', current_subtab => 'Admin/RTFM/Classes/', Title => loc("Select a Class") &>
<%$caption%>:
    % if (scalar @allowed_classes == 0) {
  • <&|/l&>No Classes matching search criteria found.
  • % } % foreach my $class ( @allowed_classes ) { % if ($session{'CurrentUser'}->UserObj->HasRight(Right => 'AdminClass', Object => $class)) {
  • <%$class->Name%>
  • % } else {
  • <%$class->Name%>
  • % } %}
<&|/l&>Include disabled classes in listing.
<%INIT> my $caption; my $Classes = new RT::FM::ClassCollection($session{'CurrentUser'}); my @allowed_classes; if ($FindDisabledClasses) { $caption = loc("All Classes"); $Classes->{'find_disabled_rows'} = 1; $Classes->UnLimit(); } else { $caption = loc("Enabled Classes"); $Classes->LimitToEnabled(); } # Limit to only those classes that the user may admin. while (my $class = $Classes->Next()) { push(@allowed_classes, $class) if $session{'CurrentUser'}->UserObj->HasRight(Right => 'AdminClass', Object => $class) or $session{'CurrentUser'}->UserObj->HasRight(Right => 'AdminTopics', Object => $class); } <%ARGS> $FindDisabledClasses => 0