[Rt-commit] r16407 - in rt/branches/3.999-DANGEROUS: lib/RT/Action lib/RT/View
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Tue Oct 21 05:41:54 EDT 2008
Author: sunnavy
Date: Tue Oct 21 05:41:53 2008
New Revision: 16407
Modified:
rt/branches/3.999-DANGEROUS/ (props changed)
rt/branches/3.999-DANGEROUS/lib/RT/Action/EditTicketCFs.pm
rt/branches/3.999-DANGEROUS/lib/RT/View/Ticket.pm
Log:
r17238 at sunnavys-mb: sunnavy | 2008-10-21 17:07:55 +0800
delete cf via ticket's api to record the transaction
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Action/EditTicketCFs.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Action/EditTicketCFs.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Action/EditTicketCFs.pm Tue Oct 21 05:41:53 2008
@@ -48,13 +48,12 @@
# deal with files to be deleted
my @to_be_deleted = grep { /delete_/ && $args->{$_} } keys %$args;
for my $tbd (@to_be_deleted) {
- if ( $tbd =~ /delete_(\d+)/ ) {
- my $id = $1;
- my $ocfv =
- RT::Model::ObjectCustomFieldValue->new(
- current_user => Jifty->web->current_user );
- $ocfv->load_by_id($id);
- $ocfv->delete;
+ if ( $tbd =~ /delete_(\d+)_(\d+)/ ) {
+ my ( $cfid, $ocfvid ) = ( $1, $2 );
+ $ticket->delete_custom_field_value(
+ field => $cfid,
+ value_id => $ocfvid,
+ );
}
}
@@ -123,7 +122,10 @@
next;
}
$delete_flag ||= 1;
- $old_cf->delete;
+ $ticket->delete_custom_field_value(
+ field => $cfid,
+ value_id => $old_cf->id,
+ );
}
}
for my $new_value (@$new_values) {
Modified: rt/branches/3.999-DANGEROUS/lib/RT/View/Ticket.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/View/Ticket.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/View/Ticket.pm Tue Oct 21 05:41:53 2008
@@ -180,8 +180,10 @@
if ($values) {
while ( my $value = $values->next ) {
Jifty::Web::Form::Field->new(
- action => $edit_cfs,
- name => 'delete_' . $value->id,
+ action => $edit_cfs,
+ name => 'delete_'
+ . $cf->id . '_'
+ . $value->id,
render_as => 'Checkbox',
)->render_widget;
Jifty->web->out( $value->content );
More information about the Rt-commit
mailing list