[Rt-commit] [svn] r717 - in rt/branches/rt-3.3: . bin etc etc/upgrade/3.1.0 html html/Admin/Elements html/Admin/Tools html/Elements html/NoAuth html/REST/1.0/Forms/ticket html/Scope html/Search html/Search/Elements html/Ticket html/Ticket/Elements html/Tools html/Tools/Elements lib/RT lib/RT/Action lib/RT/Interface sbin

jesse at pallas.eruditorum.org jesse at pallas.eruditorum.org
Wed Apr 21 01:25:02 EDT 2004


Author: jesse
Date: Wed Apr 21 01:25:01 2004
New Revision: 717

Added:
   rt/branches/rt-3.3/etc/upgrade/3.1.0/
   rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.Informix
   rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.Oracle
   rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.Pg
   rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.SQLite
   rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.mysql
   rt/branches/rt-3.3/etc/upgrade/3.1.0/content
   rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.Informix
   rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.Oracle
   rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.Pg
   rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.SQLite
   rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.mysql
   rt/branches/rt-3.3/html/Admin/Elements/ToolTabs
   rt/branches/rt-3.3/html/Admin/Tools/
   rt/branches/rt-3.3/html/Admin/Tools/Configuration.html
   rt/branches/rt-3.3/html/Admin/Tools/index.html
   rt/branches/rt-3.3/html/Elements/QueryString
   rt/branches/rt-3.3/html/Elements/ScrubHTML
   rt/branches/rt-3.3/html/Ticket/Elements/ShowTransactionAttachments
   rt/branches/rt-3.3/html/Ticket/ShowEmailRecord.html
   rt/branches/rt-3.3/html/Tools/Elements/
   rt/branches/rt-3.3/html/Tools/Elements/Tabs
   rt/branches/rt-3.3/html/Tools/Offline.html
Modified:
   rt/branches/rt-3.3/   (props changed)
   rt/branches/rt-3.3/Makefile.in
   rt/branches/rt-3.3/bin/webmux.pl.in
   rt/branches/rt-3.3/configure.ac
   rt/branches/rt-3.3/etc/RT_Config.pm.in
   rt/branches/rt-3.3/etc/schema.mysql
   rt/branches/rt-3.3/html/Admin/Elements/SelectNewGroupMembers
   rt/branches/rt-3.3/html/Elements/Tabs
   rt/branches/rt-3.3/html/Elements/TicketList
   rt/branches/rt-3.3/html/NoAuth/webrt.css
   rt/branches/rt-3.3/html/REST/1.0/Forms/ticket/default
   rt/branches/rt-3.3/html/Scope/Search.html
   rt/branches/rt-3.3/html/Search/Build.html
   rt/branches/rt-3.3/html/Search/Edit.html
   rt/branches/rt-3.3/html/Search/Elements/BuildFormatString
   rt/branches/rt-3.3/html/Search/Elements/DisplayOptions
   rt/branches/rt-3.3/html/Search/Elements/EditFormat
   rt/branches/rt-3.3/html/Search/Elements/EditSearches
   rt/branches/rt-3.3/html/Search/Results.html
   rt/branches/rt-3.3/html/Search/Results.rdf
   rt/branches/rt-3.3/html/Search/Results.tsv
   rt/branches/rt-3.3/html/Ticket/Elements/ShowRequestor
   rt/branches/rt-3.3/html/Ticket/Elements/ShowTransaction
   rt/branches/rt-3.3/html/Ticket/Elements/Tabs
   rt/branches/rt-3.3/html/Ticket/Update.html
   rt/branches/rt-3.3/html/autohandler
   rt/branches/rt-3.3/lib/RT/Action/CreateTickets.pm
   rt/branches/rt-3.3/lib/RT/Attachment_Overlay.pm
   rt/branches/rt-3.3/lib/RT/Group_Overlay.pm
   rt/branches/rt-3.3/lib/RT/I18N.pm
   rt/branches/rt-3.3/lib/RT/Interface/Web.pm
   rt/branches/rt-3.3/lib/RT/Queue_Overlay.pm
   rt/branches/rt-3.3/lib/RT/Ticket_Overlay.pm
   rt/branches/rt-3.3/lib/RT/Transaction_Overlay.pm
   rt/branches/rt-3.3/lib/RT/Users_Overlay.pm
   rt/branches/rt-3.3/sbin/rt-test-dependencies.in
Log:
  ----------------------------------------------------------------------
  r2113 at tinbook:  jesse | 2004-04-21T05:24:17.573962Z
  
  Remerging from RT 3.1.x
  ----------------------------------------------------------------------
  

Modified: rt/branches/rt-3.3/Makefile.in
==============================================================================
--- rt/branches/rt-3.3/Makefile.in	(original)
+++ rt/branches/rt-3.3/Makefile.in	Wed Apr 21 01:25:01 2004
@@ -492,6 +492,7 @@
 
 apachectl:
 	$(APACHECTL) stop
-	sleep 3
+	sleep 10
 	$(APACHECTL) start
+	sleep 5
 # }}}

Modified: rt/branches/rt-3.3/bin/webmux.pl.in
==============================================================================
--- rt/branches/rt-3.3/bin/webmux.pl.in	(original)
+++ rt/branches/rt-3.3/bin/webmux.pl.in	Wed Apr 21 01:25:01 2004
@@ -84,6 +84,8 @@
     use CGI::Cookie;
     use Time::ParseDate;
     use HTML::Entities;
+    use HTML::Scrubber;
+    use Text::Quoted;
 }
 
 

Modified: rt/branches/rt-3.3/configure.ac
==============================================================================
--- rt/branches/rt-3.3/configure.ac	(original)
+++ rt/branches/rt-3.3/configure.ac	Wed Apr 21 01:25:01 2004
@@ -6,7 +6,7 @@
 
 dnl Setup autoconf
 AC_PREREQ(2.53)
-AC_INIT(RT, [3.1.1], [rt-3.1-bugs at fsck.com])
+AC_INIT(RT, [3.1@$Rev: 2039 $], [rt-3.1-bugs at fsck.com])
 AC_CONFIG_SRCDIR([lib/RT.pm.in])
 
 dnl Extract RT version number components

Modified: rt/branches/rt-3.3/etc/RT_Config.pm.in
==============================================================================
--- rt/branches/rt-3.3/etc/RT_Config.pm.in	(original)
+++ rt/branches/rt-3.3/etc/RT_Config.pm.in	Wed Apr 21 01:25:01 2004
@@ -279,6 +279,11 @@
 
 Set($LogoURL , $WebImagesURL . "rt.jpg");
 
+# WebNoAuthRegex - What portion of RT's URLspace should not require
+# authentication.
+Set($WebNoAuthRegex, qr!^(?:/+NoAuth/|
+                            /+REST/\d+\.\d+/NoAuth/)!x );
+
 # For message boxes, set the entry box width and what type of wrapping
 # to use.
 #
@@ -293,6 +298,14 @@
 # sent in a request (although there is probably more to it than that)
 Set($TrustHTMLAttachments , undef);
 
+
+# If PreferRichText is set to a true value, RT will show HTML/Rich text
+# messages in preference to their plaintext alternatives. RT "scrubs" the 
+# html to show only a minimal subset of HTML to avoid possible contamination
+# by cross-site-scripting attacks.
+
+Set($PreferRichText, undef);
+
 # If $WebExternalAuth is defined, RT will defer to the environment's
 # REMOTE_USER variable.
 

Modified: rt/branches/rt-3.3/etc/schema.mysql
==============================================================================
--- rt/branches/rt-3.3/etc/schema.mysql	(original)
+++ rt/branches/rt-3.3/etc/schema.mysql	Wed Apr 21 01:25:01 2004
@@ -433,6 +433,7 @@
 # }}}
 
 
+# {{{ Attributes
 
 CREATE TABLE Attributes (
   id INTEGER NOT NULL  AUTO_INCREMENT,
@@ -449,7 +450,10 @@
   PRIMARY KEY (id)
 ) TYPE=InnoDB;
 
-CREATE INDEX Attributes1 on Attributes(Name, ObjectType, ObjectId);
+CREATE INDEX Attributes1 on Attributes(Name);
+CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId);
+
+# }}}
 
 # {{{ Sessions
 

Added: rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.Informix
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.Informix	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,4 @@
+sub acl {
+    return ();
+}
+1;

Added: rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.Oracle
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.Oracle	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,4 @@
+sub acl {
+    return ();
+}
+1;

Added: rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.Pg
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.Pg	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,19 @@
+sub acl {
+    my $dbh = shift;
+
+    my @acls;
+
+    my @tables = qw (
+      attributes_id_seq
+      attributes
+    );
+
+    foreach my $table (@tables) {
+        push @acls,
+          "GRANT SELECT, INSERT, UPDATE, DELETE ON $table to "
+          . $RT::DatabaseUser . ";";
+
+    }
+    return (@acls);
+}
+1;

Added: rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.SQLite
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.SQLite	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,4 @@
+sub acl {
+    return ();
+}
+1;

Added: rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.mysql
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.1.0/acl.mysql	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,4 @@
+sub acl {
+    return ();
+}
+1;

Added: rt/branches/rt-3.3/etc/upgrade/3.1.0/content
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.1.0/content	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,2 @@
+# nothing to do
+1;

Added: rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.Informix
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.Informix	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,17 @@
+CREATE TABLE Attributes (
+  	id 		SERIAL,
+	Name 			VARCHAR(255) DEFAULT '' NOT NULL,
+	Description 		VARCHAR(255) DEFAULT NULL,
+  	Content 	BYTE,
+	ContentType	VARCHAR(16),
+	ObjectType	VARCHAR(25) NOT NULL,
+	ObjectId	INTEGER DEFAULT 0 NOT NULL,
+	Creator 	INTEGER DEFAULT 0 NOT NULL,
+  	Created 	DATETIME YEAR TO SECOND,
+	LastUpdatedBy	INTEGER DEFAULT 0 NOT NULL,
+	LastUpdated	DATETIME YEAR TO SECOND,
+        PRIMARY KEY (id)
+); 
+
+CREATE INDEX Attributes1 on Attributes(Name);
+CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId);

Added: rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.Oracle
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.Oracle	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,17 @@
+CREATE SEQUENCE ATTRIBUTES_seq;
+CREATE TABLE Attributes (
+	id 			NUMBER(11,0) PRIMARY KEY,
+	Name 			VARCHAR2(255) NOT NULL,
+	Description 		VARCHAR2(255),
+  	Content 	CLOB,
+    ContentType VARCHAR(16),
+	ObjectType	VARCHAR2(25) NOT NULL,
+	ObjectId	NUMBER(11,0) DEFAULT 0 NOT NULL,
+	Creator 		NUMBER(11,0) DEFAULT 0 NOT NULL,
+	Created 		DATE,
+	LastUpdatedBy 		NUMBER(11,0) DEFAULT 0 NOT NULL,
+	LastUpdated		DATE
+);
+
+CREATE INDEX Attributes1 on Attributes(Name);
+CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId);

Added: rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.Pg
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.Pg	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,25 @@
+-- {{{ Attributes
+
+CREATE SEQUENCE attributes_id_seq;
+
+CREATE TABLE Attributes (
+  id INTEGER DEFAULT nextval('attributes_id_seq'),
+  Name varchar(255) NOT NULL  ,
+  Description varchar(255) NULL  ,
+  Content text,
+  ContentType varchar(16),
+  ObjectType varchar(64),
+  ObjectId integer, # foreign key to anything
+  Creator integer NOT NULL DEFAULT 0  ,
+  Created TIMESTAMP NULL  ,
+  LastUpdatedBy integer NOT NULL DEFAULT 0  ,
+  LastUpdated TIMESTAMP NULL  ,
+  PRIMARY KEY (id)
+
+);
+
+CREATE INDEX Attributes1 on Attributes(Name);
+CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId);
+
+-- }}}
+

