diff options
Diffstat (limited to 'rt/etc')
-rw-r--r-- | rt/etc/RT_Config.pm | 109 | ||||
-rw-r--r-- | rt/etc/RT_Config.pm.in | 97 | ||||
-rw-r--r-- | rt/etc/RT_SiteConfig.pm | 40 | ||||
-rw-r--r-- | rt/etc/acl.Oracle | 12 | ||||
-rwxr-xr-x | rt/etc/acl.Pg | 109 | ||||
-rwxr-xr-x | rt/etc/acl.mysql | 27 | ||||
-rw-r--r-- | rt/etc/rt.spec | 137 | ||||
-rw-r--r-- | rt/etc/schema.Oracle | 399 | ||||
-rwxr-xr-x | rt/etc/schema.Pg | 1 | ||||
-rwxr-xr-x | rt/etc/schema.mysql | 463 | ||||
-rwxr-xr-x | rt/etc/schema.mysql-4.1 | 1 | ||||
-rw-r--r-- | rt/etc/upgrade/2.1.71 | 211 |
12 files changed, 181 insertions, 1425 deletions
diff --git a/rt/etc/RT_Config.pm b/rt/etc/RT_Config.pm index 67d131319..b20140d3d 100644 --- a/rt/etc/RT_Config.pm +++ b/rt/etc/RT_Config.pm @@ -104,7 +104,7 @@ Valid types are "mysql", "Oracle" and "Pg" =cut -Set($DatabaseType , 'mysql'); +Set($DatabaseType , 'Pg'); =item C<$DatabaseHost>, C<$DatabaseRTHost> @@ -133,7 +133,7 @@ The name of the database user (inside the database) =cut -Set($DatabaseUser , 'rt_user'); +Set($DatabaseUser , 'freeside'); =item C<$DatabasePassword> @@ -141,7 +141,7 @@ Password the C<$DatabaseUser> should use to access the database =cut -Set($DatabasePassword , 'rt_pass'); +Set($DatabasePassword , ''); =item C<$DatabaseName> @@ -150,7 +150,7 @@ it's SID, DB objects are created in L<$DatabaseUser>'s schema. =cut -Set($DatabaseName , 'rt3'); +Set($DatabaseName , 'freeside'); =item C<$DatabaseRequireSSL> @@ -284,11 +284,6 @@ regular expression that matches all addresses used by your RT. This lets RT avoid sending mail to itself. It will also hide RT addresses from the list of "One-time Cc" and Bcc lists on ticket reply. -If you have a number of addresses configured in your RT database already, you -can generate a naive first pass regexp by using - - perl etc/upgrade/generate-rtaddressregexp - =cut Set($RTAddressRegexp , undef); @@ -320,6 +315,24 @@ F<RT/User_Local.pm> Set($CanonicalizeOnCreate, 0); +=item C<$SenderMustExistInExternalDatabase> + +If C<$SenderMustExistInExternalDatabase> is true, RT will refuse to +create non-privileged accounts for unknown users if you are using +the C<$LookupSenderInExternalDatabase> option. +Instead, an error message will be mailed and RT will forward the +message to C<$RTOwner>. + +If you are not using C<$LookupSenderInExternalDatabase>, this option +has no effect. + +If you define an AutoRejectRequest template, RT will use this +template for the rejection message. + +=cut + +Set($SenderMustExistInExternalDatabase , undef); + =item C<$ValidateUserEmailAddresses> If C<$ValidateUserEmailAddresses> is true, RT will refuse to create users with @@ -375,11 +388,6 @@ or 'qmail'. Note that you should remove the '-t' from C<$SendmailArguments> if you use 'sendmail' rather than 'sendmailpipe' -For testing purposes, or to simply disable sending mail out into the world, you -can set C<$MailCommand> to 'testfile' which writes all mail to a temporary -file. RT will log the location of the temporary file so you can extract mail -from it afterwards. - =cut Set($MailCommand , 'sendmailpipe'); @@ -399,11 +407,8 @@ Set($SetOutgoingMailFrom, 0); =item C<$OverrideOutgoingMailFrom> C<$OverrideOutgoingMailFrom> is used for overwriting the Correspond -address of the queue as it is handed to sendmail -f. This helps force -the From_ header away from www-data or other email addresses that show -up in the "Sent by" line in Outlook. - -The option is a hash reference of queue name to email address. +address of the queue. The option is a hash reference of queue name to +email address. If there is no ticket involved, then the value of the C<Default> key will be used. @@ -611,7 +616,7 @@ Set($UseFriendlyToLine, 0); =item C<$FriendlyToLineFormat> -C<sprintf()> format of the friendly 'To:' header; its arguments +C<sprintf()> format of the friendly 'From:' header; its arguments are WatcherType and TicketId. =cut @@ -733,7 +738,7 @@ NOTE that options with '-' character MUST be quoted. =cut Set(%GnuPGOptions, - homedir => 'var/data/gpg', + homedir => '/opt/rt3/var/data/gpg', # URL of a keyserver # keyserver => 'hkp://subkeys.pgp.net', @@ -787,7 +792,7 @@ direct file logging. =cut Set($LogToFile , undef); -Set($LogDir, 'var/log'); +Set($LogDir, '/opt/rt3/var/log'); Set($LogToFileNamed , "rt.log"); #log to rt.log =item C<$LogStackTraces> @@ -841,6 +846,9 @@ RT ships with several themes by default: 3.4-compat A 3.4 compatibility stylesheet to make RT look (mostly) like 3.4 +This bundled distibution of RT also includes (enabled by default): + freeside2.1 Integration with Freeside + This value actually specifies a directory in F<share/html/NoAuth/css/> from which RT will try to load the file main.css (which should @import any other files the stylesheet needs). This allows you to @@ -849,7 +857,7 @@ option can be overridden by users in their preferences. =cut -Set($WebDefaultStylesheet, 'web2'); +Set($WebDefaultStylesheet, 'freeside2.1'); =item C<$UsernameFormat> @@ -860,7 +868,7 @@ EmailAddress. =cut -Set($UsernameFormat, 'concise'); +Set($UsernameFormat, 'verbose'); =item C<$WebDomain> @@ -982,7 +990,7 @@ login if you change it. =cut -Set($WebNoAuthRegex, qr{^ (?:/+NoAuth/ | /+REST/\d+\.\d+/NoAuth/) }x ); +Set($WebNoAuthRegex, qr{^ /rt (?:/+NoAuth/ | /+REST/\d+\.\d+/NoAuth/) }x ); =item C<$SelfServiceRegex> @@ -1097,16 +1105,6 @@ displayed in kilobytes. If set to C<'b'>, then sizes will be bytes. Set($AttachmentUnits, undef); -=item C<$EditCustomFieldsSingleColumn> - -When displaying a list of Ticket Custom Fields for editing, RT defaults -to a 2 column list. If you set this to 1, it will instead display the -Custom Fields in a single column. - -=cut - -Set($EditCustomFieldsSingleColumn, 0); - =item C<$RedistributeAutoGeneratedMessages> Should RT redistribute correspondence that it identifies as @@ -1287,29 +1285,6 @@ search results in RT. Choose from [0, 120, 300, 600, 1200, 3600, 7200]. Set($SearchResultsRefreshInterval, 0); -=item C<$ResolveDefaultUpdateType> - -Set the default Update Type when clicking the Resolve link in the Ticket -links tab. - - Comment Comments (Not sent to requestors) - Respond Reply to requestors - -=cut - -Set($ResolveDefaultUpdateType, 'Comment'); - -=item C<$SuppressAutoOpenOnUpdate> - -When users click Comment or Reply on a new ticket in the web UI, the default -status for the ticket gets set to 'open' if the status is currently 'new'. -Setting this option to 1 will suppress that behavior and leave the default -status as 'new'. This option can be overridden by users in their preferences. - -=cut - -Set($SuppressAutoOpenOnUpdate, 0); - =item C<$OldestTransactionsFirst> By default, RT shows newest transactions at the bottom of the ticket @@ -1371,7 +1346,7 @@ customized homepage ("RT at a glance"). =cut -Set($HomepageComponents, [qw(QuickCreate Quicksearch MyAdminQueues MySupportQueues MyReminders RefreshHomepage Dashboards)]); +Set($HomepageComponents, [qw(QuickCreate Quicksearch MyCalendar MyAdminQueues MySupportQueues MyReminders RefreshHomepage Dashboards)]); =item C<@MasonParameters> @@ -1395,6 +1370,7 @@ C<$DefaultSearchResultFormat> is the default format for RT search results Set ($DefaultSearchResultFormat, qq{ '<B><A HREF="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></B>/TITLE:#', '<B><A HREF="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></B>/TITLE:Subject', + Customer, Status, QueueName, OwnerName, @@ -1402,6 +1378,7 @@ Set ($DefaultSearchResultFormat, qq{ '__NEWLINE__', '', '<small>__Requestors__</small>', + '', '<small>__CreatedRelative__</small>', '<small>__ToldRelative__</small>', '<small>__LastUpdatedRelative__</small>', @@ -1504,14 +1481,12 @@ Set( =item C<$ChartsTimezonesInDB> -RT stores dates using the UTC timezone in the DB, so charts grouped +Dates are stored using UTC timezone in the DB, so charts groupped by dates and time are not representative. Set C<$ChartsTimezonesInDB> -to a true value to enable timezone conversions using your DB's -capabilities. You may need to do some work on the DB side to use this +to a true value to enable timezones conversions using DB's +capabilities. You may need to do some work on DB side to use this feature, read more in F<docs/timezones_in_charts.pod>. -At this time, this feature only applies to MySQL and PostgreSQL. - =cut Set( $ChartsTimezonesInDB, 0 ); @@ -1694,7 +1669,7 @@ Set($AmbiguousDayInFuture, 0); =head1 Approval Configuration -Configuration for the approval system +Configration for the approvl system =over 4 @@ -1773,7 +1748,7 @@ custom field values from external sources at runtime. =cut -Set(@CustomFieldValuesSources, ()); +Set(@CustomFieldValuesSources, ('RT::CustomFieldValues::Queues')); =item C<$CanonicalizeRedirectURLs> @@ -1805,7 +1780,7 @@ C<Set(@Plugins, (qw(Extension::QuickDelete RT::FM)));> =cut -Set(@Plugins, ()); +Set(@Plugins, qw( RTx::Calendar )); #RTx::Checklist )); =back diff --git a/rt/etc/RT_Config.pm.in b/rt/etc/RT_Config.pm.in index ea64a2e01..1755f5455 100644 --- a/rt/etc/RT_Config.pm.in +++ b/rt/etc/RT_Config.pm.in @@ -284,11 +284,6 @@ regular expression that matches all addresses used by your RT. This lets RT avoid sending mail to itself. It will also hide RT addresses from the list of "One-time Cc" and Bcc lists on ticket reply. -If you have a number of addresses configured in your RT database already, you -can generate a naive first pass regexp by using - - perl etc/upgrade/generate-rtaddressregexp - =cut Set($RTAddressRegexp , undef); @@ -320,6 +315,24 @@ F<RT/User_Local.pm> Set($CanonicalizeOnCreate, 0); +=item C<$SenderMustExistInExternalDatabase> + +If C<$SenderMustExistInExternalDatabase> is true, RT will refuse to +create non-privileged accounts for unknown users if you are using +the C<$LookupSenderInExternalDatabase> option. +Instead, an error message will be mailed and RT will forward the +message to C<$RTOwner>. + +If you are not using C<$LookupSenderInExternalDatabase>, this option +has no effect. + +If you define an AutoRejectRequest template, RT will use this +template for the rejection message. + +=cut + +Set($SenderMustExistInExternalDatabase , undef); + =item C<$ValidateUserEmailAddresses> If C<$ValidateUserEmailAddresses> is true, RT will refuse to create users with @@ -375,11 +388,6 @@ or 'qmail'. Note that you should remove the '-t' from C<$SendmailArguments> if you use 'sendmail' rather than 'sendmailpipe' -For testing purposes, or to simply disable sending mail out into the world, you -can set C<$MailCommand> to 'testfile' which writes all mail to a temporary -file. RT will log the location of the temporary file so you can extract mail -from it afterwards. - =cut Set($MailCommand , 'sendmailpipe'); @@ -399,11 +407,8 @@ Set($SetOutgoingMailFrom, 0); =item C<$OverrideOutgoingMailFrom> C<$OverrideOutgoingMailFrom> is used for overwriting the Correspond -address of the queue as it is handed to sendmail -f. This helps force -the From_ header away from www-data or other email addresses that show -up in the "Sent by" line in Outlook. - -The option is a hash reference of queue name to email address. +address of the queue. The option is a hash reference of queue name to +email address. If there is no ticket involved, then the value of the C<Default> key will be used. @@ -611,7 +616,7 @@ Set($UseFriendlyToLine, 0); =item C<$FriendlyToLineFormat> -C<sprintf()> format of the friendly 'To:' header; its arguments +C<sprintf()> format of the friendly 'From:' header; its arguments are WatcherType and TicketId. =cut @@ -841,6 +846,9 @@ RT ships with several themes by default: 3.4-compat A 3.4 compatibility stylesheet to make RT look (mostly) like 3.4 +This bundled distibution of RT also includes (enabled by default): + freeside2.1 Integration with Freeside + This value actually specifies a directory in F<share/html/NoAuth/css/> from which RT will try to load the file main.css (which should @import any other files the stylesheet needs). This allows you to @@ -849,7 +857,7 @@ option can be overridden by users in their preferences. =cut -Set($WebDefaultStylesheet, 'web2'); +Set($WebDefaultStylesheet, 'freeside2.1'); =item C<$UsernameFormat> @@ -860,7 +868,7 @@ EmailAddress. =cut -Set($UsernameFormat, 'concise'); +Set($UsernameFormat, 'verbose'); =item C<$WebDomain> @@ -982,7 +990,7 @@ login if you change it. =cut -Set($WebNoAuthRegex, qr{^ (?:/+NoAuth/ | /+REST/\d+\.\d+/NoAuth/) }x ); +Set($WebNoAuthRegex, qr{^ /rt (?:/+NoAuth/ | /+REST/\d+\.\d+/NoAuth/) }x ); =item C<$SelfServiceRegex> @@ -1097,16 +1105,6 @@ displayed in kilobytes. If set to C<'b'>, then sizes will be bytes. Set($AttachmentUnits, undef); -=item C<$EditCustomFieldsSingleColumn> - -When displaying a list of Ticket Custom Fields for editing, RT defaults -to a 2 column list. If you set this to 1, it will instead display the -Custom Fields in a single column. - -=cut - -Set($EditCustomFieldsSingleColumn, 0); - =item C<$RedistributeAutoGeneratedMessages> Should RT redistribute correspondence that it identifies as @@ -1287,29 +1285,6 @@ search results in RT. Choose from [0, 120, 300, 600, 1200, 3600, 7200]. Set($SearchResultsRefreshInterval, 0); -=item C<$ResolveDefaultUpdateType> - -Set the default Update Type when clicking the Resolve link in the Ticket -links tab. - - Comment Comments (Not sent to requestors) - Respond Reply to requestors - -=cut - -Set($ResolveDefaultUpdateType, 'Comment'); - -=item C<$SuppressAutoOpenOnUpdate> - -When users click Comment or Reply on a new ticket in the web UI, the default -status for the ticket gets set to 'open' if the status is currently 'new'. -Setting this option to 1 will suppress that behavior and leave the default -status as 'new'. This option can be overridden by users in their preferences. - -=cut - -Set($SuppressAutoOpenOnUpdate, 0); - =item C<$OldestTransactionsFirst> By default, RT shows newest transactions at the bottom of the ticket @@ -1371,7 +1346,7 @@ customized homepage ("RT at a glance"). =cut -Set($HomepageComponents, [qw(QuickCreate Quicksearch MyAdminQueues MySupportQueues MyReminders RefreshHomepage Dashboards)]); +Set($HomepageComponents, [qw(QuickCreate Quicksearch MyCalendar MyAdminQueues MySupportQueues MyReminders RefreshHomepage Dashboards)]); =item C<@MasonParameters> @@ -1395,6 +1370,7 @@ C<$DefaultSearchResultFormat> is the default format for RT search results Set ($DefaultSearchResultFormat, qq{ '<B><A HREF="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></B>/TITLE:#', '<B><A HREF="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></B>/TITLE:Subject', + Customer, Status, QueueName, OwnerName, @@ -1402,6 +1378,7 @@ Set ($DefaultSearchResultFormat, qq{ '__NEWLINE__', '', '<small>__Requestors__</small>', + '', '<small>__CreatedRelative__</small>', '<small>__ToldRelative__</small>', '<small>__LastUpdatedRelative__</small>', @@ -1504,14 +1481,12 @@ Set( =item C<$ChartsTimezonesInDB> -RT stores dates using the UTC timezone in the DB, so charts grouped +Dates are stored using UTC timezone in the DB, so charts groupped by dates and time are not representative. Set C<$ChartsTimezonesInDB> -to a true value to enable timezone conversions using your DB's -capabilities. You may need to do some work on the DB side to use this +to a true value to enable timezones conversions using DB's +capabilities. You may need to do some work on DB side to use this feature, read more in F<docs/timezones_in_charts.pod>. -At this time, this feature only applies to MySQL and PostgreSQL. - =cut Set( $ChartsTimezonesInDB, 0 ); @@ -1694,7 +1669,7 @@ Set($AmbiguousDayInFuture, 0); =head1 Approval Configuration -Configuration for the approval system +Configration for the approvl system =over 4 @@ -1773,7 +1748,7 @@ custom field values from external sources at runtime. =cut -Set(@CustomFieldValuesSources, ()); +Set(@CustomFieldValuesSources, ('RT::CustomFieldValues::Queues')); =item C<$CanonicalizeRedirectURLs> @@ -1805,7 +1780,7 @@ C<Set(@Plugins, (qw(Extension::QuickDelete RT::FM)));> =cut -Set(@Plugins, ()); +Set(@Plugins, (qw(RTx::Calendar))); #RTx::Checklist )); =back diff --git a/rt/etc/RT_SiteConfig.pm b/rt/etc/RT_SiteConfig.pm index 1661e4d6e..e55f4fc70 100644 --- a/rt/etc/RT_SiteConfig.pm +++ b/rt/etc/RT_SiteConfig.pm @@ -14,6 +14,44 @@ # # perl -c /path/to/your/etc/RT_SiteConfig.pm -Set( $rtname, 'example.com'); +#Set( $rtname, 'example.com'); + +# These settings should have been inserted by the initial Freeside install. +# Sometimes you may want to change domain, timezone, or freeside::URL later, +# everything else should probably stay untouched. + +Set($rtname, '%%%RT_DOMAIN%%%'); +Set($Organization, '%%%RT_DOMAIN%%%'); + +Set($Timezone, '%%%RT_TIMEZONE%%%'); + +Set($WebExternalAuth, 1); +Set($WebFallbackToInternal, 1); #no +Set($WebExternalAuto, 1); + +$RT::URI::freeside::IntegrationType = 'Internal'; +$RT::URI::freeside::URL = '%%%FREESIDE_URL%%%'; + +$RT::URI::freeside::URL =~ m(^(https?://[^/]+)(/.*)$)i; +Set($WebBaseURL, $1); +Set($WebPath, "$2/rt"); + +Set($DatabaseHost , ''); + +# These settings are user-editable. + +Set($WebDefaultStylesheet, 'freeside2.1'); +Set($UsernameFormat, 'verbose'); #back to concise to hide email addresses + +#uncomment to use +#Set($DefaultSummaryRows, 10); + +Set($MessageBoxWidth, 80); +Set($MessageBoxRichTextHeight, 368); + +#redirects to ticket display on quick create +#Set($QuickCreateRedirect, 1); + #Set(@Plugins,(qw(Extension::QuickDelete RT::FM))); + 1; diff --git a/rt/etc/acl.Oracle b/rt/etc/acl.Oracle index 9ca4122a0..c8667c031 100644 --- a/rt/etc/acl.Oracle +++ b/rt/etc/acl.Oracle @@ -1,4 +1,10 @@ - -sub acl { return () } - +sub acl { +return ( +"CREATE USER ${RT::DatabaseUser} identified by ${RT::DatabasePassword}". +"temporary tablespace TEMP" . +"default tablespace USERS" . +"quota unlimited on USERS;" , +"grant connect, resource to ${RT::DatabaseUser};", +"exit;"); +} 1; diff --git a/rt/etc/acl.Pg b/rt/etc/acl.Pg index 8a0d4f28c..16ea71b2d 100755 --- a/rt/etc/acl.Pg +++ b/rt/etc/acl.Pg @@ -1,76 +1,63 @@ - sub acl { my $dbh = shift; my @acls; my @tables = qw ( - attachments_id_seq - Attachments - Attributes - attributes_id_seq - queues_id_seq - Queues - links_id_seq - Links - principals_id_seq - Principals - groups_id_seq - Groups - scripconditions_id_seq - ScripConditions - transactions_id_seq - Transactions - scrips_id_seq - Scrips - acl_id_seq - ACL - groupmembers_id_seq - GroupMembers - cachedgroupmembers_id_seq - CachedGroupMembers - users_id_seq - Users - tickets_id_seq - Tickets - scripactions_id_seq - ScripActions - templates_id_seq - Templates - objectcustomfieldvalues_id_s - ObjectCustomFieldValues - customfields_id_seq - CustomFields - objectcustomfields_id_s - ObjectCustomFields - customfieldvalues_id_seq - CustomFieldValues - sessions - ); - my $db_user = RT->Config->Get('DatabaseUser'); - my $db_pass = RT->Config->Get('DatabasePassword'); + attachments_id_seq + Attachments + queues_id_seq + Queues + links_id_seq + Links + principals_id_seq + Principals + groups_id_seq + Groups + scripconditions_id_seq + ScripConditions + transactions_id_seq + Transactions + scrips_id_seq + Scrips + acl_id_seq + ACL + groupmembers_id_seq + GroupMembers + cachedgroupmembers_id_seq + CachedGroupMembers + users_id_seq + Users + tickets_id_seq + Tickets + scripactions_id_seq + ScripActions + templates_id_seq + Templates + ticketcustomfieldvalues_id_s + TicketCustomFieldValues + customfields_id_seq + CustomFields + customfieldvalues_id_seq + CustomFieldValues + sessions + ); - # if there's already an rt_user, use it. - my @row = $dbh->selectrow_array( "SELECT usename FROM pg_user WHERE usename = '$db_user'" ); - unless ( $row[0] ) { - push @acls, "CREATE USER \"$db_user\" WITH PASSWORD '$db_pass' NOCREATEDB NOCREATEUSER;"; + # if there's already an rt_user, drop it. + my @row = + $dbh->selectrow_array( "select usename from pg_user where usename = '" . $RT::DatabaseUser."'" ); + if ( $row[0] ) { + push @acls, "drop user ${RT::DatabaseUser};",; } - my $sequence_right - = ( $dbh->{pg_server_version} >= 80200 ) - ? "USAGE, SELECT, UPDATE" - : "SELECT, UPDATE"; + push @acls, "create user ${RT::DatabaseUser} with password '${RT::DatabasePassword}' NOCREATEDB NOCREATEUSER;"; foreach my $table (@tables) { - if ( $table =~ /^[a-z]/ && $table ne 'sessions' ) { -# table like objectcustomfields_id_s - push @acls, "GRANT $sequence_right ON $table TO \"$db_user\";" - } - else { - push @acls, "GRANT SELECT, INSERT, UPDATE, DELETE ON $table TO \"$db_user\";" - } + push @acls, + "GRANT SELECT, INSERT, UPDATE, DELETE ON $table to " + . $RT::DatabaseUser . ";"; + } return (@acls); } - 1; diff --git a/rt/etc/acl.mysql b/rt/etc/acl.mysql index 16882378e..0ecaa3b15 100755 --- a/rt/etc/acl.mysql +++ b/rt/etc/acl.mysql @@ -1,25 +1,8 @@ - sub acl { - my $db_name = RT->Config->Get('DatabaseName'); - my $db_rthost = RT->Config->Get('DatabaseRTHost'); - my $db_user = RT->Config->Get('DatabaseUser'); - my $db_pass = RT->Config->Get('DatabasePassword'); - unless ( $db_user ) { - print STDERR "DatabaseUser option is not defined or empty. Skipping...\n"; - return; - } - if ( $db_user eq 'root' ) { - print STDERR "DatabaseUser is root. Skipping...\n"; - return; - } - print "Granting access to $db_user\@'$db_rthost' on $db_name.\n"; - $db_name =~ s/([_%])/\\$1/g; - return ( - "GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE - ON `$db_name`.* - TO '$db_user'\@'$db_rthost' - IDENTIFIED BY '$db_pass';", - ); +return ( +"USE mysql;", +"DELETE FROM user WHERE user = '${RT::DatabaseUser}';", +"DELETE FROM db where db = '${RT::DatabaseName}';", +"GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE ON ${RT::DatabaseName}.* TO ${RT::DatabaseUser}\@${RT::DatabaseRTHost} IDENTIFIED BY '${RT::DatabasePassword}';"); } - 1; diff --git a/rt/etc/rt.spec b/rt/etc/rt.spec deleted file mode 100644 index 14200c1f3..000000000 --- a/rt/etc/rt.spec +++ /dev/null @@ -1,137 +0,0 @@ -Summary: rt Request Tracker - -Name: rt -Version: 2.0.9pre5 -Release: 1 -Group: Applications/Web -Packager: Jesse Vincent <jesse@bestpractical.com> -Vendor: http://www.fsck.com/projects/rt -Requires: perl -Requires: mod_perl > 1.22 -Requires: perl-DBI >= 1.18 -Requires: perl-DBIx-DataSource >= 0.02 -Requires: perl-DBIx-SearchBuilder >= 0.47 -Requires: perl-HTML-Parser -Requires: perl-MLDBM -Requires: perl-libnet -Requires: perl-CGI.pm >= 2.78 -Requires: perl-Params-Validate >= 0.02 -Requires: perl-HTML-Mason >= 0.896 -Requires: perl-libapreq -Requires: perl-Apache-Session >= 1.53 -Requires: perl-MIME-tools >= 5.411 -Requires: perl-MailTools >= 1.20 -Requires: perl-Getopt-Long >= 2.24 -Requires: perl-Tie-IxHash -Requires: perl-TimeDate -Requires: perl-Time-HiRes -Requires: perl-Text-Wrapper -Requires: perl-Text-Template -Requires: perl-File-Spec >= 0.8 -Requires: perl-FreezeThaw -Requires: perl-Storable -Requires: perl-File-Temp -Requires: perl-Log-Dispatch >= 1.6 - -Source: http://www.fsck.com/pub/rt/release/%{name}.tar.gz - -Copyright: GPL -BuildRoot: /var/tmp/rt-root - -%description -RT is an industrial-grade ticketing system. It lets a group -of people intelligently and efficiently manage requests -submitted by a community of users. RT is used by systems -administrators, customer support staffs, NOCs, developers -and even marketing departments at over a thousand sites -around the world. - -%prep -groupadd rt || true -%setup -q -n %{name} - -%build - -%install - -if [ x$RPM_BUILD_ROOT != x ]; then -rm -rf $RPM_BUILD_ROOT -fi - -# -# Perform all the non-site specfic steps whilst building the package -# -make dirs libs-install html-install bin-install DESTDIR=$RPM_BUILD_ROOT -# -# fixperms needs these, so make fake empty files -touch $RPM_BUILD_ROOT/opt/rt2/etc/insertdata $RPM_BUILD_ROOT/opt/rt2/etc/config.pm -make fixperms insert-install WEB_USER=www DESTDIR=$RPM_BUILD_ROOT - -# -# Copy in the files needed again after install -# -mkdir -p $RPM_BUILD_ROOT/opt/rt2/postinstall/bin -cp -rp Makefile etc tools $RPM_BUILD_ROOT/opt/rt2/postinstall -cp -rp bin/initacls.* $RPM_BUILD_ROOT/opt/rt2/postinstall/bin - -# logging in /var/log/rt2 -mkdir -p $RPM_BUILD_ROOT/var/log/rt2 -chown www $RPM_BUILD_ROOT/var/log/rt2 -chgrp rt $RPM_BUILD_ROOT/var/log/rt2 -chmod ug=rwx,o= $RPM_BUILD_ROOT/var/log/rt2 - -%clean -if [ x$RPM_BUILD_ROOT != x ]; then -rm -rf $RPM_BUILD_ROOT -fi - -# -# A new rt groups is required -# -%pre -groupadd rt || true - -# -# Show the user the site specific steps required after install -# -%post -cat <<EOF ------------------------------------------------------------------------ -rt2 installation is complete. Now create the rt2 database by running: ------------------------------------------------------------------------ - -# cd /opt/rt2/postinstall -# make config-replace initialize.mysql insert RT_LOG_PATH=/var/log/rt2 DB_RT_PASS=new_rt_user_password - -Choose your own new_rt_user_password. You will need the mysql root password. -You can try Pg or Oracle instead of mysql - untested. - -Review and configure your site specific details in /opt/rt2/etc/config.pm -EOF - -%preun - -%files -%dir /opt/rt2 -/opt/rt2/bin -/opt/rt2/WebRT -/opt/rt2/lib -/opt/rt2/local -/opt/rt2/man -/opt/rt2/postinstall -%dir /opt/rt2/etc -/opt/rt2/etc/insertdata -%config /opt/rt2/etc/config.pm -%dir /var/log/rt2 - -%changelog -* Mon Sep 24 2001 Jesse Vincent <jesse@bestpractical.com> - Switch to rt DESTDIR support -* Fri Sep 14 2001 Cris Bailiff <c.bailiff@devsecure.com> - Fix permissions on created /var/log/rt2 and roll in 2.0.7 -* Tue Sep 4 2001 Cris Bailiff <c.bailiff@devsecure.com> -- created initial spec file -* Tue Sep 4 2001 Cris Bailiff <c.bailiff@devsecure.com> -- created initial spec file -* Tue Sep 4 2001 Cris Bailiff <c.bailiff@devsecure.com> -- created initial spec file diff --git a/rt/etc/schema.Oracle b/rt/etc/schema.Oracle deleted file mode 100644 index 693e75ae5..000000000 --- a/rt/etc/schema.Oracle +++ /dev/null @@ -1,399 +0,0 @@ - -CREATE SEQUENCE ATTACHMENTS_seq; -CREATE TABLE Attachments ( - id NUMBER(11,0) - CONSTRAINT Attachments_Key PRIMARY KEY, - TransactionId NUMBER(11,0) NOT NULL, - Parent NUMBER(11,0) DEFAULT 0 NOT NULL, - MessageId VARCHAR2(160), - Subject VARCHAR2(255), - Filename VARCHAR2(255), - ContentType VARCHAR2(80), - ContentEncoding VARCHAR2(80), - Content CLOB, - Headers CLOB, - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE -); -CREATE INDEX Attachments2 ON Attachments (TransactionId); -CREATE INDEX Attachments3 ON Attachments (Parent, TransactionId); - - -CREATE SEQUENCE QUEUES_seq; -CREATE TABLE Queues ( - id NUMBER(11,0) - CONSTRAINT Queues_Key PRIMARY KEY, - Name VARCHAR2(200) CONSTRAINT Queues_Name_Unique UNIQUE NOT NULL, - Description VARCHAR2(255), - CorrespondAddress VARCHAR2(120), - CommentAddress VARCHAR2(120), - InitialPriority NUMBER(11,0) DEFAULT 0 NOT NULL, - FinalPriority NUMBER(11,0) DEFAULT 0 NOT NULL, - DefaultDueIn NUMBER(11,0) DEFAULT 0 NOT NULL, - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE, - LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - LastUpdated DATE, - Disabled NUMBER(11,0) DEFAULT 0 NOT NULL -); - CREATE INDEX Queues1 ON Queues (LOWER(Name)); -CREATE INDEX Queues2 ON Queues (Disabled); - - -CREATE SEQUENCE LINKS_seq; -CREATE TABLE Links ( - id NUMBER(11,0) - CONSTRAINT Links_Key PRIMARY KEY, - Base VARCHAR2(240), - Target VARCHAR2(240), - Type VARCHAR2(20) NOT NULL, - LocalTarget NUMBER(11,0) DEFAULT 0 NOT NULL, - LocalBase NUMBER(11,0) DEFAULT 0 NOT NULL, - LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - LastUpdated DATE, - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE -); -CREATE UNIQUE INDEX Links1 ON Links (Base, Target, Type); -CREATE INDEX Links2 ON Links (Base, Type); -CREATE INDEX Links3 ON Links (Target, Type); -CREATE INDEX Links4 ON Links(Type,LocalBase); - - -CREATE SEQUENCE PRINCIPALS_seq; -CREATE TABLE Principals ( - id NUMBER(11,0) - CONSTRAINT Principals_Key PRIMARY KEY, - PrincipalType VARCHAR2(16), - ObjectId NUMBER(11,0), - Disabled NUMBER(11,0) DEFAULT 0 NOT NULL -); -CREATE UNIQUE INDEX Principals2 ON Principals (ObjectId); - - -CREATE SEQUENCE GROUPS_seq; -CREATE TABLE Groups ( - id NUMBER(11,0) - CONSTRAINT Groups_Key PRIMARY KEY, - Name VARCHAR2(200), - Description VARCHAR2(255), - Domain VARCHAR2(64), - Type VARCHAR2(64), - Instance NUMBER(11,0) DEFAULT 0 -- NOT NULL --- Instance VARCHAR2(64) -); -CREATE INDEX Groups1 ON Groups (LOWER(Domain), Instance, LOWER(Type), id); -CREATE INDEX Groups2 ON Groups (LOWER(Type), Instance, LOWER(Domain)); - - -CREATE SEQUENCE SCRIPCONDITIONS_seq; -CREATE TABLE ScripConditions ( - id NUMBER(11, 0) - CONSTRAINT ScripConditions_Key PRIMARY KEY, - Name VARCHAR2(200), - Description VARCHAR2(255), - ExecModule VARCHAR2(60), - Argument VARCHAR2(255), - ApplicableTransTypes VARCHAR2(60), - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE, - LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - LastUpdated DATE -); - - -CREATE SEQUENCE TRANSACTIONS_seq; -CREATE TABLE Transactions ( - id NUMBER(11,0) - CONSTRAINT Transactions_Key PRIMARY KEY, - ObjectType VARCHAR2(255), - ObjectId NUMBER(11,0) DEFAULT 0 NOT NULL, - TimeTaken NUMBER(11,0) DEFAULT 0 NOT NULL, - Type VARCHAR2(20), - Field VARCHAR2(40), - OldValue VARCHAR2(255), - NewValue VARCHAR2(255), - ReferenceType VARCHAR2(255), - OldReference NUMBER(11,0), - NewReference NUMBER(11,0), - Data VARCHAR2(255), - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE -); -CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId); - - -CREATE SEQUENCE SCRIPS_seq; -CREATE TABLE Scrips ( - id NUMBER(11,0) - CONSTRAINT Scrips_Key PRIMARY KEY, - Description VARCHAR2(255), - ScripCondition NUMBER(11,0) DEFAULT 0 NOT NULL, - ScripAction NUMBER(11,0) DEFAULT 0 NOT NULL, - ConditionRules CLOB, - ActionRules CLOB, - CustomIsApplicableCode CLOB, - CustomPrepareCode CLOB, - CustomCommitCode CLOB, - Stage VARCHAR2(32), - Queue NUMBER(11,0) DEFAULT 0 NOT NULL, - Template NUMBER(11,0) DEFAULT 0 NOT NULL, - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE, - LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - LastUpdated DATE -); - - -CREATE SEQUENCE ACL_seq; -CREATE TABLE ACL ( - id NUMBER(11,0) - CONSTRAINT ACL_Key PRIMARY KEY, - PrincipalType VARCHAR2(25) NOT NULL, - PrincipalId NUMBER(11,0) NOT NULL, - RightName VARCHAR2(25) NOT NULL, - ObjectType VARCHAR2(25) NOT NULL, - ObjectId NUMBER(11,0) DEFAULT 0 NOT NULL, - DelegatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - DelegatedFrom NUMBER(11,0) DEFAULT 0 NOT NULL -); -CREATE INDEX ACL1 ON ACL(RightName, ObjectType, ObjectId, PrincipalType, PrincipalId); - - -CREATE SEQUENCE GROUPMEMBERS_seq; -CREATE TABLE GroupMembers ( - id NUMBER(11,0) - CONSTRAINT GroupMembers_Key PRIMARY KEY, - GroupId NUMBER(11,0) DEFAULT 0 NOT NULL, - MemberId NUMBER(11,0) DEFAULT 0 NOT NULL -); -CREATE UNIQUE INDEX GroupMembers1 ON GroupMembers (GroupId, MemberId); - - -CREATE SEQUENCE CachedGroupMembers_seq; -CREATE TABLE CachedGroupMembers ( - id NUMBER(11,0) - CONSTRAINT CachedGroupMembers_Key PRIMARY KEY, - GroupId NUMBER(11,0), - MemberId NUMBER(11,0), - Via NUMBER(11,0), - ImmediateParentId NUMBER(11,0), - Disabled NUMBER(11,0) DEFAULT 0 NOT NULL -); -CREATE INDEX DisGrouMem ON CachedGroupMembers (GroupId, MemberId, Disabled); -CREATE INDEX GrouMem ON CachedGroupMembers (GroupId, MemberId); -CREATE INDEX CachedGroupMembers3 on CachedGroupMembers (MemberId, ImmediateParentId); - - -CREATE SEQUENCE USERS_seq; -CREATE TABLE Users ( - id NUMBER(11,0) - CONSTRAINT Users_Key PRIMARY KEY, - Name VARCHAR2(200) CONSTRAINT Users_Name_Unique - unique NOT NULL, - Password VARCHAR2(40), - Comments CLOB, - Signature CLOB, - EmailAddress VARCHAR2(120), - FreeFormContactInfo CLOB, - Organization VARCHAR2(200), - RealName VARCHAR2(120), - NickName VARCHAR2(16), - Lang VARCHAR2(16), - EmailEncoding VARCHAR2(16), - WebEncoding VARCHAR2(16), - ExternalContactInfoId VARCHAR2(100), - ContactInfoSystem VARCHAR2(30), - ExternalAuthId VARCHAR2(100), - AuthSystem VARCHAR2(30), - Gecos VARCHAR2(16), - HomePhone VARCHAR2(30), - WorkPhone VARCHAR2(30), - MobilePhone VARCHAR2(30), - PagerPhone VARCHAR2(30), - Address1 VARCHAR2(200), - Address2 VARCHAR2(200), - City VARCHAR2(100), - State VARCHAR2(100), - Zip VARCHAR2(16), - Country VARCHAR2(50), - Timezone VARCHAR2(50), - PGPKey CLOB, - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE, - LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - LastUpdated DATE -); --- CREATE UNIQUE INDEX Users1 ON Users (Name); - -CREATE INDEX Users2 ON Users( LOWER(Name)); -CREATE INDEX Users4 ON Users (LOWER(EmailAddress)); - - -CREATE SEQUENCE TICKETS_seq; -CREATE TABLE Tickets ( - id NUMBER(11, 0) - CONSTRAINT Tickets_Key PRIMARY KEY, - EffectiveId NUMBER(11,0) DEFAULT 0 NOT NULL, - Queue NUMBER(11,0) DEFAULT 0 NOT NULL, - Type VARCHAR2(16), - IssueStatement NUMBER(11,0) DEFAULT 0 NOT NULL, - Resolution NUMBER(11,0) DEFAULT 0 NOT NULL, - Owner NUMBER(11,0) DEFAULT 0 NOT NULL, - Subject VARCHAR2(200) DEFAULT '[no subject]', - InitialPriority NUMBER(11,0) DEFAULT 0 NOT NULL, - FinalPriority NUMBER(11,0) DEFAULT 0 NOT NULL, - Priority NUMBER(11,0) DEFAULT 0 NOT NULL, - TimeEstimated NUMBER(11,0) DEFAULT 0 NOT NULL, - TimeWorked NUMBER(11,0) DEFAULT 0 NOT NULL, - Status VARCHAR2(10), - TimeLeft NUMBER(11,0) DEFAULT 0 NOT NULL, - Told DATE, - Starts DATE, - Started DATE, - Due DATE, - Resolved DATE, - LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - LastUpdated DATE, - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE, - Disabled NUMBER(11,0) DEFAULT 0 NOT NULL -); -CREATE INDEX Tickets1 ON Tickets (Queue, Status); -CREATE INDEX Tickets2 ON Tickets (Owner); -CREATE INDEX Tickets4 ON Tickets (id, Status); -CREATE INDEX Tickets5 ON Tickets (id, EffectiveId); -CREATE INDEX Tickets6 ON Tickets (EffectiveId, Type); - - -CREATE SEQUENCE SCRIPACTIONS_seq; -CREATE TABLE ScripActions ( - id NUMBER(11,0) - CONSTRAINT ScripActions_Key PRIMARY KEY, - Name VARCHAR2(200), - Description VARCHAR2(255), - ExecModule VARCHAR2(60), - Argument VARCHAR2(255), - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE, - LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - LastUpdated DATE -); - - -CREATE SEQUENCE TEMPLATES_seq; -CREATE TABLE Templates ( - id NUMBER(11,0) - CONSTRAINT Templates_Key PRIMARY KEY, - Queue NUMBER(11,0) DEFAULT 0 NOT NULL, - Name VARCHAR2(200) NOT NULL, - Description VARCHAR2(255), - Type VARCHAR2(16), - Language VARCHAR2(16), - TranslationOf NUMBER(11,0) DEFAULT 0 NOT NULL, - Content CLOB, - LastUpdated DATE, - LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE -); - - -CREATE SEQUENCE OBJECTCUSTOMFIELDS_seq; -CREATE TABLE ObjectCustomFields ( - id NUMBER(11,0) - CONSTRAINT ObjectCustomFields_Key PRIMARY KEY, - CustomField NUMBER(11,0) NOT NULL, - ObjectId NUMBER(11,0) NOT NULL, - SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL, - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE, - LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - LastUpdated DATE -); - - -CREATE SEQUENCE OBJECTCUSTOMFIELDVALUES_seq; -CREATE TABLE ObjectCustomFieldValues ( - id NUMBER(11,0) - CONSTRAINT ObjectCustomFieldValues_Key PRIMARY KEY, - CustomField NUMBER(11,0) NOT NULL, - ObjectType VARCHAR2(25) NOT NULL, - ObjectId NUMBER(11,0) DEFAULT 0 NOT NULL, - SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL, - Content VARCHAR2(255), - LargeContent CLOB, - ContentType VARCHAR2(80), - ContentEncoding VARCHAR2(80), - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE, - LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - LastUpdated DATE, - Disabled NUMBER(11,0) DEFAULT 0 NOT NULL -); - -CREATE INDEX ObjectCustomFieldValues1 ON ObjectCustomFieldValues (Content); -CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId); - -CREATE SEQUENCE CUSTOMFIELDS_seq; -CREATE TABLE CustomFields ( - id NUMBER(11,0) - CONSTRAINT CustomFields_Key PRIMARY KEY, - Name VARCHAR2(200), - Type VARCHAR2(200), - MaxValues NUMBER(11,0) DEFAULT 0 NOT NULL, - Pattern CLOB, - Repeated NUMBER(11,0) DEFAULT 0 NOT NULL, - Description VARCHAR2(255), - SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL, - LookupType VARCHAR2(255), - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE, - LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - LastUpdated DATE, - Disabled NUMBER(11,0) DEFAULT 0 NOT NULL -); - - -CREATE SEQUENCE CUSTOMFIELDVALUES_seq; -CREATE TABLE CustomFieldValues ( - id NUMBER(11,0) - CONSTRAINT CustomFieldValues_Key PRIMARY KEY, - CustomField NUMBER(11,0), - Name VARCHAR2(200), - Description VARCHAR2(255), - SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL, - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE, - LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - LastUpdated DATE -); - -CREATE INDEX CustomFieldValues1 ON CustomFieldValues (CustomField); - -CREATE SEQUENCE ATTRIBUTES_seq; -CREATE TABLE Attributes ( - id NUMBER(11,0) PRIMARY KEY, - Name VARCHAR2(255) NOT NULL, - Description VARCHAR2(255), - Content CLOB, - ContentType VARCHAR(16), - ObjectType VARCHAR2(25) NOT NULL, - ObjectId NUMBER(11,0) DEFAULT 0 NOT NULL, - Creator NUMBER(11,0) DEFAULT 0 NOT NULL, - Created DATE, - LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL, - LastUpdated DATE -); - -CREATE INDEX Attributes1 on Attributes(Name); -CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId); - - -CREATE TABLE sessions ( - id VARCHAR2(32) - CONSTRAINT Sessions_Key PRIMARY KEY, - a_session CLOB, - LastUpdated DATE -); - diff --git a/rt/etc/schema.Pg b/rt/etc/schema.Pg index 48525c8d7..e3006d073 100755 --- a/rt/etc/schema.Pg +++ b/rt/etc/schema.Pg @@ -539,6 +539,7 @@ CREATE TABLE CustomFields ( LastUpdatedBy integer NOT NULL DEFAULT 0 , LastUpdated TIMESTAMP NULL , Disabled integer NOT NULL DEFAULT 0 , + Required integer NOT NULL DEFAULT 0 , PRIMARY KEY (id) ); diff --git a/rt/etc/schema.mysql b/rt/etc/schema.mysql deleted file mode 100755 index b7d53f884..000000000 --- a/rt/etc/schema.mysql +++ /dev/null @@ -1,463 +0,0 @@ -# {{{ Attachments - -CREATE TABLE Attachments ( - id INTEGER NOT NULL AUTO_INCREMENT, - TransactionId integer NOT NULL , - Parent integer NOT NULL DEFAULT 0 , - MessageId varchar(160) NULL , - Subject varchar(255) NULL , - Filename varchar(255) NULL , - ContentType varchar(80) NULL , - ContentEncoding varchar(80) NULL , - Content LONGTEXT NULL , - Headers LONGTEXT NULL , - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - PRIMARY KEY (id) -) TYPE=InnoDB; - -CREATE INDEX Attachments2 ON Attachments (TransactionId) ; -CREATE INDEX Attachments3 ON Attachments (Parent, TransactionId) ; -# }}} - -# {{{ Queues -CREATE TABLE Queues ( - id INTEGER NOT NULL AUTO_INCREMENT, - Name varchar(200) NOT NULL , - Description varchar(255) NULL , - CorrespondAddress varchar(120) NULL , - CommentAddress varchar(120) NULL , - InitialPriority integer NOT NULL DEFAULT 0 , - FinalPriority integer NOT NULL DEFAULT 0 , - DefaultDueIn integer NOT NULL DEFAULT 0 , - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - LastUpdatedBy integer NOT NULL DEFAULT 0 , - LastUpdated DATETIME NULL , - Disabled int2 NOT NULL DEFAULT 0 , - PRIMARY KEY (id) -) TYPE=InnoDB; -CREATE UNIQUE INDEX Queues1 ON Queues (Name) ; -CREATE INDEX Queues2 ON Queues (Disabled) ; - -# }}} - -# {{{ Links - -CREATE TABLE Links ( - id INTEGER NOT NULL AUTO_INCREMENT, - Base varchar(240) NULL , - Target varchar(240) NULL , - Type varchar(20) NOT NULL , - LocalTarget integer NOT NULL DEFAULT 0 , - LocalBase integer NOT NULL DEFAULT 0 , - LastUpdatedBy integer NOT NULL DEFAULT 0 , - LastUpdated DATETIME NULL , - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - PRIMARY KEY (id) -) TYPE=InnoDB; - -CREATE INDEX Links2 ON Links (Base, Type) ; -CREATE INDEX Links3 ON Links (Target, Type) ; -CREATE INDEX Links4 ON Links (Type,LocalBase); - -# }}} - -# {{{ Principals - -CREATE TABLE Principals ( - id INTEGER AUTO_INCREMENT not null, - PrincipalType VARCHAR(16) not null, - ObjectId integer, # foreign key to Users or Groups, depending - Disabled int2 NOT NULL DEFAULT 0 , - PRIMARY KEY (id) -) TYPE=InnoDB; - -CREATE INDEX Principals2 ON Principals (ObjectId); - -# }}} - -# {{{ Groups - -CREATE TABLE Groups ( - id INTEGER NOT NULL AUTO_INCREMENT, - Name varchar(200) NULL , - Description varchar(255) NULL , - Domain varchar(64), - Type varchar(64), - Instance integer, - PRIMARY KEY (id) -) TYPE=InnoDB; - -CREATE INDEX Groups1 ON Groups (Domain,Instance,Type,id); -CREATE INDEX Groups2 On Groups (Type, Instance); - -# }}} - -# {{{ ScripConditions - -CREATE TABLE ScripConditions ( - id INTEGER NOT NULL AUTO_INCREMENT, - Name varchar(200) NULL , - Description varchar(255) NULL , - ExecModule varchar(60) NULL , - Argument varchar(255) NULL , - ApplicableTransTypes varchar(60) NULL , - - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - LastUpdatedBy integer NOT NULL DEFAULT 0 , - LastUpdated DATETIME NULL , - PRIMARY KEY (id) -) TYPE=InnoDB; - -# }}} - -# {{{ Transactions -CREATE TABLE Transactions ( - id INTEGER NOT NULL AUTO_INCREMENT, - ObjectType varchar(64) NOT NULL, - ObjectId integer NOT NULL DEFAULT 0 , - TimeTaken integer NOT NULL DEFAULT 0 , - Type varchar(20) NULL , - Field varchar(40) NULL , - OldValue varchar(255) NULL , - NewValue varchar(255) NULL , - ReferenceType varchar(255) NULL, - OldReference integer NULL , - NewReference integer NULL , - Data varchar(255) NULL , - - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - PRIMARY KEY (id) -) TYPE=InnoDB; -CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId); - -# }}} - -# {{{ Scrips - -CREATE TABLE Scrips ( - id INTEGER NOT NULL AUTO_INCREMENT, - Description varchar(255), - ScripCondition integer NOT NULL DEFAULT 0 , - ScripAction integer NOT NULL DEFAULT 0 , - ConditionRules text NULL , - ActionRules text NULL , - CustomIsApplicableCode text NULL , - CustomPrepareCode text NULL , - CustomCommitCode text NULL , - Stage varchar(32) NULL , - Queue integer NOT NULL DEFAULT 0 , - Template integer NOT NULL DEFAULT 0 , - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - LastUpdatedBy integer NOT NULL DEFAULT 0 , - LastUpdated DATETIME NULL , - PRIMARY KEY (id) -) TYPE=InnoDB; - -# }}} - -# {{{ ACL -CREATE TABLE ACL ( - id INTEGER NOT NULL AUTO_INCREMENT, - PrincipalType varchar(25) NOT NULL, #"User" "Group", "Owner", "Cc" "AdminCc", "Requestor", "Requestor" - - PrincipalId integer NOT NULL , #Foreign key to principals - RightName varchar(25) NOT NULL , - ObjectType varchar(25) NOT NULL , - ObjectId integer NOT NULL default 0, - DelegatedBy integer NOT NULL default 0, #foreign key to principals with a userid - DelegatedFrom integer NOT NULL default 0, #foreign key to ACL - PRIMARY KEY (id) -) TYPE=InnoDB; - -CREATE INDEX ACL1 on ACL(RightName, ObjectType, ObjectId,PrincipalType,PrincipalId); - -# }}} - -# {{{ GroupMembers - -CREATE TABLE GroupMembers ( - id INTEGER NOT NULL AUTO_INCREMENT, - GroupId integer NOT NULL DEFAULT 0, - MemberId integer NOT NULL DEFAULT 0, #Foreign key to Principals - PRIMARY KEY (id) -) TYPE=InnoDB; -CREATE UNIQUE INDEX GroupMembers1 on GroupMembers (GroupId, MemberId); - - -# }}} - -# {{{ GroupMembersCache - -create table CachedGroupMembers ( - id int auto_increment, - GroupId int, # foreign key to Principals - MemberId int, # foreign key to Principals - Via int, #foreign key to CachedGroupMembers. (may point to $self->id) - ImmediateParentId int, #foreign key to prinicpals. - # this points to the group that the member is - # a member of, for ease of deletes. - Disabled int2 NOT NULL DEFAULT 0 , # if this cached group member is a member of this group by way of a disabled - # group or this group is disabled, this will be set to 1 - # this allows us to not find members of disabled subgroups when listing off - # group members recursively. - # Also, this allows us to have the ACL system elide members of disabled groups - PRIMARY KEY (id) -) TYPE=InnoDB; - -CREATE INDEX DisGrouMem on CachedGroupMembers (GroupId,MemberId,Disabled); - -# }}} - -# {{{ Users - -CREATE TABLE Users ( - id INTEGER NOT NULL AUTO_INCREMENT, - Name varchar(200) NOT NULL , - Password varchar(40) NULL , - Comments blob NULL , - Signature blob NULL , - EmailAddress varchar(120) NULL , - FreeformContactInfo blob NULL , - Organization varchar(200) NULL , - RealName varchar(120) NULL , - NickName varchar(16) NULL , - Lang varchar(16) NULL , - EmailEncoding varchar(16) NULL , - WebEncoding varchar(16) NULL , - ExternalContactInfoId varchar(100) NULL , - ContactInfoSystem varchar(30) NULL , - ExternalAuthId varchar(100) NULL , - AuthSystem varchar(30) NULL , - Gecos varchar(16) NULL , - HomePhone varchar(30) NULL , - WorkPhone varchar(30) NULL , - MobilePhone varchar(30) NULL , - PagerPhone varchar(30) NULL , - Address1 varchar(200) NULL , - Address2 varchar(200) NULL , - City varchar(100) NULL , - State varchar(100) NULL , - Zip varchar(16) NULL , - Country varchar(50) NULL , - Timezone varchar(50) NULL , - PGPKey text NULL, - - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - LastUpdatedBy integer NOT NULL DEFAULT 0 , - LastUpdated DATETIME NULL , - PRIMARY KEY (id) -) TYPE=InnoDB; - - -CREATE UNIQUE INDEX Users1 ON Users (Name) ; -CREATE INDEX Users4 ON Users (EmailAddress); - - -# }}} - -# {{{ Tickets - -CREATE TABLE Tickets ( - id INTEGER NOT NULL AUTO_INCREMENT, - EffectiveId integer NOT NULL DEFAULT 0 , - Queue integer NOT NULL DEFAULT 0 , - Type varchar(16) NULL , - IssueStatement integer NOT NULL DEFAULT 0 , - Resolution integer NOT NULL DEFAULT 0 , - Owner integer NOT NULL DEFAULT 0 , - Subject varchar(200) NULL DEFAULT '[no subject]' , - InitialPriority integer NOT NULL DEFAULT 0 , - FinalPriority integer NOT NULL DEFAULT 0 , - Priority integer NOT NULL DEFAULT 0 , - TimeEstimated integer NOT NULL DEFAULT 0 , - TimeWorked integer NOT NULL DEFAULT 0 , - Status varchar(10) NULL , - TimeLeft integer NOT NULL DEFAULT 0 , - Told DATETIME NULL , - Starts DATETIME NULL , - Started DATETIME NULL , - Due DATETIME NULL , - Resolved DATETIME NULL , - - - LastUpdatedBy integer NOT NULL DEFAULT 0 , - LastUpdated DATETIME NULL , - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - Disabled int2 NOT NULL DEFAULT 0 , - PRIMARY KEY (id) -) TYPE=InnoDB; - -CREATE INDEX Tickets1 ON Tickets (Queue, Status) ; -CREATE INDEX Tickets2 ON Tickets (Owner) ; -CREATE INDEX Tickets6 ON Tickets (EffectiveId, Type) ; - -# }}} - -# {{{ ScripActions - -CREATE TABLE ScripActions ( - id INTEGER NOT NULL AUTO_INCREMENT, - Name varchar(200) NULL , - Description varchar(255) NULL , - ExecModule varchar(60) NULL , - Argument varchar(255) NULL , - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - LastUpdatedBy integer NOT NULL DEFAULT 0 , - LastUpdated DATETIME NULL , - PRIMARY KEY (id) -) TYPE=InnoDB; - -# }}} - -# {{{ Templates - -CREATE TABLE Templates ( - id INTEGER NOT NULL AUTO_INCREMENT, - Queue integer NOT NULL DEFAULT 0 , - Name varchar(200) NOT NULL , - Description varchar(255) NULL , - Type varchar(16) NULL , - Language varchar(16) NULL , - TranslationOf integer NOT NULL DEFAULT 0 , - Content blob NULL , - LastUpdated DATETIME NULL , - LastUpdatedBy integer NOT NULL DEFAULT 0 , - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - PRIMARY KEY (id) -) TYPE=InnoDB; - -# }}} - -# {{{ ObjectCustomFieldValues - -CREATE TABLE ObjectCustomFieldValues ( - id INTEGER NOT NULL AUTO_INCREMENT, - CustomField int NOT NULL , - ObjectType varchar(255) NOT NULL, # Final target of the Object - ObjectId int NOT NULL , # New -- Replaces Ticket - SortOrder integer NOT NULL DEFAULT 0 , # New -- ordering for multiple values - - Content varchar(255) NULL , - LargeContent LONGTEXT NULL, # New -- to hold 255+ strings - ContentType varchar(80) NULL, # New -- only text/* gets searched - ContentEncoding varchar(80) NULL , # New -- for binary Content - - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - LastUpdatedBy integer NOT NULL DEFAULT 0 , - LastUpdated DATETIME NULL , - Disabled int2 NOT NULL DEFAULT 0 , # New -- whether the value was current - PRIMARY KEY (id) -) TYPE=InnoDB; - -CREATE INDEX ObjectCustomFieldValues1 ON ObjectCustomFieldValues (Content); -CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId); - -# }}} - -# {{{ CustomFields - -CREATE TABLE CustomFields ( - id INTEGER NOT NULL AUTO_INCREMENT, - Name varchar(200) NULL , - Type varchar(200) NULL , # Changed -- 'Single' and 'Multiple' is moved out - MaxValues integer, # New -- was 'Single'(1) and 'Multiple'(0) - Pattern varchar(255) NULL , # New -- Must validate against this - Repeated int2 NOT NULL DEFAULT 0 , # New -- repeated table entry - Description varchar(255) NULL , - SortOrder integer NOT NULL DEFAULT 0 , - LookupType varchar(255) NOT NULL, - - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - LastUpdatedBy integer NOT NULL DEFAULT 0 , - LastUpdated DATETIME NULL , - Disabled int2 NOT NULL DEFAULT 0 , - PRIMARY KEY (id) -) TYPE=InnoDB; - -# }}} - -# {{{ ObjectCustomFields - -CREATE TABLE ObjectCustomFields ( - id INTEGER NOT NULL AUTO_INCREMENT, - CustomField int NOT NULL , - ObjectId integer NOT NULL, - SortOrder integer NOT NULL DEFAULT 0 , - - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - LastUpdatedBy integer NOT NULL DEFAULT 0 , - LastUpdated DATETIME NULL , - PRIMARY KEY (id) -) TYPE=InnoDB; - -# }}} - -# {{{ CustomFieldValues - -CREATE TABLE CustomFieldValues ( - id INTEGER NOT NULL AUTO_INCREMENT, - CustomField int NOT NULL , - Name varchar(200) NULL , - Description varchar(255) NULL , - SortOrder integer NOT NULL DEFAULT 0 , - - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - LastUpdatedBy integer NOT NULL DEFAULT 0 , - LastUpdated DATETIME NULL , - PRIMARY KEY (id) -) TYPE=InnoDB; - -CREATE INDEX CustomFieldValues1 ON CustomFieldValues (CustomField); - -# }}} - - -# {{{ Attributes - -CREATE TABLE Attributes ( - id INTEGER NOT NULL AUTO_INCREMENT, - Name varchar(255) NULL , - Description varchar(255) NULL , - Content text, - ContentType varchar(16), - ObjectType varchar(64), - ObjectId integer, # foreign key to anything - Creator integer NOT NULL DEFAULT 0 , - Created DATETIME NULL , - LastUpdatedBy integer NOT NULL DEFAULT 0 , - LastUpdated DATETIME NULL , - PRIMARY KEY (id) -) TYPE=InnoDB; - -CREATE INDEX Attributes1 on Attributes(Name); -CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId); - -# }}} - -# {{{ Sessions - -# sessions is used by Apache::Session to keep sessions in the database. -# We should have a reaper script somewhere. - -CREATE TABLE sessions ( - id char(32) NOT NULL, - a_session LONGTEXT, - LastUpdated TIMESTAMP, - PRIMARY KEY (id) -); - -# }}} diff --git a/rt/etc/schema.mysql-4.1 b/rt/etc/schema.mysql-4.1 index 172e477c1..173570219 100755 --- a/rt/etc/schema.mysql-4.1 +++ b/rt/etc/schema.mysql-4.1 @@ -386,6 +386,7 @@ CREATE TABLE CustomFields ( LastUpdatedBy integer NOT NULL DEFAULT 0 , LastUpdated DATETIME NULL , Disabled int2 NOT NULL DEFAULT 0 , + Required int2 NOT NULL DEFAULT 0 , PRIMARY KEY (id) ) TYPE=InnoDB CHARACTER SET utf8; 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', - }, -); - -# }}} - |