[Rt-commit] rt branch, admin_ui, updated. 58880741a0230ddf32bab2e7e4f8a4bb3c63b5ad

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Dec 29 21:40:04 EST 2009


The branch, admin_ui has been updated
       via  58880741a0230ddf32bab2e7e4f8a4bb3c63b5ad (commit)
      from  fce2659d266c4905c2645fb65bded4cfb6947738 (commit)

Summary of changes:
 lib/RT/Action/ConfigMyRT.pm |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 58880741a0230ddf32bab2e7e4f8a4bb3c63b5ad
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Dec 30 10:39:54 2009 +0800

    add summary_rows arg for non system record in ConfigMyRT action

diff --git a/lib/RT/Action/ConfigMyRT.pm b/lib/RT/Action/ConfigMyRT.pm
index 4ef8af5..f0446b6 100644
--- a/lib/RT/Action/ConfigMyRT.pm
+++ b/lib/RT/Action/ConfigMyRT.pm
@@ -27,8 +27,17 @@ sub arguments {
         $args->{'reset'} = {
             render_as     => 'InlineButton',
             default_value => 1,
-            label => 'Reset',
+            label => _('Reset'),
         };
+
+        $args->{'summary_rows'} = {
+            default_value => defer {
+                $self->record->preferences( 'SummaryRows',
+                    RT->config->get('default_summary_rows') );
+            },
+            label => _('Rows per box'),
+        };
+
     }
 
     for my $type ( qw/body summary/ ) {
@@ -71,6 +80,13 @@ sub take_action {
     if ( $self->argument_value('reset') && $record_class ne 'RT::System' ) {
         $self->record->set_preferences('HomepageSettings', {});
     }
+    elsif ($self->argument_value('summary_rows')
+        && $record_class ne 'RT::System' )
+    {
+        my $value = int $self->argument_value('summary_rows');
+        $value = 0 if $value < 0;
+        $self->record->set_preferences( 'SummaryRows', $value );
+    }
     else {
 
         my $content = $self->default_value || {};

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


More information about the Rt-commit mailing list