From e81cd66ea62231e89fbd30a95a0e5bdde2292eeb Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 3 Dec 2004 20:51:54 +0000 Subject: [PATCH] landing rt 3.2.2 --- rt/bin/rt-commit-handler.in | 846 ------------------------------- rt/config | 256 ---------- rt/config.pld | 19 - rt/etc/upgrade/2.1.71 | 211 -------- rt/html/Admin/Elements/ModifyQueue | 78 --- rt/html/Admin/Elements/ModifyUser | 99 ---- rt/html/Admin/Users/Prefs.html | 122 ----- rt/html/Elements/Footer | 48 +- rt/html/Elements/Header | 57 ++- rt/html/Elements/PageLayout | 40 +- rt/html/Elements/ShadedBox | 33 -- rt/html/Elements/ShadedInputRow | 35 -- rt/html/Elements/ShadedRow | 31 -- rt/html/Elements/SimpleSearch | 38 +- rt/html/Elements/Tabs | 43 +- rt/html/Elements/ViewUser | 51 -- rt/html/NoAuth/webrt.css | 78 ++- rt/html/Search/Elements/PickRestriction | 142 ------ rt/html/Search/Elements/TicketHeader | 40 -- rt/html/Search/Elements/TicketHeaderCell | 55 -- rt/html/Search/Elements/TicketRow | 55 -- rt/html/Search/Listing.html | 113 ----- rt/html/Ticket/Elements/EditLinks | 133 ----- rt/html/Ticket/Elements/ShowLink | 40 -- rt/html/Ticket/Elements/ShowLinks | 87 ---- rt/html/Ticket/Elements/ShowSummary | 46 +- rt/html/Ticket/Elements/Tabs | 79 ++- rt/sbin/rt-setup-database.in | 77 ++- 28 files changed, 401 insertions(+), 2551 deletions(-) delete mode 100644 rt/bin/rt-commit-handler.in delete mode 100644 rt/config delete mode 100644 rt/config.pld delete mode 100644 rt/etc/upgrade/2.1.71 delete mode 100644 rt/html/Admin/Elements/ModifyQueue delete mode 100644 rt/html/Admin/Elements/ModifyUser delete mode 100644 rt/html/Admin/Users/Prefs.html delete mode 100644 rt/html/Elements/ShadedBox delete mode 100644 rt/html/Elements/ShadedInputRow delete mode 100644 rt/html/Elements/ShadedRow delete mode 100644 rt/html/Elements/ViewUser delete mode 100644 rt/html/Search/Elements/PickRestriction delete mode 100644 rt/html/Search/Elements/TicketHeader delete mode 100644 rt/html/Search/Elements/TicketHeaderCell delete mode 100644 rt/html/Search/Elements/TicketRow delete mode 100644 rt/html/Search/Listing.html delete mode 100644 rt/html/Ticket/Elements/EditLinks delete mode 100644 rt/html/Ticket/Elements/ShowLink delete mode 100644 rt/html/Ticket/Elements/ShowLinks diff --git a/rt/bin/rt-commit-handler.in b/rt/bin/rt-commit-handler.in deleted file mode 100644 index 02b01abff..000000000 --- a/rt/bin/rt-commit-handler.in +++ /dev/null @@ -1,846 +0,0 @@ -#!@PERL@ -w -# BEGIN LICENSE BLOCK -# -# Copyright (c) 1996-2003 Jesse Vincent -# -# (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 = ) { - 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 = ) { - chop $line; # strip the newline - last if ( $line =~ /^Log Message:$/ ); -} -while ( my $line = ) { - 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 = ) { - 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 - Hacked greatly by Greg A. Woods - Rewritten by Charles M. Hannum - -=cut - diff --git a/rt/config b/rt/config deleted file mode 100644 index b9418a66d..000000000 --- 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 index c71c7bbdd..000000000 --- a/rt/config.pld +++ /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 index cb89a3ac3..000000000 --- a/rt/etc/upgrade/2.1.71 +++ /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 index 36f9ce17f..000000000 --- a/rt/html/Admin/Elements/ModifyQueue +++ /dev/null @@ -1,78 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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) &> - -
- - - - - - - - - - - - - - - - - -
-<&|/l&>Queue Name: -
-<&|/l&>Description:
-<&|/l&>Correspondence Address: - - - - -<&|/l&>Comment Address: - -
-<&|/l&>Priority starts at: - - -<&|/l&>Over time, priority moves toward: - -
-<&|/l&>Requests should be due in: - - <&|/l&>days. -
-<& /Elements/Submit, Label => loc('Save Changes') &> -
-<& /Elements/TitleBoxEnd &> - -<%INIT> - - - -<%ARGS> - - -$QueueObj => undef - diff --git a/rt/html/Admin/Elements/ModifyUser b/rt/html/Admin/Elements/ModifyUser deleted file mode 100644 index 2faefefaa..000000000 --- a/rt/html/Admin/Elements/ModifyUser +++ /dev/null @@ -1,99 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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) &> - -
- - -<&|/l&>Name: -
-<&|/l&>New Password:
-<&|/l&>Retype Password:
- -<&|/l&>Comments: - -
-<&|/l&>Signature: -
-<&|/l&>EmailAddress: -
-<&|/l&>FreeformContactInfo: -
-<&|/l&>Organization: -
-<&|/l&>RealName: -
-<&|/l&>NickName: -
-<&|/l&>Lang: -
-<&|/l&>EmailEncoding: -
-<&|/l&>WebEncoding: -
-<&|/l&>ExternalContactInfoId: -
-<&|/l&>ContactInfoSystem: -
-<&|/l&>UnixUsername: -
-<&|/l&>ExternalAuthId: -
-<&|/l&>AuthSystem: -
-<&|/l&>HomePhone: -
-<&|/l&>WorkPhone: -
-<&|/l&>MobilePhone: -
-<&|/l&>PagerPhone: -
-<&|/l&>Address1: -
-<&|/l&>Address2: -
-<&|/l&>City: -
-<&|/l&>State: -
-<&|/l&>Zip: -
-<&|/l&>Country: -
-<& /Elements/Submit, Label => loc('Save Changes') &> -
-<& /Elements/TitleBoxEnd &> - -<%INIT> - - - -<%ARGS> - - -$UserObj => undef - diff --git a/rt/html/Admin/Users/Prefs.html b/rt/html/Admin/Users/Prefs.html deleted file mode 100644 index 0bba9fadd..000000000 --- a/rt/html/Admin/Users/Prefs.html +++ /dev/null @@ -1,122 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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 &> - -

