Commit 24c38861 authored by Jesse Vincent's avatar Jesse Vincent
Browse files

cleanups to the upgrade porcess

parent 93d625ab
......@@ -22,8 +22,6 @@
#
#
# END LICENSE BLOCK
#
# DO NOT HAND-EDIT the file named 'Makefile'. This file is autogenerated.
# Have a look at "configure" and "Makefile.in" instead
......
......@@ -202,8 +202,10 @@ upgrade-instruct:
@echo "Congratulations. RT has been upgraded. You should now check-over"
@echo "$(CONFIG_FILE) for any necessary site customization. Additionally,"
@echo "you should update RT's system database objects by running "
@echo " $(RT_SBIN_PATH)/rt-update-database <version>"
@echo "where <version> is the version of RT you're upgrading from."
@echo " ls etc/upgrade"
@echo "For each file in that directory whose name is greater than"
@echo "your previously installed RT version, run:"
@echo " $(RT_SBIN_PATH)/rt-setup-database --action insert --datafile etc/upgrade/<version>"
upgrade: dirs upgrade-noclobber upgrade-instruct
......
......@@ -22,8 +22,6 @@
#
#
# END LICENSE BLOCK
RT is an enterprise-grade issue tracking system. [it needs more description
here before 3.0.0]
......
#! /bin/sh
# From configure.ac Revision: 1.1 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.54 for RT 2.1.70.
# Generated by GNU Autoconf 2.54 for RT 2.1.71.
#
# Report bugs to <rt-3.0-bugs@fsck.com>.
#
......@@ -266,8 +266,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='RT'
PACKAGE_TARNAME='rt'
PACKAGE_VERSION='2.1.70'
PACKAGE_STRING='RT 2.1.70'
PACKAGE_VERSION='2.1.71'
PACKAGE_STRING='RT 2.1.71'
PACKAGE_BUGREPORT='rt-3.0-bugs@fsck.com'
ac_unique_file="lib/RT.pm.in"
......@@ -725,7 +725,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures RT 2.1.70 to adapt to many kinds of systems.
\`configure' configures RT 2.1.71 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -782,7 +782,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of RT 2.1.70:";;
short | recursive ) echo "Configuration of RT 2.1.71:";;
esac
cat <<\_ACEOF
......@@ -882,7 +882,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
RT configure 2.1.70
RT configure 2.1.71
generated by GNU Autoconf 2.54
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
......@@ -897,7 +897,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by RT $as_me 2.1.70, which was
It was created by RT $as_me 2.1.71, which was
generated by GNU Autoconf 2.54. Invocation command line was
$ $0 $@
......@@ -1209,7 +1209,7 @@ rt_version_major=2
rt_version_minor=1
rt_version_patch=70
rt_version_patch=71
test "x$rt_version_major" = 'x' && rt_version_major=0
test "x$rt_version_minor" = 'x' && rt_version_minor=0
......@@ -1843,7 +1843,7 @@ RT_LOG_PATH=${exp_logfiledir}
ac_config_files="$ac_config_files sbin/rt-setup-database sbin/rt-test-dependencies Makefile etc/RT_Config.pm lib/RT.pm lib/t/00smoke.t lib/t/01harness.t lib/t/02regression.t lib/t/03web.pl sbin/insert_approval_scrips bin/mason_handler.fcgi bin/mason_handler.svc bin/rt-commit-handler bin/rt-crontool bin/rt-mailgate bin/webmux.pl"
ac_config_files="$ac_config_files sbin/rt-setup-database sbin/rt-test-dependencies Makefile etc/RT_Config.pm lib/RT.pm lib/t/00smoke.t lib/t/01harness.t lib/t/02regression.t lib/t/03web.pl bin/mason_handler.fcgi bin/mason_handler.svc bin/rt-commit-handler bin/rt-crontool bin/rt-mailgate bin/webmux.pl"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
......@@ -2231,7 +2231,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by RT $as_me 2.1.70, which was
This file was extended by RT $as_me 2.1.71, which was
generated by GNU Autoconf 2.54. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -2285,7 +2285,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
RT config.status 2.1.70
RT config.status 2.1.71
configured by $0, generated by GNU Autoconf 2.54,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
......@@ -2384,7 +2384,6 @@ do
"lib/t/01harness.t" ) CONFIG_FILES="$CONFIG_FILES lib/t/01harness.t" ;;
"lib/t/02regression.t" ) CONFIG_FILES="$CONFIG_FILES lib/t/02regression.t" ;;
"lib/t/03web.pl" ) CONFIG_FILES="$CONFIG_FILES lib/t/03web.pl" ;;
"sbin/insert_approval_scrips" ) CONFIG_FILES="$CONFIG_FILES sbin/insert_approval_scrips" ;;
"bin/mason_handler.fcgi" ) CONFIG_FILES="$CONFIG_FILES bin/mason_handler.fcgi" ;;
"bin/mason_handler.svc" ) CONFIG_FILES="$CONFIG_FILES bin/mason_handler.svc" ;;
"bin/rt-commit-handler" ) CONFIG_FILES="$CONFIG_FILES bin/rt-commit-handler" ;;
......@@ -2791,11 +2790,6 @@ s,@INSTALL@,$ac_INSTALL,;t t
chmod +x sbin/rt-test-dependencies
chmod +x bin/rt-mailgate
;;
sbin/insert_approval_scrips ) chmod +x configure
chmod +x sbin/rt-setup-database
chmod +x sbin/rt-test-dependencies
chmod +x bin/rt-mailgate
;;
bin/mason_handler.fcgi ) chmod +x configure
chmod +x sbin/rt-setup-database
chmod +x sbin/rt-test-dependencies
......
......@@ -6,7 +6,7 @@ AC_REVISION($Revision: 1.1 $)dnl
dnl Setup autoconf
AC_PREREQ(2.53)
AC_INIT(RT, [2.1.70], [rt-3.0-bugs@fsck.com])
AC_INIT(RT, [2.1.71], [rt-3.0-bugs@fsck.com])
AC_CONFIG_SRCDIR([lib/RT.pm.in])
dnl Extract RT version number components
......@@ -185,7 +185,6 @@ AC_CONFIG_FILES([
lib/t/01harness.t
lib/t/02regression.t
lib/t/03web.pl
sbin/insert_approval_scrips
bin/mason_handler.fcgi
bin/mason_handler.svc
bin/rt-commit-handler
......
# Initial data for a fresh RT3 Installation.
@Users = (
@Users = (
{ Name => 'Nobody',
RealName => 'Nobody in particular',
Comments => 'Do not delete or modify this user. It is integral '
......@@ -15,7 +15,7 @@
Comments => 'SuperUser',
Privileged => '1', } );
@Groups = (
@Groups = (
{ Name => '',
Type => 'Everyone', # loc
Domain => 'SystemInternal',
......@@ -59,17 +59,20 @@
Description => 'Pseudogroup for internal use', # loc
}, );
@Queues = ( { Name => 'General',
Description => 'The default queue',
CorrespondAddress => "",
CommentAddress => "", }, );
@Queues = ({ Name => 'General',
Description => 'The default queue',
CorrespondAddress => "",
CommentAddress => "", },
{ Name => '___Approvals',
Description => 'A system-internal queue for the approvals system',
Disabled => 2, } );
@ScripActions = (
@ScripActions = (
{ Name => 'Autoreply To Requestors', # loc
{ Name => 'Autoreply To Requestors', # loc
Description =>
'Always sends a message to the requestors independent of message sender'
, # loc
, # loc
ExecModule => 'Autoreply',
Argument => 'Requestor' },
{ Name => 'Notify Requestors', # loc
......@@ -125,13 +128,12 @@
{ Name => 'Create Tickets', # loc
Description =>
'Create new tickets based on this scrip\'s template', # loc
ExecModule => 'CreateTickets', },
{ Name => 'Open Tickets',
Description => 'Open tickets on correspondence', # loc
ExecModule => 'AutoOpen' },
);
ExecModule => 'CreateTickets', },
{ Name => 'Open Tickets',
Description => 'Open tickets on correspondence', # loc
ExecModule => 'AutoOpen' }, );
@ScripConditions = (
@ScripConditions = (
{ Name => 'On Create', # loc
Description => 'When a ticket is created', # loc
ApplicableTransTypes => 'Create',
......@@ -191,12 +193,11 @@
ApplicableTransTypes => 'Any',
ExecModule => 'UserDefined'
},
},
);
);
@Templates = (
@Templates = (
{ Queue => '0',
Name => 'Blank', # loc
Description => 'A blank template', # loc
......@@ -253,7 +254,7 @@ Transaction: {$Transaction->Description}
{
Queue => '0',
Name => 'Admin Correspondence', # loc
Name => 'Admin Correspondence', # loc
Description => 'Default admin correspondence template', # loc
Content => '
......@@ -272,7 +273,7 @@ Transaction: {$Transaction->Description}
},
{ Queue => '0',
Name => 'Admin Comment', # loc
Name => 'Admin Comment', # loc
Description => 'Default admin comment template', # loc
Content =>
'Subject: [Comment] {my $s=($Transaction->Subject||$Ticket->Subject); $s =~ s/\\[Comment\\]//g; $comment =~ s/^Re//i; $s;}
......@@ -286,7 +287,7 @@ This is a comment. It is not sent to the Requestor(s):
},
{ Queue => '0',
Name => 'Status Change', # loc
Name => 'Status Change', # loc
Description => 'Ticket status changed', # loc
Content => 'Subject: Status Changed to: {$Transaction->NewValue}
......@@ -307,7 +308,28 @@ This is a comment. It is not sent to the Requestor(s):
According to our records, your request has been resolved. If you have any
further questions or concerns, please respond to this message.
'
} );
},
{ 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()}
'
}, );
# }}}
@Scrips = (
{ ScripCondition => 'On Correspond',
......@@ -337,14 +359,144 @@ further questions or concerns, please respond to this message.
{ 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', },
);
@ACL = (
{ UserId => 'Nobody', # - principalId
@ACL = (
{ UserId => 'Nobody', # - principalId
Right => 'OwnTicket', },
{ UserId => 'root', # - principalid
{ UserId => 'root', # - principalid
Right => 'SuperUser', },
);
@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' },
);
#This drags in RT's config.pm
# {{{ Queues
my $approvals_queue = RT::Queue->new($CurrentUser);
unless ($approvals_queue->Id) {
my ($val, $msg) = $approvals_queue->Create(
@Queues = ( {
Name => '___Approvals',
Description => 'A system-internal queue for the approvals system',
Disabled => 2,
);
Description => 'A system-internal queue for the approvals system',
Disabled => 2,
}
);
unless ($val) {
warn $msg . "\n";
}
}
# {{{ 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()}
'
},
);
# }}}
# {{{ Scrips
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' },
my @scrips = (
{
Description => "When an approval ticket is created, notify the Owner and AdminCc of the item awaiting their approval", # loc
Queue => $approvals_queue->Id,
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_queue->Id,
Queue => '___Approvals',
ScripCondition => 'On Status Change',
ScripAction => 'User Defined',
CustomCommitCode => q[
......@@ -73,11 +129,11 @@ return 1;
# ------------------------------------------------------------------- #
],
CustomPrepareCode => '1',
Template => 'AdminComment',
Template => 'Admin Comment',
},
{
Description => "When a ticket has been approved by any approver, add correspondence to the original ticket", # loc
Queue => $approvals_queue->Id,
Queue => '___Approvals',
ScripCondition => 'On Resolve',
ScripAction => 'User Defined',
CustomPrepareCode => 'return(1);',
......@@ -99,11 +155,11 @@ foreach my $obj ($self->TicketObj->AllDependedOnBy( Type => 'ticket' )) {
return 1;
# ------------------------------------------------------------------- #
],
Template => 'AdminComment'
Template => 'Admin Comment'
},
{
Description => "When a ticket has been approved by all approvers, add correspondence to the original ticket", # loc
Queue => $approvals_queue->Id,
Queue => '___Approvals',
ScripCondition => 'On Resolve',
ScripAction => 'User Defined',
CustomPrepareCode => 'return(1);',
......@@ -147,36 +203,9 @@ while (my $link = $links->Next) {
return 1;
# ------------------------------------------------------------------- #
],
Template => 'AdminComment',
},
);
# }}}
# {{{ Templates
my @templates = (
{
Queue => $approvals_queue->Id,
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()}
'
Template => 'Admin Comment',
},
);
# }}}
1;
%# BEGIN LICENSE BLOCK
%#
%# Copyright (c) 1996-2002 Jesse Vincent <jesse@bestpractical.com>
%#
%# (Except where explictly superceded by other copyright notices)
%#
%# This work is made available to you under the terms of Version 2 of