[Rt-commit] rt branch, 3.999-trunk, updated. 1cc9e1144e13ae58881e7f01c2f459023c342e55
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Wed Nov 4 23:26:46 EST 2009
The branch, 3.999-trunk has been updated
via 1cc9e1144e13ae58881e7f01c2f459023c342e55 (commit)
via 7fee39c3c7454dfa7b5a686c0d5e06bea0c9f6ab (commit)
from f1827962c7872a573689ba18103e69a62c0ba7f9 (commit)
Summary of changes:
lib/RT/Action/UserSettings.pm | 88 +++++++++++++++++++++++++++--------------
1 files changed, 58 insertions(+), 30 deletions(-)
- Log -----------------------------------------------------------------
commit 7fee39c3c7454dfa7b5a686c0d5e06bea0c9f6ab
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Nov 5 12:11:57 2009 +0800
delete the in Action/UserSettings, since it doesn't work well
diff --git a/lib/RT/Action/UserSettings.pm b/lib/RT/Action/UserSettings.pm
index baa3bda..b2d1893 100644
--- a/lib/RT/Action/UserSettings.pm
+++ b/lib/RT/Action/UserSettings.pm
@@ -7,10 +7,11 @@ use UNIVERSAL::require;
use Scalar::Util qw/looks_like_number/;
use Regexp::Common qw/Email::Address/;
-our $SYSTEM_DEFAULT = {
- display => 'use system default',
- value => 'use_system_default',
-};
+# XXX system default's option is
+# {
+# display => _('use system default'),
+# value => 'use_system_default'
+# }
use Jifty::Param::Schema;
use Jifty::Action schema {
@@ -20,7 +21,12 @@ use Jifty::Action schema {
available are defer {
my $qs = RT::Model::QueueCollection->new;
$qs->unlimit;
- my $ret = [$RT::Action::UserSettings::SYSTEM_DEFAULT];
+ my $ret = [
+ {
+ display => _('use system default'),
+ value => 'use_system_default'
+ }
+ ];
while ( my $queue = $qs->next ) {
next unless $queue->current_user_has_right("CreateTicket");
push @$ret,
@@ -40,16 +46,16 @@ use Jifty::Action schema {
available are [
{ display => 'Short usernames', value => 'concise' },
{ display => 'Name and email address', value => 'verbose' },
- $RT::Action::UserSettings::SYSTEM_DEFAULT
+ { display => _('use system default'), value => 'use_system_default' }
],
default is defer {
- RT::Action::UserSettings->default_value('username_format')
+ RT::Action::UserSettings->default_value('username_format');
};
param 'web_default_stylesheet' =>
label is 'theme',
render as 'Select',
available are [
- $RT::Action::UserSettings::SYSTEM_DEFAULT,
+ { display => _('use system default'), value => 'use_system_default' },
map { $_ } qw/3.5-default 3.4-compat web2/
],
default is defer {
@@ -58,9 +64,12 @@ use Jifty::Action schema {
param 'message_box_rich_text' =>
label is 'WYSIWYG message composer',
render as 'Radio',
- available are [ $RT::Action::UserSettings::SYSTEM_DEFAULT, 'yes', 'no' ],
+ available are [
+ { display => _('use system default'), value => 'use_system_default' },
+ 'yes', 'no'
+ ],
default is defer {
- RT::Action::UserSettings->default_value('message_box_rich_text')
+ RT::Action::UserSettings->default_value('message_box_rich_text');
};
param 'message_box_rich_text_height' =>
label is 'WYSIWYG composer height',
@@ -69,21 +78,27 @@ use Jifty::Action schema {
};
param 'message_box_width' =>
label is 'message box width',
- default is defer {
- RT::Action::UserSettings->default_value('message_box_width')
+ default is defer {
+ RT::Action::UserSettings->default_value('message_box_width');
};
param 'message_box_height' =>
label is 'message box height',
default is defer {
RT::Action::UserSettings->default_value('message_box_height');
};
+
# locale
param 'date_time_format' =>
label is 'date format',
render as 'Select',
available are defer {
my $now = RT::DateTime->now;
- my $ret = [$RT::Action::UserSettings::SYSTEM_DEFAULT];
+ my $ret = [
+ {
+ display => _('use system default'),
+ value => 'use_system_default'
+ }
+ ];
for my $name (qw/rfc2822 rfc2616 iso iCal /) {
push @$ret,
{
@@ -103,7 +118,10 @@ use Jifty::Action schema {
render as 'Select',
available are defer {
[
- $RT::Action::UserSettings::SYSTEM_DEFAULT,
+ {
+ display => _('use system default'),
+ value => 'use_system_default'
+ },
'Individual messages', #loc
'Daily digest', #loc
'Weekly digest', #loc
@@ -130,14 +148,20 @@ use Jifty::Action schema {
param 'oldest_transactions_first' =>
label is 'Show oldest transactions first',
render as 'Radio',
- available are [ $RT::Action::UserSettings::SYSTEM_DEFAULT, 'yes', 'no' ],
+ available are [
+ { display => _('use system default'), value => 'use_system_default' },
+ 'yes', 'no'
+ ],
default is defer {
RT::Action::UserSettings->default_value('oldest_transactions_first');
};
param 'show_unread_message_notifications' =>
label is 'Notify me of unread messages',
render as 'Radio',
- available are [ $RT::Action::UserSettings::SYSTEM_DEFAULT, 'yes', 'no' ],
+ available are [
+ { display => _('use system default'), value => 'use_system_default' },
+ 'yes', 'no'
+ ],
default is defer {
RT::Action::UserSettings->default_value(
'show_unread_message_notifications');
@@ -146,7 +170,10 @@ use Jifty::Action schema {
label is 'Use monospace font',
hints is 'Use fixed-width font to display plaintext messages',
render as 'Radio',
- available are [ $RT::Action::UserSettings::SYSTEM_DEFAULT, 'yes', 'no' ],
+ available are [
+ { display => _('use system default'), value => 'use_system_default' },
+ 'yes', 'no'
+ ],
default is defer {
RT::Action::UserSettings->default_value('plain_text_pre');
};
@@ -164,7 +191,7 @@ sub take_action {
for my $arg ( $self->argument_names ) {
if ( $self->has_argument($arg) ) {
delete $pref->{$arg}
- if $self->argument_value($arg) eq $SYSTEM_DEFAULT->{value};
+ if $self->argument_value($arg) eq 'use_system_default';
$pref->{$arg} = $self->argument_value($arg);
}
}
@@ -193,7 +220,7 @@ sub default_value {
return $pref->{$name};
}
else {
- return $SYSTEM_DEFAULT->{value};
+ return 'use_system_default';
}
}
@@ -206,12 +233,12 @@ my %fields = (
'Locale' => [qw/date_time_format/],
Mail => [qw/email_frequency/],
'RT at a glance' => [
- qw/default_summary_rows max_inline_body oldest_transactions_first
- show_unread_message_notifications plain_text_pre/
+ qw/default_summary_rows max_inline_body oldest_transactions_first
+ show_unread_message_notifications plain_text_pre/
],
);
-sub fields {
+sub fields {
return %fields;
}
commit 1cc9e1144e13ae58881e7f01c2f459023c342e55
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Nov 5 12:23:40 2009 +0800
update Action/UserSettings.pm: display should be _()ed
diff --git a/lib/RT/Action/UserSettings.pm b/lib/RT/Action/UserSettings.pm
index b2d1893..cd47581 100644
--- a/lib/RT/Action/UserSettings.pm
+++ b/lib/RT/Action/UserSettings.pm
@@ -31,7 +31,7 @@ use Jifty::Action schema {
next unless $queue->current_user_has_right("CreateTicket");
push @$ret,
{
- display => $queue->name,
+ display => _($queue->name),
value => $queue->id
};
}
@@ -44,9 +44,9 @@ use Jifty::Action schema {
label is 'username format',
render as 'Select',
available are [
- { display => 'Short usernames', value => 'concise' },
- { display => 'Name and email address', value => 'verbose' },
- { display => _('use system default'), value => 'use_system_default' }
+ { display => _('use system default'), value => 'use_system_default' },
+ { display => _('Short usernames'), value => 'concise' },
+ { display => _('Name and email address'), value => 'verbose' },
],
default is defer {
RT::Action::UserSettings->default_value('username_format');
@@ -56,7 +56,7 @@ use Jifty::Action schema {
render as 'Select',
available are [
{ display => _('use system default'), value => 'use_system_default' },
- map { $_ } qw/3.5-default 3.4-compat web2/
+ map {{ display => _($_), value => $_ }} qw/3.5-default 3.4-compat web2/
],
default is defer {
RT::Action::UserSettings->default_value('web_default_stylesheet');
@@ -66,7 +66,7 @@ use Jifty::Action schema {
render as 'Radio',
available are [
{ display => _('use system default'), value => 'use_system_default' },
- 'yes', 'no'
+ map { { display => _($_), value => $_ } } 'yes', 'no',
],
default is defer {
RT::Action::UserSettings->default_value('message_box_rich_text');
@@ -122,10 +122,11 @@ use Jifty::Action schema {
display => _('use system default'),
value => 'use_system_default'
},
- 'Individual messages', #loc
- 'Daily digest', #loc
- 'Weekly digest', #loc
- 'Suspended' #loc
+ map { { display => _($_), value => $_ } }
+ 'Individual messages', #loc
+ 'Daily digest', #loc
+ 'Weekly digest', #loc
+ 'Suspended', #loc
];
},
default is defer {
@@ -150,7 +151,7 @@ use Jifty::Action schema {
render as 'Radio',
available are [
{ display => _('use system default'), value => 'use_system_default' },
- 'yes', 'no'
+ map { { display => _($_), value => $_ } } 'yes', 'no',
],
default is defer {
RT::Action::UserSettings->default_value('oldest_transactions_first');
@@ -160,7 +161,7 @@ use Jifty::Action schema {
render as 'Radio',
available are [
{ display => _('use system default'), value => 'use_system_default' },
- 'yes', 'no'
+ map { { display => _($_), value => $_ } } 'yes', 'no',
],
default is defer {
RT::Action::UserSettings->default_value(
@@ -172,7 +173,7 @@ use Jifty::Action schema {
render as 'Radio',
available are [
{ display => _('use system default'), value => 'use_system_default' },
- 'yes', 'no'
+ map { { display => _($_), value => $_ } } 'yes', 'no',
],
default is defer {
RT::Action::UserSettings->default_value('plain_text_pre');
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list