<%loc("User view")%>

- -%if ($session{CurrentUser} && ($session{CurrentUser}->Id == $id)) { - <& /Elements/TitleBoxStart, title => loc('Signature') &> -
-> -

- -
- <& /Elements/TitleBoxEnd &> -
- <&|/l&>Open tickets (from listing) in another window: >
- <&|/l&>Open tickets (from listing) in a new window: >
- -
-%} - - <& /Elements/TitleBoxStart, title => loc('Email') &> -
- - -
- <& /Elements/TitleBoxEnd &> - <& /Elements/TitleBoxStart, title => loc('Real Name') &> -
- - -
- <& /Elements/TitleBoxEnd &> - - <& /Elements/TitleBoxStart, title => loc('User ID') &> -
- - -
- <& /Elements/TitleBoxEnd &> - -%# TODO: alternative email addresses + merging users - -<%ARGS> -$id => $session{CurrentUser} ? $session{CurrentUser}->Id : 0 -$Signature => undef -$Email => undef -$RealName => undef -$Name => undef - - -<%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}; -} -} - - - - - - - - - - - diff --git a/rt/html/Elements/Footer b/rt/html/Elements/Footer index 052bf87e9..12432caaa 100644 --- a/rt/html/Elements/Footer +++ b/rt/html/Elements/Footer @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# %# +%# 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) { @@ -30,7 +52,15 @@ <& /Elements/Callback, %ARGS &> % if ($Debug) { diff --git a/rt/html/Elements/Header b/rt/html/Elements/Header index 38cb4bd6b..e4f613fcc 100644 --- a/rt/html/Elements/Header +++ b/rt/html/Elements/Header @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,14 +20,30 @@ %# 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 +%# <%$Title%> @@ -31,6 +53,19 @@ + +<& /Elements/Callback, _CallbackName => 'Head', %ARGS &> - <%$AppName%> + <%$AppName%> % foreach my $action (sort keys %{$topactions}) { diff --git a/rt/html/Elements/ShadedBox b/rt/html/Elements/ShadedBox deleted file mode 100644 index 36b9cae7c..000000000 --- a/rt/html/Elements/ShadedBox +++ /dev/null @@ -1,33 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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 - - - - - -
<%$title |n %>:<%$content |n %>
-<%ARGS> -$title => undef -$content => " " - diff --git a/rt/html/Elements/ShadedInputRow b/rt/html/Elements/ShadedInputRow deleted file mode 100644 index e9fb69e5f..000000000 --- a/rt/html/Elements/ShadedInputRow +++ /dev/null @@ -1,35 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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 - - <%$title |n %>: - - value="<%$content|h%>" SIZE=<%$size%>> - - -<%ARGS> -$title => undef -$content => " " -$name => undef -$size => undef - diff --git a/rt/html/Elements/ShadedRow b/rt/html/Elements/ShadedRow deleted file mode 100644 index 8947fcd82..000000000 --- a/rt/html/Elements/ShadedRow +++ /dev/null @@ -1,31 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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 - - <%$title |n %>: - <%$content |n %> - -<%ARGS> -$title => undef -$content => " " - diff --git a/rt/html/Elements/SimpleSearch b/rt/html/Elements/SimpleSearch index 85f37403f..213aa7eac 100644 --- a/rt/html/Elements/SimpleSearch +++ b/rt/html/Elements/SimpleSearch @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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
  diff --git a/rt/html/Elements/Tabs b/rt/html/Elements/Tabs index 6791e5062..ee1a4086c 100644 --- a/rt/html/Elements/Tabs +++ b/rt/html/Elements/Tabs @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# %# +%# 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 index 657272496..000000000 --- a/rt/html/Elements/ViewUser +++ /dev/null @@ -1,51 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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 => "id."\">".loc("Tickets from [_1]", $name)."", - titleright=> "id."\">".loc("Comments about [_1]", $name)."" &> - - - - -
