1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
%# 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
% if ($Lite) {
<INPUT NAME="<%$Name%>" size=25 DEFAULT="<%$d->Name%>">
% } else {
<SELECT NAME ="<%$Name%>"
% if ($Multiple) {
MULTIPLE
% }
% if ($Size) {
SIZE=<%$Size%>
% }
>
% if ($ShowNullOption) {
<OPTION VALUE="">-</OPTION>
% }
% while (my $Class=$Classes->Next) {
% next unless ($Class->Name); # if they can't see it, don't list it
% if ($ShowAllClasses || $Class->CurrentUserHasRight('CreateArticle')) {
<OPTION VALUE="<%$Class->Id%>" <%(grep (( $Class->Id == $_ || $Class->Name eq $_ ), @Default)) && 'SELECTED'%>><%$Class->Name%>
% if (($Verbose) and ($Class->Description) ){
(<%$Class->Description%>)
% }
</OPTION>
% }
% }
</SELECT>
% }
<%ARGS>
$Multiple => undef
$Size => undef
$ShowNullOption => 1
$ShowAllClasses => 1
$Name => undef
$Verbose => undef
$Default => undef
$Lite => 0
</%ARGS>
<%INIT>
my @Default = ref($Default) eq 'ARRAY' ? @$Default : ( $Default);
my $Classes=new RT::FM::ClassCollection($session{'CurrentUser'});
$Classes->UnLimit;
my $d = new RT::FM::Class($session{'CurrentUser'});
$d->Load($Default[0]);
</%INIT>
|