
sartak at bestpractical
Nov 9, 2009, 2:09 PM
Post #1 of 1
(307 views)
Permalink
|
|
rt branch, create-action, updated. 1bf6b54164f888e16c6f6142a4b44b07a13af8cc
|
|
The branch, create-action has been updated via 1bf6b54164f888e16c6f6142a4b44b07a13af8cc (commit) from 80aefd2ada4a21788bcc7c1d114b72c996b77d63 (commit) Summary of changes: lib/RT/ScripAction/CreateTickets.pm | 6 +++--- share/html/REST/1.0/Forms/ticket/default | 2 +- t/ticket/search.t | 6 +++--- t/ticket/search_long_cf_values.t | 2 +- t/web/cf_select_one.t | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) - Log ----------------------------------------------------------------- commit 1bf6b54164f888e16c6f6142a4b44b07a13af8cc Author: Shawn M Moore <sartak [at] bestpractical> Date: Mon Nov 9 17:09:29 2009 -0500 Use the new cf_# parameter style elsewhere diff --git a/lib/RT/ScripAction/CreateTickets.pm b/lib/RT/ScripAction/CreateTickets.pm index 2f9885c..3774d42 100755 --- a/lib/RT/ScripAction/CreateTickets.pm +++ b/lib/RT/ScripAction/CreateTickets.pm @@ -730,11 +730,11 @@ sub parse_lines { # if the tag was added later, skip it my $orig_tag = $original_tags{$tag} or next; if ( $orig_tag =~ /^custom_?field-?(\d+)$/i ) { - $ticketargs{ "custom_field-" . $1 } = $args{$tag}; + $ticketargs{ "cf_" . $1 } = $args{$tag}; } elsif ( $orig_tag =~ /^(?:custom_?field|cf)-?(.*)$/i ) { my $cf = RT::Model::CustomField->new( current_user => $self->current_user ); $cf->load_by_name( name => $1, queue => $ticketargs{queue} ); - $ticketargs{ "custom_field-" . $cf->id } = $args{$tag}; + $ticketargs{ "cf_" . $cf->id } = $args{$tag}; } elsif ($orig_tag) { my $cf = RT::Model::CustomField->new( current_user => $self->current_user ); $cf->load_by_name( @@ -742,7 +742,7 @@ sub parse_lines { queue => $ticketargs{queue} ); next unless ( $cf->id ); - $ticketargs{ "custom_field-" . $cf->id } = $args{$tag}; + $ticketargs{ "cf_" . $cf->id } = $args{$tag}; } } diff --git a/share/html/REST/1.0/Forms/ticket/default b/share/html/REST/1.0/Forms/ticket/default index f31de5c..70fd7cc 100755 --- a/share/html/REST/1.0/Forms/ticket/default +++ b/share/html/REST/1.0/Forms/ticket/default @@ -150,7 +150,7 @@ else { delete $data{$k}; next; } - $v{"custom_field-".$cf->id()} = delete $data{$k}; + $v{"cf_".$cf->id()} = delete $data{$k}; } elsif (lc $k eq 'text') { $text = delete $data{$k}; diff --git a/t/ticket/search.t b/t/ticket/search.t index 30b4330..6f9ac8e 100644 --- a/t/ticket/search.t +++ b/t/ticket/search.t @@ -23,17 +23,17 @@ ok ($q->id, "Created the queue"); my $cf = RT::Model::CustomField->new(current_user => RT->system_user); $cf->create(name => 'SearchTest', type => 'Freeform', MaxValues => 0, queue => $q->id); ok($cf->id, "Created the SearchTest CF"); -my $cflabel = "custom_field-".$cf->id; +my $cflabel = "cf_".$cf->id; my $cf2 = RT::Model::CustomField->new(current_user => RT->system_user); $cf2->create(name => 'SearchTest2', type => 'Freeform', MaxValues => 0, queue => $q->id); ok($cf2->id, "Created the SearchTest2 CF"); -my $cflabel2 = "custom_field-".$cf2->id; +my $cflabel2 = "cf_".$cf2->id; my $cf3 = RT::Model::CustomField->new(current_user => RT->system_user); $cf3->create(name => 'SearchTest3', type => 'Freeform', MaxValues => 0, queue => $q->id); ok($cf3->id, "Created the SearchTest3 CF"); -my $cflabel3 = "custom_field-".$cf3->id; +my $cflabel3 = "cf_".$cf3->id; # There was a bug involving a missing join to ObjectCustomFields that diff --git a/t/ticket/search_long_cf_values.t b/t/ticket/search_long_cf_values.t index 61132ed..901d857 100644 --- a/t/ticket/search_long_cf_values.t +++ b/t/ticket/search_long_cf_values.t @@ -21,7 +21,7 @@ ok ($q->id, "Created the queue"); my $cf = RT::Model::CustomField->new( current_user => RT->system_user ); $cf->create(name => 'SearchTest', type => 'Freeform', max_values => 0, queue => $q->id); ok($cf->id, "Created the SearchTest CF"); -my $cflabel = "custom_field-".$cf->id; +my $cflabel = "cf_".$cf->id; # setup some tickets my $t1 = RT::Model::Ticket->new(current_user => RT->system_user); diff --git a/t/web/cf_select_one.t b/t/web/cf_select_one.t index cd00aa6..82ba3f5 100644 --- a/t/web/cf_select_one.t +++ b/t/web/cf_select_one.t @@ -75,7 +75,7 @@ diag "create a ticket using API with 'asd'(not 'ASD') as value of the CF" ($tid, $txnid, $msg) = $ticket->create( subject => 'test', queue => $queue->id, - "custom_field-$cfid" => 'ASD', + "cf_$cfid" => 'ASD', ); ok $tid, "Created ticket"; diag $msg if $msg && $ENV{'TEST_VERBOSE'}; ----------------------------------------------------------------------- _______________________________________________ Rt-commit mailing list Rt-commit [at] lists http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-commit
|