X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSelfService%2FCreate.html;h=b6053e38959ab8050e82147612c1c4806d781aac;hb=de9d037528895f7151a9aead6724ce2df95f9586;hp=56ef79fc3b0a2cab1ca405941b7dfe92bf9f4767;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/rt/share/html/SelfService/Create.html b/rt/share/html/SelfService/Create.html index 56ef79fc3..b6053e389 100755 --- a/rt/share/html/SelfService/Create.html +++ b/rt/share/html/SelfService/Create.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -48,17 +48,21 @@ <& Elements/Header, Title => loc("Create a ticket") &> <& /Elements/ListActions, actions => \@results &> -
+ + +% for my $key (grep {defined $ARGS{$_}} map {+("new-$_", "$_-new")} keys %RT::Link::DIRMAP) { + +% } - +
<% $m->callback( CallbackName => 'AfterQueue', %ARGS, QueueObj => $queue_obj ) %> @@ -67,7 +71,7 @@ <&|/l&>Requestors: @@ -75,7 +79,7 @@ <&|/l&>Cc: @@ -88,19 +92,15 @@ - - - - +<& /Ticket/Elements/AddAttachments, %ARGS, QueueObj => $queue_obj &>
<&|/l&>Queue: - <%$queue_obj->Name || ''%> (<%$queue_obj->Description || ''%>) + <%$queue_obj->Name || ''%> <% $queue_obj->Description ? '('.$queue_obj->Description.')' : '' %>
-<& /Elements/EmailInput, Name => 'Requestors', Size => '20', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress &> +<& /Elements/EmailInput, Name => 'Requestors', Size => '20', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress, AutocompleteMultiple => 1 &>
-<& /Elements/EmailInput, Name => 'Cc', Size => '20', Default => $ARGS{Cc} || '' &> +<& /Elements/EmailInput, Name => 'Cc', Size => '20', Default => $ARGS{Cc} || '', AutocompleteMultiple => 1 &>
- <& /Ticket/Elements/EditCustomFields, %ARGS, QueueObj => $queue_obj &> + <& /Elements/EditCustomFields, + %ARGS, + Object => RT::Ticket->new($session{CurrentUser}), + CustomFields => $queue_obj->TicketCustomFields, + AsTable => 0, + &>
-%# FIXME: if failed customfields validation, attachement needs to be choosen -%# again by user. -<&|/l&>Attach file: - - -
@@ -121,29 +121,31 @@ $Queue => undef my @results; my $queue_obj = RT::Queue->new($session{'CurrentUser'}); $queue_obj->Load($Queue); -my $CFs = $queue_obj->TicketCustomFields(); -my $ValidCFs = $m->comp( - '/Elements/ValidateCustomFields', - CustomFields => $CFs, - ARGSRef => \%ARGS -); + +ProcessAttachments(ARGSRef => \%ARGS); my $skip_create = 0; + +{ + my ($status, @msg) = $m->comp( + '/Elements/ValidateCustomFields', + CustomFields => $queue_obj->TicketCustomFields, + ARGSRef => \%ARGS + ); + unless ($status) { + push @results, @msg; + $skip_create = 1; + } +} + $m->callback( CallbackName => 'BeforeCreate', ARGSRef => \%ARGS, skip_create => \$skip_create, results => \@results ); -if ( defined($ARGS{'id'}) and $ARGS{'id'} eq 'new' ) { # new ticket? - if ( $ValidCFs && !$skip_create ) { +if ( !exists $ARGS{'AddMoreAttach'} and defined($ARGS{'id'}) and $ARGS{'id'} eq 'new' ) { # new ticket? + if ( !$skip_create ) { $m->comp('Display.html', %ARGS); $RT::Logger->crit("After display call; error is $@"); $m->abort(); } - elsif ( !$ValidCFs ) { - # Invalid CFs - while (my $CF = $CFs->Next) { - my $msg = $m->notes('InvalidField-' . $CF->Id) or next; - push @results, $CF->Name . ': ' . $msg; - } - } }