diff options
Diffstat (limited to 'rt/etc')
-rw-r--r-- | rt/etc/RT_Config.pm | 244 | ||||
-rw-r--r-- | rt/etc/RT_Config.pm.in | 232 | ||||
-rw-r--r-- | rt/etc/RT_SiteConfig.pm | 36 | ||||
-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 | ||||
-rw-r--r-- | rt/etc/upgrade/2.1.71 | 211 | ||||
-rw-r--r-- | rt/etc/upgrade/3.8.8/content | 38 |
9 files changed, 520 insertions, 1241 deletions
diff --git a/rt/etc/RT_Config.pm b/rt/etc/RT_Config.pm index 823189b45..21d837546 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 , 'SQLite'); +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> @@ -175,6 +175,26 @@ improvements, but some setups can not handle it. Set($UseSQLForACLChecks, undef); +=item C<$TicketsItemMapSize> + +In RT at display page of a ticket and there is the current search, +then links for first, next, previous and last ticket are shown in +the menu. + +To build full map RT has to fetch full result set out of DB what can +eat lots of resourses. Using this option it's possible to limit number +of tickets fetched. + +Set C<$TicketsItemMapSize> to number of tickets you want RT to look +at to build the map. If full result set is bigger than that number +then there would be no 'last' link in the menu. + +Set this to zero to return back to old behaviour. + +=cut + +Set($TicketsItemMapSize, 1000); + =back =head1 Incoming Mail Gateway Configuration @@ -266,7 +286,7 @@ avoid sending mail to itself. It will also hide RT addresses from the list of =cut -Set($RTAddressRegexp , '^rt\@example.com$'); +Set($RTAddressRegexp , undef); =item C<$CanonicalizeEmailAddressMatch>, C<$CanonicalizeEmailAddressReplace> @@ -402,6 +422,54 @@ Set($OverrideOutgoingMailFrom, { =back +=item C<$DefaultMailPrecedence> + +C<$DefaultMailPrecedence> is used to control the default +Precedence level of outgoing mail where none is specified. +By default it is C<bulk>, but if you only send mail to +your staff, you may wish to change it. + +Note that you can set the precedence of individual templates +by including an explicit Precedence header. + +If you set this value to C<undef> then we do not set a default +Precedence header to outgoing mail. However, if there already is a +Precedence header it will be preserved. + +=cut + +Set($DefaultMailPrecedence, 'bulk'); + +=back + +=item C<$DefaultErrorMailPrecedence> + +C<$DefaultErrorMailPrecedence> is used to control the default +Precedence level of outgoing mail that indicates some kind of +error condition. By default it is C<bulk>, but if you only send +mail to your staff, you may wish to change it. + +If you set this value to C<undef> then we do not add a Precedence +header to error mail. + +=cut + +Set($DefaultErrorMailPrecedence, 'bulk'); + +=back + +=item C<$UseOriginatorHeader> + +C<$UseOriginatorHeader> is used to control the insertion of an +RT-Originator Header in every outgoing mail, containing the +mail address of the transaction creator. + +=cut + +Set($UseOriginatorHeader, 1); + +=back + =head1 Sendmail Configuration These options only take effect if C<$MailCommand> is 'sendmail' or @@ -670,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', @@ -724,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> @@ -778,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 @@ -786,7 +857,7 @@ option can be overridden by users in their preferences. =cut -Set($WebDefaultStylesheet, 'web2'); +Set($WebDefaultStylesheet, 'freeside2.1'); =item C<$UsernameFormat> @@ -797,7 +868,7 @@ EmailAddress. =cut -Set($UsernameFormat, 'concise'); +Set($UsernameFormat, 'verbose'); =item C<$WebDomain> @@ -875,6 +946,41 @@ C<$LogoURL> points to the URL of the RT logo displayed in the web UI Set($LogoURL, RT->Config->Get('WebImagesURL') . "bplogo.gif"); +=item C<$LogoLinkURL> + +C<$LogoLinkURL> is the URL that the RT logo hyperlinks to. + +=cut + +Set($LogoLinkURL, "http://bestpractical.com"); + +=item C<$LogoAltText> + +C<$LogoAltText> is a string of text for the alt-text of the logo. It +will be passed through C<loc> for localization. + +=cut + +Set($LogoAltText, "Best Practical Solutions, LLC corporate logo"); + +=item C<$LogoImageHeight> + +C<$LogoImageHeight> is the value of the C<height> attribute of the logo +C<img> tag. + +=cut + +Set($LogoImageHeight, 33); + +=item C<$LogoImageWidth> + +C<$LogoImageWidth> is the value of the C<width> attribute of the logo +C<img> tag. + +=cut + +Set($LogoImageWidth, 177); + =item C<$WebNoAuthRegex> What portion of RT's URL space should not require authentication. @@ -884,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> @@ -949,6 +1055,14 @@ Should your user's signatures (from their Preferences page) be included in Comme Set($MessageBoxIncludeSignature, 1); +=item C<$MessageBoxIncludeSignatureOnComment> + +Should your user's signatures (from their Preferences page) be included in Comments. Setting this to false overrides C<$MessageBoxIncludeSignature>. + +=cut + +Set($MessageBoxIncludeSignatureOnComment, 1); + =item C<$WikiImplicitLinks> Support implicit links in WikiText custom fields? A true value @@ -970,6 +1084,27 @@ sent in a request (although there is probably more to it than that) Set($TrustHTMLAttachments, undef); +=item C<$AlwaysDownloadAttachments> + +Always download attachments, regardless of content type. If set, +this overrides C<TrustHTMLAttachments>. + +=cut + +Set($AlwaysDownloadAttachments, undef); + +=item C<$AttachmentUnits> + +Controls the units (kilobytes or bytes) that attachment sizes use +for display. The default is to display kilobytes if the attachment +is larger than 1024 bytes, bytes otherwise. If you set +C<$AttachmentUnits> to C<'k'> then attachment sizes will always be +displayed in kilobytes. If set to C<'b'>, then sizes will be bytes. + +=cut + +Set($AttachmentUnits, undef); + =item C<$RedistributeAutoGeneratedMessages> Should RT redistribute correspondence that it identifies as @@ -1075,6 +1210,16 @@ to RT for the defined time. Set($AutoLogoff, 0); +=item C<$LogoutRefresh> + +The number of seconds to wait after logout before sending the user to the +login page. By default, 1 second, though you may want to increase this if +you display additional information on the logout page. + +=cut + +Set($LogoutRefresh, 1); + =item C<$WebSecureCookies> By default, RT's session cookie isn't marked as "secure" Some web browsers @@ -1201,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> @@ -1225,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, @@ -1232,6 +1378,7 @@ Set ($DefaultSearchResultFormat, qq{ '__NEWLINE__', '', '<small>__Requestors__</small>', + '', '<small>__CreatedRelative__</small>', '<small>__ToldRelative__</small>', '<small>__LastUpdatedRelative__</small>', @@ -1251,6 +1398,46 @@ Set($DefaultSelfServiceSearchResultFormat, qq{ Requestors, OwnerName}); +=item C<%AdminSearchResultFormat> + +In admin interface format strings similar to tickets search result +formats are used. Use C<%AdminSearchResultFormat> to define format +strings per RT class. + +=cut + +Set(%AdminSearchResultFormat, + Queues => + q{'<a href="__WebPath__/Admin/Queues/Modify.html?id=__id__">__id__</a>/TITLE:#'} + .q{,'<a href="__WebPath__/Admin/Queues/Modify.html?id=__id__">__Name__</a>/TITLE:Name'} + .q{,__Description__,__Address__,__Priority__,__DefaultDueIn__,__Disabled__}, + + Groups => + q{'<a href="__WebPath__/Admin/Groups/Modify.html?id=__id__">__id__</a>/TITLE:#'} + .q{,'<a href="__WebPath__/Admin/Groups/Modify.html?id=__id__">__Name__</a>/TITLE:Name'} + .q{,'__Description__'}, + + Users => + q{'<a href="__WebPath__/Admin/Users/Modify.html?id=__id__">__id__</a>/TITLE:#'} + .q{,'<a href="__WebPath__/Admin/Users/Modify.html?id=__id__">__Name__</a>/TITLE:Name'} + .q{,__RealName__, __EmailAddress__}, + + CustomFields => + q{'<a href="__WebPath__/Admin/CustomFields/Modify.html?id=__id__">__id__</a>/TITLE:#'} + .q{,'<a href="__WebPath__/Admin/CustomFields/Modify.html?id=__id__">__Name__</a>/TITLE:Name'} + .q{,__AppliedTo__, __FriendlyType__, __FriendlyPattern__}, + + Scrips => + q{'<a href="__WebPath__/__WebRequestPathDir__/Scrip.html?id=__id__&Queue=__QueueId__">__id__</a>/TITLE:#'} + .q{,'<a href="__WebPath__/__WebRequestPathDir__/Scrip.html?id=__id__&Queue=__QueueId__">__Description__</a>/TITLE:Description'} + .q{,__Stage__, __Condition__, __Action__, __Template__}, + + Templates => + q{'<a href="__WebPath__/__WebRequestPathDir__/Template.html?Queue=__QueueId__&Template=__id__">__id__</a>/TITLE:#'} + .q{,'<a href="__WebPath__/__WebRequestPathDir__/Template.html?Queue=__QueueId__&Template=__id__">__Name__</a>/TITLE:Name'} + .q{,'__Description__'}, +); + =item C<$SuppressInlineTextFiles> If C<$SuppressInlineTextFiles> is set to a true value, then uploaded @@ -1271,17 +1458,38 @@ ticket searches. Set($DontSearchFileAttachments, undef); -=item C<$ChartFont> +=item C<%ChartFont> + +The L<GD> module (which RT uses for graphs) ships with a builtin font +that doesn't have full Unicode support. You can use a given TrueType font +for a specific language by setting %ChartFont to (language =E<gt> the +absolute path of a font) pairs. Your GD library must have support for +TrueType fonts to use this option. If there is no entry for a language +in the hash then font with 'others' key is used. -The L<GD> module (which RT uses for graphs) uses a builtin font that doesn't -have full Unicode support. You can use a particular TrueType font by setting -$ChartFont to the absolute path of that font. Your GD library must have -support for TrueType fonts to use this option. +RT comes with two TrueType fonts covering most available languages. =cut -Set($ChartFont, undef); +Set( + %ChartFont, + 'zh-cn' => "$RT::BasePath/share/fonts/DroidSansFallback.ttf", + 'zh-tw' => "$RT::BasePath/share/fonts/DroidSansFallback.ttf", + 'ja' => "$RT::BasePath/share/fonts/DroidSansFallback.ttf", + 'others' => "$RT::BasePath/share/fonts/DroidSans.ttf", +); + +=item C<$ChartsTimezonesInDB> + +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 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>. + +=cut +Set( $ChartsTimezonesInDB, 0 ); =item C<@Active_MakeClicky> @@ -1572,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 5d28e719c..c73a1e52f 100644 --- a/rt/etc/RT_Config.pm.in +++ b/rt/etc/RT_Config.pm.in @@ -175,6 +175,26 @@ improvements, but some setups can not handle it. Set($UseSQLForACLChecks, undef); +=item C<$TicketsItemMapSize> + +In RT at display page of a ticket and there is the current search, +then links for first, next, previous and last ticket are shown in +the menu. + +To build full map RT has to fetch full result set out of DB what can +eat lots of resourses. Using this option it's possible to limit number +of tickets fetched. + +Set C<$TicketsItemMapSize> to number of tickets you want RT to look +at to build the map. If full result set is bigger than that number +then there would be no 'last' link in the menu. + +Set this to zero to return back to old behaviour. + +=cut + +Set($TicketsItemMapSize, 1000); + =back =head1 Incoming Mail Gateway Configuration @@ -266,7 +286,7 @@ avoid sending mail to itself. It will also hide RT addresses from the list of =cut -Set($RTAddressRegexp , '^rt\@example.com$'); +Set($RTAddressRegexp , undef); =item C<$CanonicalizeEmailAddressMatch>, C<$CanonicalizeEmailAddressReplace> @@ -402,6 +422,54 @@ Set($OverrideOutgoingMailFrom, { =back +=item C<$DefaultMailPrecedence> + +C<$DefaultMailPrecedence> is used to control the default +Precedence level of outgoing mail where none is specified. +By default it is C<bulk>, but if you only send mail to +your staff, you may wish to change it. + +Note that you can set the precedence of individual templates +by including an explicit Precedence header. + +If you set this value to C<undef> then we do not set a default +Precedence header to outgoing mail. However, if there already is a +Precedence header it will be preserved. + +=cut + +Set($DefaultMailPrecedence, 'bulk'); + +=back + +=item C<$DefaultErrorMailPrecedence> + +C<$DefaultErrorMailPrecedence> is used to control the default +Precedence level of outgoing mail that indicates some kind of +error condition. By default it is C<bulk>, but if you only send +mail to your staff, you may wish to change it. + +If you set this value to C<undef> then we do not add a Precedence +header to error mail. + +=cut + +Set($DefaultErrorMailPrecedence, 'bulk'); + +=back + +=item C<$UseOriginatorHeader> + +C<$UseOriginatorHeader> is used to control the insertion of an +RT-Originator Header in every outgoing mail, containing the +mail address of the transaction creator. + +=cut + +Set($UseOriginatorHeader, 1); + +=back + =head1 Sendmail Configuration These options only take effect if C<$MailCommand> is 'sendmail' or @@ -778,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 @@ -786,7 +857,7 @@ option can be overridden by users in their preferences. =cut -Set($WebDefaultStylesheet, 'web2'); +Set($WebDefaultStylesheet, 'freeside2.1'); =item C<$UsernameFormat> @@ -797,7 +868,7 @@ EmailAddress. =cut -Set($UsernameFormat, 'concise'); +Set($UsernameFormat, 'verbose'); =item C<$WebDomain> @@ -875,6 +946,41 @@ C<$LogoURL> points to the URL of the RT logo displayed in the web UI Set($LogoURL, RT->Config->Get('WebImagesURL') . "bplogo.gif"); +=item C<$LogoLinkURL> + +C<$LogoLinkURL> is the URL that the RT logo hyperlinks to. + +=cut + +Set($LogoLinkURL, "http://bestpractical.com"); + +=item C<$LogoAltText> + +C<$LogoAltText> is a string of text for the alt-text of the logo. It +will be passed through C<loc> for localization. + +=cut + +Set($LogoAltText, "Best Practical Solutions, LLC corporate logo"); + +=item C<$LogoImageHeight> + +C<$LogoImageHeight> is the value of the C<height> attribute of the logo +C<img> tag. + +=cut + +Set($LogoImageHeight, 33); + +=item C<$LogoImageWidth> + +C<$LogoImageWidth> is the value of the C<width> attribute of the logo +C<img> tag. + +=cut + +Set($LogoImageWidth, 177); + =item C<$WebNoAuthRegex> What portion of RT's URL space should not require authentication. @@ -884,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> @@ -949,6 +1055,14 @@ Should your user's signatures (from their Preferences page) be included in Comme Set($MessageBoxIncludeSignature, 1); +=item C<$MessageBoxIncludeSignatureOnComment> + +Should your user's signatures (from their Preferences page) be included in Comments. Setting this to false overrides C<$MessageBoxIncludeSignature>. + +=cut + +Set($MessageBoxIncludeSignatureOnComment, 1); + =item C<$WikiImplicitLinks> Support implicit links in WikiText custom fields? A true value @@ -970,6 +1084,27 @@ sent in a request (although there is probably more to it than that) Set($TrustHTMLAttachments, undef); +=item C<$AlwaysDownloadAttachments> + +Always download attachments, regardless of content type. If set, +this overrides C<TrustHTMLAttachments>. + +=cut + +Set($AlwaysDownloadAttachments, undef); + +=item C<$AttachmentUnits> + +Controls the units (kilobytes or bytes) that attachment sizes use +for display. The default is to display kilobytes if the attachment +is larger than 1024 bytes, bytes otherwise. If you set +C<$AttachmentUnits> to C<'k'> then attachment sizes will always be +displayed in kilobytes. If set to C<'b'>, then sizes will be bytes. + +=cut + +Set($AttachmentUnits, undef); + =item C<$RedistributeAutoGeneratedMessages> Should RT redistribute correspondence that it identifies as @@ -1075,6 +1210,16 @@ to RT for the defined time. Set($AutoLogoff, 0); +=item C<$LogoutRefresh> + +The number of seconds to wait after logout before sending the user to the +login page. By default, 1 second, though you may want to increase this if +you display additional information on the logout page. + +=cut + +Set($LogoutRefresh, 1); + =item C<$WebSecureCookies> By default, RT's session cookie isn't marked as "secure" Some web browsers @@ -1201,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> @@ -1225,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, @@ -1232,6 +1378,7 @@ Set ($DefaultSearchResultFormat, qq{ '__NEWLINE__', '', '<small>__Requestors__</small>', + '', '<small>__CreatedRelative__</small>', '<small>__ToldRelative__</small>', '<small>__LastUpdatedRelative__</small>', @@ -1251,6 +1398,46 @@ Set($DefaultSelfServiceSearchResultFormat, qq{ Requestors, OwnerName}); +=item C<%AdminSearchResultFormat> + +In admin interface format strings similar to tickets search result +formats are used. Use C<%AdminSearchResultFormat> to define format +strings per RT class. + +=cut + +Set(%AdminSearchResultFormat, + Queues => + q{'<a href="__WebPath__/Admin/Queues/Modify.html?id=__id__">__id__</a>/TITLE:#'} + .q{,'<a href="__WebPath__/Admin/Queues/Modify.html?id=__id__">__Name__</a>/TITLE:Name'} + .q{,__Description__,__Address__,__Priority__,__DefaultDueIn__,__Disabled__}, + + Groups => + q{'<a href="__WebPath__/Admin/Groups/Modify.html?id=__id__">__id__</a>/TITLE:#'} + .q{,'<a href="__WebPath__/Admin/Groups/Modify.html?id=__id__">__Name__</a>/TITLE:Name'} + .q{,'__Description__'}, + + Users => + q{'<a href="__WebPath__/Admin/Users/Modify.html?id=__id__">__id__</a>/TITLE:#'} + .q{,'<a href="__WebPath__/Admin/Users/Modify.html?id=__id__">__Name__</a>/TITLE:Name'} + .q{,__RealName__, __EmailAddress__}, + + CustomFields => + q{'<a href="__WebPath__/Admin/CustomFields/Modify.html?id=__id__">__id__</a>/TITLE:#'} + .q{,'<a href="__WebPath__/Admin/CustomFields/Modify.html?id=__id__">__Name__</a>/TITLE:Name'} + .q{,__AppliedTo__, __FriendlyType__, __FriendlyPattern__}, + + Scrips => + q{'<a href="__WebPath__/__WebRequestPathDir__/Scrip.html?id=__id__&Queue=__QueueId__">__id__</a>/TITLE:#'} + .q{,'<a href="__WebPath__/__WebRequestPathDir__/Scrip.html?id=__id__&Queue=__QueueId__">__Description__</a>/TITLE:Description'} + .q{,__Stage__, __Condition__, __Action__, __Template__}, + + Templates => + q{'<a href="__WebPath__/__WebRequestPathDir__/Template.html?Queue=__QueueId__&Template=__id__">__id__</a>/TITLE:#'} + .q{,'<a href="__WebPath__/__WebRequestPathDir__/Template.html?Queue=__QueueId__&Template=__id__">__Name__</a>/TITLE:Name'} + .q{,'__Description__'}, +); + =item C<$SuppressInlineTextFiles> If C<$SuppressInlineTextFiles> is set to a true value, then uploaded @@ -1271,17 +1458,38 @@ ticket searches. Set($DontSearchFileAttachments, undef); -=item C<$ChartFont> +=item C<%ChartFont> + +The L<GD> module (which RT uses for graphs) ships with a builtin font +that doesn't have full Unicode support. You can use a given TrueType font +for a specific language by setting %ChartFont to (language =E<gt> the +absolute path of a font) pairs. Your GD library must have support for +TrueType fonts to use this option. If there is no entry for a language +in the hash then font with 'others' key is used. -The L<GD> module (which RT uses for graphs) uses a builtin font that doesn't -have full Unicode support. You can use a particular TrueType font by setting -$ChartFont to the absolute path of that font. Your GD library must have -support for TrueType fonts to use this option. +RT comes with two TrueType fonts covering most available languages. =cut -Set($ChartFont, undef); +Set( + %ChartFont, + 'zh-cn' => "$RT::BasePath/share/fonts/DroidSansFallback.ttf", + 'zh-tw' => "$RT::BasePath/share/fonts/DroidSansFallback.ttf", + 'ja' => "$RT::BasePath/share/fonts/DroidSansFallback.ttf", + 'others' => "$RT::BasePath/share/fonts/DroidSans.ttf", +); + +=item C<$ChartsTimezonesInDB> + +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 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>. + +=cut +Set( $ChartsTimezonesInDB, 0 ); =item C<@Active_MakeClicky> @@ -1572,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..eb2d09af5 100644 --- a/rt/etc/RT_SiteConfig.pm +++ b/rt/etc/RT_SiteConfig.pm @@ -14,6 +14,40 @@ # # 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); + #Set(@Plugins,(qw(Extension::QuickDelete RT::FM))); 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/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/etc/upgrade/3.8.8/content b/rt/etc/upgrade/3.8.8/content new file mode 100644 index 000000000..ee1943304 --- /dev/null +++ b/rt/etc/upgrade/3.8.8/content @@ -0,0 +1,38 @@ +@Initial = ( + sub { + # make sure global CFs are not applied to local objects + my $ocfs = RT::ObjectCustomFields->new( $RT::SystemUser ); + $ocfs->Limit( FIELD => 'ObjectId', OPERATOR => '!=', VALUE => 0 ); + my $alias = $ocfs->Join( + FIELD1 => 'CustomField', + TABLE2 => 'ObjectCustomFields', + FIELD2 => 'CustomField', + ); + $ocfs->Limit( ALIAS => $alias, FIELD => 'ObjectId', VALUE => 0 ); + while ( my $ocf = $ocfs->Next ) { + $ocf->Delete; + } + }, + sub { + # sort SortOrder + my $sth = $RT::Handle->dbh->prepare( + "SELECT cfs.LookupType, ocfs.id" + ." FROM ObjectCustomFields ocfs, CustomFields cfs" + ." WHERE cfs.id = ocfs.CustomField" + ." ORDER BY cfs.LookupType, ocfs.SortOrder, cfs.Name" + ); + $sth->execute; + + my ($i, $prev_type) = (0, ''); + while ( my ($lt, $id) = $sth->fetchrow_array ) { + $i = 0 if $prev_type ne $lt; + my $ocf = RT::ObjectCustomField->new( $RT::SystemUser ); + $ocf->Load( $id ); + my ($status, $msg) = $ocf->SetSortOrder( $i++ ); + $RT::Logger->warning("Couldn't set SortOrder: $msg") + unless $status; + $prev_type = $lt; + } + }, +); + |