[Rt-commit] rt branch, admin_ui, updated. 9292c3d888674327501604a14b44cb6ff7c15c5c

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Dec 29 22:27:21 EST 2009


The branch, admin_ui has been updated
       via  9292c3d888674327501604a14b44cb6ff7c15c5c (commit)
      from  2affed777ae0581dc95f487ac508157cc726d4b7 (commit)

Summary of changes:
 lib/RT/Action/{CreateQueue.pm => UpdateQueue.pm} |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
 copy lib/RT/Action/{CreateQueue.pm => UpdateQueue.pm} (82%)

- Log -----------------------------------------------------------------
commit 9292c3d888674327501604a14b44cb6ff7c15c5c
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Dec 30 11:27:12 2009 +0800

    add UpdateQueue action

diff --git a/lib/RT/Action/UpdateQueue.pm b/lib/RT/Action/UpdateQueue.pm
new file mode 100644
index 0000000..9e2f804
--- /dev/null
+++ b/lib/RT/Action/UpdateQueue.pm
@@ -0,0 +1,39 @@
+package RT::Action::UpdateQueue;
+use strict;
+use warnings;
+
+use base qw/Jifty::Action::Record::Update/;
+
+sub record_class { 'RT::Model::Queue' }
+
+use constant report_detailed_messages => 1;
+
+sub arguments {
+    my $self = shift;
+
+    my $args = $self->SUPER::arguments();
+    for (qw/sign encrypt/) {
+        $args->{$_} = {
+            default_value => $self->record->$_,
+            render_as     => 'checkbox',
+            label         => _($_),
+        };
+    }
+    return $args;
+}
+
+=head2 take_action
+
+=cut
+
+sub take_action {
+    my $self = shift;
+    for (qw/sign encrypt/) {
+        my $method = "set_$_";
+        $self->record->$method( $self->argument_value($_) );
+    }
+    $self->SUPER::take_action;
+    return 1;
+}
+
+1;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list