X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=rt%2Flib%2FRT%2FConfig.pm;h=fee6c51064ea56239d32bdeff600d42e9285405a;hb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;hp=f87ef84c9bfaeb5fa0e4800d1959261687cd0fdd;hpb=e4a77af2829e919d29de26e3f15f416b41bd5199;p=freeside.git diff --git a/rt/lib/RT/Config.pm b/rt/lib/RT/Config.pm index f87ef84c9..fee6c5106 100644 --- a/rt/lib/RT/Config.pm +++ b/rt/lib/RT/Config.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -303,15 +303,6 @@ our %META = ( }, # User overridable options for RT at a glance - DefaultSummaryRows => { - Section => 'RT at a glance', #loc - Overridable => 1, - SortOrder => 1, - Widget => '/Widgets/Form/Integer', - WidgetArguments => { - Description => 'Number of search results', #loc - }, - }, HomePageRefreshInterval => { Section => 'RT at a glance', #loc Overridable => 1, @@ -411,8 +402,8 @@ our %META = ( Description => q|What tickets to display in the 'More about requestor' box|, #loc Values => [qw(Active Inactive All None)], ValuesLabel => { - Active => "Show the Requestor's 10 highest priority open tickets", #loc - Inactive => "Show the Requestor's 10 highest priority closed tickets", #loc + Active => "Show the Requestor's 10 highest priority active tickets", #loc + Inactive => "Show the Requestor's 10 highest priority inactive tickets", #loc All => "Show the Requestor's 10 highest priority tickets", #loc None => "Show no tickets for the Requestor", #loc }, @@ -446,10 +437,13 @@ our %META = ( Description => 'Date format', #loc Callback => sub { my $ret = { Values => [], ValuesLabel => {}}; my $date = RT::Date->new($HTML::Mason::Commands::session{'CurrentUser'}); - $date->Set; + $date->SetToNow; foreach my $value ($date->Formatters) { push @{$ret->{Values}}, $value; - $ret->{ValuesLabel}{$value} = $date->$value(); + $ret->{ValuesLabel}{$value} = $date->Get( + Format => $value, + Timezone => 'user', + ); } return $ret; }, @@ -749,7 +743,7 @@ our %META = ( my %seen; foreach my $encoding ( grep defined && length, splice @$value ) { - next if $seen{ $encoding }++; + next if $seen{ $encoding }; if ( $encoding eq '*' ) { unshift @$value, '*'; next; @@ -1215,7 +1209,7 @@ sub SetFromConfig { # if the entry has a trailing '::' then # it is a link to another name space if ( substr( $k, -2 ) eq '::') { - $name = $self->__GetNameByRef( $ref, $k ); + $name = $self->__GetNameByRef( $ref, $pack eq 'main::'? $k : $pack.$k ); return $name if $name; } @@ -1230,13 +1224,20 @@ sub SetFromConfig { # Otherwie 5.10 goes boom. maybe we should skip any # reference next if ref($entry) eq 'SCALAR' || ref($entry) eq 'REF'; - my $entry_ref = *{$entry}{ ref($ref) }; + + my $ref_type = ref($ref); + + # regex/arrayref/hashref/coderef are stored in SCALAR glob + $ref_type = 'SCALAR' if $ref_type eq 'REF'; + + my $entry_ref = *{$entry}{ $ref_type }; + next if ref $entry_ref && ref $entry_ref ne ref $ref; next unless $entry_ref; # if references are equal then we've found if ( $entry_ref == $ref ) { $last_pack = $pack; - return ( $REF_SYMBOLS{ ref($ref) } || '*' ) . $pack . $k; + return ( $REF_SYMBOLS{ $ref_type } || '*' ) . $pack . $k; } } return '';