summaryrefslogtreecommitdiff
path: root/rt/html/Elements
diff options
context:
space:
mode:
authorivan <ivan>2005-10-15 09:33:53 +0000
committerivan <ivan>2005-10-15 09:33:53 +0000
commit6863b061a7740eed16903f01dae6b46521e9ca7b (patch)
tree3fe155299627714d423d7140ab60de4e1db95044 /rt/html/Elements
parent673b9a458d9138523026963df6fa3b4683e09bae (diff)
landing rt 3.4.4 on HEAD
Diffstat (limited to 'rt/html/Elements')
-rw-r--r--rt/html/Elements/CollectionAsTable/Row99
-rw-r--r--rt/html/Elements/Footer17
-rw-r--r--rt/html/Elements/Header15
-rw-r--r--rt/html/Elements/Menu13
-rw-r--r--rt/html/Elements/PageLayout13
-rw-r--r--rt/html/Elements/SimpleSearch6
-rw-r--r--rt/html/Elements/Tabs26
7 files changed, 115 insertions, 74 deletions
diff --git a/rt/html/Elements/CollectionAsTable/Row b/rt/html/Elements/CollectionAsTable/Row
index 701966f..3316bc0 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 <jesse@bestpractical.com>
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# <jesse@bestpractical.com>
%#
-%# (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
</%ARGS>
<%PERL>
-$m->out( '<TR class="' . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' );
+$m->out('<TR class="' . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' );
my $item;
foreach my $column (@Format) {
if ( $column->{title} eq 'NEWLINE' ) {
- while ($item < $maxitems) {
- $m->out("<td>&nbsp;</td>\n");
- $item++;
- }
- $item = 0;
+ while ( $item < $maxitems ) {
+ $m->out(qq{<td class="collection-as-table">&nbsp;</td>\n});
+ $item++;
+ }
+ $item = 0;
$m->out('</TR>');
- $m->out( '<TR class="' .
- ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' );
+ $m->out('<TR class="'
+ . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' )
+ . '" >' );
next;
}
$item++;
- $m->out('<td align="left">');
+ $m->out('<td class="collection-as-table" ');
+ $m->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/<br>/gs for @out;
+ $m->out( @out );
}
else {
- $m->out( Encode::decode_utf8($subcol) );
+ $m->out($subcol);
}
}
$m->out('</td>');
diff --git a/rt/html/Elements/Footer b/rt/html/Elements/Footer
index 12432ca..78a116f 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
%# <jesse@bestpractical.com>
%#
%# (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) {
</td>
</tr>
@@ -52,21 +52,13 @@
<& /Elements/Callback, %ARGS &>
<!--
<div class="bpscredits">
-<&|/l, '&#187;&#124;&#171;',
- $RT::VERSION,
- '2004',
- '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>',
-&>[_1] RT [_2] Copyright 1996-[_3] [_4].</&><br>
+<&|/l, '&#187;&#124;&#171;', $RT::VERSION, '2005', '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>', &>[_1] RT [_2] Copyright 1996-[_3] [_4].</&><br>
% if (!$Menu) {
<&|/l&>Distributed under version 2 <a href="http://www.gnu.org/copyleft/gpl.html"> of the GNU GPL.</a></&><br>
<&|/l, '<a href="mailto:sales@bestpractical.com">sales@bestpractical.com</a>' &>To inquire about support, training, custom development or licensing, please contact [_1].</&><br>
% }
</div>
-->
-% if ($Debug) {
-<HR>
-<b><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></b>
-% }
% if ($Debug >= 2 ) {
% require Data::Dumper;
% my $d = Data::Dumper->new([\%ARGS], [qw(%ARGS)]);
@@ -74,6 +66,7 @@
<%$d->Dump() %>
</pre>
% }
+<div class="page-stats"><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></div>
% if ($Menu) {
</TD>
</TR>
diff --git a/rt/html/Elements/Header b/rt/html/Elements/Header
index 4a16d56..b9518dc 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
%# <jesse@bestpractical.com>
%#
%# (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 }}}
%#<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
@@ -77,15 +77,18 @@ ONLOAD="
>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
- <td rowspan=2><img border=0 alt="freeside" src="<%$RT::WebImagesURL%>/small-logo.png" width="92" height="62"></td>
+<<<<<<< Header
+ <td colspan=2 rowspan=2><img border=0 alt="freeside" src="<%$RT::WebImagesURL%>/small-logo.png" width="92" height="62"></td>
<td align="left" rowspan=2><font size=6><% &RT::URI::freeside::FreesideGetConfig('company_name') %> Ticketing</font></td>
<td align="right" valign="top">
% if ($session{'CurrentUser'} && $session{'CurrentUser'}->Id && $LoggedIn) {
<SPAN STYLE="display: none"><A HREF="#skipnav"><&|/l&>Skip Menu</&></A> |</SPAN>
+%if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) {
<A HREF="<%$RT::WebPath%><% $Prefs %>" ><&|/l&>Preferences</&></A>
+% }
<& /Elements/Callback, %ARGS &>
% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) {
-| <A HREF="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL && "?URL=".$URL%>"><&|/l&>Logout</&></a>
+| <A HREF="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL ? "?URL=".$URL : ''%>"><&|/l&>Logout</&></a>
% }
<BR>
<&|/l, "<b>".$session{'CurrentUser'}->Name."</b>" &>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 e933fb4..398e3ab 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
%# <jesse@bestpractical.com>
%#
%# (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;
% }
-<li style="<%$style%>"><A HREF="<% ($toptabs->{$tab}->{'path'} =~ /^http/) ? '' : "${RT::WebPath}/" %><%$toptabs->{$tab}->{'path'}%>" style="font-size: <%$size%>;" class="<%$class%>"
+% my $url = $toptabs->{$tab}->{'path'} =~ /^https?:/i ? $toptabs->{$tab}->{'path'} : $RT::WebPath . "/" . $toptabs->{$tab}->{'path'};
+<li class="<%$class%>-<%$level%>-<%$style%>"><A HREF="<% $url %>" class="<%$class%>-<%$level%>"
<%($class eq 'currenttopnav') ? "name='focus'" : ""|n %>
<% !$level && "accesskey='".$accesskey++."'" |n%>><% $toptabs->{$tab}->{'title'}%></A>
%# Second-level items
diff --git a/rt/html/Elements/PageLayout b/rt/html/Elements/PageLayout
index 41eae78..94bdbe1 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
%# <jesse@bestpractical.com>
%#
%# (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 }}}
<table class="lightgray" border=0 cellspacing=0 cellpadding=0 width="100%">
<th class="lightgray" align="left" width=42%><span class="rtname"><%$AppName%></span>
</th>
@@ -76,7 +76,7 @@
% if ($actions->{"$action"}->{'html'}) {
% push @actions, $actions->{"$action"}->{'html'};
% } else {
-% push @actions, "<A class='nav' HREF=\"".$RT::WebPath."/".$actions->{$action}->{'path'}."\">".$actions->{$action}->{'title'}."</A>";
+% push @actions, qq|<a class="nav" href="|.$RT::WebPath."/".$actions->{$action}->{'path'}.qq|">|.$actions->{$action}->{'title'}."</a>";
% }
% }
%#<% join(" | ", @actions) | n %>
@@ -94,11 +94,12 @@
</tr>
<TR valign="top">
<TD valign="top" width="100%" height="100%" class="mainbody" >
-
+<& /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 213aa7e..e76f801 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
%# <jesse@bestpractical.com>
%#
%# (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 }}}
<form action="<% $RT::WebPath %>/index.html">
<input size="12" name="q" autocomplete="off" accesskey="0">
<input type="submit" value="<&|/l&>Search tickets</&>">&nbsp;
diff --git a/rt/html/Elements/Tabs b/rt/html/Elements/Tabs
index 4a018bf..f5839a9 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
%# <jesse@bestpractical.com>
%#
%# (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;
}