-%while (my $w=$tickets->Next) { -<%$w->Id%>: <%$w->Subject%> (<%$w->Status%>)
-%} -
- <% ($User->Comments || loc("No comment entered about this user")) %> -
-<& /Elements/TitleBoxEnd &> - -<%ARGS> -$User=>undef - - -<%INIT> -my $name=$User->RealName || $User->EmailAddress; - -my $tickets = new RT::Tickets($session{'CurrentUser'}); -$tickets->LimitWatcher(TYPE => 'Requestor', VALUE => $User->EmailAddress); - - - diff --git a/rt/html/NoAuth/webrt.css b/rt/html/NoAuth/webrt.css index 3e8e3f928..4f8d8ed5d 100644 --- a/rt/html/NoAuth/webrt.css +++ b/rt/html/NoAuth/webrt.css @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 <%init> $r->content_type('text/css'); -$r->header_out('Expires' ,'+30m'); +$r->headers_out->{'Expires'} = '+30m'; diff --git a/rt/html/Search/Elements/PickRestriction b/rt/html/Search/Elements/PickRestriction deleted file mode 100644 index ff9b86ba5..000000000 --- a/rt/html/Search/Elements/PickRestriction +++ /dev/null @@ -1,142 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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('Refine search')&> - - -
    -
  • <&|/l&>Owner is <& /Elements/SelectBoolean, Name => "OwnerOp", - TrueVal=> '=', - FalseVal => '!=' -&> -<& /Elements/SelectOwner, Name => "ValueOfOwner" &> - -
  • -<& /Elements/SelectWatcherType, Name => "WatcherRole", AllowNull => 0 &> -<&|/l&>email address -<& /Elements/SelectMatch, Name => "WatcherRoleOp" &> - - -
  • -<&|/l&>Subject <& /Elements/SelectMatch, Name => "SubjectOp" &> - - -
  • <&|/l&>Queue <& /Elements/SelectBoolean, Name => "QueueOp" , - True => loc("is"), - False => loc("isn't"), - TrueVal=> '=', - FalseVal => '!=' &> -<& /Elements/SelectQueue, Name => "ValueOfQueue" &> - - -
  • <&|/l&>Priority <& /Elements/SelectEqualityOperator, Name => "PriorityOp" &> - - - -
  • -<& /Elements/SelectDateType, Name => 'DateType' &> -<& /Elements/SelectDateRelation, Name=>"DateOp" &> -<& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &> - -
  • <&|/l&>Ticket attachment - -<& /Elements/SelectAttachmentField, Name => 'AttachmentField' &> -<& /Elements/SelectBoolean, Name => "AttachmentFieldOp", - True => loc("matches"), - False => loc("does not match"), - TrueVal => 'LIKE', - FalseVal => 'NOT LIKE' -&> - - -
  • <&|/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 ) { - -
  • <% $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, - &> -% } - -