Added: rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.SQLite
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.SQLite	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,20 @@
+--- {{{ Attributes
+CREATE TABLE Attributes (
+  id INTEGER PRIMARY KEY  ,
+  Name varchar(255) NOT NULL  ,
+  Description varchar(255) NULL  ,
+  Content LONGTEXT NULL  ,
+  ContentType varchar(16),
+  ObjectType varchar(25) NOT NULL  ,
+  ObjectId INTEGER default 0,
+  Creator integer NULL  ,
+  Created DATETIME NULL  ,
+  LastUpdatedBy integer NULL  ,
+  LastUpdated DATETIME NULL  
+ 
+) ;
+CREATE INDEX Attributes1 on Attributes(Name)
+CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId);
+
+--- }}}
+

Added: rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.mysql
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/etc/upgrade/3.1.0/schema.mysql	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,21 @@
+# {{{ Attributes
+
+CREATE TABLE Attributes (
+  id INTEGER NOT NULL  AUTO_INCREMENT,
+  Name varchar(255) NULL  ,
+  Description varchar(255) NULL  ,
+  Content text,
+  ContentType varchar(16),
+  ObjectType varchar(64),
+  ObjectId integer, # foreign key to anything
+  Creator integer NOT NULL DEFAULT 0  ,
+  Created DATETIME NULL  ,
+  LastUpdatedBy integer NOT NULL DEFAULT 0  ,
+  LastUpdated DATETIME NULL  ,
+  PRIMARY KEY (id)
+) TYPE=InnoDB;
+
+CREATE INDEX Attributes1 on Attributes(Name);
+CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId);
+
+# }}}

Modified: rt/branches/rt-3.3/html/Admin/Elements/SelectNewGroupMembers
==============================================================================
--- rt/branches/rt-3.3/html/Admin/Elements/SelectNewGroupMembers	(original)
+++ rt/branches/rt-3.3/html/Admin/Elements/SelectNewGroupMembers	Wed Apr 21 01:25:01 2004
@@ -42,8 +42,8 @@
 <%INIT>
 my $users = new RT::Users($session{'CurrentUser'});
 
-$users->Limit(FIELD => 'id', VALUE => $RT::SystemUser->id, OPERATOR => '!=' );
-$users->Limit(FIELD => 'id', VALUE => $RT::Nobody->id, OPERATOR => '!=' );
+$users->Limit(FIELD => 'id', VALUE => $RT::SystemUser->id, OPERATOR => '!=', ENTRYAGGREGATOR => 'AND');
+$users->Limit(FIELD => 'id', VALUE => $RT::Nobody->id, OPERATOR => '!=', ENTRYAGGREGATOR => 'AND' );
 $users->LimitToPrivileged();
 
 my $groups = new RT::Groups($session{'CurrentUser'});

Added: rt/branches/rt-3.3/html/Admin/Elements/ToolTabs
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/html/Admin/Elements/ToolTabs	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,56 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+<& /Admin/Elements/Tabs, subtabs => $tabs, 
+    current_tab => 'Admin/Tools/', 
+    current_subtab => $current_tab, 
+    Title => $Title &>
+
+<%INIT>
+  my $tabs = {
+                
+               A => { title => loc('System Configuration'),
+                           path => 'Admin/Tools/Configuration.html',
+                      }
+
+};
+
+  # Now let callbacks add their extra tabs
+  $m->comp('/Elements/Callback', tabs => $tabs, %ARGS);
+
+  foreach my $tab (sort keys %{$tabs}) {
+    if ($tabs->{$tab}->{'path'} eq $current_tab) {
+      $tabs->{$tab}->{"subtabs"} = $subtabs;
+      $tabs->{$tab}->{"current_subtab"} = $current_subtab;
+    }
+  }
+</%INIT>
+
+  
+<%ARGS>
+$id => undef
+$current_tab => undef
+$subtabs => undef
+$current_subtab => undef
+$Title => undef
+</%ARGS>

Added: rt/branches/rt-3.3/html/Admin/Tools/Configuration.html
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/html/Admin/Tools/Configuration.html	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,53 @@
+<%init>
+require  Module::Versions::Report;
+my $title = loc('System Configuration');
+unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) {
+ Abort(loc('This feature is only available to system administrators'));
+} 
+
+
+</%init>
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/ToolTabs, 
+    current_tab => 'Admin/Tools/Configuration.html',
+    current_subtab => 'Admin/Tools/Configuration.html', 
+    Title => $title &>
+
+
+
+
+<h2><&|/l&>Loaded perl modules</&></h2>
+<pre>
+% my $report =  Module::Versions::Report::report();
+% my @report = grep { /v\d/ } split("\n",$report);
+<%join('<br>', @report)|n%>
+
+
+</pre>
+
+<h2><&|/l&>RT Variables</&></h2>
+<table>
+%{
+%no strict qw/refs/;
+
+%foreach my $key (sort keys %{*RT::}) {
+% next unless (${'RT::'.$key} );
+% next if (ref ${'RT::'.$key} );
+<tr><td>RT::<%$key%></td>
+<td>
+% if ($key =~ /Password/i) { 
+<i>Password not printed</i>
+% } else {
+<%${'RT::'.$key} %>
+% }
+</td>
+</tr>
+% }
+%}
+</table>
+
+<h2><&|/l&>Perl configuration</&></h2>
+% require Config;
+<pre>
+<%Config::myconfig()%>
+</pre>

Added: rt/branches/rt-3.3/html/Admin/Tools/index.html
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/html/Admin/Tools/index.html	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,8 @@
+<%init>
+my $title = loc('System Tools');
+</%init>
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/ToolTabs, 
+    current_tab => 'Admin/Tools/index.html',
+    current_subtab => 'Admin/Tools/Configuration.html', 
+    Title => $title &>

Added: rt/branches/rt-3.3/html/Elements/QueryString
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/html/Elements/QueryString	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,7 @@
+<%init>
+my @params;
+while ( (my $key, my $value) = each %ARGS ){
+	push @params, $key."=".$m->interp->apply_escapes($value,'u');
+}
+return(join('&', at params));
+</%init>

Added: rt/branches/rt-3.3/html/Elements/ScrubHTML
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/html/Elements/ScrubHTML	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,14 @@
+<%init>
+my $scrubber = HTML::Scrubber->new();
+
+$scrubber->default( 0,
+    { '*' => 0, id => 1, class => 1, href => 1, face => 1, size => 1, target => 1 } );
+
+$scrubber->deny(qw[*]);
+$scrubber->allow( qw[A B U P BR I HR BR SMALL EM FONT SPAN DIV UL OL LI DL DT DD] );
+$scrubber->comment(0);
+return($scrubber->scrub($Content));
+</%init>
+<%args>
+$Content => undef
+</%args>

Modified: rt/branches/rt-3.3/html/Elements/Tabs
==============================================================================
--- rt/branches/rt-3.3/html/Elements/Tabs	(original)
+++ rt/branches/rt-3.3/html/Elements/Tabs	Wed Apr 21 01:25:01 2004
@@ -46,6 +46,9 @@
                     B => { title => loc('Tickets'),
                         path => 'Search/Build.html'
                       },
+                    C => { title => loc('Tools'),
+                           path => 'Tools/Offline.html'
+                         },
                     E => { title => loc('Configuration'),
                            path => 'Admin/'
                          },

Modified: rt/branches/rt-3.3/html/Elements/TicketList
==============================================================================
--- rt/branches/rt-3.3/html/Elements/TicketList	(original)
+++ rt/branches/rt-3.3/html/Elements/TicketList	Wed Apr 21 01:25:01 2004
@@ -41,11 +41,22 @@
 % if ($ShowNavigation) {
 <hr>
 <&|/l, $Page, int($TotalFound/$Rows)+1&>Page [_1] of [_2]</&>
-% if ($Page != 1) {
-<A href="<%$BaseURL%>?Page=<%$Page-1%>&Rows=<%$Rows%>&Format=<%$Format%>&Query=<%$Query%>"><&|/l&>Previous Page</&></a>
+
+<%perl>
+my $prev =  $m->comp('/Elements/QueryString', Query => $Query,
+                                Format => $Format,
+                                Rows => $Rows,
+                                Page => ($Page-1));
+my $next =  $m->comp('/Elements/QueryString', Query => $Query,
+                                Format => $Format,
+                                Rows => $Rows,
+                                Page => ($Page+1));
+</%perl>
+% if ($Page > 1) {
+<A href="<%$BaseURL%><%$prev%><&|/l&>Previous Page</&></a>
 % }
 % if (($Page * $Rows) < $TotalFound) {
-<A href="<%$BaseURL%>Page=<%$Page+1%>&Rows=<%$Rows%>&Format=<%$Format%>&Query=<%$Query%>"><&|/l&>Next Page</&></a>
+<A href="<%$BaseURL%><%$next%><&|/l&>Next Page</&></a>
 % }
 % }
 <%INIT>
@@ -53,6 +64,8 @@
 use vars qw($COLUMN_MAP $CUSTOM_FIELD_MAP);
 
 $Format ||= $RT::DefaultSearchResultFormat;
+# Scrub the html of the format string to remove any potential nasties.
+$Format = $m->comp('/Elements/ScrubHTML', Content => $Format);
 
 $Rows ||= '25'; # we need a positive value
 
@@ -274,7 +287,21 @@
     },
     Members => {
         value => sub {
-            my $links = $_[0]->HasMember;
+            my $links = $_[0]->Members;
+            return (
+                join(
+                    "<br>",
+                    map {
+                            '<A HREF="'
+                          . $_->BaseURI->Resolver->HREF . '">'
+                          . ( $_->BaseIsLocal ? $_->LocalBase : $_->Base )
+                          . '</A>'
+                      } @{ $links->ItemsArrayRef } ) );
+          }
+    },
+    Children => {
+        value => sub {
+            my $links = $_[0]->Members;
             return (
                 join(
                     "<br>",
@@ -329,6 +356,20 @@
                       } @{ $links->ItemsArrayRef } ) );
           }
     },
