% if ($redirect) { % my ($Item, @rv) = HTML::Mason::Commands::CreateTicket( % %ARGS, Queue => "ProjectDownloaders", % ); % $Item->Id or die @rv; % $Item->__Set( Field => 'IssueStatement', Value => $QueueObj->Id ); <&|/l&>Thank you. You may now proceed to download:
<&|/l&><< Back to the file list % return; % } <&|/l&>This project's administrator requires you to provide some information about yourself before downloading:

<%PERL> local *RT::CustomField::Attribute = sub { package RT::CustomField; my ($self, $key) = @_; my $value = $self->SUPER::Attribute($key); if ($key eq 'Pattern' and !length($value) and $Mandatory{$self->Id}) { return '.'; } return $value; }; $m->comp( '/Work/Tickets/Create.html', %ARGS, Queue => "ProjectDownloaders", NoUI => 1, Loc => 1, Subject => $url, OnlyCF => \%Info, NoCF => { Attachments => 1, Subject => 1, Content => 1 } ); <%INIT> my $CF = RT::CustomField->new($QueueObj->CurrentUser); my %Info = map +($_ => 1), ($QueueObj->DownloadACL('info') =~ /(\d+)/g); my %Mandatory; # validate CFs foreach my $info (sort keys %Info) { ($QueueObj->DownloadACL("info-$info") eq 'mandatory') or next; $Mandatory{$info}++; if ($redirect and !length($ARGS{"CustomField-$info-Values"})) { $redirect = 0; } } <%ARGS> $url $QueueObj $redirect => 0