- -<& /Elements/TitleBoxEnd &> - -<& /Elements/TitleBoxStart, title => loc('Ordering and sorting')&> - -
    - -
  • <&|/l&>Results per page <& /Elements/SelectResultsPerPage, Name => "RowsPerPage", - Default => $session{'tickets_rows_per_page'} || '50' -&> - -
  • <&|/l&>Sort results by <& /Elements/SelectTicketSortBy, Name => "TicketsSortBy", - Default => $session{'tickets_sort_by'} -&> -<& /Elements/SelectSortOrder, Name => 'TicketsSortOrder', Default => $session{'tickets_sort_order'} &> - -
  • > <&|/l&>Don't show search results -
  • <& /Elements/Refresh, Name => 'RefreshSearchInterval' , Default => $session{'tickets_refresh_interval'} &> - -
- - - - - - -<& /Elements/TitleBoxEnd &> - -<& /Elements/Submit, Label => loc('Search'), Name => 'Action'&> - - - - - <%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(); - - diff --git a/rt/html/Search/Elements/TicketHeader b/rt/html/Search/Elements/TicketHeader deleted file mode 100644 index ed2f60e4e..000000000 --- a/rt/html/Search/Elements/TicketHeader +++ /dev/null @@ -1,40 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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 - -<& TicketHeaderCell , Attribute => 'id', Header => '#'&> -<& TicketHeaderCell , Attribute => 'Subject'&> -<& TicketHeaderCell , Attribute => 'Status'&> -<& TicketHeaderCell , Attribute => 'Queue'&> -<& TicketHeaderCell , Attribute => 'Owner'&> -<& TicketHeaderCell , Attribute => 'Priority'&> - - -  -<& TicketHeaderCell , Attribute => 'Requestor(s)'&> -<& TicketHeaderCell , Attribute => 'Created'&> -<& TicketHeaderCell , Attribute => 'Told', Header => 'Last Contact'&> -<& TicketHeaderCell , Attribute => 'LastUpdated', Header => 'Last Updated'&> -<& TicketHeaderCell , Attribute => 'TimeLeft', Header => 'Left'&> - -%# loc('Last Notified'); diff --git a/rt/html/Search/Elements/TicketHeaderCell b/rt/html/Search/Elements/TicketHeaderCell deleted file mode 100644 index 5def9ea37..000000000 --- a/rt/html/Search/Elements/TicketHeaderCell +++ /dev/null @@ -1,55 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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); - - - -% if (grep (/^$Attribute$/i, $session{'tickets'}->SortFields)) { - -% } else { -HREF="<% $RT::WebPath%>/Search/Listing.html?Bookmark=<%$session{'tickets'}->FreezeLimits()|u%>&TicketsSortBy=<%$Attribute%>&TicketsSortOrder=<%$curorder%>&RowsPerPage=<%$session{'tickets_rows_per_page'}%>"> -% } -<% loc($Header) %> - -% } else { -<% loc($Header) %> -% } - -<%ARGS> -$Header => undef -$Attribute => undef - diff --git a/rt/html/Search/Elements/TicketRow b/rt/html/Search/Elements/TicketRow deleted file mode 100644 index 5d1ad209a..000000000 --- a/rt/html/Search/Elements/TicketRow +++ /dev/null @@ -1,55 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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 - - -<%$Ticket->id%> -<%$Ticket->Subject%> -<%loc($Ticket->Status)%> -<%$Ticket->QueueObj->Name%> -<%$Ticket->Owner == $RT::Nobody->Id ? loc('Nobody') : $Ticket->OwnerObj->Name%> -<%$Ticket->Priority%> - -<%$Ticket->Requestors->MemberEmailAddressesAsString%> -<%$Ticket->CreatedObj->AgeAsString || '-'%> -<%$Ticket->ToldObj->AgeAsString || '-'%> -<%$Ticket->LastUpdatedObj->AgeAsString || '-'%> -<%$Ticket->TimeLeft%> - - -<%ARGS> -$Ticket => undef -$i => undef - diff --git a/rt/html/Search/Listing.html b/rt/html/Search/Listing.html deleted file mode 100644 index 68b1fd75c..000000000 --- a/rt/html/Search/Listing.html +++ /dev/null @@ -1,113 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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'}) { - -<& Elements/TicketHeader, %ARGS &> -% my $i; -%while (my $Ticket = $session{'tickets'}->Next) { -% $i++; -<& Elements/TicketRow, Ticket => $Ticket, i=> $i, %ARGS &> -%} -
-
- -<&|/l&>First page -   -% if ( $session{'tickets'}->FirstRow >= $session{'tickets_rows_per_page'}-1 ) { -<<&|/l&>Previous page -   -% } -% if ( $session{'tickets'}->FirstRow + $session{'tickets_rows_per_page'} < $ticketcount ) { -<&|/l&>Next page> -% } -%#  
<&|/l&>Goto page
-
-
- - - - - - -
-(<&|/l, ($session{'tickets'}->FirstRow+1), ($session{'tickets'}->FirstRow() + $session{'tickets'}->RowsPerPage() ) &>[_1] - [_2] shown) - - -<&|/l&>Update all these tickets at once - -
- -% } - - - - - -
-<& /Elements/TitleBoxStart, title => loc('Current search criteria')&> - -%my %restrictions=$session{'tickets'}->DescribeRestrictions(); -%foreach my $row (keys %restrictions){ -<%$restrictions{"$row"}%> [<&|/l&>delete]
-%} -
-
-<&|/l&>Bookmarkable URL for this search -<& /Elements/TitleBoxEnd&> -
- -<& Elements/PickRestriction, %ARGS &> - -
- -<%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"); - } - -<%CLEANUP> -$session{'tickets'}->PrepForSerialization(); - diff --git a/rt/html/Ticket/Elements/EditLinks b/rt/html/Ticket/Elements/EditLinks deleted file mode 100644 index bdb8a6b7d..000000000 --- a/rt/html/Ticket/Elements/EditLinks +++ /dev/null @@ -1,133 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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 - - - - - -
-