+    Parents => {
+        value => sub {
+            my $links = $_[0]->MemberOf;
+            return (
+                join(
+                    "<br>",
+                    map {
+                            '<A HREF="'
+                          . $_->TargetURI->Resolver->HREF . '">'
+                          . ( $_->TargetIsLocal ? $_->LocalTarget : $_->Target )
+                          . '</A>'
+                      } @{ $links->ItemsArrayRef } ) );
+          }
+    },
     RefersTo => {
         value => sub {
             my $links = $_[0]->RefersTo;
@@ -402,7 +443,10 @@
 </%ARGS>
 <TR>
 <%perl>
-my @generic_query_args = ( 'Query=' . $Query, 'Rows=' . $Rows, 'Page=' . $Page );
+
+
+
+my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page );
 
 foreach my $col (@Format) {
     if ( $col->{title} eq 'NEWLINE' ) {
@@ -412,17 +456,25 @@
         $m->out('<TH align="center">');
         my $title = $col->{title};
         $title =~ s/^__(.*)__$/$1/o;
-        $title = ( ColumnMap($title, 'title')  || $title );
-        if ( $AllowSorting && $col->{'attribute'} && ColumnMap($col->{'attribute'},'attribute')) {
-            my @query_args = @generic_query_args;
-            push @query_args, ( "OrderBy=" . ( ColumnMap($col->{'attribute'}, 'attribute') || $col->{'attribute'} ) );
-            push @query_args,
-              ( "Order=" . ( $ARGS{'Order'} eq 'ASC'  
-              ? 'DESC'
-              : 'ASC' ));
-            $m->out( '<a href="' . $BaseURL . '&'
-                . join ( '&', @query_args ) . '">'
-                . loc($title) . '</a>' );
+        $title = ( ColumnMap( $title, 'title' ) || $title );
+        if (   $AllowSorting
+            && $col->{'attribute'}
+            && ColumnMap( $col->{'attribute'}, 'attribute' ) )
+        {
+
+            $m->out(
+                '<a href="' . $BaseURL 
+                  . $m->comp(
+                    '/Elements/QueryString',
+                    %generic_query_args,
+                    OrderBy => (
+                        ColumnMap( $col->{'attribute'}, 'attribute' )
+                          || $col->{'attribute'}
+                    ),
+                    Order => ( $ARGS{'Order'} eq 'ASC' ? 'DESC' : 'ASC' )
+                  ).
+                  '">' . loc($title) . '</a>'
+            );
         }
         else {
             $m->out( loc($title) );

Modified: rt/branches/rt-3.3/html/NoAuth/webrt.css
==============================================================================
--- rt/branches/rt-3.3/html/NoAuth/webrt.css	(original)
+++ rt/branches/rt-3.3/html/NoAuth/webrt.css	Wed Apr 21 01:25:01 2004
@@ -105,6 +105,19 @@
 	 text-align: right;
          }
 
+div.messagebody {
+    padding: 2em; 
+
+}
+
+
+div.downloadattachment {
+    font size: 10px;
+    text-align: right;
+
+}
+
+
 td {  font-family: Verdana, Arial, Helvetica, sans-serif;
 	 font-size: 11px;
 	 background-position: left top;

Modified: rt/branches/rt-3.3/html/REST/1.0/Forms/ticket/default
==============================================================================
--- rt/branches/rt-3.3/html/REST/1.0/Forms/ticket/default	(original)
+++ rt/branches/rt-3.3/html/REST/1.0/Forms/ticket/default	Wed Apr 21 01:25:01 2004
@@ -177,8 +177,8 @@
             $key = $simple{$key};
             $set = "Set$key";
 
-            next if $val eq $ticket->$key;
-            ($n, $s) = $ticket->$set($val);
+            next if (($val eq $ticket->$key)|| ($ticket->$key =~ /^\d+$/ && $val == $ticket->$key));
+            ($n, $s) = $ticket->$set("$val");
         }
         elsif (exists $dates{$key}) {
             $key = $dates{$key};
@@ -226,7 +226,7 @@
                 $s =~ s/^# //;
             }
         }
-        elsif ($key ne 'id' && $key ne 'type') {
+        elsif ($key ne 'id' && $key ne 'type' && $key ne 'creator') {
             $n = 0;
             $s = "Unknown field.";
         }

Modified: rt/branches/rt-3.3/html/Scope/Search.html
==============================================================================
--- rt/branches/rt-3.3/html/Scope/Search.html	(original)
+++ rt/branches/rt-3.3/html/Scope/Search.html	Wed Apr 21 01:25:01 2004
@@ -2,7 +2,6 @@
 $query => undef
 $per_page => 25
 $page => 1
-
 </%args>
 <%init>
 my $tix = RT::Tickets->new($session{'CurrentUser'});
@@ -10,6 +9,7 @@
 my $i;
 </%init>
 <& Elements/Header &>
+%# {{{ javascript
 <script>
 var oldcurrent;
 var oldcurrentcolor;
@@ -47,6 +47,7 @@
     chunk.style.display = "none";
 }
 </script>
+%#  }}}
 % if ($tix->Count) {
 <font size="-1">
 Found <%$tix->Count%> tickets.
@@ -72,18 +73,18 @@
 </center>
 <br>
 <table width="100%" cellspacing=0 cellpadding="3">
-% while (my $ticket = $tix->Next) {
+% while ( my $ticket = $tix->Next) {
 % $i++;
-<tr id="ticket<%$ticket->Id%>"
- onclick="window.open('Work.html?id=<%$ticket->Id%>','View'); hilite(<%$ticket-Id%>);"
+<tr id="ticket<% $ticket->id %>"
+ onclick="window.open('Work.html?id=<%$ticket->id%>','View'); hilite(<%$ticket->Id%>);"
  class="<%$i%2 ? 'evenline' : 'oddline'%>">
 <td rowspan="2" align="right">
-	<a href="Work.html?id=<%$ticket->Id%>" 
+	<a href="Work.html?id=<%$ticket->id%>" 
     onClick="hilite(<%$ticket->Id%>)" 
-    target="View" ><span
-    id="id-<%$ticket->Id%>"><%$ticket->Id%></span></a></td>
+    target="View" ><span id="id-<%$ticket->Id%>"><%$ticket->Id%></span></a></td>
 <td colspan="4" wrap="1"><font size="-2">
-	<a href="Work.html?id=<%$ticket->Id%>" target="View"
+	<a href="Work.html?id=<%$ticket->Id%>" 
+		target="View"
     onClick="hilite(<%$ticket->Id%>)" 
     
     >

Modified: rt/branches/rt-3.3/html/Search/Build.html
==============================================================================
--- rt/branches/rt-3.3/html/Search/Build.html	(original)
+++ rt/branches/rt-3.3/html/Search/Build.html	Wed Apr 21 01:25:01 2004
@@ -50,9 +50,9 @@
 <input type=submit name="Left" value="<">
 <input type=submit name="Right" value=">">
 <input type=submit name="DeleteClause" value="Delete">
-<input type=submit name="Clear" value="Clear">
 <br>
-%#<input type=submit name="Toggle" DISABLED value="And/Or">
+<input type=submit name="Clear" value="Clear">
+<input type=submit name="Toggle" value="And/Or">
 %#<input type=submit name="EditQuery" value="Advanced">
 </center>
 <& /Elements/TitleBoxEnd &>
@@ -79,9 +79,9 @@
 my @actions        = ();
 my %queues;
 
+$ARGS{'Format'} = $Format = $m->comp('/Elements/ScrubHTML', Content => $Format) if ($Format);
+
 if ( $ARGS{"DoSearch"} ) {
-    $Format =~ s/%23/#/g;
-    $Format =~ s/%26/&/g;
     $m->comp( "Results.html", Query   => $Query, Format  => $Format, OrderBy => $ARGS{OrderBy}, Rows    => $ARGS{RowsPerPage});
     $m->abort();
 }
@@ -106,7 +106,6 @@
     my $obj_id    = $2;
     my $search_id = $3;
 
-    # XXX TODO This will only let users save personal searches
     # We explicitly list out the available types and
     # don't trust user input here
     if (   ( $obj_type eq 'RT::User' ) && ( $obj_id == $session{'CurrentUser'}->id ) ) {
@@ -198,12 +197,15 @@
 # a criterion will get lost otherwise
 if (1) {
 
-    my $key;
+    my ($key, $top);
     if ($currentkey) {
         $key = $currentkey;
+        my ( $prefix, $depth, $num ) = parsekey($key);
+        $top = 1 if $depth == 1;  
     }
     else {
         $key = "{" . '0.0' . "}{Subkey}{1.0}";
+        $top = 1;
     }
     while ( keyexists( $items, $key ) ) {
         $key = nextkey($key);
@@ -228,6 +230,15 @@
 
             setvalue($items, $key, $clause);
             setaggregator( $items, $key, $ARGS{'AndOr'} );
+
+            if ($top) {
+                # if the next item is a subkey, put it there
+                my $newkey = appendsubkey( $items, $key );
+                my $oldkey = $key;
+                movecurrent( $items, $newkey, \$oldkey );
+            }
+
+            $currentkey = $key;
             $key   = nextkey($key);
         }
     }
@@ -321,6 +332,14 @@
         push( @actions, [ "error: nothing to delete", -1 ] );
     }
 }
+elsif ( $ARGS{"Toggle"} ) {
+    my $ea = getaggregator( $items, $currentkey);
+    if ($ea eq 'AND') {
+        setaggregator( $items, $currentkey, 'OR' );
+    } else {
+        setaggregator( $items, $currentkey, 'AND' );
+    }
+}
 elsif ( $ARGS{"Clear"} ) {
     $items = ();
 }
@@ -390,7 +409,8 @@
                     $sendkey = "{$i.$j}";
                 }
                 push @$keys, { Key => $sendkey, Value => $item, EA => $ea };
-                $$Query .= " " . $ea . " " if ( $j > 0 );
+                # no aggregator if it's first
+                $$Query .= " " . $ea . " " if ($j > 0 && $$Query); 
                 $$Query .= "("             if $depth > 0;
                 my $x = $i + 1;
                 build_array( $Query, $subkey, $sendkey, $item->{EA}, 
@@ -407,7 +427,7 @@
                         $mykey = " " . $i . $j . " ";
                     }
                     $$Query .= " " . $ea . " " if ( $j > 0 );
-                    $$Query .= "$item->{Key} $item->{Op} $item->{Value}";
+                    $$Query .= "$item->{Key} $item->{Op} $item->{Value}" if $item->{Key};
                     push @$keys, { Key => $mykey, Value => $item, EA => $ea };
 
                     if ( $item->{Key} eq "Queue" ) {
@@ -442,6 +462,8 @@
 
     setvalue($query, "{0.0}", {});
     setvalue($query, "{0.0}{Subkey}", {});
+    setvalue($query, "{0.0}{Subkey}{1.0}", {});
+    setvalue($query, "{0.0}{Subkey}{1.0}{Subkey}", {});
 
     # get the FIELDS from Tickets_Overlay
     my $tickets = new RT::Tickets( $session{'CurrentUser'} );
@@ -697,6 +719,7 @@
     my ( $prefix, $depth, $num ) = parsekey($key);
 
     my $k = "$depth." . ( $num + 1 );
+    
     return $prefix . "{$k}";
 }
 
@@ -799,15 +822,15 @@
     }
 }
 
-#sub getaggregator {
-#    my $hash = shift;
-#    my $key  = shift;
-#
-#    my $parent = parentkey($key);
-#    my $ea = gethash($hash, $parent . "{EA}");
-#
-#    return $ea;
-#}
+sub getaggregator {
+    my $hash = shift;
+    my $key  = shift;
+
+    my $parent = parentkey($key);
+    my $ea = gethash($hash, $parent . "{EA}");
+
+    return $ea;
+}
 
 sub setaggregator {
     my $hash = shift;
@@ -1051,14 +1074,12 @@
 
 # }}}
 
-# Escape the format (need more than standard mason url escaping)
-$Format =~ s/#/%23/g;
-$Format =~ s/&/%26/g;
-
 # Build a querystring for the tabs
 
 my $QueryString;
-$QueryString = "?Query=$Query&Format=$Format&Rows=$ARGS{'Rows'}" if ($Query);
+$QueryString = '?' . $m->comp('/Elements/QueryString', Query => $Query,
+	Format => $Format,
+	Rows =>$ARGS{'Rows'}) if ($Query);
 
 </%INIT>
 

Modified: rt/branches/rt-3.3/html/Search/Edit.html
==============================================================================
--- rt/branches/rt-3.3/html/Search/Edit.html	(original)
+++ rt/branches/rt-3.3/html/Search/Edit.html	Wed Apr 21 01:25:01 2004
@@ -23,7 +23,7 @@
 %# END LICENSE BLOCK
 <& /Elements/Header, Title => $title&>
 <& /Ticket/Elements/Tabs, 
-    current_tab => "Search/Edit.html".$QueryString, 
+    current_tab => "Search/Edit.html?".$QueryString, 
     Title => $title,
     Format => $Format,
     Query => $Query,
@@ -37,16 +37,13 @@
 <br>
 <textarea name="Format" rows="8" cols="72"><%$Format%></textarea>
 <br>
-<& /Elements/Submit, Label => loc("Apply"), Reset => 1, Caption => "Apply your changes"&>
+<& /Elements/Submit, Label => loc("Apply"), Reset => 1, Caption => loc("Apply your changes")&>
 </form>
 
 <%INIT>
-my $title = "Edit Query";
-
-$Format =~ s/#/%23/g;
-$Format =~ s/&/%26/g;
-
-my $QueryString = "?Query=$Query&Format=$Format&Rows=$ARGS{'Rows'}";
+my $title = loc("Edit Query");
+$Format = $m->comp('/Elements/ScrubHTML', Content => $Format);
+my $QueryString = $m->comp('/Elements/QueryString', Query=>$Query,Format=>$Format,Rows=>$ARGS{'Rows'});
 
 </%INIT>
 

Modified: rt/branches/rt-3.3/html/Search/Elements/BuildFormatString
==============================================================================
--- rt/branches/rt-3.3/html/Search/Elements/BuildFormatString	(original)
+++ rt/branches/rt-3.3/html/Search/Elements/BuildFormatString	Wed Apr 21 01:25:01 2004
@@ -30,10 +30,33 @@
     "Starts",              "Started",
     "Created",             "LastUpdated",
     "Told",                "Due",
-    "Resolved",            "RequestorGroup",
-    "NEWLINE",             "-",
+    "Resolved",            "NEWLINE",
+    "RefersTo",	           "ReferredToBy",
+    "DependsOn",           "DependedOnBy",
+    "MemberOf",            "Members",
+    "Parents",             "Children",
+    "-",
 );
 
+my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'});
+foreach (keys %cfqueues) {
+    my $id = $_;
+    $id =~ s/^.'*(.*).'*$/$1/;
+    # Gotta load up the $queue object, since queues get stored by name now.
+    my $queue = RT::Queue->new($session{'CurrentUser'});
+    $queue->Load($id);
+    $CustomFields->LimitToQueue($queue->Id);
+}
+$CustomFields->LimitToGlobal;
+
+while ( my $CustomField = $CustomFields->Next ) {
+    my $queuestr;
+    if ($CustomField->QueueObj && $CustomField->QueueObj->Id != 0) {
+	$queuestr = $CustomField->QueueObj->Name . ".";
+    }
+    push @fields, "CustomField." . $queuestr . "{" . $CustomField->Name . "}";
+}
+
 my ( @seen);
 
 my @format = split( /,\s*/, $Format );
@@ -69,43 +92,52 @@
 }
 elsif ( $ARGS{"AddCol"} ) {
     if ( defined $ARGS{'SelectDisplayColumns'} ) {
-        my %column = ();
-        $column{Column} = $fields[ $ARGS{'SelectDisplayColumns'} ];
-
-        if ( $ARGS{Face} eq "Bold" ) {
-            $column{Prefix} .= "<B>";
-        }
-        if ( $ARGS{Face} eq "Italic" ) {
-            $column{Prefix} .= "<I>";
-        }
-        if ( $ARGS{Size} ) {
-            $column{Prefix} .= "<" . $ARGS{Size} . ">";
-        }
-        if ( $ARGS{Link} eq "Display" ) {
-            $column{Prefix} .= "<A HREF=\"".$RT::WebPath."/Ticket/Display.html?id=__id__\">";
-        }
-        elsif ( $ARGS{Link} eq "Take" ) {
-            $column{Prefix} .=
-              "<A HREF=\"".$RT::WebPath."/Ticket/Display.html?Action=Take&id=__id__\">";
-        }
+	my $selected = $ARGS{'SelectDisplayColumns'};
+	my @columns;
+	if (ref($selected) eq 'ARRAY') {
+	    @columns = @$selected;
+	} else {
+	    push @columns, $selected;
+	}
+	foreach my $col (@columns) {
+	    my %column = ();
+	    $column{Column} = $fields[ $col ];
+	    
+	    if ( $ARGS{Face} eq "Bold" ) {
+		$column{Prefix} .= "<B>";
+	    }
+	    if ( $ARGS{Face} eq "Italic" ) {
+		$column{Prefix} .= "<I>";
+	    }
+	    if ( $ARGS{Size} ) {
+		$column{Prefix} .= "<" . $ARGS{Size} . ">";
+	    }
+	    if ( $ARGS{Link} eq "Display" ) {
+		$column{Prefix} .= "<A HREF=\"".$RT::WebPath."/Ticket/Display.html?id=__id__\">";
+	    }
+	    elsif ( $ARGS{Link} eq "Take" ) {
+		$column{Prefix} .=
+		    "<A HREF=\"".$RT::WebPath."/Ticket/Display.html?Action=Take&id=__id__\">";
+	    }
     
-        my $suffix;
-        if ( $ARGS{'Link'} eq "Display" || $ARGS{'Link'} eq "Take" ) {
-            $column{Suffix} .= "</a>";
-        }
-        if ( $ARGS{Size} ) {
-            $column{Suffix} .= "</" . $ARGS{Size} . ">";
-        }
-        if ( $ARGS{Face} eq "Italic" ) {
-            $column{Suffix} .= "</I>";
-        }
-        if ( $ARGS{Face} eq "Bold" ) {
-            $column{Suffix} .= "</B>";
-        }
-        if ( $ARGS{Title} ) {
-            $column{Suffix} .= "/TITLE:" . $ARGS{Title};
-        }
-        push @seen, \%column;
+	    my $suffix;
+	    if ( $ARGS{'Link'} eq "Display" || $ARGS{'Link'} eq "Take" ) {
+		$column{Suffix} .= "</a>";
+	    }
+	    if ( $ARGS{Size} ) {
+		$column{Suffix} .= "</" . $ARGS{Size} . ">";
+	    }
+	    if ( $ARGS{Face} eq "Italic" ) {
+		$column{Suffix} .= "</I>";
+	    }
+	    if ( $ARGS{Face} eq "Bold" ) {
+		$column{Suffix} .= "</B>";
+	    }
+	    if ( $ARGS{Title} ) {
+		$column{Suffix} .= "/TITLE:" . $ARGS{Title};
+	    }
+	    push @seen, \%column;
+	}
     }
 }
 elsif ( $ARGS{"ColUp"} ) {

Modified: rt/branches/rt-3.3/html/Search/Elements/DisplayOptions
==============================================================================
--- rt/branches/rt-3.3/html/Search/Elements/DisplayOptions	(original)
+++ rt/branches/rt-3.3/html/Search/Elements/DisplayOptions	Wed Apr 21 01:25:01 2004
@@ -49,7 +49,9 @@
 <td class=label>
 <&|/l&>Rows per page</&>:
 </td><td>
-<input name="RowsPerPage" value="<%$RowsPerPage%>" size=5></input>
+<& /Elements/SelectResultsPerPage, 
+    Name => "RowsPerPage", 
+    Default => $RowsPerPage &>
 </td>
 </tr>
 </table>

Modified: rt/branches/rt-3.3/html/Search/Elements/EditFormat
==============================================================================
--- rt/branches/rt-3.3/html/Search/Elements/EditFormat	(original)
+++ rt/branches/rt-3.3/html/Search/Elements/EditFormat	Wed Apr 21 01:25:01 2004
@@ -12,7 +12,7 @@
 </td>
 <tr>
 <td valign=top>
-<select size="6" name="SelectDisplayColumns">
+<select size="6" name="SelectDisplayColumns" multiple>
 % my $i = 0;
 % while ($i < scalar @$AvailableColumns) {
 % my $field = $AvailableColumns->[$i];

Modified: rt/branches/rt-3.3/html/Search/Elements/EditSearches
==============================================================================
--- rt/branches/rt-3.3/html/Search/Elements/EditSearches	(original)
+++ rt/branches/rt-3.3/html/Search/Elements/EditSearches	Wed Apr 21 01:25:01 2004
@@ -7,7 +7,7 @@
 <& SelectSearchObject, Name => 'Owner', Objects => \@Objects &><br>
 % }
 <&|/l&>Description</&>:<br>
-<font size="-1"><input size="25" name="Description" value="<%$CurrentSearch->{'Description'}%>" onChange="BuildQuery.Save.click()"></font>
+<font size="-1"><input size="25" name="Description" value="<%$CurrentSearch->{'Description'}%>"></font>
 <br>
 % if ($SearchId ne 'new') {
 <input type="submit" name="Revert" value="<%loc('Revert')%>">

Modified: rt/branches/rt-3.3/html/Search/Results.html
==============================================================================
--- rt/branches/rt-3.3/html/Search/Results.html	(original)
+++ rt/branches/rt-3.3/html/Search/Results.html	Wed Apr 21 01:25:01 2004
@@ -41,18 +41,21 @@
 
    &>
 <div align=right>
-<a href="Bulk.html<%$QueryString%>"><&|/l&>Update all these tickets at once</&></a><br>
-<a href="Results.tsv<%$QueryString%>"><&|/l&>spreadsheet</&></a><br>
-<a href="Results.rdf<%$QueryString%>"><&|/l&>RSS</&></a><br>
-<a href="<%$RT::WebPath%>/Tools/Offline.html<%$QueryString%>"><&|/l&>Download</&></a><br>
+<a href="Bulk.html<%$QueryString%>"><&|/l&>Update multiple tickets</&></a><br>
+<a href="Results.tsv<%$QueryString%>"><&|/l&>spreadsheet</&></a> |
+<a href="Results.rdf<%$QueryString%>"><&|/l&>RSS</&></a> |
+<a href="<%$RT::WebPath%>/Tools/Offline.html<%$QueryString%>"><&|/l&>Work offline</&></a><br>
 </div>
 <%INIT>
 my ($title, $ticketcount);
 $session{'i'}++;
-$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'})  unless
-($session{'tickets'});
+$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'})  unless ($session{'tickets'});
 $session{'tickets'}->FromSQL($Query) if ($Query);
 
+
+
+
+
 if ( $session{'tickets'}->Query()) {
     $ticketcount = $session{tickets}->CountAll();
     $title = loc('Found [quant,_1,ticket]', $ticketcount);
@@ -60,11 +63,13 @@
     $title = loc("Find tickets");
 }
 
-my $tabformat = $Format;
-$tabformat =~ s/#/%23/g;
-$tabformat =~ s/&/%26/g;
-my $QueryString =
-"?Query=$Query&Format=$tabformat&Rows=".$ARGS{'Rows'}."&Page=".$ARGS{'Page'};
+my $QueryString = "?".$m->comp('/Elements/QueryString',
+				Query => $Query,
+				Format => $Format,
+				Rows => $ARGS{'Rows'},
+				Page => $ARGS{'Page'});	
+
+
 
 </%INIT>
 <%CLEANUP>

Modified: rt/branches/rt-3.3/html/Search/Results.rdf
==============================================================================
--- rt/branches/rt-3.3/html/Search/Results.rdf	(original)
+++ rt/branches/rt-3.3/html/Search/Results.rdf	Wed Apr 21 01:25:01 2004
@@ -38,43 +38,3 @@
 $m->out($rss->as_string);
 $m->abort();
 </%INIT>
-<%INIT>
-
-my $Tickets = RT::Tickets->new($session{'CurrentUser'});
-$Tickets->FromSQL($ARGS{'Query'});
-    $r->content_type('xml/rss');
-
-
-
-        # create an RSS 1.0 file (http://purl.org/rss/1.0/)
-        use XML::RSS;
-        my $rss = new XML::RSS (version => '1.0');
-        $rss->channel(
-          title        => "$RT::rtname: Syndicated Search",
-          link         => $RT::WebURL,
-          description  => "",
-          dc => {
-          },
-          syn => {
-            updatePeriod     => "hourly",
-            updateFrequency  => "1",
-            updateBase       => "1901-01-01T00:00+00:00",
-          },
-        );
-
-
-    while ( my $Ticket = $Tickets->Next()) {
-       my $row;
-        $rss->add_item(
-          title       =>  $Ticket->Subject,
-          link        => $RT::WebURL."/Ticket/Display.html?id=".$Ticket->id,
-          description => $Ticket->Transactions->First->Content,
-          dc => {
-            subject  => $Ticket->Subject,
-            creator  => $Ticket->CreatorObj->RealName . "<".$Ticket->CreatorObj->EmailAddress.">",
-          },
-        );
-    }
-$m->out($rss->as_string);
-$m->abort();
-</%INIT>

Modified: rt/branches/rt-3.3/html/Search/Results.tsv
==============================================================================
--- rt/branches/rt-3.3/html/Search/Results.tsv	(original)
+++ rt/branches/rt-3.3/html/Search/Results.tsv	Wed Apr 21 01:25:01 2004
@@ -52,7 +52,6 @@
 foreach my $row (@rows) {
         my @row;
         foreach my $attr(@attrs) {
-                $RT::Logger->crit("Looking at $attr");
                 push @row, $row->{"$attr"};
         }
     foreach my $id (sort keys %known_cfs) {

Modified: rt/branches/rt-3.3/html/Ticket/Elements/ShowRequestor
==============================================================================
--- rt/branches/rt-3.3/html/Ticket/Elements/ShowRequestor	(original)
+++ rt/branches/rt-3.3/html/Ticket/Elements/ShowRequestor	Wed Apr 21 01:25:01 2004
@@ -36,7 +36,7 @@
 		  ORDER => 'DESC');
 </%PERL>
 
-% if ($requestor->Privileged) {
+% unless ($requestor->Privileged) {
 <& /Elements/TitleBoxStart, 
 	title => "<a class='inverse' href=\"$RT::WebPath/Admin/Users/Modify.html?id=".$requestor->id."\">".loc("More about [_1]", $name)."</a>" &>
 

Modified: rt/branches/rt-3.3/html/Ticket/Elements/ShowTransaction
==============================================================================
--- rt/branches/rt-3.3/html/Ticket/Elements/ShowTransaction	(original)
+++ rt/branches/rt-3.3/html/Ticket/Elements/ShowTransaction	Wed Apr 21 01:25:01 2004
@@ -22,7 +22,7 @@
 %# 
 %# END LICENSE BLOCK
 <TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>" >
-<TD bgcolor="<%$bgcolor%>"><A NAME="txn-<%$Transaction->Id%>" href="#txn-<%$Transaction->Id%>">#</A>&nbsp;</TD>
+<TD rowspan="2" valign="top" bgcolor="<%$bgcolor%>"><A NAME="txn-<%$Transaction->Id%>" href="#txn-<%$Transaction->Id%>">#</A>&nbsp;</TD>
 <TD>&nbsp&nbsp;</TD>
 <TD><font size=-2><% $transdate|n %></font>&nbsp;</TD>
 % my $desc = $Transaction->BriefDescription;
@@ -33,93 +33,13 @@
 <TD><%$TimeTaken%>&nbsp;</TD>
 <TD ALIGN="RIGHT"><font size=-1><%$titlebar_commands|n%></font></TD>
 </TR>
+<TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>"><TD colspan=5>
 % if ($Transaction->CustomFieldValues->Count) {
-<TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>" >
-<TD BGCOLOR="<%$bgcolor%>">&nbsp;&nbsp;</TD>
-<TD>&nbsp;&nbsp;</TD>
-<TD COLSPAN=4>
 <& /Elements/ShowCustomFields, Object => $Transaction &>
-</TD></TR>
-% }
-<%PERL>
-
-unless ($Collapsed) {
- foreach my $message (@$Attachments) { 
-
-        my $quoted;
-        my $headers = $message->Headers;
-        chomp $headers;
-
-        # localize the common headers (like 'Subject:'), too.
-        eval {
-            $headers =~ s/^([^:]+)(?=:)/loc($1)/em;
-          };    # we eval here to catch errors when 5.6 panics
-
-          my $MAX_INLINE_BODY = $RT::MaxInlineBody || 13456;
-        if (    $message->ContentType =~ m{^(text/plain|message|text$)}i
-             && $message->ContentLength < $MAX_INLINE_BODY ) {
-  		my $content;
-        	# If we've preloaded all the content, let's pull from there
-        	# if we haven't, load it now
-        	if ($AttachmentContent->{$message->id}) {
-            $content = $AttachmentContent->{$message->id}->Content;
-        	} else {
-            $content = $message->Content;
-        	} 
-
-
-
-        eval {
-            require Text::Quoted;
-            $quoted = Text::Quoted::extract( $content );
-        };
-        if ($@) {
-            $quoted = $content;
-        }
-    }
-
-</%PERL>
-<TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>" >                                
-      <TD BGCOLOR="<%$bgcolor%>">&nbsp;&nbsp;</TD>
-      <TD>&nbsp;&nbsp;</TD>
-      <TD COLSPAN=3 VALIGN=TOP>
-<span class="message">
-<& ShowMessageHeaders, Headers => $headers, Transaction => $Transaction, DisplayHeaders => \@DisplayHeaders &>
-% if ($ShowBody) {
-% if (!length($quoted) && $message->ContentType =~ m#^text/#) {
-<blockquote><i>
-<&|/l&>Message body not shown because it is too large or is not plain text.</&><br>
-<&|/l&>You can access it with the Download button on the right.</&></i></blockquote>
-% } else {
-<& ShowMessageStanza, Depth => 0, Message => $quoted, Transaction => $Transaction &>
-% }
-</span>
-      </TD>
-      <TD VALIGN=TOP ALIGN=RIGHT>
-	
-% if ($message->Parent == 0  ) {
-<BR>
-% }
-<%PERL>
-my $size = $message->ContentLength or next;
-
-if ($size) {
-    if ($size > 1024) {
-	$size = loc("[_1]k", int($size/102.4)/10);
-    }
-    else {
-	$size = loc("[_1]b", $size);
-    }
-</%PERL>
-<font size=-1><A HREF="<%$AttachPath%>/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename | u%>"><&|/l&>Download</&> <% $message->Filename|| loc('(untitled)') %></a> <% $size %></font>
-% }
-% } else {
-<TD>&nbsp;</TD>
-% }
 % }
+% $m->comp('ShowTransactionAttachments', %ARGS, Parent => 0) unless ($Collapsed ||!$ShowBody);
 </TD>
 </TR>
-% }
 
 <%ARGS>
 $Ticket => undef
@@ -130,6 +50,7 @@
 $RowNum => 1
 $AttachPath => $RT::WebPath."/Ticket/Attachment"
 $UpdatePath => $RT::WebPath."/Ticket/Update.html"
+$EmailRecordPath => $RT::WebPath."/Ticket/ShowEmailRecord.html"
 $Attachments => undef
 $AttachmentContent => undef
 $ShowBody => 1
@@ -191,7 +112,7 @@
     @DisplayHeaders = qw(To Cc Bcc);
 
     $titlebar_commands .=
-        "[<a target=\"_blank\" href=\"ShowEmailRecord.html?id="
+        "[<a target=\"_blank\" href=\"$EmailRecordPath?id="
       . $Transaction->Ticket
       . "&Transaction="
       . $Transaction->Id

Added: rt/branches/rt-3.3/html/Ticket/Elements/ShowTransactionAttachments
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/html/Ticket/Elements/ShowTransactionAttachments	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,173 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+<%perl>
+# Find all the attachments which have parent $Parent
+# For each of these attachments
+foreach my $message ( grep { $_->Parent == $Parent } @$Attachments ) {
+    # {{{    show the headers
+    my $headers = $message->Headers;
+    chomp $headers;
+
+    # localize the common headers (like 'Subject:'), too.
+    $headers =~ s/^([^:]+)(?=:)/loc($1)/em;
+    $m->comp(
+        'ShowMessageHeaders',
+        Headers        => $headers,
+        Transaction    => $Transaction,
+        DisplayHeaders => \@DisplayHeaders
+    );
+
+    # }}}
+    # {{{ if there's any size at all, show the download link
+    my $size = $message->ContentLength;
+    if ($size) {
+        
+</%perl> 
+<div class="downloadattachment">
+<%perl>
+
+     #     show a download link
+     if ( $size > 1024 ) {
+         $size = loc( "[_1]k", int( $size / 102.4 ) / 10 );
+     }
+     else {
+        $size = loc( "[_1]b", $size );
+     }
+        
+</%PERL> 
+<A HREF="<%$AttachPath%>/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename | u%>"><&|/l&>Download</&><%$message->Filename || loc('(untitled)') %></a> 
+<div class="downloadcontenttype">
+<%$message->ContentType%> <% $size %> 
+</div> 
+</div>
+%}
+
+% # }}}
+<div class="messagebody">
+<%perl>
+# {{{   if it's got content-disposition inline, show it inline
+    my $content;
+
+    # If it's text
+    if ( $message->ContentType =~ m{^(text|message)}i ) {
+
+        if (
+
+            # it's a toplevel object
+            !$ParentObj
+
+            # or its parent isn't a multipart alternative
+            || ( $ParentObj->ContentType !~ m{^multipart/alternative$}i )
+
+            # or it's of our prefered alterative type
+            || (
+                (
+                    $RT::PreferRichText
+                    && ( $message->ContentType =~ m{^text/(?:html|enriched)$} )
+                )
+                || ( !$RT::PreferRichText
+                    && ( $message->ContentType !~ m{^text/(?:html|enriched)$} )
+                )
+            )
+          )
+        {
+
+            if ( $AttachmentContent->{ $message->id } ) {
+                $content = $AttachmentContent->{ $message->id }->Content;
+            }
+            else {
+                $content = $message->Content;
+            }
+
+            # if it's a text/html clean the body and show it
+            if ( $message->ContentType =~ m{^text/(?:html|enriched)$}i ) {
+                $content =
+                  $m->comp( '/Elements/ScrubHTML', Content => $content );
+                $m->out( $content );
+            }
+
+            # if it's a text/plain show the body
+            elsif ( $message->ContentType =~ m{^(text|message|text)}i ) {
+
+                eval { $content = Text::Quoted::extract($content); };
+                if ($@) { 1; }
+
+                $m->comp(
+                    'ShowMessageStanza',
+                    Depth       => 0,
+                    Message     => $content,
+                    Transaction => $Transaction
+                );
+            }
+        }
+
+    }
+        # if it's an image, show it as an image
+        elsif ( $message->ContentType =~ /^image\//i ) {
+            $m->out('<img src="'
+                  . $AttachPath . '/'
+                  . $Transaction->Id . '/'
+                  . $message->Id
+                  . '/">' );
+        }
+
+
+    # }}}
+
+    $m->comp( 'ShowTransactionAttachments', %ARGS,
+          Parent    => $message->id,
+          ParentObj => $message );
+
+
+}
+</%PERL>
+</div>
+<%ARGS>
+$Ticket => undef
+$Transaction => undef
+$ShowHeaders => 0
+$Collapsed => undef
+$ShowTitleBarCommands => 1
+$RowNum => 1
+$AttachPath => $RT::WebPath."/Ticket/Attachment"
+$UpdatePath => $RT::WebPath."/Ticket/Update.html"
+$EmailRecordPath => $RT::WebPath."/Ticket/ShowEmailRecord.html"
+$Attachments => undef
+$AttachmentContent => undef
+$ShowBody => 1
+$Parent => 0
+$ParentObj => 0
+</%ARGS>
+<%INIT>
+my @DisplayHeaders=qw( _all);
+
+if ( $Transaction->Type =~ /EmailRecord$/ ) {
+    @DisplayHeaders = qw(To Cc Bcc);
+}
+
+# If the transaction has anything attached to it at all
+elsif (!$ShowHeaders)  {
+        @DisplayHeaders = qw(To From RT-Send-Cc Cc Bcc Date Subject);
+}
+</%INIT>

Modified: rt/branches/rt-3.3/html/Ticket/Elements/Tabs
==============================================================================
--- rt/branches/rt-3.3/html/Ticket/Elements/Tabs	(original)
+++ rt/branches/rt-3.3/html/Ticket/Elements/Tabs	Wed Apr 21 01:25:01 2004
@@ -157,12 +157,12 @@
 }
 }
 
-# escape the '#' symbols so they won't be parsed as part of a URL
-my $format = $ARGS{'Format'};
-$format =~ s/#/%23/g;
-$format =~ s/&/%26/g;
-
-my $args = "?Query=$ARGS{'Query'}&Format=$format&Rows=$ARGS{'Rows'}";
+my $args = "?" . $m->comp(
+    '/Elements/QueryString',
+    Query  => $ARGS{'Query'},
+    Format => $ARGS{'Format'},
+    Rows   => $ARGS{'Rows'}
+  );
 
 $tabs->{"f"} = { path      => "Search/Build.html",
                  title     => loc('New Query'),

Added: rt/branches/rt-3.3/html/Ticket/ShowEmailRecord.html
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/html/Ticket/ShowEmailRecord.html	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,26 @@
+<%attr>
+AutoFlush => 0
+</%attr>
+<%args>
+$Attachment => undef
+$Transaction => undef
+</%ARGS>
+<%init>
+     my $AttachmentObj = new RT::Attachment($session{'CurrentUser'});
+     $AttachmentObj->Load($Attachment) || Abort(loc("Attachment '[_1]' could not be loaded", $Attachment));
+
+
+     unless ($AttachmentObj->id) {
+        Abort(loc("Attachment '[_1]' could not be loaded", $Attachment));
+    }
+     unless ($AttachmentObj->TransactionId() == $Transaction ) {
+        Abort(loc("Attachment '[_1]' could not be loaded", $Attachment));
+     }
+$r->content_type('text/plain');
+</%init>
+<pre>
+<%$AttachmentObj->Headers%>
+
+<%$AttachmentObj->Content%>
+</pre>
+%$m->abort();

Modified: rt/branches/rt-3.3/html/Ticket/Update.html
==============================================================================
--- rt/branches/rt-3.3/html/Ticket/Update.html	(original)
+++ rt/branches/rt-3.3/html/Ticket/Update.html	Wed Apr 21 01:25:01 2004
@@ -105,9 +105,9 @@
 
 
 <& /Elements/Submit, Name => 'SubmitTicket' &>
-
+% if ($TicketObj->CurrentUserHasRight('ShowOutgoingEmail')) {
 <& /Ticket/Elements/PreviewScrips, TicketObj => $TicketObj, %ARGS &>
-
+% }
 </FORM>
 <%INIT>
 

Added: rt/branches/rt-3.3/html/Tools/Elements/Tabs
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/html/Tools/Elements/Tabs	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,50 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+<& /Elements/Tabs, 
+    tabs => $tabs, 
+    current_toptab => 'Tools/Offline.html', 
+    current_tab => $current_tab, 
+    Title => $Title &>
+
+<%INIT>
+  my $tabs = { a => { title => loc('Offline'),
+			  path => 'Tools/Offline.html',
+			},
+	     };
+
+  foreach my $tab (sort keys %{$tabs}) {
+    if ($tabs->{$tab}->{'path'} eq $current_tab) {
+      $tabs->{$tab}->{"subtabs"} = $subtabs;
+      $tabs->{$tab}->{"current_subtab"} = $current_subtab;
+    }
+  }
+</%INIT>
+
+
+<%ARGS>
+$subtabs => undef
+$current_tab => undef
+$current_subtab => undef
+$Title => undef
+</%ARGS>

Added: rt/branches/rt-3.3/html/Tools/Offline.html
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.3/html/Tools/Offline.html	Wed Apr 21 01:25:01 2004
@@ -0,0 +1,78 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+<& /Elements/Header, Title => loc("Offline upload") &>
+<& Elements/Tabs, 
+    current_tab => "Tools/Offline.html", 
+    Title => loc("Offline edits") &>
+
+<& /Elements/ListActions, actions => \@results &>
+
+<FORM>
+<textarea name=string cols=90 rows=30>
+<%$string%>
+</textarea>
+<& /Elements/Submit, Label => loc('Upload'), Caption => loc("Upload your changes"), color => "#993333" &>
+
+</FORM>
+
+<%INIT>
+
+my @results;
+use RT::Action::CreateTickets;
+my $action = new RT::Action::CreateTickets;
+my $string;
+
+if ($ARGS{'string'}) {
+    $action->Parse($ARGS{string});
+    push @results, $action->CreateByTemplate();
+    push @results, $action->UpdateByTemplate();
+    $string = $ARGS{string};
+} else {
+    if ($ARGS{'Query'}) {
+	my $Tickets = RT::Tickets->new($session{'CurrentUser'});
+	$Tickets->FromSQL($ARGS{'Query'});
+	
+	while (my $t = $Tickets->Next) {
+	    $string .= "===Update-Ticket: " . $t->Id . "\n";
+	    $string .= $action->GetUpdateTemplate($t);
+	    $string .= "" . "\n";
+	}
+	
+	$string .= "" . "\n";
+	$string .= "===# DO NOT EDIT BELOW THIS LINE#===\n";
+	$string .= "" . "\n";
+	
+	while (my $t = $Tickets->Next) {
+	    $string .= "===# DO NOT EDIT #===\n";
+		$string .= "===Base-Ticket: " . $t->Id . "\n";
+	    $string .= $action->GetBaseTemplate($t);
+	    $string .= "===# DO NOT EDIT #===\n";
+		$string .= "" . "\n";
+	}
+    } else {
+	$string .= "===Create-Ticket: ticket1\n";
+	$string .= $action->GetCreateTemplate();
+    }
+}
+</%INIT>

Modified: rt/branches/rt-3.3/html/autohandler
==============================================================================
--- rt/branches/rt-3.3/html/autohandler	(original)
+++ rt/branches/rt-3.3/html/autohandler	Wed Apr 21 01:25:01 2004
@@ -64,8 +64,7 @@
 $r->content_type("text/html; charset=utf-8");
 
 # If it's a noauth file, don't ask for auth.
-if ($m->base_comp->path =~ '^/+NoAuth/' ||
-    $m->base_comp->path =~ '^/+REST/\d+\.\d+/NoAuth/')
+if ($m->base_comp->path =~ $RT::WebNoAuthRegex )
 {
     $m->call_next(%ARGS);
     $m->abort();
@@ -117,6 +116,7 @@
 				       'HomePhone', 'WorkPhone', 'MobilePhone',
 				       'PagerPhone', 'Address1', 'Address2', 'City',
 				       'State', 'Zip', 'Country') {
+               $m->comp('/Elements/Callback', %ARGS, _CallbackName => 'NewUser');
 		    
 		    my $method = "Set$attribute";
 		    $UserObj->$method($new_user_info->{$attribute}) 

Modified: rt/branches/rt-3.3/lib/RT/Action/CreateTickets.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/Action/CreateTickets.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/Action/CreateTickets.pm	Wed Apr 21 01:25:01 2004
@@ -287,8 +287,12 @@
 my %LINKTYPEMAP = (
     MemberOf => { Type => 'MemberOf',
                   Mode => 'Target', },
+    Parents => { Type => 'MemberOf',
+		 Mode => 'Target', },
     Members => { Type => 'MemberOf',
                  Mode => 'Base', },
+    Children => { Type => 'MemberOf',
+		  Mode => 'Base', },
     HasMember => { Type => 'MemberOf',
                    Mode => 'Base', },
     RefersTo => { Type => 'RefersTo',
@@ -375,8 +379,9 @@
 
 	my ($id, $transid, $msg) = $T::Tickets{$template_id}->Create(%$ticketargs);
 
-	push @results, $T::Tickets{$template_id}->loc("Ticket [_1]", $T::Tickets{$template_id}->Id) . ': ' .$msg;
-
+	foreach my $res (split('\n', $msg)) {
+	    push @results, $T::Tickets{$template_id}->loc("Ticket [_1]", $T::Tickets{$template_id}->Id) . ': ' .$res;
+	}
 	if (!$id) {
 	    if ($self->TicketObj) {
 		$msg = "Couldn't create related ticket $template_id for ".
@@ -708,7 +713,9 @@
     $string .= "FinalPriority: " . $t->FinalPriority . "\n";
 
     foreach my $type (sort keys %LINKTYPEMAP) {
-	if ($type eq "HasMember") {
+	# don't display duplicates
+	if ($type eq "HasMember" || $type eq "Members"
+	    || $type eq "MemberOf") {
 	    next;
 	}
 	$string .= "$type: ";
@@ -779,8 +786,13 @@
     $string .= "InitialPriority: \n";
     $string .= "FinalPriority: \n";
 
-    foreach (keys %LINKTYPEMAP) {
-	$string .= "$_: \n";
+    foreach my $type (keys %LINKTYPEMAP) {
+	# don't display duplicates
+	if ($type eq "HasMember" || $type eq 'Members' 
+	    || $type eq 'MemberOf') {
+	    next;
+	}
+	$string .= "$type: \n";
     }
     return $string;
 }

Modified: rt/branches/rt-3.3/lib/RT/Attachment_Overlay.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/Attachment_Overlay.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/Attachment_Overlay.pm	Wed Apr 21 01:25:01 2004
@@ -465,13 +465,12 @@
 
     my $self = shift;
     my $field = shift;
-    
-   
+
     #if the field is public, return it.
-    if ($self->_Accessible($field, 'public')) {
-	    return($self->__Value($field, @_));
+    if ( $self->_Accessible( $field, 'public' ) ) {
+        return ( $self->__Value( $field, @_ ) );
     }
-    
+
     #If it's a comment, we need to be extra special careful
     elsif ( $self->TransactionObj->Type =~ /^Comment/ ) {
         if ( $self->TransactionObj->CurrentUserHasRight('ShowTicketComments') )
@@ -482,12 +481,12 @@
     elsif ( $self->TransactionObj->CurrentUserHasRight('ShowTicket') ) {
         return ( $self->__Value( $field, @_ ) );
     }
+
     #if they ain't got rights to see, don't let em
     else {
-	    return(undef);
-	}
-    	
-    
+        return (undef);
+    }
+
 }
 
 # }}}

Modified: rt/branches/rt-3.3/lib/RT/Group_Overlay.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/Group_Overlay.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/Group_Overlay.pm	Wed Apr 21 01:25:01 2004
@@ -803,22 +803,14 @@
     #If we don't have rights, don't include any results
     # TODO XXX  WHY IS THERE NO ACL CHECK HERE?
 
-    my $principals = $users->NewAlias('Principals');
-
-    $users->Join(ALIAS1 => 'main', FIELD1 => 'id',
-                 ALIAS2 => $principals, FIELD2 => 'ObjectId');
-    $users->Limit(ALIAS =>$principals,
-                  FIELD => 'PrincipalType', OPERATOR => '=', VALUE => 'User');
-
     my $cached_members = $users->NewAlias('CachedGroupMembers');
     $users->Join(ALIAS1 => $cached_members, FIELD1 => 'MemberId',
-                 ALIAS2 => $principals, FIELD2 => 'id');
+                 ALIAS2 => $users->PrincipalsAlias, FIELD2 => 'id');
     $users->Limit(ALIAS => $cached_members, 
                   FIELD => 'GroupId',
                   OPERATOR => '=',
                   VALUE => $self->PrincipalId);
 
-
     return ( $users);
 
 }

Modified: rt/branches/rt-3.3/lib/RT/I18N.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/I18N.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/I18N.pm	Wed Apr 21 01:25:01 2004
@@ -166,8 +166,8 @@
 
     my $charset = _FindOrGuessCharset($entity) or return;
     # one and only normalization
-    $charset = 'utf-8' if $charset eq 'utf8';
-    $enc     = 'utf-8' if $enc     eq 'utf8';
+    $charset = 'utf-8' if $charset =~ /^utf-?8$/i;
+    $enc     = 'utf-8' if $enc     =~ /^utf-?8$/i;
 
     SetMIMEHeadToEncoding(
 	$entity->head,

Modified: rt/branches/rt-3.3/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/Interface/Web.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/Interface/Web.pm	Wed Apr 21 01:25:01 2004
@@ -68,6 +68,7 @@
         default_escape_flags => 'h',
         allow_globals        => [qw(%session)],
         data_dir => "$RT::MasonDataDir",
+        autoflush => 1,
         @_
     );
 
@@ -98,7 +99,8 @@
         ],
         data_dir => "$RT::MasonDataDir",
         default_escape_flags => 'h',
-        allow_globals        => [qw(%session)]
+        allow_globals        => [qw(%session)],
+        autoflush => 1,
     );
   
 
@@ -917,52 +919,12 @@
         @_
     );
 
-    my (@results);
-
-    my $object     = $args{'Object'};
-    my $attributes = $args{'AttributesRef'};
-    my $ARGSRef    = $args{'ARGSRef'};
-    foreach my $attribute (@$attributes) {
-        my $value;
-        if ( defined $ARGSRef->{$attribute} ) {
-            $value = $ARGSRef->{$attribute};
-        }
-        elsif (
-              defined( $args{'AttributePrefix'} )
-              && defined(
-                  $ARGSRef->{ $args{'AttributePrefix'} . "-" . $attribute }
-              )
-          ) {
-            $value = $ARGSRef->{ $args{'AttributePrefix'} . "-" . $attribute };
-
-        } else {
-                next;
-        }
+    my $Object = $args{'Object'};
+    my @results = $Object->Update(AttributesRef => $args{'AttributesRef'},
+				  ARGSRef       => $args{'ARGSRef'},
+				  AttributePrefix => undef,
+				  );
 
-            $value =~ s/\r\n/\n/gs;
-
-        if ($value ne $object->$attribute()){
-
-              my $method = "Set$attribute";
-              my ( $code, $msg ) = $object->$method($value);
-
-              push @results, loc($attribute) . ': ' . loc_fuzzy($msg);
-=for loc
-                                   "[_1] could not be set to [_2].",       # loc
-                                   "That is already the current value",    # loc
-                                   "No value sent to _Set!\n",             # loc
-                                   "Illegal value for [_1]",               # loc
-                                   "The new value has been set.",          # loc
-                                   "No column specified",                  # loc
-                                   "Immutable field",                      # loc
-                                   "Nonexistant field?",                   # loc
-                                   "Invalid data",                         # loc
-                                   "Couldn't find row",                    # loc
-                                   "Missing a primary key?: [_1]",         # loc
-                                   "Found Object",                         # loc
-=cut
-          };
-    }
     return (@results);
 }
 

Modified: rt/branches/rt-3.3/lib/RT/Queue_Overlay.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/Queue_Overlay.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/Queue_Overlay.pm	Wed Apr 21 01:25:01 2004
@@ -21,6 +21,7 @@
 # 
 # 
 # END LICENSE BLOCK
+
 =head1 NAME
 
   RT::Queue - an RT Queue object
@@ -75,8 +76,9 @@
     ModifyScrips => 'Modify Scrips for this queue',                   # loc_pair
     ShowScrips   => 'Display Scrips for this queue',                  # loc_pair
 
-    ShowTicket         => 'Show ticket summaries',                    # loc_pair
-    ShowTicketComments => 'Show ticket private commentary',           # loc_pair
+    ShowTicket         => 'See ticket summaries',                    # loc_pair
+    ShowTicketComments => 'See ticket private commentary',           # loc_pair
+    ShowOutgoingEmail => 'See exact outgoing email messages and their recipeients',           # loc_pair
 
     Watch => 'Sign up as a ticket Requestor or ticket or queue Cc',   # loc_pair
     WatchAsAdminCc  => 'Sign up as a ticket or queue AdminCc',        # loc_pair

Modified: rt/branches/rt-3.3/lib/RT/Ticket_Overlay.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/Ticket_Overlay.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/Ticket_Overlay.pm	Wed Apr 21 01:25:01 2004
@@ -145,8 +145,12 @@
 %LINKTYPEMAP = (
     MemberOf => { Type => 'MemberOf',
                   Mode => 'Target', },
+    Parents => { Type => 'MemberOf',
+		 Mode => 'Target', },
     Members => { Type => 'MemberOf',
                  Mode => 'Base', },
+    Children => { Type => 'MemberOf',
+		  Mode => 'Base', },
     HasMember => { Type => 'MemberOf',
                    Mode => 'Base', },
     RefersTo => { Type => 'RefersTo',
@@ -311,7 +315,8 @@
 sub Create {
     my $self = shift;
 
-    my %args = ( id              => undef,
+    my %args = (
+        id                 => undef,
                  EffectiveId     => undef,
                  Queue           => undef,
                  Requestor       => undef,
@@ -333,17 +338,15 @@
                  Resolved        => undef,
                  MIMEObj         => undef,
                  _RecordTransaction => 1,
-                 
-
 
-                 @_ );
+        @_
+    );
 
     my ( $ErrStr, $Owner, $resolved );
     my (@non_fatal_errors);
 
     my $QueueObj = RT::Queue->new($RT::SystemUser);
 
-    
     if ( ( defined( $args{'Queue'} ) ) && ( !ref( $args{'Queue'} ) ) ) {
         $QueueObj->Load( $args{'Queue'} );
     }
@@ -351,9 +354,9 @@
         $QueueObj->Load( $args{'Queue'}->Id );
     }
     else {
-        $RT::Logger->debug( $args{'Queue'} . " not a recognised queue object.");
+        $RT::Logger->debug(
+            $args{'Queue'} . " not a recognised queue object." );
     }
-;
 
     #Can't create a ticket without a queue.
     unless ( defined($QueueObj) && $QueueObj->Id ) {
@@ -362,18 +365,26 @@
     }
 
     #Now that we have a queue, Check the ACLS
-    unless ( $self->CurrentUser->HasRight( Right    => 'CreateTicket',
-                                                Object => $QueueObj )
-      ) {
-        return ( 0, 0,
-                 $self->loc( "No permission to create tickets in the queue '[_1]'", $QueueObj->Name ) );
+    unless (
+        $self->CurrentUser->HasRight(
+            Right  => 'CreateTicket',
+            Object => $QueueObj
+        )
+      )
+    {
+        return (
+            0, 0,
+            $self->loc(
+                "No permission to create tickets in the queue '[_1]'",
+                $QueueObj->Name
+            )
+        );
     }
 
     unless ( $QueueObj->IsValidStatus( $args{'Status'} ) ) {
         return ( 0, 0, $self->loc('Invalid value for status') );
     }
 
-
     #Since we have a queue, we can set queue defaults
     #Initial Priority
 
@@ -381,7 +392,7 @@
     $args{'InitialPriority'} = ( $QueueObj->InitialPriority || 0 )
       unless ( $args{'InitialPriority'} );
 
-    #Final priority 
+    #Final priority
 
     # If there's no queue default final priority and it's not set, set it to 0
     $args{'FinalPriority'} = ( $QueueObj->FinalPriority || 0 )
@@ -391,7 +402,6 @@
     # where we're importing tickets (eg, from an older RT version.)
     my $priority = $args{'Priority'} || $args{'InitialPriority'};
 
-
     # {{{ Dates
     #TODO we should see what sort of due date we're getting, rather +
     # than assuming it's in ISO format.
@@ -422,10 +432,13 @@
         $Resolved->Set( Format => 'ISO', Value  => $args{'Resolved'} );
     }
 
-
     #If the status is an inactive status, set the resolved date
-    if ($QueueObj->IsInactiveStatus($args{'Status'}) && !$args{'Resolved'}) {
-        $RT::Logger->debug("Got a ".$args{'Status'} . "ticket with a resolved of ".$args{'Resolved'});
+    if ( $QueueObj->IsInactiveStatus( $args{'Status'} ) && !$args{'Resolved'} )
+    {
+        $RT::Logger->debug( "Got a "
+              . $args{'Status'}
+              . "ticket with a resolved of "
+              . $args{'Resolved'} );
         $Resolved->SetToNow;
     }
 
@@ -450,25 +463,41 @@
         $Owner = RT::User->new( $self->CurrentUser );
         $Owner->Load( $args{'Owner'} );
 
+        push( @non_fatal_errors,
+                $self->loc("Owner could not be set.") . " "
+              . $self->loc( "User '[_1]' could not be found.", $args{'Owner'} )
+          )
+          unless ( $Owner->Id );
+
     }
 
-    #If we have a proposed owner and they don't have the right 
+    #If we have a proposed owner and they don't have the right
     #to own a ticket, scream about it and make them not the owner
-    if (     ( defined($Owner) )
+    if (
+            ( defined($Owner) )
          and ( $Owner->Id )
          and ( $Owner->Id != $RT::Nobody->Id )
-         and ( !$Owner->HasRight( Object => $QueueObj,
-                                       Right    => 'OwnTicket' ) )
-      ) {
+        and (
+            !$Owner->HasRight(
+                Object => $QueueObj,
+                Right  => 'OwnTicket'
+            )
+        )
+      )
+    {
 
         $RT::Logger->warning( "User "
                               . $Owner->Name . "("
                               . $Owner->id
                               . ") was proposed "
                               . "as a ticket owner but has no rights to own "
-                              . "tickets in ".$QueueObj->Name );
+              . "tickets in "
+              . $QueueObj->Name );
 
-        push @non_fatal_errors, $self->loc("Invalid owner. Defaulting to 'nobody'.");
+        push @non_fatal_errors,
+          $self->loc( "Owner '[_1]' does not have rights to own this ticket.",
+            $Owner->Name
+          );
 
         $Owner = undef;
     }
@@ -481,20 +510,23 @@
 
     # }}}
 
-    # We attempt to load or create each of the people who might have a role for this ticket
-    # _outside_ the transaction, so we don't get into ticket creation races
+# We attempt to load or create each of the people who might have a role for this ticket
+# _outside_ the transaction, so we don't get into ticket creation races
     foreach my $type ( "Cc", "AdminCc", "Requestor" ) {
-     next unless (defined $args{$type});
-        foreach my $watcher ( ref( $args{$type} ) ? @{ $args{$type} } : ( $args{$type} ) ) {
+        next unless ( defined $args{$type} );
+        foreach my $watcher (
+            ref( $args{$type} ) ? @{ $args{$type} } : ( $args{$type} ) )
+        {
         my $user = RT::User->new($RT::SystemUser);
-        $user->LoadOrCreateByEmail($watcher) if ($watcher && $watcher !~ /^\d+$/);
+            $user->LoadOrCreateByEmail($watcher)
+              if ( $watcher && $watcher !~ /^\d+$/ );
         }
     }
 
-
     $RT::Handle->BeginTransaction();
 
-    my %params =( Queue           => $QueueObj->Id,
+    my %params = (
+        Queue           => $QueueObj->Id,
                                    Owner           => $Owner->Id,
                                    Subject         => $args{'Subject'},
                                    InitialPriority => $args{'InitialPriority'},
@@ -508,16 +540,19 @@
                                    Starts          => $Starts->ISO,
                                    Started         => $Started->ISO,
                                    Resolved        => $Resolved->ISO,
-                                   Due             => $Due->ISO );
+        Due             => $Due->ISO
+    );
 
-    # Parameters passed in during an import that we probably don't want to touch, otherwise
+# Parameters passed in during an import that we probably don't want to touch, otherwise
     foreach my $attr qw(id Creator Created LastUpdated LastUpdatedBy) {
-        $params{$attr} = $args{$attr} if ($args{$attr});
+        $params{$attr} = $args{$attr} if ( $args{$attr} );
     }
 
     # Delete null integer parameters
-    foreach my $attr qw(TimeWorked TimeLeft TimeEstimated InitialPriority FinalPriority) {
-        delete $params{$attr}  unless (exists $params{$attr} && $params{$attr});
+    foreach my $attr
+      qw(TimeWorked TimeLeft TimeEstimated InitialPriority FinalPriority) {
+        delete $params{$attr}
+          unless ( exists $params{$attr} && $params{$attr} );
     }
 
 
@@ -525,16 +560,23 @@
     unless ($id) {
         $RT::Logger->crit( "Couldn't create a ticket: " . $ticket_message);
         $RT::Handle->Rollback();
-        return ( 0, 0, $self->loc( "Ticket could not be created due to an internal error") );
+        return ( 0, 0,
+            $self->loc("Ticket could not be created due to an internal error")
+        );
     }
 
     #Set the ticket's effective ID now that we've created it.
-    my ( $val, $msg ) = $self->__Set( Field => 'EffectiveId', Value => ($args{'EffectiveId'} || $id ) );
+    my ( $val, $msg ) = $self->__Set(
+        Field => 'EffectiveId',
+        Value => ( $args{'EffectiveId'} || $id )
+    );
 
     unless ($val) {
         $RT::Logger->crit("$self ->Create couldn't set EffectiveId: $msg\n");
         $RT::Handle->Rollback();
-        return ( 0, 0, $self->loc( "Ticket could not be created due to an internal error") );
+        return ( 0, 0,
+            $self->loc("Ticket could not be created due to an internal error")
+        );
     }
 
     my $create_groups_ret = $self->_CreateTicketGroups();
@@ -544,46 +586,55 @@
                            . ". aborting Ticket creation." );
         $RT::Handle->Rollback();
         return ( 0, 0,
-                 $self->loc( "Ticket could not be created due to an internal error") );
+            $self->loc("Ticket could not be created due to an internal error")
+        );
     }
 
-    # Set the owner in the Groups table
-    # We denormalize it into the Ticket table too because doing otherwise would 
-    # kill performance, bigtime. It gets kept in lockstep thanks to the magic of transactionalization
-
-    $self->OwnerGroup->_AddMember( PrincipalId => $Owner->PrincipalId , InsideTransaction => 1);
+# Set the owner in the Groups table
+# We denormalize it into the Ticket table too because doing otherwise would
+# kill performance, bigtime. It gets kept in lockstep thanks to the magic of transactionalization
+
+    $self->OwnerGroup->_AddMember(
+        PrincipalId       => $Owner->PrincipalId,
+        InsideTransaction => 1
+    );
 
     # {{{ Deal with setting up watchers
 
-
     foreach my $type ( "Cc", "AdminCc", "Requestor" ) {
-        next unless (defined $args{$type});
-        foreach my $watcher ( ref( $args{$type} ) ? @{ $args{$type} } : ( $args{$type} ) ) {
+        next unless ( defined $args{$type} );
+        foreach my $watcher (
+            ref( $args{$type} ) ? @{ $args{$type} } : ( $args{$type} ) )
+        {
 
-	   # If there is an empty entry in the list, let's get out of here.
-	   next unless $watcher;
+            # If there is an empty entry in the list, let's get out of here.
+            next unless $watcher;
 
-	    # we reason that all-digits number must be a principal id, not email
-	    # this is the only way to can add
-	    my $field = 'Email';
-	    $field = 'PrincipalId' if $watcher =~ /^\d+$/;
+            # we reason that all-digits number must be a principal id, not email
+            # this is the only way to can add
+            my $field = 'Email';
+            $field = 'PrincipalId' if $watcher =~ /^\d+$/;
 
-	    my ( $wval, $wmsg );
+            my ( $wval, $wmsg );
 
             if ( $type eq 'AdminCc' ) {
 
-                # Note that we're using AddWatcher, rather than _AddWatcher, as we 
+        # Note that we're using AddWatcher, rather than _AddWatcher, as we
                 # actually _want_ that ACL check. Otherwise, random ticket creators
                 # could make themselves adminccs and maybe get ticket rights. that would
                 # be poor
-                ( $wval, $wmsg ) = $self->AddWatcher( Type   => $type,
+                ( $wval, $wmsg ) = $self->AddWatcher(
+                    Type   => $type,
                                                          $field => $watcher,
-                                                         Silent => 1 );
+                    Silent => 1
+                );
             }
             else {
-                ( $wval, $wmsg ) = $self->_AddWatcher( Type   => $type,
+                ( $wval, $wmsg ) = $self->_AddWatcher(
+                    Type   => $type,
                                                           $field => $watcher,
-                                                          Silent => 1 );
+                    Silent => 1
+                );
             }
 
             push @non_fatal_errors, $wmsg unless ($wval);
@@ -593,9 +644,8 @@
     # }}}
     # {{{ Deal with setting up links
 
-
     foreach my $type ( keys %LINKTYPEMAP ) {
-        next unless (defined $args{$type});
+        next unless ( defined $args{$type} );
         foreach my $link (
             ref( $args{$type} ) ? @{ $args{$type} } : ( $args{$type} ) )
         {
@@ -611,7 +661,7 @@
 
     # }}}
 
-   # {{{ Add all the custom fields 
+    # {{{ Add all the custom fields
 
     foreach my $arg ( keys %args ) {
     next unless ( $arg =~ /^CustomField-(\d+)$/i );
@@ -625,9 +675,11 @@
                                  );
     }
     }
+
     # }}}
 
     if ( $args{'_RecordTransaction'} ) {
+
         # {{{ Add a transaction for the create
         my ( $Trans, $Msg, $TransObj ) = $self->_NewTransaction(
                                                      Type      => "Create",
@@ -635,24 +687,27 @@
                                                      MIMEObj => $args{'MIMEObj'}
         );
 
-
         if ( $self->Id && $Trans ) {
-	    $TransObj->UpdateCustomFields( ARGSRef => \%args );
+	       $TransObj->UpdateCustomFields( ARGSRef => \%args );
+            $RT::Logger->info( "Ticket " . $self->Id . " created in queue '" . $QueueObj->Name . "' by " . $self->CurrentUser->Name );
             $ErrStr = $self->loc( "Ticket [_1] created in queue '[_2]'", $self->Id, $QueueObj->Name );
-            $ErrStr = join ( "\n", $ErrStr, @non_fatal_errors );
-
-            $RT::Logger->info("Ticket ".$self->Id. " created in queue '".$QueueObj->Name."' by ".$self->CurrentUser->Name);
+            $ErrStr = join( "\n", $ErrStr, @non_fatal_errors );
         }
         else {
             $RT::Handle->Rollback();
 
-            # TODO where does this get errstr from?
+            $ErrStr = join( "\n", $ErrStr, @non_fatal_errors );
             $RT::Logger->error("Ticket couldn't be created: $ErrStr");
-            return ( 0, 0, $self->loc( "Ticket could not be created due to an internal error"));
+            return (
+                0, 0,
+                $self->loc(
+                    "Ticket could not be created due to an internal error")
+            );
         }
 
         $RT::Handle->Commit();
         return ( $self->Id, $TransObj->Id, $ErrStr );
+
         # }}}
     }
     else {
@@ -660,7 +715,7 @@
         # Not going to record a transaction
         $RT::Handle->Commit();
         $ErrStr = $self->loc( "Ticket [_1] created in queue '[_2]'", $self->Id, $QueueObj->Name );
-        $ErrStr = join ( "\n", $ErrStr, @non_fatal_errors );
+        $ErrStr = join( "\n", $ErrStr, @non_fatal_errors );
         return ( $self->Id, $0, $ErrStr );
 
     }
@@ -1845,6 +1900,8 @@
 Returns true if the specified principal (or the one corresponding to the
 specified address) is a member of the group Type for this ticket.
 
+XX TODO: This should be Memoized. 
+
 =cut
 
 sub IsWatcher {

Modified: rt/branches/rt-3.3/lib/RT/Transaction_Overlay.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/Transaction_Overlay.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/Transaction_Overlay.pm	Wed Apr 21 01:25:01 2004
@@ -646,6 +646,9 @@
             elsif ( $self->Field eq 'HasMember' ) {
                 return $self->loc( "Member [_1] added", $value );
             }
+            elsif ( $self->Field eq 'MergedInto' ) {
+                return $self->loc( "Merged into [_1]", $value );
+            }
         }
         else {
             return ( $self->Data );
@@ -799,6 +802,19 @@
             return (undef);
         }
     }
+    elsif ( $self->__Value('Type') eq 'CommentEmailRecord' ) {
+        unless ( $self->CurrentUserHasRight('ShowTicketComments')
+            && $self->CurrentUserHasRight('ShowOutgoingEmail') ) {
+            return (undef);
+        }
+
+    }
+    elsif ( $self->__Value('Type') eq 'EmailRecord' ) {
+        unless ( $self->CurrentUserHasRight('ShowOutgoingEmail')) {
+            return (undef);
+        }
+
+    }
 
     #if they ain't got rights to see, don't let em
     else {
@@ -906,4 +922,12 @@
     "RT::Queue-RT::Ticket-RT::Transaction";
 }
 
+# Transactions don't change. by adding this cache congif directiove, we don't lose pathalogically on long tickets.
+sub _CacheConfig {
+  {
+     'cache_p'        => 1,
+     'fast_update_p'  => 1,
+     'cache_for_sec'  => 6000,
+  }
+}
 1;

Modified: rt/branches/rt-3.3/lib/RT/Users_Overlay.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/Users_Overlay.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/Users_Overlay.pm	Wed Apr 21 01:25:01 2004
@@ -67,10 +67,6 @@
                  ALIAS2 => $self->{'princalias'},
                  FIELD2 => 'id' );
 
-    $self->Limit( ALIAS    => $self->{'princalias'},
-                  FIELD    => 'PrincipalType',
-                  OPERATOR => '=',
-                  VALUE    => 'User' );
     return (@result);
 }
 

Modified: rt/branches/rt-3.3/sbin/rt-test-dependencies.in
==============================================================================
--- rt/branches/rt-3.3/sbin/rt-test-dependencies.in	(original)
+++ rt/branches/rt-3.3/sbin/rt-test-dependencies.in	Wed Apr 21 01:25:01 2004
@@ -101,6 +101,7 @@
 Text::Template
 File::Spec 0.8
 HTML::Entities 
+HTML::Scrubber 0.08
 Net::Domain
 Log::Dispatch 2.0
 Locale::Maketext 1.06


More information about the Rt-commit mailing list