%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
while ( my $cf_value = $cf_values->Next ) {
push @cf_values, $cf_value->Content;
}
- $clone->{"Object-RT::Ticket--CustomField-$cf_id-Value"} = join "\n",
- @cf_values;
+
+ if ( @cf_values > 1 && $cf->Type eq 'Select' ) {
+ $clone->{"Object-RT::Ticket--CustomField-$cf_id-Value"} = \@cf_values;
+ }
+ else {
+ $clone->{"Object-RT::Ticket--CustomField-$cf_id-Value"} = join "\n",
+ @cf_values;
+ }
}
# Pass customer links along (even though cloning of parent links
ARGSRef => \%ARGS
);
-# deal with deleting uploaded attachments
-foreach my $key (keys %ARGS) {
- if ($key =~ m/^DeleteAttach-(.+)$/) {
- delete $session{'Attachments'}{$1};
- }
- $session{'Attachments'} = { %{$session{'Attachments'} || {}} };
-}
-
-# store the uploaded attachment in session
-if ( defined $ARGS{'Attach'} && length $ARGS{'Attach'} ) { # attachment?
- my $attachment = MakeMIMEEntity(
- AttachmentFieldName => 'Attach'
- );
-
- my $file_path = Encode::decode_utf8("$ARGS{'Attach'}");
- $session{'Attachments'} = {
- %{$session{'Attachments'} || {}},
- $file_path => $attachment,
- };
-}
-
-# delete temporary storage entry to make WebUI clean
-unless (keys %{$session{'Attachments'}} and
- ($ARGS{'id'} eq 'new' or $ARGS{'id'} eq 'refresh')) {
- delete $session{'Attachments'};
-}
+ProcessAttachments(ARGSRef => \%ARGS);
my $checks_failure = 0;