X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=rt%2Fshare%2Fhtml%2FSelfService%2FCreate.html;h=28427ab82f338d217dca6da7fff10f5197375427;hb=7322f2afedcc2f427e997d1535a503613a83f088;hp=e28ab0f57833251dc5e35f9e1d487f2cd77cb67a;hpb=a6fe07e49e3fc12169e801b1ed6874c3a5bd8500;p=freeside.git diff --git a/rt/share/html/SelfService/Create.html b/rt/share/html/SelfService/Create.html index e28ab0f57..28427ab82 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-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -48,8 +48,12 @@ <& Elements/Header, Title => loc("Create a ticket") &> <& /Elements/ListActions, actions => \@results &> -
+ + +% for my $key (grep {defined $ARGS{$_}} map {+("new-$_", "$_-new")} keys %RT::Link::DIRMAP) { + +% } @@ -67,7 +71,7 @@ <&|/l&>Requestors: @@ -75,7 +79,7 @@ <&|/l&>Cc: @@ -88,19 +92,15 @@ - - - - +<& /Ticket/Elements/AddAttachments, %ARGS, QueueObj => $queue_obj &>
-<& /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; - } - } }