merging RT_3_6_4 to HEAD
authorivan <ivan>
Fri, 3 Aug 2007 21:49:03 +0000 (21:49 +0000)
committerivan <ivan>
Fri, 3 Aug 2007 21:49:03 +0000 (21:49 +0000)
23 files changed:
rt/FREESIDE_MODIFIED
rt/etc/RT_SiteConfig.pm
rt/html/Elements/CollectionAsTable/Row
rt/html/Elements/Footer
rt/html/Elements/Header
rt/html/Elements/Menu
rt/html/Elements/PageLayout
rt/html/Elements/QuickCreate
rt/html/Elements/SimpleSearch
rt/html/Elements/Tabs
rt/html/Elements/TicketList
rt/html/Elements/TitleBoxStart
rt/html/NoAuth/images/space.gif [deleted file]
rt/html/NoAuth/printrt.css [deleted file]
rt/html/NoAuth/webrt.css [deleted file]
rt/html/Search/Bulk.html
rt/html/Ticket/Elements/ShowMemberOf [deleted file]
rt/html/Ticket/Elements/ShowReferences [deleted file]
rt/html/Ticket/Elements/ShowSummary
rt/html/Ticket/Elements/Tabs
rt/html/Widgets/TitleBoxStart
rt/lib/RT/SearchBuilder.pm
rt/sbin/rt-setup-database.in

index 7e6d8df..d87abd2 100644 (file)
@@ -10,6 +10,7 @@ lib/RT/URI/freeside/XMLRPC.pm
  html/Elements/Header
  html/Elements/Menu
  html/Elements/PageLayout
+ html/Elements/QuickCreate
  html/Elements/SimpleSearch
  html/Elements/Tabs
  html/Elements/Footer
@@ -23,9 +24,6 @@ html/Ticket/ModifyCustomers.html
 html/NoAuth/images/small-logo.png
  html/NoAuth/webrt.css
 
-html/Elements/TitleBoxStart
-html/Search/Bulk.html
-
 html/Elements/FreesideNewCust
 html/Elements/FreesideSearch
 html/Elements/FreesideSvcSearch
index 5e3dc80..ef110db 100644 (file)
@@ -17,7 +17,7 @@
 #Set( $rtname, 'example.com');
 
 # These settings should have been inserted by the initial Freeside install.
-# Somtimes you may want to change domain, timezone, or freeside::URL later,
+# Sometimes you may want to change domain, timezone, or freeside::URL later,
 # everything else should probably stay untouched.
 
 $RT::rtname = '%%%RT_DOMAIN%%%';
index 0de362e..64ecef4 100644 (file)
@@ -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">&nbsp;</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>
index 78a116f..00a3c33 100644 (file)
@@ -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:
 %# 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,     '&#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>
+  <p id="bpscredits">
+    <span>
+<&|/l,     '&#187;&#124;&#171;', $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 ) {
 <%$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>
index b5512aa..f40d45e 100644 (file)
@@ -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:
 %# 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>
index 398e3ab..b5b2bda 100644 (file)
@@ -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:
 %# 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">&#183; </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">&#183;&#183;&#183;</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>
index f13ee0d..493f227 100644 (file)
@@ -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:
 %# 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 && "&#183; "|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">&#183;&#183;&#183;</li>
+%         }
+%         $postsep = $sep;
+%     }
 % } else {
-% push @actions,  qq|<a class="nav" href="|.$RT::WebPath."/".$actions->{$action}->{'path'}.qq|">|.$actions->{$action}->{'title'}."</a>";
+&nbsp;
 % }
-%  }
-%#<% join(" | ", @actions) | n %>
-<% '['. join("] [", @actions). ']&nbsp;' | 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">&#183; </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">&#183;&#183;&#183;</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>
index 0b97121..75b3a45 100644 (file)
@@ -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:
 %# 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>
+
index e9fc5c6..a4fd7e2 100644 (file)
@@ -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:
 %# 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>
index bbea3fe..f94711c 100644 (file)
@@ -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/'
index 4195d63..02b0716 100644 (file)
@@ -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>
index d98fe27..ba24fd9 100644 (file)
@@ -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:
 %# 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>&nbsp;
