[Rt-commit] r16139 - in rt/branches/3.999-DANGEROUS: lib/RT/Action lib/RT/Interface
clkao at bestpractical.com
clkao at bestpractical.com
Sun Sep 28 10:17:54 EDT 2008
Author: clkao
Date: Sun Sep 28 10:17:54 2008
New Revision: 16139
Modified:
rt/branches/3.999-DANGEROUS/lib/RT/Action/UpdateTicket.pm
rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web.pm
rt/branches/3.999-DANGEROUS/share/html/Ticket/ModifyAll.html
Log:
generalize the action result message handling.
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Action/UpdateTicket.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Action/UpdateTicket.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Action/UpdateTicket.pm Sun Sep 28 10:17:54 2008
@@ -6,6 +6,8 @@
sub record_class { 'RT::Model::Ticket' }
+use constant report_detailed_messages => 1;
+
=head2 take_action
=cut
@@ -32,27 +34,4 @@
return 1;
}
-sub report_success {
- my $self = shift;
-
- # Your success message here
- $self->result->message( _('Dates Updated') );
-}
-
-sub detailed_messages {
- my $self = shift;
- my $result = {Jifty->web->response->results}->{$self->moniker};
- my @results;
- if ($result) {
- for my $type ( sort keys %{ $result->content->{detailed_messages} } ) {
- push @results, $result->content->{detailed_messages}{$type};
- }
- }
- return @results;
-}
-
-sub report_detailed_messages {
- return 1;
-}
-
1;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web.pm Sun Sep 28 10:17:54 2008
@@ -1459,4 +1459,22 @@
return ( _load_container_object( $obj_type, $obj_id ), $search_id );
}
+=head2 get_jifty_messages
+
+=cut
+
+sub get_jifty_messages {
+ my $results = { Jifty->web->response->results };
+ return map { _detailed_messages($results->{$_}) } sort keys %$results;
+}
+
+sub _detailed_messages {
+ my $result = shift;
+ my $msg = $result->content('detailed_messages')
+ or return $result->message;
+
+ return map { $msg->{$_} } sort keys %$msg;
+}
+
+
1;
Modified: rt/branches/3.999-DANGEROUS/share/html/Ticket/ModifyAll.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Ticket/ModifyAll.html (original)
+++ rt/branches/3.999-DANGEROUS/share/html/Ticket/ModifyAll.html Sun Sep 28 10:17:54 2008
@@ -159,7 +159,7 @@
$m->callback( ticket_obj => $Ticket, args_ref => \%ARGS );
-my (@wresults, @results, @dresults, @lresults, @cf_results);
+my (@wresults, @results, @lresults, @cf_results);
unless ($only_search_for_people or $only_search_for_group ) {
# There might be two owners.
@@ -195,7 +195,7 @@
}
@lresults = process_ticket_links( ticket_obj => $Ticket, args_ref => \%ARGS);
- at dresults = $action->detailed_messages;
+my @dresults = get_jifty_messages();
push @results, @wresults;
push @results, @dresults;
More information about the Rt-commit
mailing list