<&|/l&>Current Relationships

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<&|/l&>(Check box to delete)
<&|/l&>Depends on: -% while (my $link = $Ticket->DependsOn->Next) { - - <& ShowLink, URI => $link->TargetURI &>
-% } -
<&|/l&>Depended on by: -% while (my $link = $Ticket->DependedOnBy->Next) { -% my $member = $link->BaseObj; - - <& ShowLink, URI => $link->BaseURI &>
-% } -
<&|/l&>Parents: -% while (my $link = $Ticket->MemberOf->Next) { - - <& ShowLink, URI => $link->TargetURI &>
-% } -
<&|/l&>Children: -% while (my $link = $Ticket->Members->Next) { - - <& ShowLink, URI => $link->BaseURI &>
-% } -
<&|/l&>Refers to: -% while (my $link = $Ticket->RefersTo->Next) { - - <& ShowLink, URI => $link->TargetURI &>
-%} -
<&|/l&>Referred to by: -% while (my $link = $Ticket->ReferredToBy->Next) { - - <& ShowLink, URI => $link->BaseURI &>
-% } -
- -
-

<&|/l&>New Relationships

-<&|/l&>Enter tickets or URIs to link tickets to. Seperate multiple entries with spaces.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<&|/l&>Merge into: <&|/l&>(only one ticket)
<&|/l&>Depends on:
<&|/l&>Depended on by:
<&|/l&>Parents:
<&|/l&>Children:
<&|/l&>Refers to:
<&|/l&>Referred to by:
-
- - - -<%ARGS> -$Ticket => undef - diff --git a/rt/html/Ticket/Elements/ShowLink b/rt/html/Ticket/Elements/ShowLink deleted file mode 100644 index 493fd95a5..000000000 --- a/rt/html/Ticket/Elements/ShowLink +++ /dev/null @@ -1,40 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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 - -% 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%> -% } - -<%ARGS> -$URI => undef - diff --git a/rt/html/Ticket/Elements/ShowLinks b/rt/html/Ticket/Elements/ShowLinks deleted file mode 100644 index f88a6008d..000000000 --- a/rt/html/Ticket/Elements/ShowLinks +++ /dev/null @@ -1,87 +0,0 @@ -%# BEGIN LICENSE BLOCK -%# -%# Copyright (c) 1996-2003 Jesse Vincent -%# -%# (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 - - - - - - - - - - - - - - - - - - - - - - - - - - -% # Allow people to add more rows to the table -% $m->comp('/Elements/Callback', %ARGS ); - -
<&|/l&>Depends on: -
    -% while (my $Link = $Ticket->DependsOn->Next) { -
  • <& ShowLink, URI => $Link->TargetURI &> -% } -
