diff options
Diffstat (limited to 'rt/etc')
| -rw-r--r-- | rt/etc/RT_Config.pm | 179 | ||||
| -rw-r--r-- | rt/etc/RT_SiteConfig.pm | 31 | ||||
| -rw-r--r-- | rt/etc/acl.Oracle | 12 | ||||
| -rwxr-xr-x | rt/etc/acl.Pg | 38 | ||||
| -rwxr-xr-x | rt/etc/acl.mysql | 3 | ||||
| -rw-r--r-- | rt/etc/schema.Oracle | 398 | ||||
| -rwxr-xr-x | rt/etc/schema.mysql | 89 | ||||
| -rw-r--r-- | rt/etc/upgrade/2.1.71 | 211 |
8 files changed, 229 insertions, 732 deletions
diff --git a/rt/etc/RT_Config.pm b/rt/etc/RT_Config.pm index 5386a8e05..6267af539 100644 --- a/rt/etc/RT_Config.pm +++ b/rt/etc/RT_Config.pm @@ -17,7 +17,7 @@ use RT::Config; # {{{ Base Configuration -# $rtname the string that RT will look for in mail messages to +# $rtname is the string that RT will look for in mail messages to # figure out what ticket a new piece of mail belongs to # Your domain name is recommended, so as not to pollute the namespace. @@ -26,6 +26,28 @@ use RT::Config; Set($rtname , "example.com"); + +# This regexp controls what subject tags RT recognizes as its own. +# If you're not dealing with historical $rtname values, you'll likely +# never have to enable this feature. +# +# Be VERY CAREFUL with it. Note that it overrides $rtname for subject +# token matching and that you should use only "non-capturing" parenthesis +# grouping. For example: +# +# Set($EmailSubjectTagRegex, qr/(?:example.com|example.org)/i ); +# +# and NOT +# +# Set($EmailSubjectTagRegex, qr/(example.com|example.org)/i ); +# +# This setting would make RT behave exactly as it does without the +# setting enabled. +# +# Set($EmailSubjectTagRegex, qr/\Q$rtname\E/i ); + + + # You should set this to your organization's DNS domain. For example, # fsck.com or asylum.arkham.ma.us. It's used by the linking interface to # guarantee that ticket URIs are unique and easy to construct. @@ -42,14 +64,12 @@ Set($Timezone , 'US/Eastern'); # }}} -# }}} - # {{{ Database Configuration # Database driver beeing used. Case matters # Valid types are "mysql", "Oracle" and "Pg" -Set($DatabaseType , 'mysql'); +Set($DatabaseType , 'Pg'); # The domain name of your database server # If you're running mysql and it's on localhost, @@ -62,13 +82,13 @@ Set($DatabaseRTHost , 'localhost'); Set($DatabasePort , ''); #The name of the database user (inside the database) -Set($DatabaseUser , 'rt_user'); +Set($DatabaseUser , 'freeside'); # Password the DatabaseUser should use to access the database -Set($DatabasePassword , 'rt_pass'); +Set($DatabasePassword , ''); # The name of the RT's database on your database server -Set($DatabaseName , 'rt3'); +Set($DatabaseName , 'freeside'); # If you're using Postgres and have compiled in SSL support, # set DatabaseRequireSSL to 1 to turn on SSL communication @@ -89,7 +109,7 @@ Set($OwnerEmail , 'root'); Set($LoopsToRTOwner , 1); -# If $StoreLoopss is defined, RT will record messages that it believes +# If $StoreLoops is defined, RT will record messages that it believes # to be part of mail loops. # As it does this, it will try to be careful not to send mail to the # sender of these messages @@ -106,12 +126,12 @@ Set($StoreLoops , undef); Set($MaxAttachmentSize , 10000000); # $TruncateLongAttachments: if this is set to a non-undef value, -# RT will truncate attachments longer than MaxAttachmentLength. +# RT will truncate attachments longer than MaxAttachmentSize. Set($TruncateLongAttachments , undef); # $DropLongAttachments: if this is set to a non-undef value, -# RT will silently drop attachments longer than MaxAttachmentLength. +# RT will silently drop attachments longer than MaxAttachmentSize. Set($DropLongAttachments , undef); @@ -135,8 +155,12 @@ Set($RTAddressRegexp , '^rt\@example.com$'); # (These values are passed to the CanonicalizeEmailAddress subroutine in RT/User.pm) # By default, that routine performs a s/$Match/$Replace/gi on any address passed to it -Set($CanonicalizeEmailAddressMatch , 'subdomain.example.com$'); -Set($CanonicalizeEmailAddressReplace , 'example.com'); +#Set($CanonicalizeEmailAddressMatch , '@subdomain\.example\.com$'); +#Set($CanonicalizeEmailAddressReplace , '@example.com'); + +# set this to true and the create new user page will use the values that you +# enter in the form but use the function CanonicalizeUserInfo in User_Local.pm +Set($CanonicalizeOnCreate , 0); # If $SenderMustExistInExternalDatabase is true, RT will refuse to # create non-privileged accounts for unknown users if you are using @@ -175,7 +199,7 @@ Set($CommentAddress , 'RT_CommentAddressNotSet'); # If 'sendmailpipe' doesn't work well for you, try 'sendmail' # # Note that you should remove the '-t' from $SendmailArguments -# if you use 'sendmail rather than 'sendmailpipe' +# if you use 'sendmail' rather than 'sendmailpipe' Set($MailCommand , 'sendmailpipe'); @@ -186,6 +210,11 @@ Set($MailCommand , 'sendmailpipe'); # These options are good for most sendmail wrappers and workalikes Set($SendmailArguments , "-oi -t"); +# $SendmailBounceArguments defines what flags to pass to $Sendmail +# assuming RT needs to send an error (ie. bounce). + +Set($SendmailBounceArguments , '-f "<>"'); + # These arguments are good for sendmail brand sendmail 8 and newer #Set($SendmailArguments,"-oi -t -ODeliveryMode=b -OErrorMode=m"); @@ -216,12 +245,15 @@ Set($UseFriendlyToLine , 0); # are WatcherType and TicketId. Set($FriendlyToLineFormat, "\"%s of $RT::rtname Ticket #%s\":;"); -# By default RT doesn't notify the person who performs an update, as they +# By default, RT doesn't notify the person who performs an update, as they # already know what they've done. If you'd like to change this behaviour, # Set $NotifyActor to 1 Set($NotifyActor, 0); +# By default, RT records each message it sends out to its own internal database.# To change this behaviour, set $RecordOutgoingEmail to 0 + +Set($RecordOutgoingEmail, 1); # }}} @@ -247,6 +279,14 @@ Set($LogToFile , undef); Set($LogDir, '/opt/rt3/var/log'); Set($LogToFileNamed , "rt.log"); #log to rt.log +# On Solaris or UnixWare, set to ( socket => 'inet' ). Options here +# override any other options RT passes to Log::Dispatch::Syslog. +# Other interesting flags include facility and logopt. (See the +# Log::Dispatch::Syslog documentation for more information.) (Maybe +# ident too, if you have multiple RT installations.) + +@LogToSyslogConf = () unless (@LogToSyslogConf); + # }}} # {{{ Web interface configuration @@ -263,17 +303,22 @@ Set($WebPath , ""); # This is the Scheme, server and port for constructing urls to webrt # $WebBaseURL doesn't need a trailing / -Set($WebBaseURL , "http://RT::WebBaseURL.not.configured:80"); +Set($WebBaseURL , "http://localhost"); Set($WebURL , $WebBaseURL . $WebPath . "/"); # $WebImagesURL points to the base URL where RT can find its images. -Set($WebImagesURL , $WebURL . "NoAuth/images/"); +Set($WebImagesURL , $WebPath . "/NoAuth/images/"); -# $RTLogoURL points to the URL of the RT logo displayed in the web UI +# $LogoURL points to the URL of the RT logo displayed in the web UI -Set($LogoURL , $WebImagesURL . "rt.jpg"); +Set($LogoURL , $WebImagesURL . "bplogo.gif"); + +# WebNoAuthRegex - What portion of RT's URLspace should not require +# authentication. +Set($WebNoAuthRegex, qr!^(?:/+NoAuth/| + /+REST/\d+\.\d+/NoAuth/)!x ); # For message boxes, set the entry box width and what type of wrapping # to use. @@ -289,6 +334,20 @@ Set($MessageBoxWrap, "HARD"); # sent in a request (although there is probably more to it than that) Set($TrustHTMLAttachments , undef); +# Should RT redistribute correspondence that it identifies as +# machine generated? A true value (the default) will do so, setting +# this to '0' will cause no such messages to be redistributed. +# You can also use 'privileged', which will redistribute only to +# privileged users. This is seful if you get malformed bounces caused by +# autocreated requestors with bogus addresses. +Set($RedistributeAutoGeneratedMessages, 1); + +# If PreferRichText is set to a true value, RT will show HTML/Rich text +# messages in preference to their plaintext alternatives. RT "scrubs" the +# html to show only a minimal subset of HTML to avoid possible contamination +# by cross-site-scripting attacks. +Set($PreferRichText, undef); + # If $WebExternalAuth is defined, RT will defer to the environment's # REMOTE_USER variable. @@ -316,32 +375,66 @@ Set($WebExternalAuto , undef); # Set($WebSessionClass , 'Apache::Session::File'); +# By default, RT clears its database cache after every page view. +# This ensures that you've always got the most current information +# when working in a multi-process (mod_perl or FastCGI) Environment +# Setting $WebFlushDbCacheEveryRequest to '0' will turn this off, +# which will speed RT up a bit, at the expense of a tiny bit of data +# accuracy + +Set($WebFlushDbCacheEveryRequest, '1'); + + # $MaxInlineBody is the maximum attachment size that we want to see # inline when viewing a transaction. 13456 is a random sane-sounding # default. Set($MaxInlineBody, 13456); -# $MyTicketsLength is the length of the table on the front page. -# For some people, the default of 10 isn't big enough to get a feel for -# how much work needs to be done before you get some time off. +# $MyTicketsLength is the length of the owned tickets table on the +# front page. For some people, the default of 10 isn't big enough +# to get a feel for how much work needs to be done before you get +# some time off. Set($MyTicketsLength, 10); +# $MyRequestsLength is the length of the requested tickets table +# on the front page. + +Set($MyRequestsLength, 10); + # @MasonParameters is the list of parameters for the constructor of # HTML::Mason's Apache or CGI Handler. This is normally only useful -# for debugging, eg. profiling individual components with -# (preamble => 'my $p = MasonX::Profiler->new($m, $r);'); +# for debugging, eg. profiling individual components with: +# use MasonX::Profiler; # available on CPAN +# @MasonParameters = (preamble => 'my $p = MasonX::Profiler->new($m, $r);'); @MasonParameters = () unless (@MasonParameters); +# $DefaultSearchResultFormat is the default format for RT search results +Set ($DefaultSearchResultFormat, qq{ + '<B><A HREF="$RT::WebPath/Ticket/Display.html?id=__id__">__id__</a></B>/TITLE:#', + '<B><A HREF="$RT::WebPath/Ticket/Display.html?id=__id__">__Subject__</a></B>/TITLE:Subject', + Status, + QueueName, + OwnerName, + Priority, + '__NEWLINE__', + '', + '<small>__Requestors__</small>', + '<small>__CreatedRelative__</small>', + '<small>__ToldRelative__</small>', + '<small>__LastUpdatedRelative__</small>', + '<small>__TimeLeft__</small>'}); + + # }}} # {{{ RT UTF-8 Settings # An array that contains languages supported by RT's internationalization -# interface. Defaults to all *.po lexicons; set it to qw(en ja) will make -# RT bilingual instead of multilingual, but will save same memory. +# interface. Defaults to all *.po lexicons; setting it to qw(en ja) will make +# RT bilingual instead of multilingual, but will save some memory. @LexiconLanguages = qw(*) unless (@LexiconLanguages); @@ -371,4 +464,40 @@ Set($AmbiguousDayInPast , 1); # }}} +# {{{ Miscellaneous RT Settings + +# You can define new statuses and even reorder existing statuses here. +# WARNING. DO NOT DELETE ANY OF THE DEFAULT STATUSES. If you do, RT +# will break horribly. + +@ActiveStatus = qw(new open stalled) unless @ActiveStatus; +@InactiveStatus = qw(resolved rejected deleted) unless @InactiveStatus; + +# Backward compatability setting. Add/Delete Link used to record one +# transaction and run one scrip. Set this value to 0 if you want +# both link transactions to have a scrip run. +Set($LinkTransactionsRun1Scrip , 1); + +# }}} + + +# {{{ Development Mode +# +# RT comes with a "Development mode" setting. +# This setting, as a convenience for developers, turns on +# all sorts of development options that you most likely don't want in +# production: +# +# * Turns off Mason's 'static_source' directive. By default, you can't +# edit RT's web ui components on the fly and have RT magically pick up +# your changes. (It's a big performance hit) +# +# * More to come +# + +Set($DevelMode, '0'); + +# }}} + + 1; diff --git a/rt/etc/RT_SiteConfig.pm b/rt/etc/RT_SiteConfig.pm index f5cc2985b..5e3dc8081 100644 --- a/rt/etc/RT_SiteConfig.pm +++ b/rt/etc/RT_SiteConfig.pm @@ -14,5 +14,34 @@ # # 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. +# Somtimes you may want to change domain, timezone, or freeside::URL later, +# everything else should probably stay untouched. + +$RT::rtname = '%%%RT_DOMAIN%%%'; +$RT::Organization = '%%%RT_DOMAIN%%%'; + +$RT::Timezone = '%%%RT_TIMEZONE%%%'; + +$RT::WebBaseURL = ''; +$RT::WebPath = '/freeside/rt'; + +$RT::WebExternalAuth = 1; +$RT::WebFallbackToInternal = 1; #no +$RT::WebExternalAuto = 1; + +$RT::URI::freeside::IntegrationType = 'Internal'; +$RT::URI::freeside::URL = '%%%FREESIDE_URL%%%'; + +Set($DatabaseHost , ''); + +# These settings are user-editable. + +$RT::MyTicketsLength = 10; +$RT::QuickCreateLong = 0; #set to true to cause quick ticket creation to + #redirect to the "long" ticket creation screen + #instead of just creating a ticket with the subject. + 1; diff --git a/rt/etc/acl.Oracle b/rt/etc/acl.Oracle index ac29215c2..c8667c031 100644 --- a/rt/etc/acl.Oracle +++ b/rt/etc/acl.Oracle @@ -1,10 +1,10 @@ sub acl { return ( -"CREATE USER ${RT::DatabaseUser} identified by ${RT::DatabasePassword} ". -"default tablespace USERS " . -"temporary tablespace TEMP " . -"quota unlimited on USERS" , -"grant connect, resource to ${RT::DatabaseUser}" -); +"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 fb625592d..16ea71b2d 100755 --- a/rt/etc/acl.Pg +++ b/rt/etc/acl.Pg @@ -7,42 +7,38 @@ sub acl { attachments_id_seq Attachments - Attributes - attributes_id_seq queues_id_seq - Queues + Queues links_id_seq - Links + Links principals_id_seq - Principals + Principals groups_id_seq - Groups + Groups scripconditions_id_seq - ScripConditions + ScripConditions transactions_id_seq - Transactions + Transactions scrips_id_seq - Scrips + Scrips acl_id_seq - ACL + ACL groupmembers_id_seq - GroupMembers + GroupMembers cachedgroupmembers_id_seq - CachedGroupMembers + CachedGroupMembers users_id_seq - Users + Users tickets_id_seq - Tickets + Tickets scripactions_id_seq - ScripActions + ScripActions templates_id_seq - Templates - objectcustomfieldvalues_id_s - ObjectCustomFieldValues + Templates + ticketcustomfieldvalues_id_s + TicketCustomFieldValues customfields_id_seq - CustomFields - objectcustomfields_id_s - ObjectCustomFields + CustomFields customfieldvalues_id_seq CustomFieldValues sessions diff --git a/rt/etc/acl.mysql b/rt/etc/acl.mysql index 621ef121c..0ecaa3b15 100755 --- a/rt/etc/acl.mysql +++ b/rt/etc/acl.mysql @@ -1,9 +1,8 @@ sub acl { -return () if !$RT::DatabaseUser or $RT::DatabaseUser eq 'root'; 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}';"); +"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/schema.Oracle b/rt/etc/schema.Oracle deleted file mode 100644 index 569d80cc4..000000000 --- a/rt/etc/schema.Oracle +++ /dev/null @@ -1,398 +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 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 VARCHAR2(255), - 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.mysql b/rt/etc/schema.mysql index b7d53f884..46f8ec562 100755 --- a/rt/etc/schema.mysql +++ b/rt/etc/schema.mysql @@ -16,6 +16,7 @@ CREATE TABLE Attachments ( PRIMARY KEY (id) ) TYPE=InnoDB; +CREATE INDEX Attachments1 ON Attachments (Parent) ; CREATE INDEX Attachments2 ON Attachments (TransactionId) ; CREATE INDEX Attachments3 ON Attachments (Parent, TransactionId) ; # }}} @@ -58,9 +59,9 @@ CREATE TABLE Links ( PRIMARY KEY (id) ) TYPE=InnoDB; +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); # }}} @@ -86,12 +87,12 @@ CREATE TABLE Groups ( Description varchar(255) NULL , Domain varchar(64), Type varchar(64), - Instance integer, + Instance varchar(64), PRIMARY KEY (id) ) TYPE=InnoDB; CREATE INDEX Groups1 ON Groups (Domain,Instance,Type,id); -CREATE INDEX Groups2 On Groups (Type, Instance); +CREATE INDEX Groups2 On Groups (Type, Instance, Domain); # }}} @@ -117,23 +118,21 @@ CREATE TABLE ScripConditions ( # {{{ Transactions CREATE TABLE Transactions ( id INTEGER NOT NULL AUTO_INCREMENT, - ObjectType varchar(64) NOT NULL, - ObjectId integer NOT NULL DEFAULT 0 , + EffectiveTicket integer NOT NULL DEFAULT 0 , + Ticket 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 , + Data varchar(100) NULL , Creator integer NOT NULL DEFAULT 0 , Created DATETIME NULL , PRIMARY KEY (id) ) TYPE=InnoDB; -CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId); +CREATE INDEX Transactions1 ON Transactions (Ticket); +CREATE INDEX Transactions2 ON Transactions (EffectiveTicket); # }}} @@ -211,6 +210,7 @@ create table CachedGroupMembers ( ) TYPE=InnoDB; CREATE INDEX DisGrouMem on CachedGroupMembers (GroupId,MemberId,Disabled); +CREATE INDEX GrouMem on CachedGroupMembers (GroupId,MemberId); # }}} @@ -257,6 +257,8 @@ CREATE TABLE Users ( CREATE UNIQUE INDEX Users1 ON Users (Name) ; +CREATE INDEX Users2 ON Users (Name); +CREATE INDEX Users3 ON Users (id, EmailAddress); CREATE INDEX Users4 ON Users (EmailAddress); @@ -297,6 +299,9 @@ CREATE TABLE Tickets ( CREATE INDEX Tickets1 ON Tickets (Queue, Status) ; CREATE INDEX Tickets2 ON Tickets (Owner) ; +CREATE INDEX Tickets3 ON Tickets (EffectiveId) ; +CREATE INDEX Tickets4 ON Tickets (id, Status) ; +CREATE INDEX Tickets5 ON Tickets (id, EffectiveId) ; CREATE INDEX Tickets6 ON Tickets (EffectiveId, Type) ; # }}} @@ -338,31 +343,21 @@ CREATE TABLE Templates ( # }}} -# {{{ ObjectCustomFieldValues +# {{{ TicketCustomFieldValues -CREATE TABLE ObjectCustomFieldValues ( +CREATE TABLE TicketCustomFieldValues ( id INTEGER NOT NULL AUTO_INCREMENT, + Ticket int NOT NULL , 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 @@ -370,13 +365,10 @@ CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,Ob 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 + Type varchar(200) NULL , + Queue integer NOT NULL DEFAULT 0 , Description varchar(255) NULL , SortOrder integer NOT NULL DEFAULT 0 , - LookupType varchar(255) NOT NULL, Creator integer NOT NULL DEFAULT 0 , Created DATETIME NULL , @@ -386,22 +378,8 @@ CREATE TABLE CustomFields ( PRIMARY KEY (id) ) TYPE=InnoDB; -# }}} - -# {{{ ObjectCustomFields +CREATE INDEX CustomFields1 on CustomFields (Disabled, Queue); -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; # }}} @@ -421,31 +399,6 @@ CREATE TABLE CustomFieldValues ( 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 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', - }, -); - -# }}} - |
