landing rt 3.2.2
authorivan <ivan>
Fri, 3 Dec 2004 20:51:54 +0000 (20:51 +0000)
committerivan <ivan>
Fri, 3 Dec 2004 20:51:54 +0000 (20:51 +0000)
28 files changed:
rt/bin/rt-commit-handler.in [deleted file]
rt/config [deleted file]
rt/config.pld [deleted file]
rt/etc/upgrade/2.1.71 [deleted file]
rt/html/Admin/Elements/ModifyQueue [deleted file]
rt/html/Admin/Elements/ModifyUser [deleted file]
rt/html/Admin/Users/Prefs.html [deleted file]
rt/html/Elements/Footer
rt/html/Elements/Header
rt/html/Elements/PageLayout
rt/html/Elements/ShadedBox [deleted file]
rt/html/Elements/ShadedInputRow [deleted file]
rt/html/Elements/ShadedRow [deleted file]
rt/html/Elements/SimpleSearch
rt/html/Elements/Tabs
rt/html/Elements/ViewUser [deleted file]
rt/html/NoAuth/webrt.css
rt/html/Search/Elements/PickRestriction [deleted file]
rt/html/Search/Elements/TicketHeader [deleted file]
rt/html/Search/Elements/TicketHeaderCell [deleted file]
rt/html/Search/Elements/TicketRow [deleted file]
rt/html/Search/Listing.html [deleted file]
rt/html/Ticket/Elements/EditLinks [deleted file]
rt/html/Ticket/Elements/ShowLink [deleted file]
rt/html/Ticket/Elements/ShowLinks [deleted file]
rt/html/Ticket/Elements/ShowSummary
rt/html/Ticket/Elements/Tabs
rt/sbin/rt-setup-database.in

