From 6863b061a7740eed16903f01dae6b46521e9ca7b Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 15 Oct 2005 09:33:53 +0000 Subject: landing rt 3.4.4 on HEAD --- rt/html/Elements/CollectionAsTable/Row | 99 +++++++++++++++++++++++----------- rt/html/Elements/Footer | 17 ++---- rt/html/Elements/Header | 15 +++--- rt/html/Elements/Menu | 13 ++--- rt/html/Elements/PageLayout | 13 ++--- rt/html/Elements/SimpleSearch | 6 +-- rt/html/Elements/Tabs | 26 +++++---- 7 files changed, 115 insertions(+), 74 deletions(-) (limited to 'rt/html/Elements') diff --git a/rt/html/Elements/CollectionAsTable/Row b/rt/html/Elements/CollectionAsTable/Row index 701966fcc..3316bc027 100644 --- a/rt/html/Elements/CollectionAsTable/Row +++ b/rt/html/Elements/CollectionAsTable/Row @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,14 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# -%# END LICENSE BLOCK - +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} <%ARGS> $i => undef @Format => undef @@ -32,42 +53,56 @@ $Warning => undef <%PERL> -$m->out( '' ); +$m->out('' ); my $item; foreach my $column (@Format) { if ( $column->{title} eq 'NEWLINE' ) { - while ($item < $maxitems) { - $m->out(" \n"); - $item++; - } - $item = 0; + while ( $item < $maxitems ) { + $m->out(qq{ \n}); + $item++; + } + $item = 0; $m->out(''); - $m->out( '' ); + $m->out('' ); next; } $item++; - $m->out(''); + $m->out('out( 'align="' . $column->{align} . '"' ) if ( $column->{align} ); + $m->out('>'); foreach my $subcol ( @{ $column->{output} } ) { if ( $subcol =~ /^__(.*?)__$/o ) { - my $col = $1; - my $value = $m->comp('/Elements/RT__Ticket/ColumnMap', Name => $col, Attr => 'value'); + my $col = $1; + my $value = $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $col, + Attr => 'value' + ); + my @out; + + if ( $value && ref($value) ) { + + # All HTML snippets are returned by the callback function + # as scalar references. Data fetched from the objects are + # plain scalars, and needs to be escaped properly. + @out = + map { + ref($_) ? $$_ : $m->interp->apply_escapes( $_ => 'h' ) + } &{$value}( $record, $i ) + ; + } + else { - if ( $value && ref($value)) { - # All HTML snippets are returned by the callback function - # as scalar references. Data fetched from the objects are - # plain scalars, and needs to be escaped properly. - $m->out( - map { ref($_) ? $$_ : $m->interp->apply_escapes( $_ => 'h' ) } - &{ $value } ( $record, $i ) - ); - } else { - # Simple value; just escape it. - $m->out( $m->interp->apply_escapes( $value => 'h' ) ); + # Simple value; just escape it. + @out = $m->interp->apply_escapes( $value => 'h' ); } + s/\n/
/gs for @out; + $m->out( @out ); } else { - $m->out( Encode::decode_utf8($subcol) ); + $m->out($subcol); } } $m->out(''); diff --git a/rt/html/Elements/Footer b/rt/html/Elements/Footer index 12432caaa..78a116f38 100644 --- a/rt/html/Elements/Footer +++ b/rt/html/Elements/Footer @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($Menu) { @@ -52,21 +52,13 @@ <& /Elements/Callback, %ARGS &> -% if ($Debug) { -
-<&|/l&>Time to display: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%> -% } % if ($Debug >= 2 ) { % require Data::Dumper; % my $d = Data::Dumper->new([\%ARGS], [qw(%ARGS)]); @@ -74,6 +66,7 @@ <%$d->Dump() %> % } +
<&|/l&>Time to display: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%>
% if ($Menu) { diff --git a/rt/html/Elements/Header b/rt/html/Elements/Header index 4a16d5667..b9518dcb7 100644 --- a/rt/html/Elements/Header +++ b/rt/html/Elements/Header @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# @@ -77,15 +77,18 @@ ONLOAD=" > - +<<<<<<< Header +
freesidefreeside <% &RT::URI::freeside::FreesideGetConfig('company_name') %> Ticketing % if ($session{'CurrentUser'} && $session{'CurrentUser'}->Id && $LoggedIn) { <&|/l&>Skip Menu | +%if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) { <&|/l&>Preferences +% } <& /Elements/Callback, %ARGS &> % unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { -| <&|/l&>Logout +| <&|/l&>Logout % }
<&|/l, "".$session{'CurrentUser'}->Name."" &>Logged in as [_1] @@ -130,7 +133,7 @@ require RT::URI::freeside; <%ARGS> $Prefs => '/User/Prefs.html' $Focus => 'focus' -$Title => undef +$Title => 'RT' $Code => undef $Refresh => 0 $Why => undef diff --git a/rt/html/Elements/Menu b/rt/html/Elements/Menu index e933fb4f0..398e3ab07 100644 --- a/rt/html/Elements/Menu +++ b/rt/html/Elements/Menu @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# font size depends on level % if ($level ge 3) { % $size = $basesize-(6); @@ -69,16 +69,17 @@ % } % my $style=""; % if ($sep) { -% $style="border-top: solid #999 1px; padding-top: .1em; margin-top: .5em;"; +% $style="minor"; % } elsif ($level == 0 ) { -% $style="border-bottom: solid white 1px; padding-top: .25em; padding-bottom: .5em;" ; +% $style="major"; % } % if ($toptabs->{$tab}->{'separator'}) { % $sep=1; % } else { % $sep=0; % } -
  • <%$toptabs->{$tab}->{'path'}%>" style="font-size: <%$size%>;" class="<%$class%>" +% my $url = $toptabs->{$tab}->{'path'} =~ /^https?:/i ? $toptabs->{$tab}->{'path'} : $RT::WebPath . "/" . $toptabs->{$tab}->{'path'}; +
  • <% !$level && "accesskey='".$accesskey++."'" |n%>><% $toptabs->{$tab}->{'title'}%> %# Second-level items diff --git a/rt/html/Elements/PageLayout b/rt/html/Elements/PageLayout index 41eae785f..94bdbe194 100644 --- a/rt/html/Elements/PageLayout +++ b/rt/html/Elements/PageLayout @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} @@ -76,7 +76,7 @@ % if ($actions->{"$action"}->{'html'}) { % push @actions, $actions->{"$action"}->{'html'}; % } else { -% push @actions, "{$action}->{'path'}."\">".$actions->{$action}->{'title'}.""; +% push @actions, qq|{$action}->{'path'}.qq|">|.$actions->{$action}->{'title'}.""; % } % } %#<% join(" | ", @actions) | n %> @@ -94,11 +94,12 @@
    <%$AppName%>
    - +<& /Elements/Callback, _CallbackName => 'BeforeBody', %ARGS &> +%$m->flush_buffer(); # we've got the page laid out, let's flush the buffer; <%INIT> foreach my $tab (sort keys %{$toptabs}) { - if ($toptabs->{$tab}->{'path'} eq $current_toptab) { + if ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) { $toptabs->{$tab}->{"subtabs"} = $tabs; $toptabs->{$tab}->{"current_subtab"} = $current_tab; } diff --git a/rt/html/Elements/SimpleSearch b/rt/html/Elements/SimpleSearch index 213aa7eac..e76f801df 100644 --- a/rt/html/Elements/SimpleSearch +++ b/rt/html/Elements/SimpleSearch @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
      diff --git a/rt/html/Elements/Tabs b/rt/html/Elements/Tabs index 4a018bfad..f5839a9e5 100644 --- a/rt/html/Elements/Tabs +++ b/rt/html/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/PageLayout, current_toptab => $current_toptab, current_tab => $current_tab, @@ -76,17 +76,25 @@ my $basetabs = { C => { title => loc('Tools'), path => 'Tools/Offline.html' }, - E => { title => loc('Configuration'), - path => 'Admin/' - }, - K => { title => loc('Preferences'), - path => 'User/Prefs.html' - }, P => { title => loc('Approval'), path => 'Approvals/' }, }; +if ($session{'CurrentUser'}->HasRight( Right => 'ShowConfigTab', + Object => $RT::System )) { + $basetabs->{E} = { title => loc('Configuration'), + path => 'Admin/', + }; +} + +if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', + Object => $RT::System )) { + $basetabs->{K} = { title => loc('Preferences'), + path => 'User/Prefs.html' + }; +} + if (!defined $toptabs) { $toptabs = $basetabs; } -- cgit v1.2.1