-      <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 : '&nbsp;' |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>
diff --git a/rt/html/NoAuth/images/space.gif b/rt/html/NoAuth/images/space.gif
deleted file mode 100644 (file)
index 1d11fa9..0000000
Binary files a/rt/html/NoAuth/images/space.gif and /dev/null differ
diff --git a/rt/html/NoAuth/printrt.css b/rt/html/NoAuth/printrt.css
deleted file mode 100644 (file)
index 72e7e8b..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
-%# 
-%# 
-%# 
-%# 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
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%# 
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%# 
-%# 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.
-%# 
-%# 
-%# 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
-%#
-%# Special stylesheet for printing tickets
-%# Koos van den Hout koos@cs.uu.nl 2005-11-21
-%#
-
-SPAN.nav { display: none !important; }
-.nav2 { display: none !important; }
-.nav { display: none !important; }
-.topnav { display: none !important; }
-.blue { display: none !important; }
-.darkblue { display: none !important; }
-.blueright { display: none !important; }
-.currentnav { display: none !important; }
-th.titlebox { border-top: none; border-bottom: none; }
-th.titleboxright { display:none !important; border-top: none; border-bottom: none; }
-.titlebox { border-top: none; border-bottom: none; }
-
-div.downloadattachment, div.downloadcontenttype {
-       display: none !important;
-}
-
-
-a[href$="Respond"], a[href$="Comment"], a[href*="ShowEmailRecord"] {
-       display: none !important;
-}
-
-
-%# Provide a callback for adding/modifying the style sheet.
-%# http://www.w3.org/TR/REC-CSS1 - section 3.2, says:
-%#   "latter specified rule wins"
-<& /Elements/Callback &>
-<%flags>
-inherit => undef
-</%flags>
-<%init>
-$r->content_type('text/css');
-$r->headers_out->{'Expires'} = '+30m';
-</%init>
diff --git a/rt/html/NoAuth/webrt.css b/rt/html/NoAuth/webrt.css
deleted file mode 100644 (file)
index 5da0f83..0000000
+++ /dev/null
@@ -1,759 +0,0 @@
-/*
-%# BEGIN BPS TAGGED BLOCK {{{
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC 
-%#                                          <jesse@bestpractical.com>
-%# 
-%# (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
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%# 
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%# 
-%# 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.
-%# 
-%# 
-%# 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 }}}
-*/
-
-/* * {
-  font-family: Arial, Verdana, Helvetica, sans-serif;
-  font-size: 1.2em;
-} */
-
-SPAN.nav {  font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 12px;
-        color: #FFFFFF;
-        text-decoration: none;
-        white-space: nowrap}
-.nav2 {         font-size: 10px;
-        white-space: nowrap}
-.nav {  font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 13px;
-        font-weight: bold;
-        color: #FFFFFF;
-        text-decoration: none;
-        white-space: nowrap}
-.currentnav {  font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 13px;
-         font-weight: bold;
-        color: #FFFF66;
-        text-decoration: none;
-        white-space: nowrap}
-.topnav {  font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 16px;
-        font-weight: normal;
-        color: #FFFFFF;
-        text-decoration: none;
-        white-space: nowrap}
-
-/*
-%# .topnav is the original RT class for the sidebar navigation tabs.
-%# Font-sizing by level depth was originally hard-coded into Elements/Menu.
-%# This modification sets a different class name for each level, allowing
-%# style sheet control over the formats.
-*/
-
-a.topnav-0 {  font-family: Verdana, Arial, Helvetica, sans-serif;
-        font-size: 16px;
-        font-weight: normal;
-        color: #FFFFFF;
-        text-decoration: none;
-        white-space: nowrap}
-a.topnav-1 {  font-family: Verdana, Arial, Helvetica, sans-serif;
-        font-size: 14px;
-        font-weight: normal;
-        color: #FFFFFF;
-        text-decoration: none;
-        white-space: nowrap}
-a.topnav-2 {  font-family: Verdana, Arial, Helvetica, sans-serif;
-        font-size: 12px;
-        font-weight: normal;
-        color: #FFFFFF;
-        text-decoration: none;
-        white-space: nowrap}
-a.topnav-3 {  font-family: Verdana, Arial, Helvetica, sans-serif;
-        font-size: 11px;
-        font-weight: normal;
-        color: #FFFFFF;
-        text-decoration: none;
-        white-space: nowrap}
-a.topnav-4 {  font-family: Verdana, Arial, Helvetica, sans-serif;
-        font-size: 11px;
-        font-weight: normal;
-        color: #FFFFFF;
-        text-decoration: none;
-        white-space: nowrap}
-a.topnav-5 {  font-family: Verdana, Arial, Helvetica, sans-serif;
-        font-size: 11px;
-        font-weight: normal;
-        color: #FFFFFF;
-        text-decoration: none;
-        white-space: nowrap}
-li.topnav-0-minor {
-        border-top: solid #777777 1px;
-        padding-top: .1em;
-        margin-top: .5em;
-}
-li.topnav-1-minor {
-        border-top: solid #777777 1px;
-        padding-top: .1em;
-        margin-top: .5em;
-}
-li.topnav-2-minor {
-        border-top: solid #777777 1px;
-        padding-top: .1em;
-        margin-top: .5em;
-}
-li.topnav-3-minor {
-        border-top: solid #777777 1px;
-        padding-top: .1em;
-        margin-top: .5em;
-}
-li.topnav-4-minor {
-        border-top: solid #777777 1px;
-        padding-top: .1em;
-        margin-top: .5em;
-}
-li.topnav-5-minor {
-        border-top: solid #777777 1px;
-        padding-top: .1em;
-        margin-top: .5em;
-}
-li.topnav-0-major {
-        border-bottom: solid black 1px;
-        padding-top: .25em;
-        padding-bottom: .5em;
-}
-li.topnav-1-major {
-        border-bottom: solid black 1px;
-        padding-top: .25em;
-        padding-bottom: .5em;
-}
-li.topnav-2-major {
-        border-bottom: solid black 1px;
-        padding-top: .25em;
-        padding-bottom: .5em;
-}
-li.topnav-3-major {
-        border-bottom: solid black 1px;
-        padding-top: .25em;
-        padding-bottom: .5em;
-}
-li.topnav-4-major {
-        border-bottom: solid black 1px;
-        padding-top: .25em;
-        padding-bottom: .5em;
-}
-li.topnav-5-major {
-        border-bottom: solid black 1px;
-        padding-top: .25em;
-        padding-bottom: .5em;
-}
-
-.currenttopnav {  font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 16px;
-         font-weight: bold;
-        color: #ffffff; background-color: #7e0079;
-        text-decoration: none;
-        white-space: nowrap}
-
-/*
-%# .currenttopnav is the original RT class for the sidebar navigation tabs.
-%# Font-sizing by level depth was originally hard-coded into Elements/Menu.
-%# This modification sets a different class name for each level, allowing
-%# style sheet control over the formats
-*/
-
-a.currenttopnav-0 {  font-family: Verdana, Arial, Helvetica, sans-serif;
-        font-size: 16px;
-         font-weight: bold;
-        color: #ffffff; background-color: #7e0079;
-        text-decoration: none;
-        white-space: nowrap}
-a.currenttopnav-1 {  font-family: Verdana, Arial, Helvetica, sans-serif;
-        font-size: 14px;
-         font-weight: bold;
-        color: #ffffff; background-color: #7e0079;
-        text-decoration: none;
-        white-space: nowrap}
-a.currenttopnav-2 {  font-family: Verdana, Arial, Helvetica, sans-serif;
-        font-size: 12px;
-         font-weight: normal;
-        color: #ffffff; background-color: #7e0079;
-        text-decoration: none;
-        white-space: nowrap}
-a.currenttopnav-3 {  font-family: Verdana, Arial, Helvetica, sans-serif;
-        font-size: 11px;
-         font-weight: normal;
-        color: #ffffff; background-color: #7e0079;
-        text-decoration: none;
-        white-space: nowrap}
-a.currenttopnav-4 {  font-family: Verdana, Arial, Helvetica, sans-serif;
-        font-size: 11px;
-         font-weight: normal;
-        color: #ffffff; background-color: #7e0079;
-        text-decoration: none;
-        white-space: nowrap}
-a.currenttopnav-5 {  font-family: Verdana, Arial, Helvetica, sans-serif;
-        font-size: 11px;
-         font-weight: normal;
-        color: #ffffff; background-color: #7e0079;
-        text-decoration: none;
-        white-space: nowrap}
-li.currenttopnav-0-minor {
-        border-top: solid #999999 1px;
-        padding-top: .1em;
-        margin-top: .5em;
-}
-li.currenttopnav-1-minor {
-        border-top: solid #777777 1px;
-        padding-top: .1em;
-        margin-top: .5em;
-}
-li.currenttopnav-2-minor {
-        border-top: solid #777777 1px;
-        padding-top: .1em;
-        margin-top: .5em;
-}
-li.currenttopnav-3-minor {
-        border-top: solid #777777 1px;
-        padding-top: .1em;
-        margin-top: .5em;
-}
-li.currenttopnav-4-minor {
-        border-top: solid #777777 1px;
-        padding-top: .1em;
-        margin-top: .5em;
-}
-li.currenttopnav-5-minor {
-        border-top: solid #777777 1px;
-        padding-top: .1em;
-        margin-top: .5em;
-}
-li.currenttopnav-0-major {
-        border-bottom: solid black 1px;
-        padding-top: .25em;
-        padding-bottom: .5em;
-}
-li.currenttopnav-1-major {
-        border-bottom: solid black 1px;
-        padding-top: .25em;
-        padding-bottom: .5em;
-}
-li.currenttopnav-2-major {
-        border-bottom: solid black 1px;
-        padding-top: .25em;
-        padding-bottom: .5em;
-}
-li.currenttopnav-3-major {
-        border-bottom: solid black 1px;
-        padding-top: .25em;
-        padding-bottom: .5em;
-}
-li.currenttopnav-4-major {
-        border-bottom: solid black 1px;
-        padding-top: .25em;
-        padding-bottom: .5em;
-}
-li.currenttopnav-5-major {
-        border-bottom: solid black 1px;
-        padding-top: .25em;
-        padding-bottom: .5em;
-}
-
-.topactions {  font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 10px;
-        color: #FFFFFF;
-        text-decoration: none;
-        white-space: nowrap}
-.subnav {  font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 11px;
-        font-weight: normal;
-        color: #FFFFFF;
-        text-decoration: none;
-        white-space: nowrap}
-.currentsubnav {  font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 11px;
-         font-weight: bold;
-        color: #FFFF66;
-        text-decoration: none;
-        white-space: nowrap}
-.error {  background-color: #ff0000;
-        background-position: left top;
-        vertical-align: top;
-        text-align: left;
-         }
-.oldblue {  background-color: #0066CC;
-        background-position: left top;
-        vertical-align: top;
-        text-align: left;
-         }
-.blue {
-        background-color: #4682B4;
-/* %#   background-color: #eeeeee; */
-        background-position: left top;
-        vertical-align: top;
-        text-align: left;
-         }
-/* %# Actually the "topactions" section */
-.blueright {  background-color: #4682B4;
-        background-position: left top;
-        vertical-align: top;
-        text-align: right;
-         padding-right: 1em;
-         }
-.olddarkblue {  background-color: #003399;
-        background-position: left top;
-        vertical-align: top;
-        text-align: left;
-         }
-.darkblue {
-        background-color: #000080;
-        background-position: left top;
-        vertical-align: top;
-        text-align: left;
-         }
-.darkblueright { 
-        background-color: #000080;
-        background-position: left top;
-        vertical-align: top;
-        text-align: right;
-         }
-.lightgray {
-        background-color: #eeeeee;
-        background-position: left top;
-        vertical-align: top;
-        text-align: left;
-         }
-.lightgrayright { 
-        background-color: #eeeeee;
-        background-position: left top;
-        vertical-align: top;
-        text-align: right;
-         }
-.black {
-        background-color: #000000;
-        color: #ffffff;
-        background-position: left top;
-        vertical-align: top;
-        text-align: left;
-         }
-.blackright { 
-        background-color: #000000;
-        color: #ffffff;
-        background-position: left top;
-        vertical-align: center;
-        text-align: right;
-        font-size:16px;
-        padding-right:4px
-         }
-
-input.fsblackbutton {
-        background-color:#333333;
-        color: #ffffff;
-        border:1px solid;
-        border-top-color:#cccccc;
-        border-left-color:#cccccc;
-        border-right-color:#aaaaaa;
-        border-bottom-color:#aaaaaa;
-        font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-weight:bold;
-        padding-left:12px;
-        padding-right:12px;
-        overflow:visible;
-        filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff333333',EndColorStr='#ff666666')
-}
-
-input.fsblackbuttonselected {
-        background-color:#7e0079;
-        color: #ffffff;
-        border:1px solid;
-        border-top-color:#cccccc;
-        border-left-color:#cccccc;
-        border-right-color:#aaaaaa;
-        border-bottom-color:#aaaaaa;
-        font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-weight:bold;
-        padding-left:12px;
-        padding-right:12px;
-        overflow:visible;
-        filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff330033',EndColorStr='#ff7e0079')
-}
-
-.mediumgray {
-        background-color: #cccccc;
-        background-position: left top;
-        vertical-align: top;
-        text-align: left;
-         }
-.mediumgrayright { 
-        background-color: #cccccc;
-        background-position: left top;
-        vertical-align: top;
-        text-align: right;
-         }
-.darkmediumgray {
-        background-color: #aaaaaa;
-        background-position: left top;
-        vertical-align: top;
-        text-align: left;
-         }
-.darkmediumgrayright { 
-        background-color: #aaaaaa;
-        background-position: left top;
-        vertical-align: top;
-        text-align: right;
-         }
-.bggray {
-        background-color: #e8e8e8;
-        background-position: left top;
-        vertical-align: top;
-        text-align: left;
-         }
-.bggrayright { 
-        background-color: #e8e8e8;
-        background-position: left top;
-        vertical-align: top;
-        text-align: right;
-         }
-.white {
-        background-color: #ffffff;
-        background-position: left top;
-        vertical-align: top;
-        text-align: left;
-         }
-.whiteright { 
-        background-color: #ffffff;
-        background-position: left top;
-        vertical-align: top;
-        text-align: right;
-         }
-.overdue {
-        color: red;
-}
-
-div.messagebody {
-    padding: 2em; 
-
-}
-
-
-div.downloadattachment {
-    font-size: 10px;
-    text-align: right;
-
-}
-
-
-td {  font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 12px;
-        background-position: left top;
-         }
-.black { background-color: #000000;
-        background-position: left top;
-         }
-span.rtname {  font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 18px;
-        font-weight: normal;
-        color: #ffffff}
-span.title {  font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 20px;
-        font-weight: bold;
-        color: #ffffff}
-.header {  font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 12px;
-        font-weight: bold;
-        color: #0066CC}
-.subheader { font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 11px;
-        font-weight: bold;
-        color: #0066CC }
-.value {       font-weight: bold; }
-.entry {       font-weight: normal; }
-.label {       font-weight: normal;
-              text-align: right; }
-.labeltop {       font-weight: normal;
-              text-align: right;
-              vertical-align: top }
-.productnav {  font-family: Arial, Verdana, Helvetica, sans-serif;
-        font-size: 11px;
-        color: #FFFFFF;
-        text-align: center;
-        vertical-align: middle;
-        text-decoration: none}
-.rtblue { background-color: #3399FF;
-         margin-top: 0.2em;
-        background-position: left top;
-        vertical-align: top }
-
-
-.currenttab { margin: 0.2em; background: #336699; }
-.othertab { margin: 0.2em; background: #efefef; }
-.oddline { background-color : #ccccee; }
-
-UL.topnav LI :focus { text-decoration: underline; }
-
-TD.mainbody {
-        padding-top: 0.5em;
-        padding-left: 1em;
-        padding-right: 1em;
-        margin-left: 1em;
-        margin-right: 1em;
-        background-color: #e8e8e8;
-}
-
-td.boxcontainer + td.boxcontainer {
-       margin-left: 1em;
-       padding-left: 1em;
-       border-collapse: collapse;
-}
-
-th.ticketheader { font-size: 80%;
-     font-weight: bold;
-     color: #336699;
-     background: #cccccc; 
-}
-
-th.titlebox {
-        text-align: left;
-        padding-left: 0.5em;
-        padding-right: 0.5em;
-        margin-left: 0.5em;
-        margin-right: 0.5em;
-        border-top: solid black 1px;
-        border-bottom: solid black 1px;
-}    
-th.titleboxright {
-        text-align: right;
-        padding-left: 0.5em;
-        padding-right: 0.5em;
-        margin-left: 0.5em;
-        margin-right: 0.5em;
-        border-top: solid black 1px;
-        border-bottom: solid black 1px;
-}    
-
-TD.titlebox {
-        padding-left: 1em;
-        padding-right: 1em;
-        padding-top: 1em;
-        padding-bottom: 1em;
-}
-
-SPAN.message {
-       font-size: 100%;
-        font-family: Arial, Verdana, Helvetica, sans-serif;
-}
-
-
-BODY {
-  color: #000;
-  background: #FFFFFF;
-  font-family: Verdana, Arial, Helvetica, sans-serif;
-  margin-top: 0px;
-  margin-bottom: 0px;
-  margin-left: 0px;
-  margin-right: 0px;
-  border-top: 0px;
-  border-bottom: 0px;
-  border-left: 0px;
-  border-right: 0px;
-}
-
-
-TR.oddline { 
-    background-color : #ffffff;
-}
-
-TR.evenline { 
-    background-color : #ccccee;
-}
-
-H1, H2, H3 { 
-  margin-top: 0.2em;
-  color: #336699;
-  font-family: Verdana, Arial, Helvetica, sans-serif;
-
-  clear: both;
-}
-
-
-DIV.endmatter { margin-left: -7% }
-.bpscredits {margin-top: 1em;
-             text-align: right; 
-             color: #666666;
-             }
-
-
-A { font-weight: bold; color: #000000
-            }
-
-.currenttab { color: #ffffff;}
-.othertab { color: #336699; }
-
-.inverse { color: #ffffff; }
-
-
-
-A:link IMG, A:visited IMG { border-style: none }
-a:focus {text-decoration: underline }
-A IMG { color: white } /* The only way to hide the border in NS 4.x */
-
-/* a:link {  text-decoration: none} */
-/* a:visited {  text-decoration: none}   */
-
-a:hover {  text-decoration: underline}
-/* a:focus { background-color: #ccccee } */
-
-.hide {
-  display: none;
-  color: white;
-}
-
-SPAN.date { font-size: 0.8em }
-
-span.title { font-size: 1.6em;
-            vertical-align: middle;
-/* %#       color: #ffffff; */
-             color: #000000;
-           }
-span.productname { font-size: 2em;
-             color: #0066cc;}
-SPAN.titleboxtitle, SPAN.titleboxclose {
-        font-size: 80%;
-        color: #ffffff;
-        vertical-align: middle;
-        text-align: left;
-        }
-SPAN.titleboxtitle a {
-        color: #ffffff;
-}
-SPAN.titleboxtitle a:after {
-       content: "...";
-}
-
-SPAN.titleboxright {
-        font-size: 0.8em;
-        color: #ffffff;
-        vertical-align: middle;
-        text-align: right;
-        }
-
-SPAN.attribution {
-  font-weight: bold;
-}
-
-SPAN.label { font-size: 0.8em; 
-}
-
-DIV.page-stats { font-size: 0.8em;
-                  color: #cccccc;
-                  text-align: right;
-              }
-
-
-BLOCKQUOTE {
-  font-style: italic;
-}
-
-.emphasized {
-  font-weight: bold
-}
-
-
-.oddline { 
-        background-color : #ccccee;
-}
-
-ul.topnav {
-       list-style: none;
-       margin-left: 0;
-       margin-right: 0.25em;           
-       padding-left: 0.25em;
-       padding-bottom: 0;      
-       padding-top:0;
-       margin-top: 0;
-       margin-bottom:0;
-}
-
-.menu-major-separator {
-       border-bottom: solid white 1px;
-       padding-top: .25em;
-       padding-bottom: .5em;
-}
-
-.menu-minor-separator {
-        border-top: solid #999999 1px;
-       padding-top: .1em;
-       margin-top: .5em;
-}
-
-TH.collection-as-table {  text-align: center;
-                          font-size: 0.8em; 
-                          padding-left: .5em;
-                          padding-right: .5em;
-                          color: #333333;
-                          background-color: #cccccc;
-                          white-space: nowrap;
-                  }
-
-TD.collection-as-table {  text-align: left;
-                          padding-left: .5em;
-                          padding-right: .5em;
-                        }
-
-textarea.signature {
-    width: 100%;
-}
-textarea.comments {
-    width: 100%;
-}
-
-textarea.messagebox {
-    width: 100%;
-}
-
-/*
-%# Provide a callback for adding/modifying the style sheet.
-%# http://www.w3.org/TR/REC-CSS1 - section 3.2, says:
-%#   "latter specified rule wins"
-<& /Elements/Callback &>
-<%flags>
-inherit => undef
-</%flags>
-<%init>
-$r->content_type('text/css');
-#$r->headers_out->{'Expires'} = '+30m';
-</%init>
-*/
index b7c64e3..9742df5 100644 (file)
@@ -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:
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<& /Elements/Header, Title => loc("Bulk ticket update") &>
-<& /Elements/Tabs, Title => loc("Bulk ticket update") &>
+<& /Elements/Header, Title => $title &>
+<& /Ticket/Elements/Tabs, 
+    current_tab => "Search/Bulk.html",
+    Title => $title,
+    Format => $ARGS{'Format'}, # we don't want the locally modified one
+    Query => $Query,
+    Rows => $Rows,
+    OrderBy => $OrderBy,
+    Order => $Order &>
 
 <& /Elements/ListActions, actions => \@results &>
-<FORM METHOD="POST" ACTION="<%$RT::WebPath%>/Search/Bulk.html" >
-<input type="hidden" name="Query" value="<%$ARGS{'Query'}%>">
-<TABLE WIDTH=100% border=0 cellpadding=3 CELLSPACING=0>
-<TR>
-<TH><&|/l&>Update</&></TH>
-%foreach my $col (@cols) {
-% my $colalias = $col;
-% $colalias =~ s/(Obj\-\>|)(Name|AsString)//;
-
-<TH><% loc($colalias) %>&nbsp;</TH>
+<form method="post" action="<%$RT::WebPath%>/Search/Bulk.html" enctype="multipart/form-data">
+% foreach my $var qw(Query Format OrderBy Order Rows Page) {
+<input type="hidden" class="hidden" name="<%$var%>" value="<%$ARGS{$var}%>" />
 %}
-</TR>
-
-<%PERL>
-
-my $i;
-
-$Tickets->RedoSearch();
-while (my $Ticket = $Tickets->Next) {
- $i++;
- if ($i % 2) {
-     $bgcolor = "#d4d4d4";
- }
- else {
-     $bgcolor = "#ffffff";
- }
-      </%PERL>
-<TR bgcolor="<%$bgcolor%>">
-<TD><input type=checkbox name="UpdateTicket<%$Ticket->Id%>" value="1" CHECKED></TD>
-%foreach my $col (@cols) {
-<TD>
-% if ($col eq 'id') {
-<A HREF="<% $RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id()%></A>
-% }
-%else {
-<% eval "\$Ticket->$col()" %>&nbsp;
-%}
-</TD>
-%}
-</TR>
-%}
-
-
-
-</TABLE>
-
-<HR>
-
-
-<& /Elements/TitleBoxStart, title => loc('Update selected tickets') &>
-<TABLE>
-<TR>
-<TD VALIGN=TOP>
+<& /Elements/TicketList, Query => $Query,
+    DisplayFormat => $Format,
+    Format => $ARGS{'Format'},
+    Verbatim => 1,
+    AllowSorting => 1,
+    OrderBy => $OrderBy,
+    Order => $Order,
+    Rows => $Rows,
+    Page => $Page,
+    BaseURL => $RT::WebPath."/Search/Bulk.html?"
+   &>
+
+<hr>
+
+<& /Elements/Submit, Label => loc('Update'), CheckAll => 1, ClearAll => 1 &>
+<br />
+<&|/Widgets/TitleBox, title => $title &>
+<table>
+<tr>
+<td valign="top">
 <table>
-<tr><td class=label> <&|/l&>Make Owner</&>: </td>
-<td class=value> <& /Elements/SelectOwner, Name => "Owner" &> (<input type=checkbox name="ForceOwnerChange"> <&|/l&>Force change</&>) </td></tr>
-<tr><td class=label> <&|/l&>Add Requestor</&>: </td>
-<td class=value> <INPUT Name="AddRequestor" SIZE=20> </td></tr>
-<tr><td class=label> <&|/l&>Remove Requestor</&>: </td>
-<td class=value> <INPUT Name="DeleteRequestor" SIZE=20> </td></tr>
-<tr><td class=label> <&|/l&>Add Cc</&>: </td>
-<td class=value> <INPUT Name="AddCc" SIZE=20> </td></tr>
-<tr><td class=label> <&|/l&>Remove Cc</&>: </td>
-<td class=value> <INPUT Name="DeleteCc" SIZE=20> </td></tr>
-<tr><td class=label> <&|/l&>Add AdminCc</&>: </td>
-<td class=value> <INPUT Name="AddAdminCc" SIZE=20> </td></tr>
-<tr><td class=label> <&|/l&>Remove AdminCc</&>: </td>
-<td class=value> <INPUT Name="DeleteAdminCc" SIZE=20> </td></tr>
+<tr><td class="label"> <&|/l&>Make Owner</&>: </td>
+<td class="value"> <& /Elements/SelectOwner, Name => "Owner" &> (<input type="checkbox" class="checkbox" name="ForceOwnerChange" /> <&|/l&>Force change</&>) </td></tr>
+<tr><td class="label"> <&|/l&>Add Requestor</&>: </td>
+<td class="value"> <input name="AddRequestor" size="20" /> </td></tr>
+<tr><td class="label"> <&|/l&>Remove Requestor</&>: </td>
+<td class="value"> <input name="DeleteRequestor" size="20" /> </td></tr>
+<tr><td class="label"> <&|/l&>Add Cc</&>: </td>
+<td class="value"> <input name="AddCc" size="20" /> </td></tr>
+<tr><td class="label"> <&|/l&>Remove Cc</&>: </td>
+<td class="value"> <input name="DeleteCc" size="20" /> </td></tr>
+<tr><td class="label"> <&|/l&>Add AdminCc</&>: </td>
+<td class="value"> <input name="AddAdminCc" size="20" /> </td></tr>
+<tr><td class="label"> <&|/l&>Remove AdminCc</&>: </td>
+<td class="value"> <input name="DeleteAdminCc" size="20" /> </td></tr>
 </table>
-</TD>
-<TD VALIGN=TOP>
+</td>
+<td valign="top">
 <table>
-<tr><td class=label> <&|/l&>Make subject</&>: </td>
-<td class=value> <INPUT Name="Subject" SIZE=20> </td></tr>
-<tr><td class=label> <&|/l&>Make priority</&>: </td>
-<td class=value> <INPUT Name="Priority" SIZE=4> </td></tr>
-<tr><td class=label> <&|/l&>Make queue</&>: </td>
-<td class=value> <& /Elements/SelectQueue, Name => "Queue" &> </td></tr>
-<tr><td class=label> <&|/l&>Make Status</&>: </td>
-<td class=value> <& /Elements/SelectStatus, Name => "Status" &> </td></tr>
-<tr><td class=label> <&|/l&>Make date Starts</&>: </td>
-<td class=value> <& /Elements/SelectDate, Name => "Starts_Date", ShowTime => 0, Default => '' &> </td></tr>
-<tr><td class=label> <&|/l&>Make date Started</&>: </td>
-<td class=value> <& /Elements/SelectDate, Name => "Started_Date", ShowTime => 0, Default => '' &> </td></tr>
-<tr><td class=label> <&|/l&>Make date Told</&>: </td>
-<td class=value> <& /Elements/SelectDate, Name => "Told_Date", ShowTime => 0, Default => '' &> </td></tr>
-<tr><td class=label> <&|/l&>Make date Due</&>: </td>
-<td class=value> <& /Elements/SelectDate, Name => "Due_Date", ShowTime => 0, Default => '' &> </td></tr>
-<tr><td class=label> <&|/l&>Make date Resolved</&>: </td>
-<td class=value> <& /Elements/SelectDate, Name => "Resolved_Date", ShowTime => 0, Default => '' &> </td></tr>
+<tr><td class="label"> <&|/l&>Make subject</&>: </td>
+<td class="value"> <input name="Subject" size="20" /> </td></tr>
+<tr><td class="label"> <&|/l&>Make priority</&>: </td>
+<td class="value"> <input name="Priority" size="4" /> </td></tr>
+<tr><td class="label"> <&|/l&>Make queue</&>: </td>
+<td class="value"> <& /Elements/SelectQueue, Name => "Queue" &> </td></tr>
+<tr><td class="label"> <&|/l&>Make Status</&>: </td>
+<td class="value"> <& /Elements/SelectStatus, Name => "Status" &> </td></tr>
+<tr><td class="label"> <&|/l&>Make date Starts</&>: </td>
+<td class="value"> <& /Elements/SelectDate, Name => "Starts_Date", ShowTime => 0, Default => '' &> </td></tr>
+<tr><td class="label"> <&|/l&>Make date Started</&>: </td>
+<td class="value"> <& /Elements/SelectDate, Name => "Started_Date", ShowTime => 0, Default => '' &> </td></tr>
+<tr><td class="label"> <&|/l&>Make date Told</&>: </td>
+<td class="value"> <& /Elements/SelectDate, Name => "Told_Date", ShowTime => 0, Default => '' &> </td></tr>
+<tr><td class="label"> <&|/l&>Make date Due</&>: </td>
+<td class="value"> <& /Elements/SelectDate, Name => "Due_Date", ShowTime => 0, Default => '' &> </td></tr>
+<tr><td class="label"> <&|/l&>Make date Resolved</&>: </td>
+<td class="value"> <& /Elements/SelectDate, Name => "Resolved_Date", ShowTime => 0, Default => '' &> </td></tr>
 </table>
 
-</TD>
-</TR>
+</td>
+</tr>
 </table>
-<& /Elements/TitleBoxEnd&>
-<& /Elements/TitleBoxStart, title => loc('Add comments or replies to selected tickets') &>
+</&>
+<&| /Widgets/TitleBox, title => loc('Add comments or replies to selected tickets') &>
 <table>
-<tr><td align=right><&|/l&>Update Type</&>:</td>
+<tr><td align="right"><&|/l&>Update Type</&>:</td>
 <td><select name="UpdateType">
   <option value="private" ><&|/l&>Comments (not sent to requestors)</&></option>
 <option value="response" ><&|/l&>Reply to requestors</&></option>
 </select> 
 </td></tr>
-<tr><td align=right><&|/l&>Subject</&>:</td><td> <input name="UpdateSubject" size=60 value=""></td></tr>
+<tr><td align="right"><&|/l&>Subject</&>:</td><td> <input name="UpdateSubject" size="60" value="" /></td></tr>
 % while (my $CF = $TxnCFs->Next()) {
-<TR>
-<TD ALIGN=RIGHT><% $CF->Name %>:</TD>
-<TD><& /Elements/EditCustomField, 
+<tr>
+<td align="right"><% $CF->Name %>:</td>
+<td><& /Elements/EditCustomField, 
     CustomField => $CF, 
     NamePrefix => "Object-RT::Transaction--CustomField-"
-    &><em><% $CF->FriendlyType %></em></TD>
-</TD></TR>
+    &><em><% $CF->FriendlyType %></em></td>
+</td></tr>
 % } # end if while
- <tr><td align=right><&|/l&>Attach</&>:</td><td><input name="UpdateAttachment" type="file"></td></tr>
- <tr><td class=labeltop><&|/l&>Message</&>:</td><td>
+ <tr><td align="right"><&|/l&>Attach</&>:</td><td><input name="UpdateAttachment" type="file" /></td></tr>
+ <tr><td class="labeltop"><&|/l&>Message</&>:</td><td>
  <& /Elements/MessageBox, Name=>"UpdateContent"&>
  </td></tr>
  </table>
 
-<& /Elements/TitleBoxEnd &>
-
+</&>
+<&|/Widgets/TitleBox, title => loc('Edit Custom Fields'), color => "#336633"&>
+<%perl>
+my $cfs = RT::CustomFields->new($session{'CurrentUser'});
+$cfs->LimitToGlobal();
+$cfs->LimitToQueue($_) for keys %$seen_queues;
+</%perl>
+<table>
+<tr>
+<th><&|/l&>Name</&></th>
+<th><&|/l&>Add values</&></th>
+<th><&|/l&>Delete values</&></th>
+</tr>
+% while (my $cf = $cfs->Next()) {
+<tr>
+<td class="label"><%$cf->Name%><br />
+<em>(<%$cf->FriendlyType%>)</em></td>
+% my $rows = 5;
+% my @add = (NamePrefix => 'Bulk-Add-CustomField-', CustomField => $cf, Rows => $rows, Multiple => ($cf->MaxValues ==1 ? 0 : 1) , Cols => 25);
+% my @del = (NamePrefix => 'Bulk-Delete-CustomField-', CustomField => $cf, Rows => $rows, Multiple => 1, Cols => 25);
+% if ($cf->Type eq 'Select') {
+<td><& /Elements/EditCustomFieldSelect, @add &></td>
+<td><& /Elements/EditCustomFieldSelect, @del &></td>
+% } elsif ($cf->Type eq 'Combobox') {
+<td><& /Elements/EditCustomFieldCombobox, @add &></td>
+<td><& /Elements/EditCustomFieldCombobox, @del &></td>
+% } elsif ($cf->Type eq 'Freeform') {
+<td><& /Elements/EditCustomFieldFreeform, @add &></td>
+<td><& /Elements/EditCustomFieldFreeform, @del &></td>
+% } elsif ($cf->Type eq 'Text') {
+<td><& /Elements/EditCustomFieldText, @add &></td>
+<td>&nbsp;</td>
+% } else {
+%   $RT::Logger->crit("Unknown CustomField type: " . $cf->Type);
+% }
+</tr>
+% }
+</table>
+</&>
 
-<& /Elements/TitleBoxStart, title => loc('Edit Links'), color => "#336633"&>
-<i><&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.</&></i><br>
+<&|/Widgets/TitleBox, title => loc('Edit Links'), color => "#336633"&>
+<em><&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.</&></em><br />
 <& /Ticket/Elements/BulkLinks &>
-<& /Elements/TitleBoxEnd &>
+</&>
+
+<& /Elements/Submit, Label => loc('Update') &>
+
 
-<& /Elements/Submit, Label => loc('Update All') &>
+</form>
 
 
-</FORM>
 <%INIT>
+my $title = loc("Update multiple tickets");
 
 # Iterate through the ARGS hash and remove anything with a null value.
-map ($ARGS{$_} =~ /^$/ && (delete $ARGS{$_}), keys %ARGS);
-
-my ($bgcolor, @results);
-my @cols = qw(id Status Priority Subject QueueObj->Name OwnerObj->Name RequestorAddresses DueAsString );
-
-
-my $Tickets = RT::Tickets->new($session{'CurrentUser'});
-$Tickets->FromSQL($ARGS{'Query'});
-
-Abort(loc("No search to operate on.")) unless ($Tickets);
-
-my %allcfs;
-my %cfqnames;
-my %cfqs;
-my $count = 0;
-while (my $Ticket = $Tickets->Next) {
-    my $cfq = $Ticket->QueueObj;
-    my $cfqid = $cfq->Id;
-    my $cfqn = $cfq->Name;
-    unless ( exists $cfqs{$cfqid} ) {
-       $cfqs{$cfqid} = 1;
-       $count++;
-       my $cfs = $cfq->TicketCustomFields;
-       while (my $cf = $cfs->Next) {
-           $allcfs{$cf->Id} = $cf;
-           $cfqnames{$cf->Id} = $cfqn;
-       }
+map ( $ARGS{$_} =~ /^$/ && ( delete $ARGS{$_} ), keys %ARGS );
+
+my (@results);
+
+$Page ||= 1;
+
+$Format ||= $RT::DefaultSearchResultFormat;
+
+# inject _CHECKBOX to the first field.
+$Format =~ s/'?([^']+)'?,/'___CHECKBOX__$1',/;
+
+my $Tickets = RT::Tickets->new( $session{'CurrentUser'} );
+$Tickets->FromSQL($Query);
+if ( $OrderBy =~ /\|/ ) {
+
+  # Multiple Sorts
+  my @OrderBy = split /\|/, $OrderBy;
+  my @Order   = split /\|/, $Order;
+  $Tickets->OrderByCols(
+    map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } }
+      ( 0 .. $#OrderBy ) );
+}
+else {
+  $Tickets->OrderBy( FIELD => $OrderBy, ORDER => $Order );
+}
+
+$Tickets->RowsPerPage($Rows) if ($Rows);
+$Tickets->GotoPage( $Page - 1 );    # SB uses page 0 as the first page
+
+Abort( loc("No search to operate on.") ) unless ($Tickets);
+
+# build up a list of all custom fields for tickets that we're displaying, so
+# we can display sane edit widgets.
+
+my $fields      = {};
+my $seen_queues = {};
+while ( my $ticket = $Tickets->Next ) {
+    next if $seen_queues->{ $ticket->Queue }++;
+
+    my $custom_fields = $ticket->QueueObj->TicketCustomFields;
+    while ( my $field = $custom_fields->Next ) {
+        $fields->{ $field->id } = $field;
     }
 }
 
-my $do_comment_reply=0;
+my $do_comment_reply = 0;
+
 # Prepare for ticket updates
-$ARGS{'UpdateContent'} =~ s/\r\n/\n/g;
-chomp ($ARGS{'UpdateContent'}) ;
-
-if ($ARGS{'UpdateContent'} &&
-    $ARGS{'UpdateContent'} ne '' &&
-    $ARGS{'UpdateContent'} ne  "-- \n" .
-    $session{'CurrentUser'}->UserObj->Signature) {
-            $do_comment_reply=1;
+if ($ARGS{'UpdateContent'}) {
+    $ARGS{'UpdateContent'} =~ s/\r\n/\n/g;
+    chomp( $ARGS{'UpdateContent'} );
+
+    if ($ARGS{'UpdateContent'} ne ''
+        && $ARGS{'UpdateContent'} ne "-- \n"
+        . $session{'CurrentUser'}->UserObj->Signature ) {
+        $do_comment_reply = 1;
+    }
 }
 
 #Iterate through each ticket we've been handed
@@ -229,50 +266,131 @@ my @linkresults;
 my %queues;
 
 $Tickets->RedoSearch();
-while (my $Ticket = $Tickets->Next) {
-    $queues{$Ticket->QueueObj->Id}++;
-    $RT::Logger->debug( "Checking Ticket ".$Ticket->Id ."\n");
-    next unless ($ARGS{"UpdateTicket".$Ticket->Id});
-    $RT::Logger->debug ("Matched\n");
-    my @updateresults; 
+
+# pull out the labels for any custom fields we want to update
+
+my $cf_del_keys;
+@$cf_del_keys = grep { /^Bulk-Delete-CustomField/ } keys %ARGS;
+my $cf_add_keys;
+@$cf_add_keys = grep { /^Bulk-Add-CustomField/ } keys %ARGS;
+
+
+while ( my $Ticket = $Tickets->Next ) {
+    next unless ( $ARGS{ "UpdateTicket" . $Ticket->Id } );
+
+    #Update the links
+    $ARGS{'id'} = $Ticket->id;
+    $queues{ $Ticket->QueueObj->Id }++;
+
+    my @updateresults;
     if ($do_comment_reply) {
-       ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef => \%ARGS, Actions => \@updateresults); 
+        ProcessUpdateMessage(
+            TicketObj => $Ticket,
+            ARGSRef   => \%ARGS,
+            Actions   => \@updateresults
+        );
     }
 
     #Update the basics.
-    my @basicresults = ProcessTicketBasics(TicketObj => $Ticket, ARGSRef => \%ARGS);
-    my @dateresults = ProcessTicketDates(TicketObj => $Ticket, ARGSRef => \%ARGS);
+    my @basicresults =
+      ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS );
+    my @dateresults =
+      ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS );
+
     #Update the watchers
-    my @watchresults = ProcessTicketWatchers(TicketObj => $Ticket, ARGSRef => \%ARGS);    
+    my @watchresults =
+      ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS );
 
+    foreach my $type qw(MergeInto DependsOn MemberOf RefersTo) {
+        $ARGS{ $Ticket->id . "-" . $type } = $ARGS{"Ticket-$type"};
+        $ARGS{ $type . "-" . $Ticket->id } = $ARGS{"$type-Ticket"};
+    }
+    @linkresults =
+      ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS );
+    foreach my $type qw(MergeInto DependsOn MemberOf RefersTo) {
+        delete $ARGS{ $type . "-" . $Ticket->id };
+        delete $ARGS{ $Ticket->id . "-" . $type };
+    }
 
-    #Update the links
-    $ARGS{'id'} = $Ticket;
-    $ARGS{$Ticket->Id.'-MergeInto'} = $ARGS{'Ticket-MergeInto'};
-    $ARGS{$Ticket->Id.'-DependsOn'} = $ARGS{'Ticket-DependsOn'};
-    $ARGS{'DependsOn-'.$Ticket->Id} = $ARGS{'DependsOn-Ticket'};
-    $ARGS{$Ticket->Id.'-MemberOf'} = $ARGS{'Ticket-MemberOf'};
-    $ARGS{'MemberOf-'.$Ticket->Id} = $ARGS{'MemberOf-Ticket'};
-    $ARGS{$Ticket->Id.'-RefersTo'} = $ARGS{'Ticket-RefersTo'};
-    $ARGS{'RefersTo-'.$Ticket->Id} = $ARGS{'RefersTo-Ticket'};
-    @linkresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
-    delete $ARGS{'id'};
-    delete $ARGS{$Ticket->Id.'-MergeInto'};
-    delete $ARGS{$Ticket->Id.'-DependsOn'};
-    delete $ARGS{'DependsOn-'.$Ticket->Id};
-    delete $ARGS{$Ticket->Id.'-MemberOf'};
-    delete $ARGS{'MemberOf-'.$Ticket->Id};
-    delete $ARGS{$Ticket->Id.'-RefersTo'};
-    delete $ARGS{'RefersTo-'.$Ticket->Id};
-    my @tempresults = (@watchresults, @basicresults, @dateresults,
-    @updateresults, @linkresults);
-    @tempresults = map { loc("Ticket [_1]: [_2]",$Ticket->Id,$_) } @tempresults;
-
-    @results = (@results, @tempresults);
+    my @cfresults;
+
+    foreach my $list ( $cf_add_keys, $cf_del_keys ) {
+        next unless $list->[0];
+
+
+        my $op;
+        if ( $list->[0] =~ /Add/ ) {
+            $op = 'add';
+
+        }
+        elsif ( $list->[0] =~ /Del/ ) {
+            $op = 'del';
+        }
+        else {
+            $RT::Logger->crit(
+                "Got an op that was neither add nor delete. can never happen"
+                  . $list->[0] );
+            last;
+        }
+
+        foreach my $key (@$list) {
+            my ( $cfid, $cf );
+            if ( $key =~ /CustomField-(\d+)-/ ) {
+                $cfid = $1;
+                $cf   = RT::CustomField->new( $session{'CurrentUser'} );
+                $cf->Load($cfid);
+            }
+            else {next}
+            my @values =
+              ref( $ARGS{$key} ) eq 'ARRAY'
+              ? @{ $ARGS{$key} }
+              : ( $ARGS{$key} );
+            map { s/(\r\n|\r)/\n/g; } @values;    # fix the newlines
+                 # now break the multiline values into multivalues
+            @values = map { split( /\n/, $_ ) } @values
+              unless ( $cf->SingleValue );
+
+            my $current_values = $Ticket->CustomFieldValues($cfid);
+            foreach my $value (@values) {
+                if ( $op eq 'del' && $current_values->HasEntry($value) ) {
+                    my ( $id, $msg ) = $Ticket->DeleteCustomFieldValue(
+                        Field => $cfid,
+                        Value => $value
+                    );
+                    push @cfresults, $msg;
+                }
+
+                elsif ( $op eq 'add' && !$current_values->HasEntry($value) ) {
+                    my ( $id, $msg ) = $Ticket->AddCustomFieldValue(
+                        Field => $cfid,
+                        Value => $value
+                    );
+                    push @cfresults, $msg;
+                }
+            }
+        }
+    }
+    my @tempresults = (
+        @watchresults,  @basicresults, @dateresults,
+        @updateresults, @linkresults,  @cfresults
+    );
+
+    @tempresults =
+      map { loc( "Ticket [_1]: [_2]", $Ticket->Id, $_ ) } @tempresults;
+
+    @results = ( @results, @tempresults );
 }
 
-my $TxnCFs = RT::CustomFields->new($session{CurrentUser});
-$TxnCFs->LimitToLookupType("RT::Queue-RT::Ticket-RT::Transaction");
-$TxnCFs->LimitToGlobalOrObjectId(sort keys %queues);
+my $TxnCFs = RT::CustomFields->new( $session{CurrentUser} );
+$TxnCFs->LimitToLookupType( RT::Transaction->CustomFieldLookupType );
+$TxnCFs->LimitToGlobalOrObjectId( sort keys %queues );
 
 </%INIT>
+<%args>
+$Format => undef
+$Page => 1
+$Rows => undef
+$Order => 'ASC'
+$OrderBy => 'id'
+$Query => undef
+</%args>
diff --git a/rt/html/Ticket/Elements/ShowMemberOf b/rt/html/Ticket/Elements/ShowMemberOf
deleted file mode 100644 (file)
index e443132..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC 
-%#                                          <jesse@bestpractical.com>
-%# 
-%# (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
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%# 
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%# 
-%# 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.
-%# 
-%# 
-%# 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 }}}
-<UL>
-% my $memberof = $Ticket->MemberOf;
-% while (my $member_of = $memberof->Next) {
-<LI><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member_of->Id%>"><%$member_of->Id%></a>: <%$member_of->Subject%> [<%$member_of->Status%>]
-% }
-</UL>
-
-<%INIT>
-</%INIT>
-<%ARGS>
-$Ticket => undef
-</%ARGS>
diff --git a/rt/html/Ticket/Elements/ShowReferences b/rt/html/Ticket/Elements/ShowReferences
deleted file mode 100644 (file)
index bb323f6..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC 
-%#                                          <jesse@bestpractical.com>
-%# 
-%# (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
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%# 
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%# 
-%# 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.
-%# 
-%# 
-%# 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 }}}
-<UL>
-% while (my $Link = $Ticket->RefersTo->Next) {
-<LI>
-% if ($Link->TargetURI->IsLocal) {
-% my $member = $Link->TargetObj;
-
-<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br>
-% } else {
-<A HREF="<%$Link->TargetURI->HREF%>"><%$Link->Target%></A>
-% }
-%}
-
-
-
-% while (my $Link = $Ticket->ReferredToBy->Next) {
-<LI>
-% if ($Link->BaseURI->IsLocal) {
-% my $member = $Link->BaseObj;
-<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br>
-% } else {
-<A HREF="<%$Link->BaseURI->HREF%>"><%$Link->Base%></A>
-%}
-% }
-</UL>
-<%ARGS>
-$Ticket => undef
-</%ARGS>
index 5a6e7e0..d171f40 100644 (file)
@@ -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:
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-      <TABLE WIDTH="100%" class="ticketsummary" >
-      <TR>
-       <TD VALIGN=TOP WIDTH="50%" class="boxcontainer">
-         <& /Elements/TitleBoxStart, title => loc('The Basics'), 
+      <table width="100%" class="ticket-summary">
+      <tr>
+       <td valign="top" width="50%" class="boxcontainer">
+         <&| /Widgets/TitleBox, title => loc('The Basics'), 
                title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, 
-               title_class=> 'inverse',  
-               color => "#993333" &>
+               class => 'ticket-info-basics' &>
                <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &>
-         <& /Elements/TitleBoxEnd &>
-          <br>
+         </&>
+
 % if ($Ticket->QueueObj->TicketCustomFields->First) {
-         <& /Elements/TitleBoxStart, title => loc('Custom Fields'), 
+         <&| /Widgets/TitleBox, title => loc('Custom Fields'), 
                title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, 
-               title_class=> 'inverse',  
-               color => "#993333" &>
+               class => 'ticket-info-cfs'  &> 
                <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &>
-         <& /Elements/TitleBoxEnd &>
-
-<br>
+         </&>
 % }
-         <& /Elements/TitleBoxStart, title => loc('People'), 
+         <&| /Widgets/TitleBox, title => loc('People'), 
                title_href =>"$RT::WebPath/Ticket/ModifyPeople.html?id=".$Ticket->Id, 
-               title_class=> 'inverse',  
-               color => "#333399" &>
-         <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &>
-         <& /Elements/TitleBoxEnd &>
-         <br>
+               class => 'ticket-info-people' &>
+            <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &>
+         </&>
 
-         <& /Elements/TitleBoxStart, title => loc('Customers'),
+         <& /Widgets/TitleBoxStart, title => loc('Customers'),
                title_href =>"$RT::WebPath/Ticket/ModifyCustomers.html?id=".$Ticket->Id,
-               title_class=> 'inverse',
-               color => "#7f007b" &>
+               class=> 'ticket-info-customers' &>
           <& /Ticket/Elements/ShowCustomers, Ticket => $Ticket &>
-          <& /Elements/TitleBoxEnd &>
+          </&>
 
-       <BR>
-       </TD>
-       <TD VALIGN=TOP WIDTH="50%" class="boxcontainer">
+      <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &>
+        <br />
+         <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &>
 
-         <& /Elements/TitleBoxStart, title => loc("Dates"),
+      <& /Elements/Callback, %ARGS, _CallbackName => 'LeftColumn' &>
+       </td>
+       <td valign="top" width="50%" class="boxcontainer">
+         <&|/Widgets/TitleBox, title => loc("Reminders"),
+               title_href =>"$RT::WebPath/Ticket/Reminders.html?id=".$Ticket->Id, 
+               class => 'ticket-info-reminders' &>
+        <table>
+        <tr>
+        <td>
+            <form action="<%$RT::WebPath%>/Ticket/Display.html" method="post">
+             <& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 0 &>
+              <div align="right"><input type="submit" class="button" value="Save" /></div>
+            </form>
+            </td>
+            </tr>
+            </table>
+         </&>
+         <&| /Widgets/TitleBox, title => loc("Dates"),
                title_href =>"$RT::WebPath/Ticket/ModifyDates.html?id=".$Ticket->Id, 
-               title_class=> 'inverse',  
-                color => "#663366" &>
+               class => 'ticket-info-dates' &>
          <& /Ticket/Elements/ShowDates, Ticket => $Ticket &>
-         <& /Elements/TitleBoxEnd &>
-       <BR>  
-         <& /Elements/TitleBoxStart, title => loc('Links'), 
+         </&>
+
+         <&| /Widgets/TitleBox, title => loc('Links'), 
                title_href => "$RT::WebPath/Ticket/ModifyLinks.html?id=".$Ticket->Id, 
-               title_class=> 'inverse',  
-               titleright => '', color=> "#336633" &>
+               class => 'ticket-info-links' &>
                <& /Elements/ShowLinks, Ticket => $Ticket &>
-       <& /Elements/TitleBoxEnd &>
-        <BR>
-         <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &>
-
-         <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &>
-
+          </&>
+    <& /Elements/Callback, %ARGS, _CallbackName => 'RightColumn' &>
 
-       </TD>
-      </TR>
-    </TABLE>
+       </td>
+      </tr>
+    </table>
 <%ARGS>
 $Ticket => undef
 $Attachments => undef
index 46e1d4a..3dee8df 100644 (file)
@@ -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:
@@ -121,9 +123,11 @@ my $ticket_page_tabs = {
             path  => "Ticket/ModifyLinks.html?id=" . $id, },
     _Eb=> { title => loc('Customers'),
             path  => "Ticket/ModifyCustomers.html?id=" . $id, },
-    _F => { title => loc('Jumbo'),
-            path  => "Ticket/ModifyAll.html?id=" . $id,
-            separator => 1
+    _F => { title => loc('Reminders'),
+            path  => "Ticket/Reminders.html?id=" . $id,
+            separator => 1, },
+    _X => { title => loc('Jumbo'),
+            path  => "Ticket/ModifyAll.html?id=" . $id, 
  },
 
 };
@@ -138,76 +142,102 @@ foreach my $tab ( sort keys %{$ticket_page_tabs} ) {
 $tabs->{'this'}->{"subtabs"} = $ticket_page_tabs;
 $current_tab = "Ticket/Display.html?id=" . $id;
 
+my %can = (
+    ModifyTicket => $Ticket->CurrentUserHasRight('ModifyTicket'),
+);
 
-
-
-
-if (    $Ticket->CurrentUserHasRight('ModifyTicket')
-     or $Ticket->CurrentUserHasRight('ReplyToTicket') ) {
-    $actions->{'A'} = { title => loc('Reply'),
-                        path  => "Ticket/Update.html?Action=Respond&id=" . $id,
+if ( $can{'ModifyTicket'} or $Ticket->CurrentUserHasRight('ReplyToTicket') ) {
+    $actions->{'F'} = {
+        title => loc('Reply'),
+        path  => "Ticket/Update.html?Action=Respond&id=" . $id,
     };
 }
 
-if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) {
+if ( $can{'ModifyTicket'} ) {
     if ( $Ticket->Status ne 'resolved' ) {
-        $actions->{'B'} = {
-
+        $actions->{'G'} = {
             path => "Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=" . $id,
             title => loc('Resolve') };
     }
     if ( $Ticket->Status ne 'open' ) {
-        $actions->{'C'} = { path => "Ticket/Display.html?Status=open&id=" . $id,
+        $actions->{'A'} = { path => "Ticket/Display.html?Status=open&id=" . $id,
                             title => loc('Open it') };
     }
 }
 
 if ( $Ticket->CurrentUserHasRight('OwnTicket') ) {
-    if ( $Ticket->OwnerObj->id == $RT::Nobody->id ) {
-        $actions->{'D'} = { path => "Ticket/Display.html?Action=Take&id=" . $id,
-                            title => loc('Take') };
+    if ( $Ticket->OwnerObj->Id == $RT::Nobody->id
+         and ( $can{'ModifyTicket'} or $Ticket->CurrentUserHasRight('TakeTicket') ) )
+    {
+        $actions->{'B'} = {
+            path => "Ticket/Display.html?Action=Take&id=" . $id,
+            title => loc('Take'),
+        };
     }
-    elsif ( $Ticket->OwnerObj->id != $session{CurrentUser}->id ) {
-        $actions->{'E'} = {path => "Ticket/Display.html?Action=Steal&id=" . $id,
-                           title => loc('Steal') };
+    elsif ( $Ticket->OwnerObj->id != $session{CurrentUser}->id 
+            and ( $can{'ModifyTicket'} or $Ticket->CurrentUserHasRight('StealTicket') ) )
+    {
+        $actions->{'C'} = {
+            path => "Ticket/Display.html?Action=Steal&id=" . $id,
+            title => loc('Steal'),
+        };
     }
 }
 
-if (    $Ticket->CurrentUserHasRight('ModifyTicket')
-     or $Ticket->CurrentUserHasRight('CommentOnTicket') ) {
-    $actions->{'F'} = { title => loc('Comment'),
-                        path  => "Ticket/Update.html?Action=Comment&id=" . $id,
+if ( $can{'ModifyTicket'} or $Ticket->CurrentUserHasRight('CommentOnTicket') ) {
+    $actions->{'E'} = {
+        title => loc('Comment'),
+        path  => "Ticket/Update.html?Action=Comment&id=" . $id,
     };
 }
 }
 
-my $args = "?" . $m->comp(
+if ( (defined $actions->{A} || defined $actions->{B} || defined $actions->{C})
+    && (defined $actions->{E} || defined $actions->{F} || defined $actions->{G}) ) { 
+    
+    if    (defined $actions->{C}) { $actions->{C}->{separator} = 1 }
+    elsif (defined $actions->{B}) { $actions->{B}->{separator} = 1 }
+    elsif (defined $actions->{A}) { $actions->{A}->{separator} = 1 }
+}
+
+my $args;
+$args= "?" . $m->comp(
     '/Elements/QueryString',
     Query   => $ARGS{'Query'}   || $session{'CurrentSearchHash'}->{'Query'},
     Format  => $ARGS{'Format'}  || $session{'CurrentSearchHash'}->{'Format'},
     OrderBy => $ARGS{'OrderBy'} || $session{'CurrentSearchHash'}->{'OrderBy'},
     Order   => $ARGS{'Order'}   || $session{'CurrentSearchHash'}->{'Order'},
+    Page   => $ARGS{'Page'}   || $session{'CurrentSearchHash'}->{'Page'},
     Rows    => $ARGS{'Rows'},
   ) if ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'});
 $args ||= '';
 
 $tabs->{"f"} = { path      => "Search/Build.html?NewQuery=1",
-                 title     => loc('New Query')};
+                 title     => loc('New Search')};
 $tabs->{"g"} = { path      => "Search/Build.html$args",
-                 title     => loc('Query Builder')};
+                 title     => loc('Edit Search')};
 $tabs->{"h"} = { path      => "Search/Edit.html$args",
                  title     => loc('Advanced'),
                  separator => 1 };
-if (defined $session{'tickets'} and $session{'tickets'}->Count) {
+if ($args) {
   $tabs->{"i"} = { path      => "Search/Results.html$args",
                    title     => loc('Show Results'),
-                   separator => 1,
-                   subtabs   => $searchtabs };
+                   };
   if ($current_tab =~  "Search/Results.html") {
     $current_tab = "Search/Results.html$args";
   }
+  $tabs->{"j"} = { path      => "Search/Bulk.html$args",
+                   title     => loc('Bulk Update'),
+                   };
+  if ($current_tab =~  "Search/Bulk.html") {
+    $current_tab = "Search/Bulk.html$args";
+  }
+  foreach my $searchtab (keys %{$searchtabs}) {
+    ($searchtab =~ /^_/) ? $tabs->{"s".$searchtab} = $searchtabs->{$searchtab} : $tabs->{"z_".$searchtab} = $searchtabs->{$searchtab};
+  }
 }
 
+
 </%INIT>
 
   
index 7edc8a1..1320b8f 100755 (executable)
@@ -64,7 +64,7 @@ $title => ''
 $title_class => ''
 $titleright_href => undef
 $titleright => undef
-$contentbg => "#dddddd"
+$contentbg => "#d4d4d4"
 $color => "#336699"
 $id => ''
 $hideable => 1
index b6d980d..178b66b 100644 (file)
@@ -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,6 @@
 # those contributions and any derivatives thereof.
 # 
 # END BPS TAGGED BLOCK }}}
-
 =head1 NAME
 
   RT::SearchBuilder - a baseclass for RT collection objects
@@ -68,7 +69,7 @@ ok (require RT::SearchBuilder);
 package RT::SearchBuilder;
 
 use RT::Base;
-use DBIx::SearchBuilder 1.36;
+use DBIx::SearchBuilder "1.40";
 
 use strict;
 use vars qw(@ISA);
index 06c04dc..98d965c 100644 (file)
@@ -3,7 +3,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)
@@ -23,7 +23,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:
@@ -47,8 +49,9 @@
 use strict;
 use vars qw($PROMPT $VERSION $Handle $Nobody $SystemUser $item);
 use vars
-  qw(@Groups @Users @ACL @Queues @ScripActions @ScripConditions @Templates @CustomFields @Scrips);
+  qw(@Groups @Users @ACL @Queues @ScripActions @ScripConditions @Templates @CustomFields @Scrips @Attributes);
 
+use lib "@LOCAL_LIB_PATH@";
 use lib "@RT_LIB_PATH@";
 
 #This drags in  RT's config.pm
@@ -81,6 +84,11 @@ GetOptions(
     'datadir=s'
 );
 
+unless ( $args{'action'} ) {
+    help();
+    exit(-1);
+}
+
 $| = 1;    #unbuffer that output.
 
 require RT::Handle;
@@ -93,56 +101,50 @@ if ( $args{'prompt-for-dba-password'} ) {
     chomp( $args{'dba-password'} );
 }
 
-unless ( $args{'action'} ) {
-    help();
-    die;
-}
 if ( $args{'action'} eq 'init' ) {
     $dbh = DBI->connect( get_system_dsn(), $args{'dba'}, $args{'dba-password'} )
       || die "Failed to connect to " . get_system_dsn() . " as $args{'dba'}: $DBI::errstr";
     print "Now creating a database for RT.\n";
-    if ($RT::DatabaseType ne 'Oracle' ||
-        $args{'dba'} ne $RT::DatabaseUser) {
-    create_db();
+    if ( $RT::DatabaseType ne 'Oracle' || $args{'dba'} ne $RT::DatabaseUser ) {
+        create_db();
     } else {
         print "...skipped as ".$args{'dba'} ." is not " . $RT::DatabaseUser . " or we're working with Oracle.\n";
     }
 
-    if ($RT::DatabaseType eq "mysql") {
+    if ( $RT::DatabaseType eq "mysql" ) {
         # Check which version we're running
         my ($version) = $dbh->selectrow_hashref("show variables like 'version'")->{Value} =~ /^(\d\.\d+)/;
         print "*** Warning: RT is unsupported on MySQL versions before 4.0.x\n" if $version < 4;
 
         # MySQL must have InnoDB support
         my $innodb = $dbh->selectrow_hashref("show variables like 'have_innodb'")->{Value};
-        if ($innodb eq "NO") {
+        if ( $innodb eq "NO" ) {
             die "RT requires that MySQL be compiled with InnoDB table support.\n".
               "See http://dev.mysql.com/doc/mysql/en/InnoDB.html\n";
-        } elsif ($innodb eq "DISABLED") {
+        } elsif ( $innodb eq "DISABLED" ) {
             die "RT requires that MySQL InnoDB table support be enabled.\n".
               ($version < 4
                ? "Add 'innodb_data_file_path=ibdata1:10M:autoextend' to the [mysqld] section of my.cnf\n"
                : "Remove the 'skip-innodb' line from your my.cnf file, restart MySQL, and try again.\n");
         }
     }
-    
+
     # SQLite can't deal with the disconnect/reconnect
-    unless ($RT::DatabaseType eq 'SQLite') {
+    unless ( $RT::DatabaseType eq 'SQLite' ) {
 
         $dbh->disconnect;
 
-       if ($RT::DatabaseType eq "Oracle") {
-        $RT::DatabasePassword = $RT::DatabasePassword; #Warning avidance
-        $dbh = DBI->connect( $Handle->DSN, ${RT::DatabaseUser}, ${RT::DatabasePassword} ) || die $DBI::errstr;
-       } else {
-       
-        $dbh = DBI->connect( $Handle->DSN, $args{'dba'}, $args{'dba-password'} ) || die $DBI::errstr;
-       }
+        if ( $RT::DatabaseType eq "Oracle" ) {
+            $RT::DatabasePassword = $RT::DatabasePassword; #Warning avidance
+            $dbh = DBI->connect( $Handle->DSN, ${RT::DatabaseUser}, ${RT::DatabasePassword} ) || die $DBI::errstr;
+        } else {       
+            $dbh = DBI->connect( $Handle->DSN, $args{'dba'}, $args{'dba-password'} ) || die $DBI::errstr;
+        }
     }
     print "Now populating database schema.\n";
     insert_schema();
     print "Now inserting database ACLs\n";
-    insert_acl() unless ($RT::DatabaseType eq 'Oracle');
+    insert_acl() unless $RT::DatabaseType eq 'Oracle';
     print "Now inserting RT core system objects\n";
     insert_initial_data();
     print "Now inserting RT data\n";
@@ -150,11 +152,11 @@ if ( $args{'action'} eq 'init' ) {
 }
 elsif ( $args{'action'} eq 'drop' ) {
     unless ( $dbh =
-         DBI->connect( get_system_dsn(), $args{'dba'}, $args{'dba-password'} ) )
+        DBI->connect( get_system_dsn(), $args{'dba'}, $args{'dba-password'} ) )
     {
         warn $DBI::errstr;
         warn "Database doesn't appear to exist. Aborting database drop.";
-        exit(0);
+        exit;
     }
     drop_db();
 }
@@ -162,38 +164,43 @@ elsif ( $args{'action'} eq 'insert_initial' ) {
     insert_initial_data();
 }
 elsif ( $args{'action'} eq 'insert' ) {
-    insert_data( $args{'datafile'} || ($args{'datadir'}."/content"));
+    insert_data( $args{'datafile'} || ($args{'datadir'}."/content") );
 }
-elsif ($args{'action'} eq 'acl') {
+elsif ( $args{'action'} eq 'acl' ) {
     $dbh = DBI->connect( $Handle->DSN, $args{'dba'}, $args{'dba-password'} )
       || die "Failed to connect to " . get_system_dsn() . " as $args{'dba'}: $DBI::errstr";
-     insert_acl($args{'datadir'});
+    insert_acl($args{'datadir'});
 }
-elsif ($args{'action'} eq 'schema') {
+elsif ( $args{'action'} eq 'schema' ) {
     $dbh = DBI->connect( $Handle->DSN, $args{'dba'}, $args{'dba-password'} )
       || die "Failed to connect to " . get_system_dsn() . " as $args{'dba'}: $DBI::errstr";
-        insert_schema($args{'datadir'});
+    insert_schema($args{'datadir'});
 }
-
 else {
-    print STDERR '$0 called with an invalid --action parameter';
+    print STDERR "$0 called with an invalid --action parameter\n";
     exit(-1);
 }
 
 # {{{ sub insert_schema
 sub insert_schema {
-        my $base_path = (shift || $RT::EtcPath);
+    my $base_path = (shift || $RT::EtcPath);
     my (@schema);
     print "Creating database schema.\n";
 
-    if ( -f $base_path . "/schema." . $RT::DatabaseType ) {
-       no warnings 'unopened';
+    my $schema_file = $base_path . "/schema." . $RT::DatabaseType;
+    if ( -f $schema_file ) {
+        open( SCHEMA, "<$schema_file"  ) or die "Can't open $schema_file: $!";
+       my @lines = <SCHEMA>;
 
-        open( SCHEMA, "<" . $base_path . "/schema." . $RT::DatabaseType );
-        open( SCHEMA_LOCAL, "<" . $RT::LocalEtcPath . "/schema." . $RT::DatabaseType );
+       my $local_schema_file = $RT::LocalEtcPath . "/schema." . $RT::DatabaseType;
+       if (-f $local_schema_file) {
+           open( SCHEMA_LOCAL, "<$local_schema_file" )
+               or die "Can't open $local_schema_file: $!";
+           push @lines, ';;', <SCHEMA_LOCAL>;
+       }
 
         my $statement = "";
-        foreach my $line (<SCHEMA>, ($_ = ';;'), <SCHEMA_LOCAL>) {
+        foreach my $line (@lines) {
             $line =~ s/\#.*//g;
             $line =~ s/--.*//g;
             $statement .= $line;
@@ -204,11 +211,12 @@ sub insert_schema {
             }
         }
 
-       local $SIG{__WARN__} = sub {};
-       my $is_local = 0; # local/etc/schema needs to be nonfatal. 
+        local $SIG{__WARN__} = sub {};
+        my $is_local = 0; # local/etc/schema needs to be nonfatal.
         $dbh->begin_work or die $dbh->errstr;
         foreach my $statement (@schema) {
-           if ($statement =~ /^\s*;$/) { $is_local = 1; next; }
+            if ( $statement =~ /^\s*;$/ ) { $is_local = 1; next; }
+
             print STDERR "SQL: $statement\n" if defined $args{'debug'};
             my $sth = $dbh->prepare($statement) or die $dbh->errstr;
             unless ( $sth->execute or $is_local ) {
@@ -216,13 +224,11 @@ sub insert_schema {
             }
         }
         $dbh->commit or die $dbh->errstr;
-
     }
     else {
         die "Couldn't find schema file for " . $RT::DatabaseType . "\n";
     }
     print "Done setting up database schema.\n";
-
 }
 
 # }}}
@@ -232,13 +238,13 @@ sub drop_db {
     if ( $RT::DatabaseType eq 'Oracle' ) {
         print <<END;
 
-To delete the tables and sequences of the RT Oracle database by running 
-    \@etc/drop.Oracle 
+To delete the tables and sequences of the RT Oracle database by running
+    \@etc/drop.Oracle
 through SQLPlus.
 
 END
         return;
-    }  
+    }
     unless ( $args{'force'} ) {
         print <<END;
 
@@ -253,8 +259,8 @@ END
     print "Dropping $RT::DatabaseType database $RT::DatabaseName.\n";
 
     if ( $RT::DatabaseType eq 'SQLite' ) {
-       unlink $RT::DatabaseName or warn $!;
-       return;
+        unlink $RT::DatabaseName or warn $!;
+        return;
     }
     $dbh->do("Drop DATABASE $RT::DatabaseName") or warn $DBI::errstr;
 }
@@ -269,15 +275,15 @@ sub create_db {
     }
     elsif ( $RT::DatabaseType eq 'Pg' ) {
         $dbh->do("CREATE DATABASE $RT::DatabaseName WITH ENCODING='UNICODE'");
-        if ($DBI::errstr) {
+        if ( $DBI::errstr ) {
             $dbh->do("CREATE DATABASE $RT::DatabaseName") || die $DBI::errstr;
         }
     }
-    elsif ($RT::DatabaseType eq 'Oracle') {
+    elsif ( $RT::DatabaseType eq 'Oracle' ) {
         insert_acl();
     }
     elsif ( $RT::DatabaseType eq 'Informix' ) {
-       $ENV{DB_LOCALE} = 'en_us.utf8';
+        $ENV{DB_LOCALE} = 'en_us.utf8';
         $dbh->do("CREATE DATABASE $RT::DatabaseName WITH BUFFERED LOG");
     }
     else {
@@ -315,8 +321,7 @@ sub _yesno {
 
 # {{{ insert_acls
 sub insert_acl {
-
-        my $base_path = (shift || $RT::EtcPath);
+    my $base_path = (shift || $RT::EtcPath);
 
     if ( $RT::DatabaseType =~ /^oracle$/i ) {
         do $base_path . "/acl.Oracle"
@@ -378,8 +383,8 @@ sub get_system_dsn {
         $dsn =~ s/dbname=$RT::DatabaseName/dbname=template1/;
     }
     elsif ( $RT::DatabaseType eq 'Informix' ) {
-       # with Informix, you want to connect sans database:
-       $dsn =~ s/Informix:$RT::DatabaseName/Informix:/;
+        # with Informix, you want to connect sans database:
+        $dsn =~ s/Informix:$RT::DatabaseName/Informix:/;
     }
     return $dsn;
 }
@@ -418,14 +423,15 @@ sub insert_initial_data {
         Comments =>
 'Do not delete or modify this user. It is integral to RT\'s internal database structures',
         Creator => '1',
-        LastUpdatedBy => '1' );
+        LastUpdatedBy => '1',
+    );
 
-    unless ($val) {
+    unless ( $val ) {
         print "$msg\n";
-        exit(1);
+        exit(-1);
     }
     print "done.\n";
-    $RT::Handle->Disconnect() unless ($RT::DatabaseType eq 'SQLite');
+    $RT::Handle->Disconnect() unless $RT::DatabaseType eq 'SQLite';
 
 }
 
@@ -461,77 +467,78 @@ sub insert_data {
     require $datafile
       || die "Couldn't find initial data for import\n" . $@;
 
-    if (@Groups) {
+    if ( @Groups ) {
         print "Creating groups...";
         foreach $item (@Groups) {
             my $new_entry = RT::Group->new($CurrentUser);
             my ( $return, $msg ) = $new_entry->_Create(%$item);
-            print "(Error: $msg)" unless ($return);
+            print "(Error: $msg)" unless $return;
             print $return. ".";
         }
         print "done.\n";
     }
-    if (@Users) {
+    if ( @Users ) {
         print "Creating users...";
         foreach $item (@Users) {
             my $new_entry = new RT::User($CurrentUser);
             my ( $return, $msg ) = $new_entry->Create(%$item);
-            print "(Error: $msg)" unless ($return);
+            print "(Error: $msg)" unless $return;
             print $return. ".";
         }
         print "done.\n";
     }
-    if (@Queues) {
+    if ( @Queues ) {
         print "Creating queues...";
         for $item (@Queues) {
             my $new_entry = new RT::Queue($CurrentUser);
             my ( $return, $msg ) = $new_entry->Create(%$item);
-            print "(Error: $msg)" unless ($return);
+            print "(Error: $msg)" unless $return;
             print $return. ".";
         }
         print "done.\n";
     }
-    if (@ACL) {
+    if ( @ACL ) {
         print "Creating ACL...";
         for my $item (@ACL) {
 
-           my ($princ, $object);
+            my ($princ, $object);
 
-           # Global rights or Queue rights?
-           if ($item->{'Queue'}) {
+            # Global rights or Queue rights?
+            if ( $item->{'Queue'} ) {
                 $object = RT::Queue->new($CurrentUser);
                 $object->Load( $item->{'Queue'} );
-           } else {
-               $object = $RT::System;
-           }
+            } else {
+                $object = $RT::System;
+            }
 
-           # Group rights or user rights?
-           if ($item->{'GroupDomain'}) {
+            # Group rights or user rights?
+            if ( $item->{'GroupDomain'} ) {
                 $princ = RT::Group->new($CurrentUser);
-               if ($item->{'GroupDomain'} eq 'UserDefined') {
+                if ( $item->{'GroupDomain'} eq 'UserDefined' ) {
                   $princ->LoadUserDefinedGroup( $item->{'GroupId'} );
-               } elsif ($item->{'GroupDomain'} eq 'SystemInternal') {
+                } elsif ( $item->{'GroupDomain'} eq 'SystemInternal' ) {
                   $princ->LoadSystemInternalGroup( $item->{'GroupType'} );
-               } elsif ($item->{'GroupDomain'} eq 'RT::System-Role') {
+                } elsif ( $item->{'GroupDomain'} eq 'RT::System-Role' ) {
                   $princ->LoadSystemRoleGroup( $item->{'GroupType'} );
-               } elsif ($item->{'GroupDomain'} eq 'RT::Queue-Role' &&
-                        $item->{'Queue'}) {
+                } elsif ( $item->{'GroupDomain'} eq 'RT::Queue-Role' &&
+                          $item->{'Queue'} )
+                {
                   $princ->LoadQueueRoleGroup( Type => $item->{'GroupType'},
-                                             Queue => $object->id);
-               } else {
+                                              Queue => $object->id);
+                } else {
                   $princ->Load( $item->{'GroupId'} );
-               }
-           } else {
-               $princ = RT::User->new($CurrentUser);
-               $princ->Load( $item->{'UserId'} );
-           }
-
-           # Grant it
-           my ( $return, $msg ) = $princ->PrincipalObj->GrantRight(
+                }
+            } else {
+                $princ = RT::User->new($CurrentUser);
+                $princ->Load( $item->{'UserId'} );
+            }
+
+            # Grant it
+            my ( $return, $msg ) = $princ->PrincipalObj->GrantRight(
                                                      Right => $item->{'Right'},
                                                      Object => $object );
 
-            if ($return) {
+            if ( $return ) {
                 print $return. ".";
             }
             else {
@@ -542,65 +549,68 @@ sub insert_data {
         }
         print "done.\n";
     }
-    if (@CustomFields) {
+    if ( @CustomFields ) {
         print "Creating custom fields...";
         for $item (@CustomFields) {
             my $new_entry = new RT::CustomField($CurrentUser);
             my $values    = $item->{'Values'};
             delete $item->{'Values'};
-            my $q     = $item->{'Queue'};
-            my $q_obj = RT::Queue->new($CurrentUser);
-            $q_obj->Load($q);
-            if ( $q_obj->Id ) {
-                $item->{'Queue'} = $q_obj->Id;
-            }
-            elsif ( $q == 0 ) {
-                $item->{'Queue'} = 0;
-            }
-            else {
-                print "(Error: Could not find queue " . $q . ")\n"
-                  unless ( $q_obj->Id );
+            my ( $return, $msg ) = $new_entry->Create(%$item);
+            unless( $return ) {
+                print "(Error: $msg)\n";
                 next;
             }
-            my ( $return, $msg ) = $new_entry->Create(%$item);
 
             foreach my $value ( @{$values} ) {
                 my ( $eval, $emsg ) = $new_entry->AddValue(%$value);
-                print "(Error: $emsg)\n" unless ($eval);
+                print "(Error: $emsg)\n" unless $eval;
+            }
+
+            if ( $item->{LookupType} && !exists $item->{'Queue'} ) { # enable by default
+                my $ocf = RT::ObjectCustomField->new($CurrentUser);
+                $ocf->Create( CustomField => $new_entry->Id );
             }
 
-            print "(Error: $msg)\n" unless ($return);
+            print "(Error: $msg)\n" unless $return;
             print $return. ".";
         }
 
         print "done.\n";
     }
 
-    if (@ScripActions) {
+    if ( @ScripActions ) {
         print "Creating ScripActions...";
 
         for $item (@ScripActions) {
             my $new_entry = RT::ScripAction->new($CurrentUser);
-            my $return    = $new_entry->Create(%$item);
+            my ($return,$msg) = $new_entry->Create(%$item);
+            unless ($return) {
+                print "(Error: $msg)\n";
+                exit;
+            }
             print $return. ".";
         }
 
         print "done.\n";
     }
 
-    if (@ScripConditions) {
+    if ( @ScripConditions ) {
         print "Creating ScripConditions...";
 
         for $item (@ScripConditions) {
             my $new_entry = RT::ScripCondition->new($CurrentUser);
-            my $return    = $new_entry->Create(%$item);
+            my ($return,$msg) = $new_entry->Create(%$item);
+            unless ($return) {
+                print "(Error: $msg)\n";
+                exit;
+            }
             print $return. ".";
         }
 
         print "done.\n";
     }
 
-    if (@Templates) {
+    if ( @Templates ) {
         print "Creating templates...";
 
         for $item (@Templates) {
@@ -610,13 +620,30 @@ sub insert_data {
         }
         print "done.\n";
     }
-    if (@Scrips) {
+    if ( @Scrips ) {
         print "Creating scrips...";
 
         for $item (@Scrips) {
             my $new_entry = new RT::Scrip($CurrentUser);
             my ( $return, $msg ) = $new_entry->Create(%$item);
-            if ($return) {
+            if ( $return ) {
+                print $return. ".";
+            }
+            else {
+                print "(Error: $msg)\n";
+            }
+        }
+        print "done.\n";
+    }
+    if ( @Attributes ) {
+        print "Creating predefined searches...";
+        my $sys = RT::System->new($CurrentUser);
+
+        for $item (@Attributes) {
+            my $obj = delete $item->{Object}; # XXX: make this something loadable
+            $obj ||= $sys;
+            my ( $return, $msg ) = $obj->AddAttribute (%$item);
+            if ( $return ) {
                 print $return. ".";
             }
             else {
@@ -625,7 +652,7 @@ sub insert_data {
         }
         print "done.\n";
     }
-    $RT::Handle->Disconnect() unless ($RT::DatabaseType eq 'SQLite');
+    $RT::Handle->Disconnect() unless $RT::DatabaseType eq 'SQLite';
     print "Done setting up database content.\n";
 }
 
@@ -651,7 +678,7 @@ sub help {
 $0: Set up RT's database
 
 --action        init    Initialize the database
-                drop    Drop the database. 
+                drop    Drop the database.
                         This will ERASE ALL YOUR DATA
                 insert_initial 
                         Insert RT's core system objects
@@ -659,11 +686,11 @@ $0: Set up RT's database
                         By default, will use RT's installation data.
                         To use a local or supplementary datafile, specify it
                         using the '--datafile' option below.
-                        
+
                 acl     Initialize only the database ACLs
                         To use a local or supplementary datafile, specify it
                         using the '--datadir' option below.
-                        
+
                 schema  Initialize only the database schema
                         To use a local or supplementary datafile, specify it
                         using the '--datadir' option below.