diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-06-04 00:16:28 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-06-04 00:16:28 -0700 |
commit | 7588a4ac90a9b07c08a3107cd1107d773be1c991 (patch) | |
tree | 55b8bedb5f899e705da0ba7f608267943bf89e94 /rt/share/html/REST/1.0/Forms/ticket/default | |
parent | 98d2b25256055abb0dfcb9f586b434474fa97afd (diff) |
RT 4.0.13
Diffstat (limited to 'rt/share/html/REST/1.0/Forms/ticket/default')
-rwxr-xr-x | rt/share/html/REST/1.0/Forms/ticket/default | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/rt/share/html/REST/1.0/Forms/ticket/default b/rt/share/html/REST/1.0/Forms/ticket/default index 016a50c73..0bced1e99 100755 --- a/rt/share/html/REST/1.0/Forms/ticket/default +++ b/rt/share/html/REST/1.0/Forms/ticket/default @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -167,7 +167,7 @@ else { elsif (lc $k eq 'text') { $text = delete $data{$k}; } - elsif ( lc $k ne 'id' ) { + elsif ( $k !~ /^(?:id|requestors)$/i ) { $e = 1; push @$o, $k; push(@comments, "# $k: Unknown field"); @@ -188,7 +188,8 @@ else { MIME::Entity->build( From => $session{CurrentUser}->EmailAddress, Subject => $v{Subject}, - Data => $text + Data => $text, + 'X-RT-Interface' => 'REST', ); } @@ -375,11 +376,18 @@ else { else { my $vals = $ticket->CustomFieldValues($cf->id); - if ( $cf->SingleValue ) { + if ( !defined $val || !length $val ) { + while ( my $val = $vals->Next ) { + ($n, $s) = $ticket->DeleteCustomFieldValue( + Field => $cf, ValueId => $val->id, + ); + $s =~ s/^# // if defined $s; + } + } + elsif ( $cf->SingleValue ) { my $old = $vals->Next; if ( $old ) { if ( $val ne $old->Content ) { - $old->Delete; ($n, $s) = $ticket->AddCustomFieldValue( Field => $cf, Value => $val ); $s =~ s/^# // if defined $s; @@ -433,7 +441,7 @@ else { $new{$c}--; } else { - $v->Delete(); + $ticket->DeleteCustomFieldValue( Field => $cf, ValueId => $v->id ); } } for ( @new ) { |