[Rt-commit] r12565 - in rt/branches/3.8-TESTING: . share/html/Elements share/html/Prefs
alexmv at bestpractical.com
alexmv at bestpractical.com
Tue May 20 15:46:15 EDT 2008
Author: alexmv
Date: Tue May 20 15:46:07 2008
New Revision: 12565
Modified:
rt/branches/3.8-TESTING/ (props changed)
rt/branches/3.8-TESTING/lib/RT/Config.pm
rt/branches/3.8-TESTING/share/html/Elements/QuickCreate
rt/branches/3.8-TESTING/share/html/Elements/SelectNewTicketQueue
rt/branches/3.8-TESTING/share/html/Prefs/Other.html
Log:
r32002 at kohr-ah: chmrr | 2008-05-20 15:45:39 -0400
* DefaultQueue preference
Modified: rt/branches/3.8-TESTING/lib/RT/Config.pm
==============================================================================
--- rt/branches/3.8-TESTING/lib/RT/Config.pm (original)
+++ rt/branches/3.8-TESTING/lib/RT/Config.pm Tue May 20 15:46:07 2008
@@ -165,6 +165,25 @@
},
},
},
+ DefaultQueue => {
+ Section => 'General',
+ Overridable => 1,
+ Widget => '/Widgets/Form/Select',
+ WidgetArguments => {
+ Description => 'Default queue',
+ Callback => sub {
+ my $ret = { Values => [], ValuesLabel => {}};
+ my $q = new RT::Queues($HTML::Mason::Commands::session{'CurrentUser'});
+ $q->UnLimit;
+ while (my $queue = $q->Next) {
+ next unless $queue->CurrentUserHasRight("CreateTicket");
+ push @{$ret->{Values}}, $queue->Id;
+ $ret->{ValuesLabel}{$queue->Id} = $queue->Name;
+ }
+ return $ret;
+ },
+ }
+ },
EmailFrequency => {
Section => 'Mail', #loc
Overridable => 1,
Modified: rt/branches/3.8-TESTING/share/html/Elements/QuickCreate
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Elements/QuickCreate (original)
+++ rt/branches/3.8-TESTING/share/html/Elements/QuickCreate Tue May 20 15:46:07 2008
@@ -54,7 +54,7 @@
<&|/l&>Subject</&>
</td>
<td class="value"><input size="15" name="Subject" /></td>
-<td class="label"><&|/l&>Queue</&></td><td class="value"><& /Elements/SelectNewTicketQueue, Name => 'Queue', ShowNullOption => 0 &>
+<td class="label"><&|/l&>Queue</&></td><td class="value"><& /Elements/SelectNewTicketQueue, Name => 'Queue' &>
</td><td>
<td class="label"><&|/l&>Owner</&></td><td class="value">
<select type="select" name="Owner">
Modified: rt/branches/3.8-TESTING/share/html/Elements/SelectNewTicketQueue
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Elements/SelectNewTicketQueue (original)
+++ rt/branches/3.8-TESTING/share/html/Elements/SelectNewTicketQueue Tue May 20 15:46:07 2008
@@ -46,5 +46,5 @@
%#
%# END BPS TAGGED BLOCK }}}
<label accesskey="9">
- <& /Elements/SelectQueue, Name => 'Queue', %ARGS, ShowNullOption => 0, ShowAllQueues => 0 &>
+ <& /Elements/SelectQueue, Name => 'Queue', Default => RT->Config->Get("DefaultQueue", $session{'CurrentUser'}), %ARGS, ShowNullOption => 0, ShowAllQueues => 0 &>
</label>
Modified: rt/branches/3.8-TESTING/share/html/Prefs/Other.html
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Prefs/Other.html (original)
+++ rt/branches/3.8-TESTING/share/html/Prefs/Other.html Tue May 20 15:46:07 2008
@@ -59,7 +59,7 @@
% my $meta = RT->Config->Meta( $option );
<& $meta->{'Widget'},
Default => 1,
- %{ $localize_meta->( $meta->{'WidgetArguments'} ) },
+ %{ $finalize_meta->( $meta->{'WidgetArguments'} ) },
Name => $option,
DefaultValue => scalar RT->Config->Get( $option ),
CurrentValue => $preferences->{ $option },
@@ -100,8 +100,9 @@
}, );
$UserObj->SetPreferences( $RT::System, $preferences );
}
-my $localize_meta = sub {
+my $finalize_meta = sub {
my %meta = %{ shift() };
+ %meta = (%meta, %{ $meta{Callback}->() }) if $meta{Callback};
$meta{'Description'} = loc( $meta{'Description'} ) if $meta{'Description'};
if ( $meta{'ValuesLabel'} ) {
while (my ($k, $v) = each %{ $meta{'ValuesLabel'} } ) {
More information about the Rt-commit
mailing list