X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FConfig.pm;h=23441934f2e86e321faa09ee6893f49a08994084;hb=0ea23112cfa0d82738b0f08d60d90579721b7524;hp=014c76468723374dae32063356fdc9b137c3ae89;hpb=aa38c070977cf63365a4d26a3e4a7e5049ad70d0;p=freeside.git diff --git a/rt/lib/RT/Config.pm b/rt/lib/RT/Config.pm index 014c76468..23441934f 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, @@ -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; }, @@ -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; } @@ -1225,18 +1219,27 @@ sub SetFromConfig { my $entry = ${$pack}{$k}; next unless $entry; - # get entry for type we are looking for - # XXX skip references to scalars or other references. - # 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) }; + # Inlined constants are simplified in the symbol table -- + # namely, when possible, you only get a reference back in + # $entry, rather than a full GLOB. In 5.10, scalar + # constants began being inlined this way; starting in 5.20, + # list constants are also inlined. Notably, ref(GLOB) is + # undef, but inlined constants are currently either REF, + # SCALAR, or ARRAY. + next if ref($entry); + + 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 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 '';