diff --git a/rt/bin/rt-commit-handler.in b/rt/bin/rt-commit-handler.in
deleted file mode 100644 (file)
index 02b01ab..0000000
+++ /dev/null
@@ -1,846 +0,0 @@
-#!@PERL@ -w
-# BEGIN LICENSE BLOCK
-# 
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@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
-
-# {{{ Docs
-# -*-Perl-*-
-#
-#ident "@(#)ccvs/contrib:$Name:  $:$Id: rt-commit-handler.in,v 1.1 2003-07-15 13:16:15 ivan Exp $"
-#
-# Perl filter to handle the log messages from the checkin of files in multiple
-# directories.  This script will group the lists of files by log message, and
-# send one piece of mail per unique message, no matter how many files are
-# committed.
-
-=head1 NAME rt-commit-handler
-
-=head1 USAGE
-
-
-
-=head2 Regular use
-
-Stick the following in in CVSROOT/commitinfo
-
- ALL     @RT_BIN_PATH@/rt-commit-handler --record-last-dir
-
-Stick the following  in CVSROOT/loginfo
-
- ALL     @RT_BIN_PATH@/rt-commit-handler --cvs-root /pathtocvs/root --rt %{Vvts}
-
-=head2 Invocation (advanced use)
-
-rt-commit-handler --cvs-root /path/to/cvs/root [-d] [-D] [-r] [-M module] \
-                [[-m mailto] ...] [[-R replyto] ...] [-f logfile] 
-
-
-       -d              - turn on debugging
-       -m mailto       - send mail to "mailto" (multiple)
-       -R replyto      - set the "Reply-To:" to "replyto" (multiple)
-       -M modulename   - set module name to "modulename"
-       -f logfile      - write commit messages to logfile too
-       -D              - generate diff commands
-        --rt              - invoke RT commit handler
-        --cvs-root       - specify your CVS root 
-
-        --record-last-dir -  Record the last directory with changes in
-                             pre-commit (commitinfo) mode
-
-
-=cut
-
-# }}}
-
-use strict;
-use Carp;
-use Getopt::Long;
-use Text::Wrap;
-use Digest::MD5;
-use MIME::Entity;
-
-use lib ("@RT_LIB_PATH@", "@LOCAL_LIB_PATH@");
-
-use RT::Interface::CLI qw(CleanEnv GetCurrentUser GetMessageContent loc);
-
-use vars
-  qw(@MAILER $TMPDIR $FILE_PREFIX $LASTDIR_FILE $HASH_FILE $VERSION_FILE             $MESSAGE_FILE $MAIL_FILE $DEBUG $MAILTO $REPLYTO $id $MODULE_NAME
-  $LOGIN $COMMITLOG $CVS_ROOT $RT_HANDLER);
-
-#Clean out all the nasties from the environment
-CleanEnv();
-
-#Load etc/config.pm and drop privs
-RT::LoadConfig();
-
-#Drop setgid permissions
-RT::DropSetGIDPermissions();
-
-# {{{ Variable setup
-$TMPDIR      = '/tmp';
-$FILE_PREFIX = $TMPDIR . '/#cvs.';
-
-# The root of your CVS install. we should get this from some smarter place.
-# It needs a trailing /
-
-$LASTDIR_FILE = $FILE_PREFIX . "lastdir";
-$HASH_FILE    = $FILE_PREFIX . "hash";
-$VERSION_FILE = $FILE_PREFIX . "version";
-$MESSAGE_FILE = $FILE_PREFIX . "message";
-$MAIL_FILE    = $FILE_PREFIX . "mail";
-
-$DEBUG      = 0;
-$RT_HANDLER = 1;
-
-$MAILTO = '';
-
-my @files = ();
-my (@log_lines);
-my $do_diff = 0;
-my $id      = getpgrp();    # note, you *must* use a shell which does setpgrp()
-$LOGIN = getpwuid($<);
-
-# }}}
-
-die "User could not be found" unless ($LOGIN);
-
-# {{{ parse command line arguments (file list is seen as one arg)
-#
-while ( my $arg = shift @ARGV ) {
-
-    if ( $arg eq '-d' ) {
-        $DEBUG = 1;
-        warn "Debug turned on...\n";
-    }
-    elsif ( $arg =~ /^--record-last-dir$/i ) {
-        record_last_dir( $id, $ARGV[0] );
-        exit(0);
-    }
-    elsif ( $arg eq '-m' ) {
-        $MAILTO .= ", " if $MAILTO;
-        $MAILTO .= shift @ARGV;
-    }
-    elsif ( $arg eq '--rt' ) {
-        $RT_HANDLER = 1;
-    }
-    elsif ( $arg eq '-R' ) {
-        $REPLYTO .= ", " if $REPLYTO;
-        $REPLYTO .= shift @ARGV;
-    }
-    elsif ( $arg eq '-M' ) {
-        die ("too many '-M' args\n") if $MODULE_NAME;
-        $MODULE_NAME = shift @ARGV;
-    }
-    elsif ( $arg eq '--cvs-root' ) {
-        $CVS_ROOT = shift @ARGV;
-        $CVS_ROOT .= "/" unless ( $CVS_ROOT =~ /\/$/ );
-    }
-    elsif ( $arg eq '-f' ) {
-        die ("too many '-f' args\n") if $COMMITLOG;
-        $COMMITLOG = shift @ARGV;
-
-        # This is a disgusting hack to untaint $COMMITLOG if we're running from
-        # setgid cvs.
-        $COMMITLOG = untaint($COMMITLOG);
-    }
-    elsif ( $arg eq '-D' ) {
-        $do_diff = 1;
-    }
-    else {
-        @files = split ( ' ', $arg );
-        last;
-    }
-}
-
-# }}}
-
-$REPLYTO = $LOGIN unless ($REPLYTO);
-
-# for now, the first "file" is the repository directory being committed,
-# relative to the $CVSROOT location
-#
-my $dir = shift @files;
-
-# XXX there are some ugly assumptions in here about module names and
-# XXX directories relative to the $CVSROOT location -- really should
-# XXX read $CVSROOT/CVSROOT/modules, but that's not so easy to do, since
-# XXX we have to parse it backwards.
-#
-# XXX For now we set the `module' name to the top-level directory name.
-#
-unless ($MODULE_NAME) {
-    ($MODULE_NAME) = split ( '/', $dir, 2 );
-}
-
-if ($DEBUG) {
-    warn "module - ", $MODULE_NAME, "\n";
-    warn "dir    - ", $dir,         "\n";
-    warn "files  - ", join ( " ", @files ), "\n";
-    warn "id     - ", $id, "\n";
-}
-
-# {{{ Check for a new directory or an import command.
-
-#
-#    files[0] - "-"
-#    files[1] - "New"
-#    files[2] - "directory"
-#
-#    files[0] - "-"
-#    files[1] - "Imported"
-#    files[2] - "sources"
-#
-if ( $files[0] eq "-" ) {
-
-    #we just don't care about  New Directory notes
-    unless ( $files[1] eq "New" && $files[2] eq "directory" ) {
-
-        my @text = ();
-
-        push @text, build_header();
-        push @text, "";
-
-        while ( my $line = <STDIN> ) {
-            chop $line;    # Drop the newline
-            push @text, $line;
-        }
-
-        append_logfile( $COMMITLOG, @text ) if ($COMMITLOG);
-
-        mail_notification( $id, @text );
-    }
-
-    exit 0;
-}
-
-# }}}
-
-# {{{ Collect just the log message from stdin.
-#
-
-while ( my $line = <STDIN> ) {
-    chop $line;    # strip the newline
-    last if ( $line =~ /^Log Message:$/ );
-}
-while ( my $line = <STDIN> ) {
-    chop $line;    # strip the newline
-    $line =~ s/\s+$//;    # strip trailing white space
-    push @log_lines, $line;
-}
-
-my $md5 = Digest::MD5->new();
-foreach my $line (@log_lines) {
-    $md5->add( $line . "\n" );
-}
-my $hash = $md5->hexdigest();
-
-warn "hash = $hash\n" if ($DEBUG);
-
-if ( !-e "$MESSAGE_FILE.$id.$hash" ) {
-    append_logfile( "$HASH_FILE.$id",      $hash );
-    write_file( "$MESSAGE_FILE.$id.$hash", @log_lines );
-}
-
-# }}}
-
-# Spit out the information gathered in this pass.
-
-append_logfile( "$VERSION_FILE.$id.$hash", $dir . '/', @files );
-
-# {{{ Check whether this is the last directory.  If not, quit.
-
-warn "Checking current dir against last dir $LASTDIR_FILE.$id\n" if ($DEBUG);
-
-my @last_dir = read_file("$LASTDIR_FILE.$id");
-
-unless ($CVS_ROOT) {
-    die "No cvs root specified with --cvs-root. Can't continue.";
-}
-
-if ( $last_dir[0] ne $CVS_ROOT . $dir ) {
-    warn "Current directory $CVS_ROOT$dir is not last directory $last_dir[0].\n"
-      if ($DEBUG);
-    exit 0;
-}
-
-# }}}
-
-# {{{ End Of Commits!
-#
-
-# This is it.  The commits are all finished.  Lump everything together
-# into a single message, fire a copy off to the mailing list, and drop
-# it on the end of the Changes file.
-#
-
-#
-# Produce the final compilation of the log messages
-#
-
-my @hashes = read_file("$HASH_FILE.$id");
-my (@text);
-
-push @text, build_header();
-push @text, "";
-
-my ( @added_files, @modified_files, @removed_files );
-
-foreach my $hash (@hashes) {
-
-    # In case we're running setgid, make sure the hash file hasn't been hacked.
-    $hash =~ m/([a-z0-9]*)/ || die "*** Hacking attempt detected\n";
-    $hash = $1;
-
-    my @files     = read_file("$VERSION_FILE.$id.$hash");
-    my @log_lines = read_file("$MESSAGE_FILE.$id.$hash");
-
-    my $working_on_dir;    # gets set as we iterate through the files.
-    foreach my $file (@files) {
-
-        #If we've entered a new directory, make a note of that and remove the trailing /
-
-        if ( $file =~ s'\/$'' ) {
-            $working_on_dir = $file;
-            next;
-        }
-
-        my @file_entry = ( split ( ',', $file, 4 ), $working_on_dir );
-
-        # file_entry looks like ths:
-
-        # 0        1          2      3        4
-        # Old rev : new rev : tag:   file    :directory        
-        my $entry = {};
-        $entry->{'old'}  = $file_entry[0];
-        $entry->{'new'}  = $file_entry[1];
-        $entry->{'tag'}  = $file_entry[2];
-        $entry->{'file'} = $file_entry[3];
-        $entry->{'dir'}  = $file_entry[4];
-
-        if ( $file_entry[0] eq 'NONE' ) {
-            $entry->{'old'} = '0';
-            push @added_files, $entry;
-        }
-        elsif ( $file_entry[1] eq 'NONE' ) {
-            $entry->{'new'} = '0';
-            push @removed_files, $entry;
-        }
-        else {
-            push @modified_files, $entry;
-        }
-    }
-}
-
-# }}}
-
-# {{{ start building up the body
-
-# Strip leading and trailing blank lines from the log message.  Also
-# compress multiple blank lines in the body of the message down to a
-# single blank line.
-#
-
-my $blank = 1;
-@log_lines = map {
-    my $wasblank = $blank;
-    $blank = $_ eq '';
-    $blank && $wasblank ? () : $_;
-} @log_lines;
-
-pop @log_lines if $blank;
-
-@modified_files = order_and_summarize_diffs(@modified_files);
-@added_files    = order_and_summarize_diffs(@added_files);
-@removed_files  = order_and_summarize_diffs(@removed_files);
-
-push @text, "Modified Files:", format_lists(@modified_files)
-  if (@modified_files);
-
-push @text, "Added Files:", format_lists(@added_files) if (@added_files);
-
-push @text, "Removed Files:", format_lists(@removed_files) if (@removed_files);
-
-push @text, "", "Log Message", @log_lines if (@log_lines);
-
-push @text, "";
-
-if ($RT_HANDLER) {
-    rt_handler(
-        @log_lines,                             "\n",
-        loc("To generate a diff of this commit:\n"), "\n",
-        format_diffs( @modified_files, @added_files, @removed_files )
-    );
-}
-
-if ($COMMITLOG) {
-    append_logfile( $COMMITLOG, @text );
-}
-
-if ($do_diff) {
-    push @text, "";
-    push @text, loc("To generate a diff of this commit:");
-    push @text, format_diffs( @modified_files, @added_files, @removed_files );
-    push @text, "";
-}
-
-# }}}
-
-# {{{ Mail out the notification.
-
-mail_notification( $id, @text );
-
-# }}} 
-
-# {{{ clean up
-
-unless ($DEBUG) {
-    $hash = untaint($hash);
-    $id   = untaint($id);
-    unlink "$VERSION_FILE.$id.$hash";
-    unlink "$MESSAGE_FILE.$id.$hash";
-    unlink "$MAIL_FILE.$id";
-    unlink "$LASTDIR_FILE.$id";
-    unlink "$HASH_FILE.$id";
-}
-
-# }}}
-
-exit 0;
-
-# {{{ Subroutines
-#
-
-# {{{ append_logfile
-sub append_logfile {
-    my $filename = shift;
-    my (@lines) = @_;
-
-    $filename = untaint($filename);
-
-    open( FILE, ">>$filename" )
-      || die ("Cannot open file $filename for append.\n");
-    foreach my $line (@lines) {
-        print FILE $line . "\n";
-    }
-    close(FILE);
-}
-
-# }}}
-
-# {{{ write_file
-sub write_file {
-    my $filename = shift;
-    my (@lines) = @_;
-
-    $filename = untaint($filename);
-
-    open( FILE, ">$filename" )
-      || die ("Cannot open file $filename for write.\n");
-    foreach my $line (@lines) {
-        print FILE $line . "\n";
-    }
-    close(FILE);
-}
-
-# }}}
-
-# {{{ read_file
-sub read_file {
-    my $filename = shift;
-    my (@lines);
-
-    open( FILE, "<$filename" )
-      || die ("Cannot open file $filename for read.\n");
-    while ( my $line = <FILE> ) {
-        chop $line;
-        push @lines, $line;
-    }
-    close(FILE);
-
-    return (@lines);
-}
-
-# }}}
-
-# {{{ sub format_lists
-
-sub format_lists {
-    my @items = (@_);
-
-    my $files = "";
-    map {
-        $_->{'files'} && ( $files .= ' ' . join ( ' ', @{ $_->{'files'} } ) );
-    } @items;
-
-    my @lines = wrap( "\t", "\t\t", $files );
-    return (@lines);
-
-}
-
-# }}}
-
-# {{{ sub format_diffs
-
-sub format_diffs {
-    my @items = (@_);
-
-    my @lines;
-    foreach my $item (@items) {
-        next unless ( $item->{'files'} );
-        push ( @lines,
-            "cvs diff -r"
-              . $item->{'old'} . " -r"
-              . $item->{'new'} . " "
-              . join ( " ", @{ $item->{'files'} } ) . "\n" );
-
-    }
-
-    @lines = fill( "\t", "\t\t", @lines );
-
-    return (@lines);
-}
-
-# }}}
-
-# {{{ sub order_and_summarize_diffs {
-
-# takes an array of file items
-# returns a sorted array of fileset items, which are like file items, except they can have an array of files, rather than 
-# a singleton file.
-
-sub order_and_summarize_diffs {
-
-    my @files = (@_);
-
-    # Sort by tag, dir, file.
-    @files = sort {
-        $a->{'tag'} cmp $b->{'tag'}
-          || $a->{'dir'} cmp $b->{'dir'}
-          || $a->{'file'} cmp $b->{'file'};
-    } @files;
-
-    # Combine adjacent rows that are the same modulo the file name.
-
-    my @items = (undef);
-
-    foreach my $file (@files) {
-        if ( $#items == -1    #if it's empty
-            || ( !defined $items[-1]->{'old'}
-                || $items[-1]->{'old'} ne $file->{'old'} )
-            || ( !defined $items[-1]->{'new'}
-                || $items[-1]->{'new'} ne $file->{'new'} )
-            || ( !defined $items[-1]->{'tag'}
-                || $items[-1]->{'tag'} ne $file->{'tag'} ) )
-        {
-
-            push ( @items, $file );
-        }
-        push ( @{ $items[-1]->{'files'} },
-            $file->{'dir'} . "/" . $file->{'file'} );
-    }
-
-    return (@items);
-}
-
-# }}}
-
-# {{{ build_header
-
-sub build_header {
-    my $now    = gmtime;
-    my $header =
-      sprintf( "Module Name:\t%s\nCommitted By:\t%s\nDate:\t\t%s %s %s",
-        $MODULE_NAME, $LOGIN, substr( $now, 0, 19 ), "UTC",
-        substr( $now, 20, 4 ) );
-    return ($header);
-}
-
-# }}}
-
-# {{{ mail_notification
-sub mail_notification {
-    my $id = shift;
-    my (@text) = @_;
-    write_file( "$MAIL_FILE.$id", "From: " . $LOGIN,
-        "Subject: CVS commit: " . $MODULE_NAME, "To: " . $MAILTO,
-        "Reply-To: " . $REPLYTO,                "", "", @text );
-
-    my $entity = MIME::Entity->build(
-        From       => $LOGIN,
-        To         => $MAILTO,
-        Subject    => "CVS commit: " . $MODULE_NAME,
-        'Reply-To' => $REPLYTO,
-        Data       => join ( "\n", @text )
-    );
-    if ( $RT::MailCommand eq 'sendmailpipe' ) {
-        open( MAIL, "|$RT::SendmailPath $RT::SendmailArguments" )
-          || die "Couldn't send mail: " . $@ . "\n";
-        print MAIL $entity->as_string;
-        close(MAIL);
-    }
-    else {
-        $entity->send( $RT::MailCommand, $RT::MailParams );
-    }
-
-}
-
-# }}}
-
-# {{{ sub record_last_dir
-
-sub record_last_dir {
-    my $id  = shift;
-    my $dir = shift;
-
-    # make a note of this directory. later, we'll use this to 
-    # figure out if we've gone through the whole commit,
-    # for something that is a bad mockery of attomic commits.
-
-    warn "about to write $dir to $LASTDIR_FILE.$id" if ($DEBUG);
-
-    write_file( "$LASTDIR_FILE.$id", $dir );
-}
-
-# }}}
-
-# {{{ Get the RT stuff set up
-
-# {{{ sub rt_handler 
-
-sub rt_handler {
-    my (@LogMessage) = (@_);
-
-    #Connect to the database and get RT::SystemUser and RT::Nobody loaded
-    RT::Init;
-
-    require RT::Ticket;
-
-    #Get the current user all loaded
-    my $CurrentUser = GetCurrentUser();
-
-    if ( !$CurrentUser->Id ) {
-        print
-loc("No valid RT user found. RT cvs handler disengaged. Please consult your RT administrator.\n");
-        return;
-    }
-
-    my (@commands) = find_commands( \@LogMessage );
-
-    my ( @tickets, @errors );
-
-    # Get the list of tickets we're working with out of commands
-    grep { $_ =~ /^RT-Ticket:\s*(.*?)$/i && push ( @tickets, $1 ) } @commands;
-
-    my $message = new MIME::Entity;
-    $message->build(
-        From    => $CurrentUser->EmailAddress,
-        Subject => 'CVS Commit',
-        Data    => \@LogMessage
-    );
-
-    # {{{ comment or correspond, as needed
-
-    foreach my $ticket (@tickets) {
-        my $TicketObj = RT::Ticket->new($CurrentUser);
-        $TicketObj->Load($ticket);
-        my ( $id, $msg );
-        unless ( $TicketObj->Id ) {
-            push ( @errors,
-"Couldn't load ticket #$ticket. Not adding commit log to ticket history.\n"
-            );
-        }
-
-        if ( $LogMessage[0] =~ /^(comment|private)$/ ) {
-            ( $id, $msg ) = $TicketObj->Comment( MIMEObj => $message );
-
-        }
-        else {
-            ( $id, $msg ) = $TicketObj->Correspond( MIMEObj => $message );
-        }
-
-        push ( @errors, ">> Log message",
-            "Ticket #" . $TicketObj->Id . ": " . $msg );
-
-    }
-
-    # }}}
-
-    my ($reply) = ActOnPseudoHeaders( $CurrentUser, @commands );
-    print "$reply\n" if ($reply);
-    print join ( "\n", @errors );
-    print "\n";
-
-}
-
-# }}}
-
-# {{{ sub find_commands
-
-sub find_commands {
-    my $lines = shift;
-    my (@pseudoheaders);
-
-    while ( my $line = shift @{$lines} ) {
-        next if $line =~ /^\s*?$/;
-        if ( $line =~ /^RT-/i ) {
-
-            push ( @pseudoheaders, $line );
-        }
-
-        #If we find a line that's not a command, get out.
-        else {
-            unshift ( @{$lines}, $line );
-            last;
-        }
-    }
-
-    return (@pseudoheaders);
-
-}
-
-# }}}
-
-# {{{ sub ActOnPseudoHeaders
-
-=item ActOnPseudoHeaders $PseudoHeaders
-
-Takes a string of pseudo-headers, iterates through them and does what they tell it to.
-
-=cut
-
-sub ActOnPseudoHeaders {
-    my $CurrentUser = shift;
-    my (@actions) = (@_);
-
-    my $ResultsMessage = '';
-    my $Ticket         = RT::Ticket->new($CurrentUser);
-
-    foreach my $action (@actions) {
-        my ($val);
-        my $msg = '';
-
-        $ResultsMessage .= ">>> $action\n";
-
-        if ( $action =~ /^RT-(.*?):\s*(.*)$/i ) {
-            my $command = $1;
-            my $args    = $2;
-
-            if ( $command =~ /^ticket$/i ) {
-
-                $val = $Ticket->Load($args);
-                unless ($val) {
-                    $ResultsMessage .=
-                      loc("ERROR: Couldn't load ticket '[_1]': [_2].\n", $1, $msg);
-                      . loc("Aborting to avoid unintended ticket modifications.\n")
-                      . loc("The following commands were not proccessed:\n\n")
-                      . join ( "\n", @actions );
-                    return ($ResultsMessage);
-                }
-                $ResultsMessage .= loc("Ticket [_1] loaded\n", $Ticket->Id);
-            }
-            else {
-                unless ( $Ticket->Id ) {
-                    $ResultsMessage .= loc("No Ticket specified. Aborting ticket ")
-                      . loc("modifications\n\n")
-                      . loc("The following commands were not proccessed:\n\n")
-                      . join ( "\n", @actions );
-                    return ($ResultsMessage);
-                }
-
-                # Deal with the basics
-                if ( $command =~ /^(Subject|Owner|Status|Queue)$/i ) {
-                    my $method = 'Set' . ucfirst( lc($1) );
-                    ( $val, $msg ) = $Ticket->$method($args);
-                }
-
-                # Deal with the dates
-                elsif ( $command =~ /^(due|starts|started|resolved)$/i ) {
-                    my $method = 'Set' . ucfirst( lc($1) );
-                    my $date   = new RT::Date($CurrentUser);
-                    $date->Set( Format => 'unknown', Value => $args );
-                    ( $val, $msg ) = $Ticket->$method( $date->ISO );
-                }
-
-                # Deal with the watchers
-                elsif ( $command =~ /^(requestor|requestors|cc|admincc)$/i ) {
-                    my $operator = "+";
-                    my ($type);
-                    if ( $args =~ /^(\+|\-)(.*)$/ ) {
-                        $operator = $1;
-                        $args     = $2;
-                    }
-                    $type = 'Requestor' if ( $command =~ /^requestor/i );
-                    $type = 'Cc'        if ( $command =~ /^cc/i );
-                    $type = 'AdminCc'   if ( $command =~ /^admincc/i );
-
-                       my $user = RT::User->new($CurrentUser);
-                    $user->Load($args);
-
-                    if ($operator eq '+') {
-                        ($val, $msg) = $Ticket->AddWatcher( Type => $type,
-                                                            PrincipalId => $user->PrincipalId);
-                    } elsif ($operator eq '-') {
-                        ($val, $msg) = $Ticket->DeleteWatcher( Type => $type,
-                                                               PrincipalId => $user->PrincipalId);
-                    }
-
-            }
-            $ResultsMessage .= $msg . "\n";
-        }
-
-    }
-    return ($ResultsMessage);
-
-}
-
-# }}}
-
-# {{{ sub untaint 
-sub untaint {
-    my $val = shift;
-
-    if ( $val =~ /^([-\#\/\w.]+)$/ ) {
-        $val = $1;    # $data now untainted
-    }
-    else {
-        die loc("Bad data in [_1]", $val);    # log this somewhere
-    }
-    return ($val);
-}
-
-# }}}
-
-=head1 AUTHOR
-
-
-
-  rt-commit-handler is a rewritten version of the NetBSD commit handler,
-  which was placed in the public domain by Charles Hannum. It bore the following
-  authors statement:
-
- Contributed by David Hampton <hampton@cisco.com>
- Hacked greatly by Greg A. Woods <woods@planix.com>
- Rewritten by Charles M. Hannum <mycroft@netbsd.org>
-
-=cut
-
diff --git a/rt/config b/rt/config
deleted file mode 100644 (file)
index b9418a6..0000000
--- a/rt/config
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * This is the project ``config'' file.  It controls many aspects of
- * how Aegis interacts with your project.
- *
- * There are several sections of this file, each dealing with a different
- * aspect of the interaction between Aegis and the tools used to manage
- * yout project.
- */
-
-/*
- * -------------------------------------------------------------------------
- *
- * The build tool is delegated.
- */
-
-/*
- * The build_command field of the config file is used to invoke the relevant
- * build command.  The following command tells cook where to find the recipes.
- * The ${s Howto.cook} expands to a path into the baseline during development
- * if the file is not in the change.  Look in aesub(5) for more information
- * about command substitutions.
- */
-build_command =
-       "";
-        
-/*        cook -book ${s Howto.cook} search_path=$search_path \
-project=$p change=$c version=$v -star -no-log -action -notouch";
-
-/* 
- * The recipes in the User Guide will all remove their targets before
- * constructing them, which qualifies them to use the following entry in the
- * config file.  The targets MUST be removed first if this field is true,
- * otherwise the baseline would cease to be self-consistent.
- *
- * Fortunately, Cook has a nifty ``set unlink;'' statement which is
- * placed at the top of the cookbook.
- */ 
-link_integration_directory = true;
-
-
-/*
- * -------------------------------------------------------------------------
- *
- * The history tool is delegated.
- *
- * The fhist program was written by David I. Bell and is admirably
- * suited to providing a history mechanism with out the "cruft" that
- * SCCS and RCS impose.  The fhist program also comes with two other
- * utilities, fcomp and fmerge, which use the same minimal difference
- * algorithm.
- *
- * Please note that the [# edit #] feature needs to be avoided, or the
- * -Fored_Update (-fu) flag needs to be used in addition to the
- * -Conditional_Update (-cu) flag, otherwise updates will complain that
- * ``Input file "XXX" contains edit A instead of B for module "YYY"''
- *
- * The history_create_command and the history_put_command are
- * intentionally identical.  This minimizes problems when using
- * branches.
- *
- * The ${quote ...} construct is used to quote filesnames whicg contain
- * shell special characters.  A minimum of quoting is performed, so if
- * the filenames do not contail shell special characters, no quotes will
- * be used.
- */
-
-/*
- * This command is used to create a new project history.  The command is
- * always executed as the project owner.  Note he the source is left in
- * the baseline.  The following substitutions are available:
- *
- * ${Input}
- *     absolute path of the source file
- * ${History}
- *     absolute path of the history file
- *
- * The history_create_command and the history_put_command are
- * intentionally identical.  This minimizes problems when using
- * branches.
- */
-history_create_command =
-       "fhist ${quote ${basename $input}} -cr -cu -i ${quote $input} \
--p ${quote ${dirname $history}} -r";
-
-/*
- * This command is used to get a specific edit back from history.  The
- * command may be executed by developers.  The following substitutions
- * are available:
- *
- * ${History}
- *     absolute path of the history file
- * ${Edit}
- *     edit number, as given by history_query_command
- * ${Output}
- *     absolute path of the destination file
- *
- * Note that the destination filename will never look anything like the
- * history source filename, so the -p is essential.
- */
-history_get_command =
-       "fhist ${quote ${basename $history}} -e ${quote $e} \
--o ${quote $output} -p ${quote ${dirname $history}}";
-
-/*
- * This command is used to add a new "top-most" entry to the history
- * file.  This command is always executed as the project owner.  Note
- * that the source file is left in the baseline.  The following
- * substitutions are available:
- *
- * ${Input}
- *     absolute path of source file
- * ${History}
- *     absolute path of history file
- *
- * The history_create_command and the history_put_command are
- * intentionally identical.  This minimizes problems when using
- * branches.
- */
-history_put_command =
-       "fhist ${quote ${basename $input}} -cr -cu -i ${quote $input} \
--p ${quote ${dirname $history}} -r";
-
-/*
- * This command is used to query what the history mechanism calls the
- * "top-most" edit of a history file.  The result may be any arbitrary
- * string, it need not be anything like a number, just so long as it
- * uniquely identifies the edit for use by the history_get_command at a
- * later date.  The edit number is to be printed on the standard output.
- * This command may be executed by developers.  The following
- * substitutions are available:
- *
- * ${History}
- *     absolute path of the history file
- */
-history_query_command =
-       "fhist ${quote ${basename $history}} -l 0 \
--p ${quote ${dirname $history}} -q";
-
-/*
- * -------------------------------------------------------------------------
- *
- * The difference and merge tools are delegated.
- */
-
-/*
- * Compare two files using fcomp.  The -w option produces an output of
- * the entire file, with insertions an deletions marked by "change bars"
- * in the left margin.  This is superior to context difference, as it
- * shows the entire file as context.  The -s option could be added to
- * compare runs of white space as equal.
- *
- * This command is used by aed(1) to produce a difference listing when
- * file in the development directory was originally copied from the
- * current version in the baseline.
- *
- * All of the command substitutions described in aesub(5) are available.
- * In addition, the following substitutions are also available:
- *
- * ${ORiginal}
- *     The absolute path name of a file containing the version
- *     originally copied.  Usually in the baseline.
- * ${Input}
- *     The absolute path name of the edited version of the file.
- *     Usually in the development directory.
- * ${Output}
- *     The absolute path name of the file in which to write the
- *     difference listing.  Usually in the development directory.
- *
- * An exit status of 0 means successful, even of the files differ (and
- * they usually do).  An exit status which is non-zero means something
- * is wrong.
- *
- * The non-zero exit status may be used to overload this command with
- * extra tests, such as line length limits.  The difference files must
- * be produced in addition to these extra tests.
- */
-diff_command =
-       "fcomp -w ${quote $original} ${quote $input} -o ${quote $output}";
-
-/*
- * Compare three files using fmerge.  Conflicts are marked in the
- * output.
- *
- * This command is used by aed(1) to produce a difference listing when a
- * file in the development directory is out of date compared to the
- * current version in the baseline.
- *
- * All of the command substitutions described in aesub(5) are available.
- * In addition, the following substitutions are also available:
- *
- * ${ORiginal}
- *     The absolute path name of a file containing the common ancestor
- *     version of ${MostRecent} and {$Input}.  Usually the version
- *     originally copied into the change.  Usually in a temporary file.
- * ${Most_Recent}
- *     The absolute path name of a file containing the most recent
- *     version.  Usually in the baseline.
- * ${Input}
- *     The absolute path name of the edited version of the file.
- *     Usually in the development directory.
- * ${Output}
- *     The absolute path name of the file in which to write the
- *     difference listing.  Usually in the development directory.
- *
- * An exit status of 0 means successful, even of the files differ (and
- * they usually do).  An exit status which is non-zero means something
- * is wrong.
- */
-merge_command =
-       "fmerge ${quote $original} ${quote $MostRecent} ${quote $input} \
--o ${quote $output} -c /dev/null";
-
-/*
- * -------------------------------------------------------------------------
- *
- * The new file templates are very handy.  They allow all sorts of things
- * to be se automatically.  You need to edit them to add your own name,
- * and copyright conditions.
- */
-
-file_template =
-[
-       {
-               pattern = [ "*" ];
-                body = "${read_file ${source etc/template/generic abs}}";
-
-       }
-];
-
-/* -------------------------------------------------------------------------
- *
- * The integrate_begin_exceptions are files which are not hard linked
- * from the baseline to the integration directory.  In this case, this
- * is done to ensure the version stmp is updated appropriately.
- */
-
-integrate_begin_exceptions = [ ];
-
-
-
-
-/* -------------------------------------------------------------------------
- *
- * The trojan_horse_suspect field is a list of filename patterns which
- * indicate files which *could* host a Trojan horse attack.  It makes
- * aedist --receive more cautions.  It is NOT a silver bullet: just
- * about ANY file can host a Trojan, one way or the other.
- */
-
-trojan_horse_suspect = [ ];
-
-build_covers_all_architectures = true;
-
-test_command = "make test";
-
-build_time_adjust=dont_adjust;
diff --git a/rt/config.pld b/rt/config.pld
deleted file mode 100644 (file)
index c71c7bb..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-(test "x$prefix" = "xNONE" || test "x$prefix" = "x") && prefix=/opt/rt3
-(test "x$exec_prefix" = "xNONE" || test "x$exec_prefix" = "x") && exec_prefix=${prefix}
-bindir=${exec_prefix}/bin
-sbindir=${exec_prefix}/sbin
-sysconfdir=${prefix}/etc
-mandir=${prefix}/man
-libdir=${prefix}/lib
-datadir=${prefix}/share
-(test "x$htmldir" = "xNONE" || test "x$htmldir" = "x") && htmldir=${datadir}/html
-(test "x$manualdir" = "xNONE" || test "x$manualdir" = "x") && manualdir=${datadir}/doc
-localstatedir=${prefix}/var
-(test "x$logfiledir" = "xNONE" || test "x$logfiledir" = "x") && logfiledir=${localstatedir}/log
-(test "x$masonstatedir" = "xNONE" || test "x$masonstatedir" = "x") && masonstatedir=${localstatedir}/mason_data
-(test "x$sessionstatedir" = "xNONE" || test "x$sessionstatedir" = "x") && sessionstatedir=${localstatedir}/session_data
-(test "x$customdir" = "xNONE" || test "x$customdir" = "x") && customdir=${prefix}/local
-(test "x$custometcdir" = "xNONE" || test "x$custometcdir" = "x") && custometcdir=${customdir}/etc
-(test "x$customhtmldir" = "xNONE" || test "x$customhtmldir" = "x") && customhtmldir=${customdir}/html
-(test "x$customlexdir" = "xNONE" || test "x$customlexdir" = "x") && customlexdir=${customdir}/po
-(test "x$customlibdir" = "xNONE" || test "x$customlibdir" = "x") && customlibdir=${customdir}/lib
diff --git a/rt/etc/upgrade/2.1.71 b/rt/etc/upgrade/2.1.71
deleted file mode 100644 (file)
index cb89a3a..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-@Queues = ( {
-        Name        => '___Approvals',
-    Description => 'A system-internal queue for the approvals system',
-        Disabled    => 2,
-        }
-);
-
-
-
-
-
-# {{{ Templates
-@Templates = (
-    {
-        Queue       => '___Approvals',
-        Name        => "New Pending Approval", # loc
-        Description => "Notify Owners and AdminCcs of new items pending their approval", # loc
-       Content     => 'Subject: New Pending Approval: {$Ticket->Subject}
-
-Greetings,
-
-There is a new item pending your approval: "{$Ticket->Subject()}", 
-a summary of which appears below.
-
-Please visit {$RT::WebURL}Approvals/Display.html?id={$Ticket->id}
-to approve or reject this ticket, or {$RT::WebURL}Approvals/ to
-batch-process all your pending approvals.
-
--------------------------------------------------------------------------
-{$Transaction->Content()}
-'
-    },
-);
-
-# }}}
-
-1;
-
-@ScripActions = (
-     { Name => 'Open Tickets',
-       Description => 'Open tickets on correspondence',
-        ExecModule => 'AutoOpen' },
-
-);
-
- @Scrips = (
-        { ScripCondition => 'On Correspond',
-          ScripAction => 'Open Tickets',
-          Template => 'Blank',
-          Queue => '0'
-        }, 
-    {  ScripCondition => 'On Create',
-       ScripAction    => 'AutoReply To Requestors',
-       Template       => 'AutoReply' },
-    {  ScripCondition => 'On Create',
-       ScripAction    => 'Notify AdminCcs',
-       Template       => 'Transaction' },
-    {  ScripCondition => 'On Correspond',
-       ScripAction    => 'Notify AdminCcs',
-       Template       => 'Admin Correspondence' },
-    {  ScripCondition => 'On Correspond',
-       ScripAction    => 'Notify Requestors And Ccs',
-       Template       => 'Correspondence' },
-    {  ScripCondition => 'On Correspond',
-       ScripAction    => 'Notify Other Recipients',
-       Template       => 'Correspondence' },
-    {  ScripCondition => 'On Comment',
-       ScripAction    => 'Notify AdminCcs As Comment',
-       Template       => 'Admin Comment' },
-    {  ScripCondition => 'On Comment',
-       ScripAction    => 'Notify Other Recipients As Comment',
-       Template       => 'Correspondence' },
-    {  ScripCondition => 'On Resolve',
-       ScripAction    => 'Notify Requestors',
-       Template       => 'Resolved' },
-
-
-    {
-        Description    => "When an approval ticket is created, notify the Owner and AdminCc of the item awaiting their approval", # loc
-        Queue          => '___Approvals',
-        ScripCondition => 'On Create',
-        ScripAction    => 'Notify AdminCcs',
-        Template       => 'New Pending Approval'
-    },
-    {
-        Description           => "If an approval is rejected, reject the original and delete pending approvals",       # loc
-        Queue                  => '___Approvals',
-        ScripCondition         => 'On Status Change',
-        ScripAction            => 'User Defined',
-        CustomCommitCode       => q[
-# ------------------------------------------------------------------- #
-return(1) unless ( lc($self->TransactionObj->NewValue) eq "rejected" or
-                  lc($self->TransactionObj->NewValue) eq "deleted" );
-
-my $links = $self->TicketObj->DependedOnBy;
-foreach my $link (@{ $links->ItemsArrayRef }) {
-    my $obj = $link->BaseObj;
-    if ($obj->QueueObj->IsActiveStatus($obj->Status)) {
-       if ($obj->Type eq 'ticket') {
-           $obj->Correspond(
-               Content => $self->loc("Your request was rejected."),
-           );
-           $obj->SetStatus(
-               Status  => 'rejected',
-               Force   => 1,
-           );
-       }
-       else {
-           $obj->SetStatus(
-               Status  => 'deleted',
-               Force   => 1,
-           );
-       }
-    }
-}
-
-$links = $self->TicketObj->DependsOn;
-foreach my $link (@{ $links->ItemsArrayRef }) {
-    my $obj = $link->TargetObj;
-    if ($obj->QueueObj->IsActiveStatus($obj->Status)) {
-       $obj->SetStatus(
-           Status      => 'deleted',
-           Force       => 1,
-       );
-    }
-}
-
-return 1;
-# ------------------------------------------------------------------- #
-       ],
-        CustomPrepareCode => '1',
-        Template          => 'Admin Comment',
-    },
-    {
-        Description      => "When a ticket has been approved by any approver, add correspondence to the original ticket", # loc
-        Queue             => '___Approvals',
-        ScripCondition    => 'On Resolve',
-        ScripAction       => 'User Defined',
-        CustomPrepareCode => 'return(1);',
-        CustomCommitCode  => q[
-# ------------------------------------------------------------------- #
-return(1) unless ($self->TicketObj->Type eq 'approval');
-
-foreach my $obj ($self->TicketObj->AllDependedOnBy( Type => 'ticket' )) {
-    $obj->Correspond(
-       Content => $self->loc( "Your request has been approved by [_1]. Other approvals may still be pending.", # loc
-           $self->TransactionObj->CreatorObj->Name,
-       ) . "\n" . $self->loc( "Approver's notes: [_1]", # loc
-           $self->TicketObj->Transactions->Last->Content,
-       ),
-       _reopen => 0,
-    );
-}
-
-return 1;
-# ------------------------------------------------------------------- #
-       ],
-       Template => 'Admin Comment'
-    },
-    {
-        Description      => "When a ticket has been approved by all approvers, add correspondence to the original ticket", # loc
-        Queue             => '___Approvals',
-        ScripCondition    => 'On Resolve',
-        ScripAction       => 'User Defined',
-        CustomPrepareCode => 'return(1);',
-        CustomCommitCode  => q[
-# ------------------------------------------------------------------- #
-# Find all the tickets that depend on this (that this is approving)
-
-my $Ticket = $self->TicketObj;
-my @TOP    = $Ticket->AllDependedOnBy( Type => 'ticket' );
-my $links  = $Ticket->DependedOnBy;
-
-while (my $link = $links->Next) {
-    my $obj = $link->BaseObj;
-    next if ($obj->HasUnresolvedDependencies( Type => 'approval' ));
-
-    if ($obj->Type eq 'ticket') {
-       $obj->Correspond(
-           Content     => $self->loc("Your request has been approved."),
-           _reopen     => 0,
-       );
-    }
-    elsif ($obj->Type eq 'code') {
-       my $code = $obj->Transactions->First->Content;
-       my $rv;
-
-       foreach my $TOP (@TOP) {
-           local $@;
-           $rv++ if eval $code;
-           $RT::Logger->error("Cannot eval code: $@") if $@;
-       }
-
-       if ($rv or !@TOP) {
-           $obj->SetStatus( Status     => 'resolved', Force    => 1,);
-       }
-       else {
-           $obj->SetStatus( Status     => 'rejected', Force    => 1,);
-       }
-    }
-}
-
-return 1;
-# ------------------------------------------------------------------- #
-       ],
-        Template    => 'Admin Comment',
-    },
-);
-
-# }}}
-
diff --git a/rt/html/Admin/Elements/ModifyQueue b/rt/html/Admin/Elements/ModifyQueue
deleted file mode 100644 (file)
index 36f9ce1..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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/TitleBoxStart, title => loc('Editing Configuration for queue [_1]', $QueueObj->Id) &>
-
-<FORM ACTION="<%$RT::WebPath%>/Admin/Queues/Modify.html" METHOD=POST>
-<INPUT TYPE=HIDDEN NAME=id VALUE="<%$QueueObj->Id%>">
-<TABLE>
-<TR><TD ALIGN=RIGHT>
-<&|/l&>Queue Name</&>:
-</TD>
-<TD><INPUT name="Name" value="<%$QueueObj->Name%>"></TD>
-</TR><TR>
-<TD ALIGN=RIGHT>
-<&|/l&>Description</&>:</TD><TD COLSPAN=3><INPUT name="Description" value="<%$QueueObj->Description%>" size=60></TD></TR>
-<TR>
-<TD ALIGN=RIGHT>
-<&|/l&>Correspondence Address</&>:
-</TD><TD>
-<INPUT name="CorrespondAddress" value="<%$QueueObj->CorrespondAddress%>">
-</TD>
-<TD ALIGN=RIGHT>
-
-<&|/l&>Comment Address</&>: </TD><TD>
-<INPUT NAME="CommentAddress" value="<%$QueueObj->CommentAddress%>">
-</TD>
-</TR><TR>
-
-<TD ALIGN=RIGHT>
-<&|/l&>Priority starts at</&>:
-</TD><TD><INPUT NAME="InitialPriority" value="<%$QueueObj->InitialPriority %>">
-</TD>
-<TD ALIGN=RIGHT>
-<&|/l&>Over time, priority moves toward</&>:
-</TD><TD><INPUT NAME="FinalPriority" value="<%$QueueObj->FinalPriority %>">
-</TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT>
-<&|/l&>Requests should be due in</&>:
-</TD><TD>
-<INPUT NAME="DefaultDueIn" VALUE="<%$QueueObj->DefaultDueIn%>"> <&|/l&>days</&>.
-</TD>
-</TR>
-</TABLE>
-<& /Elements/Submit, Label => loc('Save Changes') &>
-</form>
-<& /Elements/TitleBoxEnd &>
-
-<%INIT>
-
-</%INIT>
-
-<%ARGS>
-
-
-$QueueObj => undef
-</%ARGS>
diff --git a/rt/html/Admin/Elements/ModifyUser b/rt/html/Admin/Elements/ModifyUser
deleted file mode 100644 (file)
index 2faefef..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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/TitleBoxStart, title => loc('Editing Configuration for user [_1]', $UserObj->Name) &>
-
-<FORM ACTION="<%$RT::WebPath%>/Admin/Users/Modify.html" METHOD=POST>
-<INPUT TYPE=HIDDEN NAME=id VALUE="<%$UserObj->Id%>">
-
-<&|/l&>Name</&>: <input name="Name" value="<%$UserObj->Name%>">
-<BR>
-<&|/l&>New Password</&>: <input type=password name="Pass1"><BR>
-<&|/l&>Retype Password</&>: <input type=password name="Pass2"><BR>
-
-<&|/l&>Comments</&>: <TEXTAREA name="Comments" COLS=80 ROWS=5 WRAP=VIRTUAL>
-<%$UserObj->Comments%></TEXTAREA>
-
-<BR>
-<&|/l&>Signature</&>: <TEXTAREA COLS=80 ROWS=5 name="Signature" WRAP=HARD>
-<%$UserObj->Signature%></TEXTAREA>
-<BR>
-<&|/l&>EmailAddress</&>: <input name="EmailAddress" value="<%$UserObj->EmailAddress%>">
-<BR>
-<&|/l&>FreeformContactInfo</&>: <input name="FreeformContactInfo" value="<%$UserObj->FreeformContactInfo%>">
-<BR>
-<&|/l&>Organization</&>: <input name="Organization" value="<%$UserObj->Organization%>">
-<BR>
-<&|/l&>RealName</&>: <input name="RealName" value="<%$UserObj->RealName%>">
-<BR>
-<&|/l&>NickName</&>: <input name="NickName" value="<%$UserObj->NickName%>">
-<BR>
-<&|/l&>Lang</&>: <input name="Lang" value="<%$UserObj->Lang%>">
-<BR>
-<&|/l&>EmailEncoding</&>: <input name="EmailEncoding" value="<%$UserObj->EmailEncoding%>">
-<BR>
-<&|/l&>WebEncoding</&>: <input name="WebEncoding" value="<%$UserObj->WebEncoding%>">
-<BR>
-<&|/l&>ExternalContactInfoId</&>: <input name="ExternalContactInfoId" value="<%$UserObj->ExternalContactInfoId%>">
-<BR>
-<&|/l&>ContactInfoSystem</&>: <input name="ContactInfoSystem" value="<%$UserObj->ContactInfoSystem%>">
-<BR>
-<&|/l&>UnixUsername</&>: <input name="Gecos" value="<%$UserObj->Gecos%>">
-<BR>
-<&|/l&>ExternalAuthId</&>: <input name="ExternalAuthId" value="<%$UserObj->ExternalAuthId%>">
-<BR>
-<&|/l&>AuthSystem</&>: <input name="AuthSystem" value="<%$UserObj->AuthSystem%>">
-<BR>
-<&|/l&>HomePhone</&>: <input name="HomePhone" value="<%$UserObj->HomePhone%>">
-<BR>
-<&|/l&>WorkPhone</&>: <input name="WorkPhone" value="<%$UserObj->WorkPhone%>">
-<BR>
-<&|/l&>MobilePhone</&>: <input name="MobilePhone" value="<%$UserObj->MobilePhone%>">
-<BR>
-<&|/l&>PagerPhone</&>: <input name="PagerPhone" value="<%$UserObj->PagerPhone%>">
-<BR>
-<&|/l&>Address1</&>: <input name="Address1" value="<%$UserObj->Address1%>">
-<BR>
-<&|/l&>Address2</&>: <input name="Address2" value="<%$UserObj->Address2%>">
-<BR>
-<&|/l&>City</&>: <input name="City" value="<%$UserObj->City%>">
-<BR>
-<&|/l&>State</&>: <input name="State" value="<%$UserObj->State%>">
-<BR>
-<&|/l&>Zip</&>: <input name="Zip" value="<%$UserObj->Zip%>">
-<BR>
-<&|/l&>Country</&>: <input name="Country" value="<%$UserObj->Country%>">
-<BR>
-<& /Elements/Submit, Label => loc('Save Changes') &>
-</form>
-<& /Elements/TitleBoxEnd &>
-
-<%INIT>
-
-</%INIT>
-
-<%ARGS>
-
-
-$UserObj => undef
-</%ARGS>
diff --git a/rt/html/Admin/Users/Prefs.html b/rt/html/Admin/Users/Prefs.html
deleted file mode 100644 (file)
index 0bba9fa..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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("User view") &>
-
-<& /Elements/ViewUser, User=>$u &>
-
-<h2 class="title"><%loc("User view")%></h2>
-
-%if ($session{CurrentUser} && ($session{CurrentUser}->Id == $id)) {
-       <& /Elements/TitleBoxStart, title => loc('Signature')  &>
-<form method=post>
-<input type="hidden" name="id" value=<%$id%>>
-<TEXTAREA COLS=72 ROWS=4 WRAP=HARD NAME="Signature"><% $u->Signature %></TEXTAREA><br><br>
-<input type="submit" value="<&|/l&>Update signature</&>">
-</form>
-         <& /Elements/TitleBoxEnd &>
-         <form method=post>
-         <&|/l&>Open tickets (from listing) in another window</&>: <input type="checkbox" name="NewWindowOption" <%exists $session{NewWindowOption} && "CHECKED"%>><br>
-         <&|/l&>Open tickets (from listing) in a new window</&>: <input type="checkbox" name="AlwaysNewWindowOption" <%exists $session{AlwaysNewWindowOption} && "CHECKED"%>><br>
-         <input type="submit" name="NewWindowSetting" value="<&|/l&>New window setting</&>">
-         </form>
-%}
-
-       <& /Elements/TitleBoxStart, title => loc('Email')  &>
-<form method=post>
-<input type="hidden" name="id" value="<%$id%>">
-<input name="Email" value="<% $u->EmailAddress %>"><input type="submit" value="<&|/l&>Update email</&>">
-</form>
-         <& /Elements/TitleBoxEnd &>
-       <& /Elements/TitleBoxStart, title => loc('Real Name')  &>
-<form method=post>
-<input type="hidden" name="id" value="<%$id%>">
-<input name="RealName" value="<% $u->RealName %>"><input type="submit" value="<&|/l&>Update name</&>">
-</form>
-         <& /Elements/TitleBoxEnd &>
-
-       <& /Elements/TitleBoxStart, title => loc('User ID')  &>
-<form method=post>
-<input type="hidden" name="id" value="<%$id%>">
-<input name="Name" value="<% $u->Name %>"><input type="submit" value="<&|/l&>Update ID</&>">
-</form>
-         <& /Elements/TitleBoxEnd &>
-
-%# TODO: alternative email addresses + merging users
-
-<%ARGS>
-$id => $session{CurrentUser} ? $session{CurrentUser}->Id : 0
-$Signature => undef
-$Email => undef
-$RealName => undef
-$Name => undef
-</%ARGS>
-
-<%INIT>
-require RT::User;
-my $u=RT::User->new($session{CurrentUser});
-$u->Load($id) || die loc("Couldn't load that user ([_1])", $id);
-if ($Signature) {
-my ($val, $msg)=$u->SetSignature($Signature);
-$RT::Logger->log(level=>($val ? 'info' : 'error'), message=>$msg);
-}
-
-if ($Email) {
-my ($val, $msg)=$u->SetEmailAddress($Email);
-$RT::Logger->log(level=>($val ? 'info' : 'error'), message=>$msg);
-}
-
-if ($RealName) {
-my ($val, $msg)=$u->SetRealName($RealName);
-$RT::Logger->log(level=>($val ? 'info' : 'error'), message=>$msg);
-}
-
-if ($Name) {
-my ($val, $msg)=$u->SetName($Name);
-$RT::Logger->log(level=>($val ? 'info' : 'error'), message=>$msg);
-}
-
-if ($ARGS{NewWindowSetting}) {
-if ($ARGS{NewWindowOption}) {
-$session{NewWindowOption}=1;
-} else {
-delete $session{NewWindowOption};
-}
-if ($ARGS{AlwaysNewWindowOption}) {
-$session{NewWindowOption}=1;
-$session{AlwaysNewWindowOption}=1;
-} else {
-delete $session{AlwaysNewWindowOption};
-}
-}
-
-</%INIT>
-
-
-
-
-
-
-
-
-
index 052bf87..12432ca 100644 (file)
@@ -1,8 +1,14 @@
-%# BEGIN LICENSE BLOCK
+%# {{{ BEGIN BPS TAGGED BLOCK
 %# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
+%#                                          <jesse@bestpractical.com>
 %# 
-%# (Except where explictly superceded by other copyright notices)
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
 %# 
 %# This work is made available to you under the terms of Version 2 of
 %# the GNU General Public License. A copy of that license should have
 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 %# General Public License for more details.
 %# 
-%# Unless otherwise specified, all modifications, corrections or
-%# extensions to this work which alter its source code become the
-%# property of Best Practical Solutions, LLC when submitted for
-%# inclusion in the work.
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# 
 %# 
+%# CONTRIBUTION SUBMISSION POLICY:
 %# 
-%# END LICENSE BLOCK
+%# (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
 % if ($Menu) {
 </td>
 </tr>
 <& /Elements/Callback, %ARGS &>
 <!--
 <div class="bpscredits">
-&#187;&#124;&#171; <&|/l, $RT::VERSION &>RT [_1] from <a href="http://bestpractical.com">Best Practical Solutions, LLC</a>.</&>
+<&|/l,     '&#187;&#124;&#171;', 
+     $RT::VERSION, 
+     '2004', 
+    '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>',
+&>[_1] RT [_2] Copyright 1996-[_3] [_4].</&><br>
+% if (!$Menu) {
+<&|/l&>Distributed under version 2 <a href="http://www.gnu.org/copyleft/gpl.html"> of the GNU GPL.</a></&><br>
+<&|/l, '<a href="mailto:sales@bestpractical.com">sales@bestpractical.com</a>' &>To inquire about support, training, custom development or licensing, please contact [_1].</&><br>
+% }
 </div>
 -->
 % if ($Debug) {
index 38cb4bd..e4f613f 100644 (file)
@@ -1,8 +1,14 @@
-%# BEGIN LICENSE BLOCK
+%# {{{ BEGIN BPS TAGGED BLOCK
 %# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
+%#                                          <jesse@bestpractical.com>
 %# 
-%# (Except where explictly superceded by other copyright notices)
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
 %# 
 %# This work is made available to you under the terms of Version 2 of
 %# the GNU General Public License. A copy of that license should have
 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 %# General Public License for more details.
 %# 
-%# Unless otherwise specified, all modifications, corrections or
-%# extensions to this work which alter its source code become the
-%# property of Best Practical Solutions, LLC when submitted for
-%# inclusion in the work.
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# 
+%# 
+%# 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 LICENSE BLOCK
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+%# }}} 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>
 
 <link rel="shortcut icon" href="<%$RT::WebImagesURL%>/favicon.png" type="image/png">
 <link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/webrt.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 BGCOLOR="<%$BgColor%>"
 % if ($Focus) {
@@ -87,8 +122,8 @@ ONLOAD="
 </table>
 <%INIT>
 
-$r->header_out('Pragma' => 'no-cache');
-$r->header_out('Cache-control' => 'no-cache');
+$r->headers_out->{'Pragma'} = 'no-cache';
+$r->headers_out->{'Cache-control'} = 'no-cache';
 </%INIT>
 
 <%ARGS>
index 6146b80..c2097e3 100644 (file)
@@ -1,8 +1,14 @@
-%# BEGIN LICENSE BLOCK
+%# {{{ BEGIN BPS TAGGED BLOCK
 %# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
+%#                                          <jesse@bestpractical.com>
 %# 
-%# (Except where explictly superceded by other copyright notices)
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
 %# 
 %# This work is made available to you under the terms of Version 2 of
 %# the GNU General Public License. A copy of that license should have
 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 %# General Public License for more details.
 %# 
-%# Unless otherwise specified, all modifications, corrections or
-%# extensions to this work which alter its source code become the
-%# property of Best Practical Solutions, LLC when submitted for
-%# inclusion in the work.
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# 
+%# 
+%# 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 LICENSE BLOCK
+%# }}} END BPS TAGGED BLOCK
 <table class="lightgray" border=0 cellspacing=0 cellpadding=0 width="100%">
-  <th class="lightgray" align="left" width=50%><span class="rtname"><%$AppName%></span>
+  <th class="titlebox" align="left" width=42%><span class="rtname"><%$AppName%></span>
   </th>
       <span class="topactions">
 % foreach my $action (sort keys %{$topactions}) {
diff --git a/rt/html/Elements/ShadedBox b/rt/html/Elements/ShadedBox
deleted file mode 100644 (file)
index 36b9cae..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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
-<table>
-  <tr>
-    <td class="label"><%$title |n %>:</td>
-    <td class="value"><%$content |n %></td>
-  </tr>
-</table>
-<%ARGS>
-$title => undef
-$content => "&nbsp;"
-</%ARGS>
diff --git a/rt/html/Elements/ShadedInputRow b/rt/html/Elements/ShadedInputRow
deleted file mode 100644 (file)
index e9fb69e..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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
-<tr>
-  <td class="label"><%$title |n %>:</td>
-  <td class="value">
-    <input name=<%$name%> value="<%$content|h%>" SIZE=<%$size%>>
-  </td>
-</tr>
-<%ARGS>
-$title => undef
-$content => "&nbsp;"
-$name => undef
-$size => undef
-</%ARGS>
diff --git a/rt/html/Elements/ShadedRow b/rt/html/Elements/ShadedRow
deleted file mode 100644 (file)
index 8947fcd..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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
-<tr>
-  <td class="label"><%$title |n %>:</td>
-  <td class="value"><%$content |n %></td>
-</tr>
-<%ARGS>
-$title => undef
-$content => "&nbsp;"
-</%ARGS>
index 85f3740..213aa7e 100644 (file)
@@ -1,8 +1,14 @@
-%# BEGIN LICENSE BLOCK
+%# {{{ BEGIN BPS TAGGED BLOCK
 %# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
+%#                                          <jesse@bestpractical.com>
 %# 
-%# (Except where explictly superceded by other copyright notices)
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
 %# 
 %# This work is made available to you under the terms of Version 2 of
 %# the GNU General Public License. A copy of that license should have
 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 %# General Public License for more details.
 %# 
-%# Unless otherwise specified, all modifications, corrections or
-%# extensions to this work which alter its source code become the
-%# property of Best Practical Solutions, LLC when submitted for
-%# inclusion in the work.
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# 
+%# 
+%# 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 LICENSE BLOCK
+%# }}} END BPS TAGGED BLOCK
 <form action="<% $RT::WebPath %>/index.html">
 <input size="12" name="q" autocomplete="off" accesskey="0">
 <input type="submit" value="<&|/l&>Search tickets</&>">&nbsp;
index 6791e50..ee1a408 100644 (file)
@@ -1,8 +1,14 @@
-%# BEGIN LICENSE BLOCK
+%# {{{ BEGIN BPS TAGGED BLOCK
 %# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
+%#                                          <jesse@bestpractical.com>
 %# 
-%# (Except where explictly superceded by other copyright notices)
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
 %# 
 %# This work is made available to you under the terms of Version 2 of
 %# the GNU General Public License. A copy of that license should have
 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 %# General Public License for more details.
 %# 
-%# Unless otherwise specified, all modifications, corrections or
-%# extensions to this work which alter its source code become the
-%# property of Best Practical Solutions, LLC when submitted for
-%# inclusion in the work.
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# 
 %# 
+%# CONTRIBUTION SUBMISSION POLICY:
 %# 
-%# END LICENSE BLOCK
+%# (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
 <& /Elements/PageLayout,
     current_toptab => $current_toptab,
     current_tab => $current_tab,
@@ -49,8 +71,11 @@ my $basetabs = {
                            path => '',
                          },
                     B => { title => loc('Tickets'),
-                        path => 'Search/Listing.html'
+                        path => 'Search/Build.html'
                       },
+                    C => { title => loc('Tools'),
+                           path => 'Tools/Offline.html'
+                         },
                     E => { title => loc('Configuration'),
                            path => 'Admin/'
                          },
diff --git a/rt/html/Elements/ViewUser b/rt/html/Elements/ViewUser
deleted file mode 100644 (file)
index 6572724..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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/TitleBoxStart, 
-       title => "<a class='inverse' href=\"$RT::WebPath/Search/Listing.html?LimitRequestorById=1&IdOfRequestor=".$User->id."\">".loc("Tickets from [_1]", $name)."</a>",
-       titleright=> "<a class='inverse' href=\"$RT::WebPath/EditUserComments.html?id=".$User->id."\">".loc("Comments about [_1]", $name)."</a>" &>
-<TABLE WIDTH="100%">
-<tr>
-<td halign=left valign=top>
-%while (my $w=$tickets->Next) {
-<%$w->Id%>: <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$w->id%>"><%$w->Subject%></a> (<%$w->Status%>)<BR>
-%}
-</td>
-<td align=right valign=top>
-       <% ($User->Comments || loc("No comment entered about this user")) %>
-</tr>
-</table>
-<& /Elements/TitleBoxEnd &>
-
-<%ARGS>
-$User=>undef
-</%ARGS>
-
-<%INIT>
-my $name=$User->RealName || $User->EmailAddress;       
-
-my $tickets = new RT::Tickets($session{'CurrentUser'});
-$tickets->LimitWatcher(TYPE => 'Requestor', VALUE => $User->EmailAddress);
-
-
-</%INIT>
index 3e8e3f9..4f8d8ed 100644 (file)
@@ -1,8 +1,14 @@
-%# BEGIN LICENSE BLOCK
+%# {{{ BEGIN BPS TAGGED BLOCK
 %# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
+%#                                          <jesse@bestpractical.com>
 %# 
-%# (Except where explictly superceded by other copyright notices)
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
 %# 
 %# This work is made available to you under the terms of Version 2 of
 %# the GNU General Public License. A copy of that license should have
 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 %# General Public License for more details.
 %# 
-%# Unless otherwise specified, all modifications, corrections or
-%# extensions to this work which alter its source code become the
-%# property of Best Practical Solutions, LLC when submitted for
-%# inclusion in the work.
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# 
+%# 
+%# 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 LICENSE BLOCK
+%# }}} END BPS TAGGED BLOCK
 SPAN.nav {  font-family: Verdana, Arial, Helvetica, sans-serif;
         font-size: 12px;
 %#      color: #FFFFFF;
@@ -151,6 +173,22 @@ SPAN.nav {  font-family: Verdana, Arial, Helvetica, sans-serif;
         vertical-align: top;
         text-align: right;
          }
+.overdue {
+        color: red;
+}
+
+div.messagebody {
+    padding: 2em; 
+
+}
+
+
+div.downloadattachment {
+    font size: 10px;
+    text-align: right;
+
+}
+
 
 td {  font-family: Verdana, Arial, Helvetica, sans-serif;
         font-size: 11px;
@@ -202,12 +240,18 @@ UL.topnav LI :focus { text-decoration: underline; }
 
 TD.mainbody {
         padding-top: 0.5em;
-        padding-left: 0em;
+        padding-left: 1em;
         padding-right: 1em;
         margin-left: 1em;
         margin-right: 1em;
 }
 
+td.boxcontainer + td.boxcontainer {
+       margin-left: 1em;
+       padding-left: 1em;
+       border-collapse: collapse;
+}
+
 th.ticketheader { font-size: 80%;
      font-weight: bold;
      color: #336699;
@@ -318,12 +362,18 @@ span.title { font-size: 1.6em;
            }
 span.productname { font-size: 2em;
              color: #0066cc;}
-SPAN.titleboxtitle {
-        font-size: 1.1em;
+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;
@@ -380,10 +430,14 @@ ul.topnav {
        margin-bottom:0;
 }
 
+%# 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->header_out('Expires' ,'+30m');
+$r->headers_out->{'Expires'} = '+30m';
 </%init>
diff --git a/rt/html/Search/Elements/PickRestriction b/rt/html/Search/Elements/PickRestriction
deleted file mode 100644 (file)
index ff9b86b..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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
-<FORM ACTION="<%$RT::WebPath%>/Search/Listing.html" METHOD="GET">
-<INPUT TYPE=HIDDEN NAME="Bookmark" VALUE="<% $session{'tickets'}->FreezeLimits()%>">
-<& /Elements/TitleBoxStart, title => loc('Refine search')&>
-<INPUT TYPE=HIDDEN NAME="CompileRestriction" VALUE=1>
-
-<ul>
-<li><&|/l&>Owner is</&>  <& /Elements/SelectBoolean, Name => "OwnerOp", 
-                                         TrueVal=> '=', 
-                                         FalseVal => '!=' 
-&> 
-<& /Elements/SelectOwner, Name => "ValueOfOwner" &>
-
-<li>
-<& /Elements/SelectWatcherType, Name => "WatcherRole", AllowNull => 0 &>
-<&|/l&>email address</&> 
-<& /Elements/SelectMatch, Name => "WatcherRoleOp" &>
-<INPUT Name="ValueOfWatcherRole" SIZE=20>
-
-<li>
-<&|/l&>Subject</&> <& /Elements/SelectMatch, Name => "SubjectOp" &> 
-<INPUT Name="ValueOfSubject" SIZE=20>
-
-<li><&|/l&>Queue</&>  <& /Elements/SelectBoolean,  Name => "QueueOp" , 
-                                       True => loc("is"), 
-                                       False => loc("isn't"), 
-                                       TrueVal=> '=', 
-                                       FalseVal => '!=' &>
-<& /Elements/SelectQueue, Name => "ValueOfQueue" &>
-
-
-<li><&|/l&>Priority</&> <& /Elements/SelectEqualityOperator, Name => "PriorityOp" &>
-
-<INPUT Name="ValueOfPriority" SIZE=5>
-
-<li>
-<& /Elements/SelectDateType, Name => 'DateType' &>
-<& /Elements/SelectDateRelation, Name=>"DateOp" &>
-<& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &>
-
-<li><&|/l&>Ticket attachment</&> 
-
-<& /Elements/SelectAttachmentField, Name => 'AttachmentField' &>
-<& /Elements/SelectBoolean, Name => "AttachmentFieldOp", 
-                           True => loc("matches"), 
-                           False => loc("does not match"), 
-                           TrueVal => 'LIKE', 
-                           FalseVal => 'NOT LIKE' 
-&> 
-<Input Name="ValueOfAttachmentField" Size=20>
-
-<li><&|/l&>Status</&> 
-<& /Elements/SelectBoolean, Name => "StatusOp", 
-                           True => loc("is"), 
-                           False => loc("isn't"), 
-                           TrueVal=> '=', 
-                           FalseVal => '!=' 
-&>  
-<& /Elements/SelectStatus, Name => "ValueOfStatus", SkipDeleted => 1 &>
-
-
-% while ( my $CustomField = $CustomFields->Next ) {
-
-<li><% $CustomField->Name %> 
-        <& /Elements/SelectCustomFieldOperator, Name => "CustomFieldOp". $CustomField->id, 
-                                    True => loc("is"), 
-                                    False => loc("isn't"), 
-                                    TrueVal=> '=', FalseVal => '!=' &>
-
-<& /Elements/SelectCustomFieldValue, Name => "CustomField".$CustomField->id,
-                            CustomField => $CustomField,
-                            &>
-% }
-
-</UL>
-
-<& /Elements/TitleBoxEnd &>
-
-<& /Elements/TitleBoxStart, title => loc('Ordering and sorting')&>
-
-<UL>
-
-<li><&|/l&>Results per page</&> <& /Elements/SelectResultsPerPage, Name => "RowsPerPage", 
-                                                       Default => $session{'tickets_rows_per_page'} || '50'
-&>
-
-<li><&|/l&>Sort results by</&> <& /Elements/SelectTicketSortBy, Name => "TicketsSortBy", 
-                                                    Default => $session{'tickets_sort_by'} 
-&> 
-<& /Elements/SelectSortOrder, Name => 'TicketsSortOrder', Default => $session{'tickets_sort_order'} &>
-
-<li><input type="checkbox" name="HideResults" <%$ARGS{'HideResults'} && 'CHECKED'%>> <&|/l&>Don't show search results</&>
-<li><& /Elements/Refresh, Name => 'RefreshSearchInterval' , Default => $session{'tickets_refresh_interval'} &>
-
-</UL>
-
-
-</DIV>
-
-
-
-<& /Elements/TitleBoxEnd &>
-
-<& /Elements/Submit, Label => loc('Search'), Name => 'Action'&>
-
-</FORM>
-
-
- <%INIT>
-my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'});
- foreach ( $session{'tickets'}->RestrictionValues('Queue') ) {
-        # Gotta load up the $queue object, since queues get stored by name now.
-        my $queue = RT::Queue->new($session{'CurrentUser'});
-        $queue->Load($_);
-        $CustomFields->LimitToQueue($queue->Id);
- }
-
- $CustomFields->LimitToGlobal();
-
-</%INIT>
diff --git a/rt/html/Search/Elements/TicketHeader b/rt/html/Search/Elements/TicketHeader
deleted file mode 100644 (file)
index ed2f60e..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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
-<TR>
-<& TicketHeaderCell , Attribute => 'id', Header => '#'&>
-<& TicketHeaderCell , Attribute => 'Subject'&>
-<& TicketHeaderCell , Attribute => 'Status'&>
-<& TicketHeaderCell , Attribute => 'Queue'&>
-<& TicketHeaderCell , Attribute => 'Owner'&>
-<& TicketHeaderCell , Attribute => 'Priority'&>
-</TR>
-<TR>
-<TH class="ticketheader">&nbsp;</TH>
-<& TicketHeaderCell , Attribute => 'Requestor(s)'&>
-<& TicketHeaderCell , Attribute => 'Created'&>
-<& TicketHeaderCell , Attribute => 'Told', Header => 'Last Contact'&>
-<& TicketHeaderCell , Attribute => 'LastUpdated', Header => 'Last Updated'&>
-<& TicketHeaderCell , Attribute => 'TimeLeft', Header => 'Left'&>
-</TR>
-%# loc('Last Notified');
diff --git a/rt/html/Search/Elements/TicketHeaderCell b/rt/html/Search/Elements/TicketHeaderCell
deleted file mode 100644 (file)
index 5def9ea..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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
-<%INIT> 
-my ($order,$curorder);
- $Attribute =~ s/Obj->(Name|AsString|AgeAsString)//g;
-  if ($session{'tickets_sort_order'} =~ /^asc$/i) {
-   $order = 'DESC';
-   $curorder = 'ASC';
- } else {
-   $order = 'ASC';
-   $curorder = 'DESC';
- }
-$Header = $Attribute unless ($Header);
-
-</%INIT>
-<th class="ticketheader">
-% if (grep (/^$Attribute$/i, $session{'tickets'}->SortFields)) {
-<A 
-% if ($Attribute eq $session{'tickets_sort_by'}) {
-class="currenttab"
-HREF="<% $RT::WebPath%>/Search/Listing.html?Bookmark=<%$session{'tickets'}->FreezeLimits()|u%>&TicketsSortBy=<%$Attribute%>&TicketsSortOrder=<%$order%>&RowsPerPage=<%$session{'tickets_rows_per_page'}%>">
-% } else {
-HREF="<% $RT::WebPath%>/Search/Listing.html?Bookmark=<%$session{'tickets'}->FreezeLimits()|u%>&TicketsSortBy=<%$Attribute%>&TicketsSortOrder=<%$curorder%>&RowsPerPage=<%$session{'tickets_rows_per_page'}%>">
-% }
-<% loc($Header) %>
-</A>
-% } else {
-<% loc($Header) %>
-% }
-</th>
-<%ARGS>
-$Header => undef
-$Attribute => undef 
-</%ARGS>
diff --git a/rt/html/Search/Elements/TicketRow b/rt/html/Search/Elements/TicketRow
deleted file mode 100644 (file)
index 5d1ad20..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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
-<SPAN class="search">
-<TR
-% if ($i%2) {
-CLASS="oddline"
-% } else {
-CLASS="evenline"
-% }
->
-<TD ROWSPAN="2"><B><A HREF="<%$RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->Id%>"><%$Ticket->id%></a></B></TD>
-<TD><B><A HREF="<%$RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Subject%></a></B></TD>
-<TD><%loc($Ticket->Status)%></TD>
-<TD><%$Ticket->QueueObj->Name%></TD>
-<TD><%$Ticket->Owner == $RT::Nobody->Id ? loc('Nobody') : $Ticket->OwnerObj->Name%></TD>
-<TD><%$Ticket->Priority%></TD>
-</TR>
-<TR
-% if ($i%2) {
-CLASS="oddline"
-% } else {
-CLASS="evenline"
-% }
-><TD><small><%$Ticket->Requestors->MemberEmailAddressesAsString%></small></TD>
-<TD><SMALL><%$Ticket->CreatedObj->AgeAsString || '-'%></SMALL></TD>
-<TD><SMALL><%$Ticket->ToldObj->AgeAsString || '-'%></SMALL></TD>
-<TD><SMALL><%$Ticket->LastUpdatedObj->AgeAsString || '-'%></SMALL></TD>
-<TD><SMALL><%$Ticket->TimeLeft%></SMALL></TD>
-</TR>
-</SPAN>
-<%ARGS>
-$Ticket => undef
-$i => undef
-</%ARGS>
diff --git a/rt/html/Search/Listing.html b/rt/html/Search/Listing.html
deleted file mode 100644 (file)
index 68b1fd7..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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 => $title, Refresh => $session{'tickets_refresh_interval'} &>
-<& /Ticket/Elements/Tabs, 
-    current_tab => 'Search/Listing.html', 
-    Title => $title &>
-
-%if ($ticketcount && !  $ARGS{'HideResults'}) {
-<TABLE WIDTH=100% border=0 cellpadding=2 CELLSPACING=0>
-<& Elements/TicketHeader, %ARGS &>
-% my $i;
-%while (my $Ticket = $session{'tickets'}->Next) {
-% $i++;
-<& Elements/TicketRow, Ticket => $Ticket, i=> $i, %ARGS &>
-%}
-</TABLE>
-<div align=center>
-<font size=2>
-<a href="<%$RT::WebPath%>/Search/Listing.html?GotoPage=1"><&|/l&>First page</&></a>
-&nbsp;&nbsp;
-%  if ( $session{'tickets'}->FirstRow >= $session{'tickets_rows_per_page'}-1 ) {
-<a href="<%$RT::WebPath%>/Search/Listing.html?GotoPage=Prev">&lt;<&|/l&>Previous page</&></a>
-&nbsp;&nbsp;
-%  }                                                                           
-%  if ( $session{'tickets'}->FirstRow + $session{'tickets_rows_per_page'} < $ticketcount ) {                                                               
-<a href="<%$RT::WebPath%>/Search/Listing.html?GotoPage=Next"><&|/l&>Next page</&>&gt;</a>
-%  }
-%#&nbsp;&nbsp;<form method=get action="<%$RT::WebPath%>/Search/Listing.html"><&|/l&>Goto page</&> <input name=GotoPage size=2></form>
-</font>
-</div>
-<!--<div align=right>-->
-<table width="100%" border=0 cellpadding=3 CELLSPACING=1>
-<tr>
-<td align=left>
-(<&|/l, ($session{'tickets'}->FirstRow+1), ($session{'tickets'}->FirstRow() + $session{'tickets'}->RowsPerPage()  ) &>[_1] - [_2] shown</&>)
-</td>
-<td align=right>
-
-<a href="<%$RT::WebPath%>/Search/Bulk.html"><&|/l&>Update all these tickets at once</&></a>
-<!--</div>-->
-</td>
-</tr>
-</table>
-
-% }
-<TABLE WIDTH="100%">
-<TR>
-<TD VALIGN="TOP">
-<& /Elements/TitleBoxStart, title => loc('Current search criteria')&>
-
-%my %restrictions=$session{'tickets'}->DescribeRestrictions();
-%foreach my $row (keys %restrictions){
-<%$restrictions{"$row"}%> <A HREF="<% $RT::WebPath %>/Search/Listing.html?DeleteRestriction=<%$row%>">[<&|/l&>delete</&>]</a><br>
-%}
-<BR>
-<BR>
-<A HREF="<% $RT::WebPath%>/Search/Listing.html?Bookmark=<%$session{'tickets'}->FreezeLimits()|nu%>&TicketsSortBy=<%$session{'tickets_sort_by'}%>&TicketsSortOrder=<%$session{'tickets_sort_order'}%>&RowsPerPage=<%$session{'tickets_rows_per_page'}%>"><&|/l&>Bookmarkable URL for this search</&></a>
-<& /Elements/TitleBoxEnd&>
-</TD>
-<TD>
-
-<& Elements/PickRestriction, %ARGS &>
-
-</TD>
-</TR>
-</TABLE>
-
-<%INIT>
-
-my ($title, $ticketcount);
-$session{'i'}++;
-if ($session{'tickets'}) {
-    if ($ARGS{'DeleteRestriction'}) {
-           $session{'tickets'}->DeleteRestriction($ARGS{'DeleteRestriction'});
-    }
-    if ( ($ARGS{'ClearRestrictions'}) || ($ARGS{'NewSearch'}) ) {
-           $session{'tickets'}->ClearRestrictions;
-           $session{'tickets'}->CleanSlate;
-       }       
-}
-   ProcessSearchQuery(ARGS=>\%ARGS);
-   $session{'tickets'}->RedoSearch();
-   if ( $session{'tickets'}->DescribeRestrictions()) {
-       $ticketcount = $session{tickets}->CountAll();
-        $title = loc('Found [quant,_1,ticket]', $ticketcount);
-    } else {
-        $title = loc("Find tickets");
-   }
-</%INIT>
-<%CLEANUP>
-$session{'tickets'}->PrepForSerialization();
-</%CLEANUP>
diff --git a/rt/html/Ticket/Elements/EditLinks b/rt/html/Ticket/Elements/EditLinks
deleted file mode 100644 (file)
index bdb8a6b..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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
-<TABLE width=100%>
-  <TR>
-    <TD VALIGN=TOP WIDTH=50%>
-      <h3><&|/l&>Current Relationships</&></h3>
-
-<table>
-  <tr>
-    <td></td>
-    <td><i><&|/l&>(Check box to delete)</&></i></td>
-  </tr>
-  <tr>
-    <td class="labeltop"><&|/l&>Depends on</&>:</td>
-    <td class="value">
-% while (my $link = $Ticket->DependsOn->Next) {
-      <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>">
-        <& ShowLink, URI => $link->TargetURI &><br>
-% }
-    </td>
-  </tr>
-  <tr>
-    <td class="labeltop"><&|/l&>Depended on by</&>:</td>
-    <td class="value">
-% while (my $link = $Ticket->DependedOnBy->Next) {
-% my $member = $link->BaseObj;
-      <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-">
-        <& ShowLink, URI => $link->BaseURI &><br>
-% }
-    </td>
-  </tr>
-  <tr>
-    <td class="labeltop"><&|/l&>Parents</&>:</td>
-    <td class="value">
-% while (my $link = $Ticket->MemberOf->Next) {
-      <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>">
-        <& ShowLink, URI => $link->TargetURI &><br>
-% }
-    </td>
-  </tr>
-  <tr>
-    <td class="labeltop"><&|/l&>Children</&>:</td>
-    <td class="value">
-% while (my $link = $Ticket->Members->Next) {
-      <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-">
-        <& ShowLink, URI => $link->BaseURI &><br>
-% }
-    </td>
-  </tr>
-  <tr>
-    <td class="labeltop"><&|/l&>Refers to</&>:</td>
-    <td class="value">
-% while (my $link = $Ticket->RefersTo->Next) {
-      <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>">
-        <& ShowLink, URI => $link->TargetURI &><br>
-%}
-    </td>
-  </tr>
-  <tr>
-    <td class="labeltop"><&|/l&>Referred to by</&>:</td>
-    <td class="value">
-% while (my $link = $Ticket->ReferredToBy->Next) {
-      <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-">
-        <& ShowLink, URI => $link->BaseURI &><br>
-% }
-    </td>
-  </tr>
-</table>
-                           
-</TD>
-<TD VALIGN=TOP>
-<h3><&|/l&>New Relationships</&></h3>
-<i><&|/l&>Enter tickets or URIs to link tickets to. Seperate multiple entries with spaces.</&></i><br>
-<TABLE>
-  <TR>
-    <TD class="label"><&|/l&>Merge into</&>:</TD>
-    <TD class="entry"><input name="<%$Ticket->Id%>-MergeInto"> <i><&|/l&>(only one ticket)</&></i></TD>
-  </TR>
-  <TR>
-    <TD class="label"><&|/l&>Depends on</&>:</TD>
-    <TD class="entry"><input name="<%$Ticket->Id%>-DependsOn"></TD>
-  </TR>
-  <TR>
-    <TD class="label"><&|/l&>Depended on by</&>:</TD>
-    <TD class="entry"><input name="DependsOn-<%$Ticket->Id%>"></TD>
-  </TR>
-  <TR>
-    <TD class="label"><&|/l&>Parents</&>:</TD>
-    <TD class="entry"><input name="<%$Ticket->Id%>-MemberOf"></TD>
-  </TR>
-  <TR>
-    <TD class="label"><&|/l&>Children</&>:</TD>
-    <TD class="entry"> <input name="MemberOf-<%$Ticket->Id%>"></TD>
-  </TR>
-  <TR>
-    <TD class="label"><&|/l&>Refers to</&>:</TD>
-    <TD class="entry"><input name="<%$Ticket->Id%>-RefersTo"></TD>
-  </TR>
-  <TR>
-    <TD class="label"><&|/l&>Referred to by</&>:</TD>
-    <TD class="entry"> <input name="RefersTo-<%$Ticket->Id%>"></TD>
-  </TR>
-</TABLE>
-</TD>
-</TR>
-</TABLE>
-
-
-      
-<%ARGS>
-$Ticket => undef
-</%ARGS>
diff --git a/rt/html/Ticket/Elements/ShowLink b/rt/html/Ticket/Elements/ShowLink
deleted file mode 100644 (file)
index 493fd95..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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
-<A href="<%$URI->Resolver->HREF%>">
-% if ($URI->IsLocal) {
-% my $member = $URI->Object;
-% if (UNIVERSAL::isa($member, "RT::Ticket")) {
-<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<% loc($member->Status) %>]
-% } elsif ( UNIVERSAL::can($member, 'Name')) {
-<%$URI->Resolver->AsString%>: <%$member->Name%>
-% } else {
-<%$URI->Resolver->AsString%>
-% }
-% } else {
-<%$URI->Resolver->AsString%>
-% }
-</a>
-<%ARGS>
-$URI => undef
-</%ARGS>
diff --git a/rt/html/Ticket/Elements/ShowLinks b/rt/html/Ticket/Elements/ShowLinks
deleted file mode 100644 (file)
index f88a600..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@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
-<table>
-  <tr>
-    <td class="labeltop"><&|/l&>Depends on</&>:</td>
-    <td class="value">
-<ul>
-% while (my $Link = $Ticket->DependsOn->Next) {
-<li><& ShowLink, URI => $Link->TargetURI &>
-% }
-</ul>
-    </td>
-  </tr>
-  <tr>
-    <td class="labeltop"><&|/l&>Depended on by</&>:</td>
-    <td class="value">
-<ul>
-% while (my $Link = $Ticket->DependedOnBy->Next) {
-<li><& ShowLink, URI => $Link->BaseURI &>
-% }
-</ul>
-    </td>
-  </tr>
-  <tr>
-    <td class="labeltop"><&|/l&>Parents</&>:</td>
-    <td class="value">
-<ul>
-% while (my $Link = $Ticket->MemberOf->Next) {
-<li><& ShowLink, URI => $Link->TargetURI &>
-% }
-</ul>
-    </td>
-  </tr>
-  <tr>
-    <td class="labeltop"><&|/l&>Children</&>:</td>
-    <td class="value"><& /Ticket/Elements/ShowMembers, Ticket => $Ticket &></td>
-  </tr>
-  <tr>
-    <td class="labeltop"><&|/l&>Refers to</&>:</td>
-    <td class="value">
-<ul>
-% while (my $Link = $Ticket->RefersTo->Next) {
-<li><& ShowLink, URI => $Link->TargetURI &>
-% }
-</ul>
-    </td>
-  </tr>
-  <tr>
-    <td class="labeltop"><&|/l&>Referred to by</&>:</td>
-    <td class="value">
-    <ul>
-% while (my $Link = $Ticket->ReferredToBy->Next) {
-<li><& ShowLink, URI => $Link->BaseURI &>
-% }
-</ul>
-    </td>
-  </tr>
-
-% # Allow people to add more rows to the table                                                                                                                           
-%  $m->comp('/Elements/Callback', %ARGS );
-
-</table>
-
-<%ARGS>
-$Ticket => undef
-</%ARGS>
index 1b9f629..f3775ea 100644 (file)
@@ -1,8 +1,14 @@
-%# BEGIN LICENSE BLOCK
+%# {{{ BEGIN BPS TAGGED BLOCK
 %# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
+%#                                          <jesse@bestpractical.com>
 %# 
-%# (Except where explictly superceded by other copyright notices)
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
 %# 
 %# This work is made available to you under the terms of Version 2 of
 %# the GNU General Public License. A copy of that license should have
 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 %# General Public License for more details.
 %# 
-%# Unless otherwise specified, all modifications, corrections or
-%# extensions to this work which alter its source code become the
-%# property of Best Practical Solutions, LLC when submitted for
-%# inclusion in the work.
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# 
+%# 
+%# 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 LICENSE BLOCK
+%# }}} END BPS TAGGED BLOCK
       <TABLE WIDTH="100%" class="ticketsummary" >
       <TR>
-       <TD VALIGN=TOP WIDTH="50%">
+       <TD VALIGN=TOP WIDTH="50%" class="boxcontainer">
          <& /Elements/TitleBoxStart, title => loc('The Basics'), 
                title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, 
                title_class=> 'inverse',  
@@ -58,7 +80,7 @@
 
        <BR>
        </TD>
-       <TD VALIGN=TOP WIDTH="50%">
+       <TD VALIGN=TOP WIDTH="50%" class="boxcontainer">
 
          <& /Elements/TitleBoxStart, title => loc("Dates"),
                title_href =>"$RT::WebPath/Ticket/ModifyDates.html?id=".$Ticket->Id, 
          <& /Ticket/Elements/ShowDates, Ticket => $Ticket &>
          <& /Elements/TitleBoxEnd &>
        <BR>  
-         <& /Elements/TitleBoxStart, title => loc('Relationships'), 
+         <& /Elements/TitleBoxStart, title => loc('Links'), 
                title_href => "$RT::WebPath/Ticket/ModifyLinks.html?id=".$Ticket->Id, 
                title_class=> 'inverse',  
                titleright => '', color=> "#336633" &>
-               <& /Ticket/Elements/ShowLinks, Ticket => $Ticket &>
+               <& /Elements/ShowLinks, Ticket => $Ticket &>
        <& /Elements/TitleBoxEnd &>
         <BR>
          <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &>
index 26b2527..64fa131 100644 (file)
@@ -1,8 +1,14 @@
-%# BEGIN LICENSE BLOCK
+%# {{{ BEGIN BPS TAGGED BLOCK
 %# 
-%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
+%#                                          <jesse@bestpractical.com>
 %# 
-%# (Except where explictly superceded by other copyright notices)
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
 %# 
 %# This work is made available to you under the terms of Version 2 of
 %# the GNU General Public License. A copy of that license should have
 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 %# General Public License for more details.
 %# 
-%# Unless otherwise specified, all modifications, corrections or
-%# extensions to this work which alter its source code become the
-%# property of Best Practical Solutions, LLC when submitted for
-%# inclusion in the work.
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# 
+%# 
+%# 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 LICENSE BLOCK
+%# }}} END BPS TAGGED BLOCK
 <& /Elements/Callback, Ticket => $Ticket, actions=> $actions, tabs => $tabs, %ARGS &>
 <& /Elements/Tabs, 
     tabs => $tabs, 
 <%INIT>
 
 my $tabs = {};
-my $current_toptab = "Search/Listing.html",
-    my $searchtabs = { new => { title => loc('New Search'),
-                                path => 'Search/Listing.html?ClearRestrictions=1'}
-                        
-
-} ;
+my $current_toptab = "Search/Build.html",
+my $searchtabs = {};
 my $actions;
 
 if ( $Ticket) {
@@ -55,7 +73,7 @@ if ( defined $session{'tickets'} ) {
                $session{'tickets'}->PrepForSerialization();
         }
 
-        # Don't $current_toptab = display prev links if we're on the first ticket
+        # Don't display prev links if we're on the first ticket
         if ($item_map->{$Ticket->Id}->{prev}) {
                 $searchtabs->{'_a'} = {
                             class => "nav",
@@ -162,10 +180,33 @@ if (    $Ticket->CurrentUserHasRight('ModifyTicket')
     };
 }
 }
-$tabs->{"g"} = { path      => 'Search/Listing.html',
-                 title     => loc('Search'),
-                 separator => 1,
-                 subtabs   => $searchtabs };
+
+my $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'},
+    Rows    => $ARGS{'Rows'},
+  ) if ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'});
+
+$tabs->{"f"} = { path      => "Search/Build.html?NewQuery=1",
+                 title     => loc('New Query')};
+$tabs->{"g"} = { path      => "Search/Build.html$args",
+                 title     => loc('Query Builder')};
+$tabs->{"h"} = { path      => "Search/Edit.html$args",
+                 title     => loc('Advanced'),
+                 separator => 1 };
+if (defined $session{'tickets'} and $session{'tickets'}->Count) {
+  $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";
+  }
+}
+
 </%INIT>
 
   
index 0b9a107..9d8fd2e 100644 (file)
@@ -1,9 +1,15 @@
 #!@PERL@ -w
-# BEGIN LICENSE BLOCK
+# {{{ BEGIN BPS TAGGED BLOCK
 # 
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
+# COPYRIGHT:
+#  
+# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
+#                                          <jesse@bestpractical.com>
 # 
-# (Except where explictly superceded by other copyright notices)
+# (Except where explicitly superseded by other copyright notices)
+# 
+# 
+# LICENSE:
 # 
 # This work is made available to you under the terms of Version 2 of
 # the GNU General Public License. A copy of that license should have
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 # General Public License for more details.
 # 
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 # 
 # 
-# END LICENSE BLOCK
-
+# CONTRIBUTION SUBMISSION POLICY:
+# 
+# (The following paragraph is not intended to limit the rights granted
+# to you to modify and distribute this software under the terms of
+# the GNU General Public License and is only of importance to you if
+# you choose to contribute your changes and enhancements to the
+# community by submitting them to Best Practical Solutions, LLC.)
+# 
+# By intentionally submitting any modifications, corrections or
+# derivatives to this work, or any other work intended for use with
+# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+# you are the copyright holder for those contributions and you grant
+# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+# royalty-free, perpetual, license to use, copy, create derivative
+# works based on those contributions, and sublicense and distribute
+# those contributions and any derivatives thereof.
+# 
+# }}} END BPS TAGGED BLOCK
 use strict;
 use vars qw($PROMPT $VERSION $Handle $Nobody $SystemUser $item);
 use vars
@@ -87,10 +108,30 @@ if ( $args{'action'} eq 'init' ) {
         print "...skipped as ".$args{'dba'} ." is not " . $RT::DatabaseUser . " or we're working with Oracle.\n";
     }
 
-    $dbh->disconnect;
-    $dbh = DBI->connect( $Handle->DSN, $args{'dba'}, $args{'dba-password'} )
-      || die $DBI::errstr;
+    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") {
+            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") {
+            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') {
 
+        $dbh->disconnect;
+        $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";
@@ -114,7 +155,7 @@ elsif ( $args{'action'} eq 'insert_initial' ) {
     insert_initial_data();
 }
 elsif ( $args{'action'} eq 'insert' ) {
-    insert_data( $args{'datafile'} );
+    insert_data( $args{'datafile'} || ($args{'datadir'}."/content"));
 }
 elsif ($args{'action'} eq 'acl') {
     $dbh = DBI->connect( $Handle->DSN, $args{'dba'}, $args{'dba-password'} )
@@ -277,6 +318,10 @@ sub insert_acl {
         do $base_path . "/acl.mysql"
           || die "Couldn't find ACLS for mysql in " . $RT::EtcPath . "\n" . $@;
     }
+    elsif ( $RT::DatabaseType =~ /^Sybase$/i ) {
+        do $base_path . "/acl.Sybase"
+          || die "Couldn't find ACLS for Sybase in " . $RT::EtcPath . "\n" . $@;
+    }
     elsif ( $RT::DatabaseType =~ /^informix$/i ) {
         do $base_path . "/acl.Informix"
           || die "Couldn't find ACLS for Informix in " . $RT::EtcPath . "\n" . $@;
@@ -339,7 +384,7 @@ sub insert_initial_data {
     #Put together a current user object so we can create a User object
     my $CurrentUser = new RT::CurrentUser();
 
-    print "Checking for existing system user ($CurrentUser)...";
+    print "Checking for existing system user...";
     my $test_user = RT::User->new($CurrentUser);
     $test_user->Load('RT_System');
     if ( $test_user->id ) {
@@ -367,7 +412,7 @@ sub insert_initial_data {
         exit(1);
     }
     print "done.\n";
-    $RT::Handle->Disconnect();
+    $RT::Handle->Disconnect() unless ($RT::DatabaseType eq 'SQLite');
 
 }
 
@@ -566,7 +611,7 @@ sub insert_data {
         }
         print "done.\n";
     }
-    $RT::Handle->Disconnect();
+    $RT::Handle->Disconnect() unless ($RT::DatabaseType eq 'SQLite');
 
 }