diff options
author | ivan <ivan> | 2007-08-03 21:49:03 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-08-03 21:49:03 +0000 |
commit | 3a651bfd3784bdbb4367b3d6385ccee33e8ebe5c (patch) | |
tree | 05fc4d7ede2deab9460606a342aeacb68956aee3 /rt/html/Elements | |
parent | 6dc9b93431801f93f2003b7163d24cd5ddaf4cd3 (diff) |
merging RT_3_6_4 to HEAD
Diffstat (limited to 'rt/html/Elements')
-rw-r--r-- | rt/html/Elements/CollectionAsTable/Row | 18 | ||||
-rw-r--r-- | rt/html/Elements/Footer | 47 | ||||
-rw-r--r-- | rt/html/Elements/Header | 119 | ||||
-rw-r--r-- | rt/html/Elements/Menu | 128 | ||||
-rw-r--r-- | rt/html/Elements/PageLayout | 222 | ||||
-rw-r--r-- | rt/html/Elements/QuickCreate | 37 | ||||
-rw-r--r-- | rt/html/Elements/SimpleSearch | 12 | ||||
-rw-r--r-- | rt/html/Elements/Tabs | 13 | ||||
-rw-r--r-- | rt/html/Elements/TicketList | 46 | ||||
-rw-r--r-- | rt/html/Elements/TitleBoxStart | 49 |
10 files changed, 421 insertions, 270 deletions
diff --git a/rt/html/Elements/CollectionAsTable/Row b/rt/html/Elements/CollectionAsTable/Row index 0de362ea8..64ecef41c 100644 --- a/rt/html/Elements/CollectionAsTable/Row +++ b/rt/html/Elements/CollectionAsTable/Row @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -53,17 +55,17 @@ $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' ) { + if ( defined $column->{title} && $column->{title} eq 'NEWLINE' ) { while ( $item < $maxitems ) { $m->out(qq{<td class="collection-as-table"> </td>\n}); $item++; } $item = 0; - $m->out('</TR>'); - $m->out('<TR class="' + $m->out('</tr>'); + $m->out('<tr class="' . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' ); next; @@ -99,7 +101,7 @@ foreach my $column (@Format) { # Simple value; just escape it. @out = $m->interp->apply_escapes( $value => 'h' ); } - s/\n/<br>/gs for @out; + s/\n/<br \/>/gs for @out; $m->out( @out ); } else { @@ -108,5 +110,5 @@ foreach my $column (@Format) { } $m->out('</td>'); } -$m->out('</TR>'); +$m->out('</tr>'); </%PERL> diff --git a/rt/html/Elements/Footer b/rt/html/Elements/Footer index 78a116f38..00a3c33d0 100644 --- a/rt/html/Elements/Footer +++ b/rt/html/Elements/Footer @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,20 +45,27 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -% if ($Menu) { -</td> -</tr> -<tr> -<td> -% } +%# End of div#body from /Elements/PageLayout +</div> <& /Elements/Callback, %ARGS &> +<div id="footer"> + <p id="time"> + <span><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></span> + </p> + <!-- -<div class="bpscredits"> -<&|/l, '»|«', $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> + <p id="bpscredits"> + <span> +<&|/l, '»|«', $RT::VERSION, '2006', '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>', &>[_1] RT [_2] Copyright 1996-[_3] [_4].</&> +</span> +</p> % 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> + <p id="legal"> +<&|/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 /> + </p> % } + </div> --> % if ($Debug >= 2 ) { @@ -66,17 +75,9 @@ <%$d->Dump() %> </pre> % } -<div class="page-stats"><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></div> -% if ($Menu) { -</TD> -</TR> -</TABLE> -</TD> -</TR> -</TABLE> -% } -</BODY> -</HTML> + + </body> +</html> % $m->abort(); <%ARGS> diff --git a/rt/html/Elements/Header b/rt/html/Elements/Header index b5512aae9..f40d45ee1 100644 --- a/rt/html/Elements/Header +++ b/rt/html/Elements/Header @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,59 +45,74 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -%#<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<HTML> -<HEAD> -<TITLE><%$Title%></TITLE> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> + +<title><%$Title%></title> + % if ($Refresh && $Refresh > 0) { -<META HTTP-EQUIV="REFRESH" CONTENT="<%$Refresh%>"> + <meta http-equiv="refresh" content="<%$Refresh%>" /> % } <link rel="shortcut icon" href="<%$RT::WebImagesURL%>/favicon.png" type="image/png" /> -<link media="all" rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/webrt.css" type="text/css" /> -<link media="print" rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/printrt.css" type="text/css" /> - -<script> -function hideshow(num) { - idstring = "element-" + num; - chunk = document.getElementById(idstring); - if ( chunk.style.display == "none") { - chunk.style.display = chunk.style.tag; - } else { - chunk.style.tag = chunk.style.display; - chunk.style.display = "none"; - } -} -</script> -<& /Elements/Callback, _CallbackName => 'Head', %ARGS &> -</HEAD> -<BODY BACKGROUND="<% $RT::URI::freeside::URL %>/images/background-cheat.png" STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0" -% if ($Focus) { -ONLOAD=" - var tmp = (document.getElementsByName('<% $Focus %>')); - if (tmp.length > 0) tmp[tmp.length-1].focus(); -" +<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/css/<% $RT::WebDefaultStylesheet %>/main.css" type="text/css" media="all" /> +<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/css/print.css" type="text/css" media="print" /> + +% if ( $RSSAutoDiscovery ) { + <link rel="alternate" href="<%$RSSAutoDiscovery%>" type="application/rss+xml" title="RSS RT Search" /> % } -> + +<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/util.js"></script> +<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/ahah.js"></script> +<script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/titlebox-state.js"></script> +<script type="text/javascript"><!-- + onLoadHook("loadTitleBoxStates()"); +% if ( $Focus ) { + onLoadHook("focusElementById('<% $Focus %>')"); +% } +% if ( $onload ) { + onLoadHook("<% $onload |n %>"); +% } +--></script> + +<& /Elements/Callback, _CallbackName => 'Head', %ARGS &> + +</head> + <body BACKGROUND="<% $RT::URI::freeside::URL %>/images/background-cheat.png" + STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0" + <% $id && qq[ id="comp-$id"] |n %> + > + +% if ($ShowBar) { + <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" STYLE="padding-left:0; padding-right:4"> <tr> <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') || 'ExampleCo' %></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> -<&|/l, "<b>".$session{'CurrentUser'}->Name."</b>" &>Logged in as [_1]</&> -<BR> -%if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) { -<A HREF="<%$RT::WebPath%><% $Prefs %>" ><&|/l&>Preferences</&></A> + +<div id="quickbar"> + <div id="quick-personal"> + <span class="hide"><a href="#skipnav"><&|/l&>Skip Menu</&></a> | </span> +% if ($session{'CurrentUser'}->Name) { + <&|/l, "<span>".$session{'CurrentUser'}->Name."</span>" &>Logged in as [_1]</&> +% if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) { + | <a href="<%$RT::WebPath%><%$Prefs%>"><&|/l&>Preferences</&></a> +% } +% } else { + <&|/l&>Not logged in.</&> % } -<& /Elements/Callback, %ARGS &> -% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { -| <A HREF="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL ? "?URL=".$URL : ''%>"><&|/l&>Logout</&></a> + <& /Elements/Callback, %ARGS &> +% unless (!$session{'CurrentUser'}->Name +% or ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth)) { + | <a href="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL ? "?URL=".$URL : ''%>"><&|/l&>Logout</&></a> % } -% } else { -<&|/l&>Not logged in.</&> + </div> % } + </td> </tr> @@ -124,22 +141,32 @@ ONLOAD=" </tr> </table> -<%INIT> +<%INIT> $r->headers_out->{'Pragma'} = 'no-cache'; $r->headers_out->{'Cache-control'} = 'no-cache'; + require RT::URI::freeside; + +my $id = $m->request_comp->path; +$id =~ s|^/||g; +$id =~ s|/|-|g; +$id =~ s|\.html$||g; +$id =~ s|index$||g + if $id ne 'index'; +$id =~ s|-$||g; </%INIT> <%ARGS> $Prefs => '/User/Prefs.html' -$Focus => 'focus' +#$Focus => 'focus' +$Focus => '' $Title => 'RT' $Code => undef $Refresh => 0 $Why => undef -$BgColor => '#ffffff' $ShowBar => 1 -$LoggedIn => 1 $URL => undef +$RSSAutoDiscovery => undef +$onload => undef </%ARGS> diff --git a/rt/html/Elements/Menu b/rt/html/Elements/Menu index 398e3ab07..b5b2bdad5 100644 --- a/rt/html/Elements/Menu +++ b/rt/html/Elements/Menu @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,66 +45,90 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -%# font size depends on level -% if ($level ge 3) { -% $size = $basesize-(6); -% } elsif ($level gt 0) { -% $size = $basesize-($level * 2); -% $padding = 2; -% } -% else { -% $size = $basesize; -% $padding = 5; -% } -<ul class="topnav" > -% my $sep=0; -% my $accesskey="1"; +<ul<% !$level ? ' id="system-menu"' : ''|n %><% $menu_class ? qq[ class="$menu_class"] : ''|n %>> +<div<% $menu_class ? qq[ class="$menu_class"] : ''|n %>><div class="wrapper"> +% my $sep = 0; +% my $postsep = 0; +% my $accesskey = 1; +% +% $count = 0; +% $class = {}; +% % foreach $tab (sort keys %{$toptabs}) { -% my $current = $current_toptab || ""; -% my $path = $toptabs->{$tab}->{'path'} || ""; -% $path =~ s#/index.html$##gi; -% $current =~ s#/index.html$##gi; -% if ( $path eq $current) { -% $class="currenttopnav" -% } else { -% $class="topnav" -% } -% my $style=""; -% if ($sep) { -% $style="minor"; -% } elsif ($level == 0 ) { -% $style="major"; -% } -% if ($toptabs->{$tab}->{'separator'}) { -% $sep=1; -% } else { -% $sep=0; -% } -% 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> +% $count++; +% +% my $current = $current_toptab || ""; +% my $path = $toptabs->{$tab}->{'path'} || ""; +% +% $path =~ s#/index.html$##gi; +% $current =~ s#/index.html$##gi; +% +% $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0; +% +% my @aclass; +% push @aclass, 'selected' +% if $path eq $current; +% +% push @aclass, 'odd' +% if $level % 2; +% +% $class->{a} = join ' ', @aclass; +% +% my @li; +% push @li, 'first' +% if $count == 1; +% +% push @li, 'pre-separator' +% if $sep; +% +% push @li, 'post-separator' +% if $postsep; +% +% $class->{li} = join ' ', @li; +% +% my $url = ($toptabs->{$tab}->{'path'}||'') =~ /^https?:/i +% ? $toptabs->{$tab}->{'path'} || '' +% : $RT::WebPath . "/" . $toptabs->{$tab}->{'path'}; +% + <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>> + <% $count > 1 && !$postsep && qq[<span class="bullet">· </span>]|n%> + <a href="<% $url %>" + <% $class->{a} && qq[ class="$class->{a}"] |n%> + <% !$level && " accesskey='".$accesskey++."'" |n%>> + <% $toptabs->{$tab}->{'title'} || ''%></a> %# Second-level items -%# if ($current_toptab eq $toptabs->{$tab}->{'path'}) { -%# commented out by jesse on 4 jan 2003 so that tickets/search and ticket/# can -%# both have menu items -% if ($toptabs->{$tab}->{'subtabs'}) { - <& /Elements/Menu, level => $level+1, - current_toptab => $toptabs->{$tab}->{'current_subtab'}, - toptabs => $toptabs->{$tab}->{'subtabs'} &></li> -% } -%# } +% if ($toptabs->{$tab}->{'subtabs'} +% and keys %{$toptabs->{$tab}->{'subtabs'}}) +% { + <& /Elements/Menu, level => $level+1, + current_toptab => $toptabs->{$tab}->{'current_subtab'}, + toptabs => $toptabs->{$tab}->{'subtabs'}, + last_level => $toptabs->{$tab}->{last_system_menu_level} &> +% } + </li> +% if ($sep) { + <li class="separator">···</li> +% } +% +% $postsep = $sep; % } +</div></div> </ul> <%INIT> -my ($tab, $subtab, $class, $size, $padding); -my $basesize=16; +my ($tab, $class, $count); +my @ul; +push @ul, 'last-menu-level' + if $last_level; +push @ul, 'odd' + if $level % 2; +my $menu_class = join ' ', @ul; </%INIT> <%ARGS> $current_toptab => "" $toptabs => undef $level => 0 +$last_level => 0 </%ARGS> diff --git a/rt/html/Elements/PageLayout b/rt/html/Elements/PageLayout index f13ee0dda..493f2275f 100644 --- a/rt/html/Elements/PageLayout +++ b/rt/html/Elements/PageLayout @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,72 +45,124 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<table class="black" border=0 cellspacing=0 cellpadding=0 width="100%"> -<tr> - <TD colspan=5 WIDTH="100%" STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>/images/black-gradient.png" HEIGHT="13" WIDTH="100%"></TD> -</tr> -<tr> -%# <th class="black" align="left" width=15%><span class="rtname"><%$AppName%></span> -%# </th> - <span class="topactions"> -% my $notfirst = 0; foreach my $action (sort keys %{$topactions}) { - <td class="blackright" ALIGN="right" VALIGN="center"> - <%$topactions->{"$action"}->{'html'} |n %> - </td> + <div id="topactions"> +% foreach my $action (reverse sort keys %{$topactions}) { + <span class="topaction"> +% $m->out($topactions->{"$action"}->{'html'}); + </span> % } - </span> -</tr> -</table> -<table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%"> -<TR> - <TD BGCOLOR="#000000" STYLE="padding:0" WIDTH="154"></TD> - <TD STYLE="padding:0" WIDTH="13"><IMG BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>/images/black-gray-corner.png"></TD> - <TD STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>/images/black-gray-top.png" HEIGHT="13" WIDTH="100%"></TD> -</TR> -%# Vertical menu -<TR height="100%"> -<TD valign="top" width="140" class="black"> - <& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &> -</TD> -<TD STYLE="padding:0" HEIGHT="100%" WIDTH=13 VALIGN="top"><IMG WIDTH="13" HEIGHT="100%" BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>/images/black-gray-side.png"></TD> -<td valign="top"> -<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> - <td class="<% $actions ? 'darkmediumgray' : 'bggray' %>" valign="top"> - <span class="title"><%$title%></span> -</td> -</tr> -<tr> -<td class="<% $actions ? 'darkmediumgrayright' : 'bggrayright' %>" valign="top"> - <span class="nav"> -% if ($actions) { -% my @actions; -% foreach my $action (sort keys %{$actions}) { -% if ($actions->{"$action"}->{'html'}) { -% push @actions, $actions->{"$action"}->{'html'}; + </div> + +%# End of div#quickbar from /Elements/Header +</div> + +<div id="nav"> +<& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &> +</div> + +<div id="header"> + <h1><%$title%></h1> + +% my $sep = 0; +% my $postsep = 0; +% my $count = 0; +% my $class = { }; +% + <ul id="page-menu"<% (($actions && %$actions) || ($subactions && %$subactions)) && q[ class="actions-present"] | n %>> + <div><div><div> +% if ($page_tabs) { +% foreach my $tab (sort keys %{$page_tabs}) { +% next if $tab =~ /^(?:current_toptab|this)$/; +% $count++; +% +% my $current = $page_tabs->{current_toptab} || ""; +% my $path = $page_tabs->{$tab}->{'path'} || ""; +% +% $path =~ s#/index.html$##gi; +% $current =~ s#/index.html$##gi; +% +% $sep = $toptabs->{$tab}->{'separator'} ? 1 : 0; +% +% $class->{a} = $path eq $current ? ' class="selected"' : undef; +% +% my @li; +% push @li, 'first' +% if $count == 1; +% +% push @li, 'pre-separator' +% if $sep; +% +% push @li, 'post-separator' +% if $postsep; +% +% $class->{li} = join ' ', @li; +% +% + <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && "· "|n%><a href="<%$RT::WebPath%>/<%$page_tabs->{$tab}->{'path'}%>"<%$class->{a}|n%><% $class->{a} ? ' name="focus"' : ''|n %>><% $page_tabs->{$tab}->{'title'} %></a></li> +% +% if ($sep) { + <li class="separator">···</li> +% } +% $postsep = $sep; +% } % } else { -% push @actions, qq|<a class="nav" href="|.$RT::WebPath."/".$actions->{$action}->{'path'}.qq|">|.$actions->{$action}->{'title'}."</a>"; + % } -% } -%#<% join(" | ", @actions) | n %> -<% '['. join("] [", @actions). '] ' | n %> -% if ($subactions) { -% my @actions; -% foreach my $action (sort keys %{$subactions}) { -% push @actions, $subactions->{"$action"}->{'html'}; -% } -<% join(" | ", @actions) | n %> + </div></div></div> + </ul> + +% if (($actions && %$actions) || ($subactions && %$subactions)) { + <ul id="actions-menu"> + <div><div><div> +% $sep = 0; +% $postsep = 0; +% $count = 0; +% $class = { }; +% +% for my $type ($actions, $subactions) { +% +% if ($type && %$type) { +% foreach my $action (sort keys %{$type}) { +% $count++; +% +% $sep = $type->{$action}->{'separator'} ? 1 : 0; +% +% my @li; +% push @li, 'first' +% if $count == 1; +% +% push @li, 'pre-separator' +% if $sep; +% +% push @li, 'post-separator' +% if $postsep; +% +% $class->{li} = join ' ', @li; +% + <li<% $class->{li} ? qq[ class="$class->{li}"] : ''|n %>><% $count > 1 && !$postsep && qq[<span class="bullet">· </span>]|n%> +% if ($type->{"$action"}->{'html'}) { + <% $type->{"$action"}->{'html'} | n %> +% } else { + <a href="<%$RT::WebPath%>/<%$type->{$action}->{'path'}%>"<% $type->{$action}->{class} && ' class="'.$type->{$action}->{class}.'"' |n %><% $type->{$action}->{id} && ' id="'.$type->{$action}->{id}.'"' |n %>><%$type->{$action}->{'title'}%></a> +% } + </li> +% if ($sep) { + <li class="separator">···</li> +% } +% $postsep = $sep; +% } % } % } - </span> - </td> -</tr> -<TR valign="top"> -<TD valign="top" width="100%" height="100%" class="mainbody" > + </div></div></div> + </ul> +% } +</div> + +<div id="body"> <& /Elements/Callback, _CallbackName => 'BeforeBody', %ARGS &> %$m->flush_buffer(); # we've got the page laid out, let's flush the buffer; -<%INIT> +<%INIT> foreach my $tab (sort keys %{$toptabs}) { if ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) { $toptabs->{$tab}->{"subtabs"} = $tabs; @@ -120,7 +174,53 @@ if (! defined($AppName)) { $AppName = loc("RT for [_1]", $RT::rtname); } +my ($menu_depth, $almost_last, $page_tabs); + +if ($RT::WebDefaultStylesheet ne '3.4-compat') { + ($menu_depth, $almost_last) = @{$m->comp('.menu_recurse', data => $toptabs)}; + + if (defined $almost_last->{subtabs} and %{$almost_last->{subtabs}}) { + $page_tabs = { + current_toptab => $almost_last->{current_subtab}, + %{$almost_last->{subtabs}}, + }; + + delete $almost_last->{subtabs}; + delete $almost_last->{current_subtab}; + } +} </%INIT> + +%# There's probably a better way to do this that involves three times as +%# much work and redoing the whole menu/tab system... which would seem a +%# bit out of scope. +%# +%# This function recurses through the menu and returns the second to +%# last menu, that is, the menu holding the last reference to +%# and submenu. It also returns the number of menu levels minus +%# the last submenu. +<%def .menu_recurse> + <%args> + $data => { } + $pdata => { } + $ppdata => { } + $level => 0 + </%args> + <%init> + for my $key (keys %$data) { + return $m->comp('.menu_recurse', data => $data->{$key}->{subtabs}, + pdata => $data->{$key}, + ppdata => $pdata, + level => $level+1) + if ref($data->{$key}) eq 'HASH' + and defined $data->{$key}->{subtabs} + and %{$data->{$key}->{subtabs}}; + } + $ppdata->{last_system_menu_level}++; + return [$level, $pdata]; + </%init> +</%def> + <%ARGS> $current_toptab => undef $current_tab => undef @@ -130,5 +230,5 @@ $tabs => undef $actions => undef $subactions => undef $title => $m->callers(-1)->path -$AppName => '' +$AppName => undef </%ARGS> diff --git a/rt/html/Elements/QuickCreate b/rt/html/Elements/QuickCreate index 0b97121a4..75b3a4598 100644 --- a/rt/html/Elements/QuickCreate +++ b/rt/html/Elements/QuickCreate @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,28 +45,27 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/TitleBoxStart, title => loc('Quick ticket creation') &> +<div class="quick-create"> +<&| /Widgets/TitleBox, title => loc('Quick ticket creation') &> <form method="post" action="<%$RT::WebPath%>/<% $RT::QuickCreateLong ? 'Ticket/Create.html' : 'index.html' %>"> -<input type="hidden" name="QuickCreate" value="1"> +<input type="hidden" class="hidden" name="QuickCreate" value="1" /> <table> -<tr> -<td> -<font size="-2"><&|/l&>Subject</&>:<br><input size="30" name="Subject"></font> -</td> -<td> -<font size="-2"><&|/l&>Queue</&>:<br><& /Elements/SelectQueue, Name => 'Queue', ShowNullOption => 0 &></font> -</td> -<td> -<font size="-2"><&|/l&>Owner</&>:<br> +<tr><td> +<&|/l&>Subject</&>:<br /><input size="30" name="Subject" /> +</td><td> +<&|/l&>Queue</&>:<br /><& /Elements/SelectNewTicketQueue, Name => 'Queue', ShowNullOption => 0 &> +</td><td> +<&|/l&>Owner</&>:<br /> <select type="select" name="Owner"> -<option value="<%$session{'CurrentUser'}->id%>" SELECTED><%$session{'CurrentUser'}->Name %></option> +<option value="<%$session{'CurrentUser'}->id%>" selected><%$session{'CurrentUser'}->Name %></option> <option value="<%$RT::Nobody->id%>"><%loc('Nobody')%></option> </select> -</font> </td> </tr> -%#<tr><td colspan="3"><font size="-2"><textarea cols="50" rows="3"></textarea></font></td></tr> +%#<tr><td colspan="3"><textarea cols="50" rows="3"></textarea></td></tr> </table> -<div align="right"><input type="submit" value="<%loc('Create')%>"></div> +<div align="right"><input type="submit" class="button" value="<%loc('Create')%>" /></div> </form> -<& /Elements/TitleBoxEnd &> +</&> +</div> + diff --git a/rt/html/Elements/SimpleSearch b/rt/html/Elements/SimpleSearch index e9fc5c6ed..a4fd7e270 100644 --- a/rt/html/Elements/SimpleSearch +++ b/rt/html/Elements/SimpleSearch @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,14 +45,14 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<form action="<% $RT::WebPath %>/index.html" STYLE="margin:0"> +<form action="<% $RT::WebPath %>/Search/Simple.html" STYLE="margin:0"> <SCRIPT TYPE="text/javascript"> function clearhint_search_ticket (what) { if ( what.value == '(ticket # or subject string)' ) what.value = ''; } </SCRIPT> -<input name="q" accesskey="0" VALUE="(ticket # or subject string)" onFocus="clearhint_search_ticket(this);" onClick="clearhint_search_ticket(this);" STYLE="text-align:right; font-family: Arial, Verdana, Helvetica, sans-serif;"><BR> +<input name="q" autocomplete="off" accesskey="0" class="field" VALUE="(ticket # or subject string)" onFocus="clearhint_search_ticket(this);" onClick="clearhint_search_ticket(this);" STYLE="text-align:right; font-family: Arial, Verdana, Helvetica, sans-serif;"><BR> <A HREF="<% $RT::WebPath %>/Search/Build.html" STYLE="color: #ffffff; font-size: 70%; font-weight:normal">Advanced</A> -<input type="submit" value="<&|/l&>Search tickets</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%;padding-left:2px;padding-right:2px"> +<input type="submit" class="fsblackbutton" value="<&|/l&>Search tickets</&>" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%;padding-left:2px;padding-right:2px"> </form> diff --git a/rt/html/Elements/Tabs b/rt/html/Elements/Tabs index bbea3fe9a..f94711c3c 100644 --- a/rt/html/Elements/Tabs +++ b/rt/html/Elements/Tabs @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -78,11 +80,14 @@ my $basetabs = { title => 'Ticketing Main', path => '', }, - B => { title => loc('Search Tickets'), + Ab => { title => loc('Simple Ticket Search'), + path => 'Search/Simple.html' + }, + B => { title => loc('Adv. Ticket Search'), path => 'Search/Build.html' }, C => { title => loc('Tools'), - path => 'Tools/Offline.html' + path => 'Tools/index.html' }, P => { title => loc('Approval'), path => 'Approvals/' diff --git a/rt/html/Elements/TicketList b/rt/html/Elements/TicketList index 4195d6320..02b071624 100644 --- a/rt/html/Elements/TicketList +++ b/rt/html/Elements/TicketList @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,7 +45,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%> +<table border="0" cellspacing="0" cellpadding="1" width="100%"> % if ($ShowHeader) { <& /Elements/CollectionAsTable/Header, @@ -69,7 +71,7 @@ <& /Elements/CollectionAsTable/Row, Format => \@Format, i => $i, record => $record, maxitems => $maxitems &> % } -</TABLE> +</table> % if ($Rows && $ShowNavigation) { <hr> @@ -77,7 +79,9 @@ % if (($TotalFound % $Rows) == 0) { % $oddRows = 0; % } else { $oddRows = 1; } -<&|/l, $Page, int($TotalFound/$Rows)+$oddRows&>Page [_1] of [_2]</&> +% my $pages = int($TotalFound/$Rows)+$oddRows; +% $pages = 1 if $pages < 1; +<&|/l, $Page, $pages &>Page [_1] of [_2]</&> <%perl> my $prev = $m->comp( @@ -100,18 +104,27 @@ my $next = $m->comp( ); </%perl> % if ($Page > 1) { -<A href="<%$BaseURL%><%$prev%>"><&|/l&>Previous Page</&></a> +<a href="<%$BaseURL%><%$prev%>"><&|/l&>Previous Page</&></a> % } % if (($Page * $Rows) < $TotalFound) { -<A href="<%$BaseURL%><%$next%>"><&|/l&>Next Page</&></a> +<a href="<%$BaseURL%><%$next%>"><&|/l&>Next Page</&></a> % } % } <%INIT> my $maxitems = 0; $Format ||= $RT::DefaultSearchResultFormat; + +# DisplayFormat lets us use a "temporary" format for display, while +# still using our original format for next/prev page links. +# bulk update uses this feature to add checkboxes + + +$DisplayFormat ||= $Format; + # Scrub the html of the format string to remove any potential nasties. $Format = $m->comp('/Elements/ScrubHTML', Content => $Format); +$DisplayFormat = $m->comp('/Elements/ScrubHTML', Content => $DisplayFormat); unless ($Collection) { @@ -119,13 +132,13 @@ unless ($Collection) { $Collection->FromSQL($Query); } -my (@Format) = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $Format); +my (@Format) = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $DisplayFormat); # Find the maximum number of items in any row, so we can pad the table. my $item = 0; foreach my $col (@Format) { $item++; - if ( $col->{title} eq 'NEWLINE' ) { + if ( $col->{title} && ($col->{title} eq 'NEWLINE') ) { $item = 0; } else { @@ -133,10 +146,20 @@ foreach my $col (@Format) { } } +if ($OrderBy =~ /\|/) { + # Multiple Sorts + my @OrderBy = split /\|/,$OrderBy; + my @Order = split /\|/,$Order; + $Collection->OrderByCols( + map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } ( 0 + .. $#OrderBy ) );; +} else { + $Collection->OrderBy(FIELD => $OrderBy, ORDER => $Order); +} -$Collection->OrderBy(FIELD => $OrderBy, ORDER => $Order); $Collection->RowsPerPage($Rows) if ($Rows); -$Collection->GotoPage($Page-1); # SB uses page 0 as the first page +$Page = 1 unless $Page > 0; # workaround problems with Page = '' or undef +$Collection->GotoPage( $Page - 1 ); # SB uses page 0 as the first page my $TotalFound = $Collection->CountAll(); </%INIT> @@ -151,6 +174,7 @@ $Order => undef $OrderBy => undef $BaseURL => undef $Format => $RT::DefaultSearchResultFormat +$DisplayFormat => undef $ShowNavigation => 1 $ShowHeader => 1 </%ARGS> diff --git a/rt/html/Elements/TitleBoxStart b/rt/html/Elements/TitleBoxStart index d98fe2744..ba24fd92e 100644 --- a/rt/html/Elements/TitleBoxStart +++ b/rt/html/Elements/TitleBoxStart @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,46 +45,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<TABLE CLASS="box <%$class|n%>" - BGCOLOR="<%$color%>" - CELLSPACING=0 - BORDER=0 - WIDTH="<%$width%>" - CELLPADDING="0"> - - <TR> - <TH - <%$color && "style=\"color: $color;\""|n%> - <%$class ? "class=\"$class\"" : "class=\"titlebox\""|n%>> - <span class="titleboxclose"> - <a href="#" onClick="hideshow('<%$id%>')">X</A></span> - <span class="titleboxtitle"> - <b><% $title_href && "<A $title_class HREF=\"$title_href\">"|n%><%$title |n %><% $title_href && "</A>" |n%></b> - </span> - </TH> - <TH - <%$color && "style=\"color: $color;\""|n%> - <%$class ? "class=\"$class\"": "class=\"titleboxright\""|n%>> - <span class="titleboxright"><%$titleright ? $titleright : ' ' |n %></span> - </TH> - </TR> - <tr id="element-<%$id%>"> - <td bgcolor="<%$contentbg%>" colspan="3" class="<%defined($bodyclass) ? $bodyclass : $class|n%>"> -<%ARGS> -$width => "100%" -$class => undef -$bodyclass => undef -$title_href => undef -$title => undef -$title_class => '' - -$titleright_href => undef -$titleright => undef -$contentbg => "#d4d4d4" -$color => "#336699" -</%ARGS> <%init> -my $id = rand(2000); - -$title_class = "CLASS=\"$title_class\"" if $title_class; +# For compatibility with 3.4 +$m->comp('/Widgets/TitleBoxStart', %ARGS ); </%init> |