-
<&|/l&>Depended on by: -
    -% while (my $Link = $Ticket->DependedOnBy->Next) { -
  • <& ShowLink, URI => $Link->BaseURI &> -% } -
-
<&|/l&>Parents: -
    -% while (my $Link = $Ticket->MemberOf->Next) { -
  • <& ShowLink, URI => $Link->TargetURI &> -% } -
-
<&|/l&>Children:<& /Ticket/Elements/ShowMembers, Ticket => $Ticket &>
<&|/l&>Refers to: -
    -% while (my $Link = $Ticket->RefersTo->Next) { -
  • <& ShowLink, URI => $Link->TargetURI &> -% } -
-
<&|/l&>Referred to by: -
    -% while (my $Link = $Ticket->ReferredToBy->Next) { -
  • <& ShowLink, URI => $Link->BaseURI &> -% } -
-
- -<%ARGS> -$Ticket => undef - diff --git a/rt/html/Ticket/Elements/ShowSummary b/rt/html/Ticket/Elements/ShowSummary index 1b9f62908..f3775eacf 100644 --- a/rt/html/Ticket/Elements/ShowSummary +++ b/rt/html/Ticket/Elements/ShowSummary @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,16 +20,32 @@ %# 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/TitleBoxStart, title => loc('The Basics'), title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, title_class=> 'inverse', @@ -58,7 +80,7 @@
+ <& /Elements/TitleBoxStart, title => loc("Dates"), title_href =>"$RT::WebPath/Ticket/ModifyDates.html?id=".$Ticket->Id, @@ -67,11 +89,11 @@ <& /Ticket/Elements/ShowDates, Ticket => $Ticket &> <& /Elements/TitleBoxEnd &>
- <& /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 &>
<& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &> diff --git a/rt/html/Ticket/Elements/Tabs b/rt/html/Ticket/Elements/Tabs index 26b252707..64fa13165 100644 --- a/rt/html/Ticket/Elements/Tabs +++ b/rt/html/Ticket/Elements/Tabs @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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, @@ -31,12 +53,8 @@ <%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"; + } +} + diff --git a/rt/sbin/rt-setup-database.in b/rt/sbin/rt-setup-database.in index 0b9a1071a..9d8fd2ee0 100644 --- a/rt/sbin/rt-setup-database.in +++ b/rt/sbin/rt-setup-database.in @@ -1,9 +1,15 @@ #!@PERL@ -w -# BEGIN LICENSE BLOCK +# {{{ BEGIN BPS TAGGED BLOCK # -# Copyright (c) 1996-2003 Jesse Vincent +# COPYRIGHT: +# +# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +# # -# (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 @@ -15,14 +21,29 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # -# Unless otherwise specified, all modifications, corrections or -# extensions to this work which alter its source code become the -# property of Best Practical Solutions, LLC when submitted for -# inclusion in the work. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # -# END LICENSE BLOCK - +# CONTRIBUTION SUBMISSION POLICY: +# +# (The following paragraph is not intended to limit the rights granted +# to you to modify and distribute this software under the terms of +# the GNU General Public License and is only of importance to you if +# you choose to contribute your changes and enhancements to the +# community by submitting them to Best Practical Solutions, LLC.) +# +# By intentionally submitting any modifications, corrections or +# derivatives to this work, or any other work intended for use with +# Request Tracker, to Best Practical Solutions, LLC, you confirm that +# you are the copyright holder for those contributions and you grant +# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +# royalty-free, perpetual, license to use, copy, create derivative +# works based on those contributions, and sublicense and distribute +# those contributions and any derivatives thereof. +# +# }}} END BPS TAGGED BLOCK 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'); } -- 2.11.0