diff options
Diffstat (limited to 'rt/t/data/initialdata')
-rw-r--r-- | rt/t/data/initialdata/initialdata | 101 | ||||
-rw-r--r-- | rt/t/data/initialdata/transaction-cfs | 52 |
2 files changed, 153 insertions, 0 deletions
diff --git a/rt/t/data/initialdata/initialdata b/rt/t/data/initialdata/initialdata new file mode 100644 index 000000000..19e019652 --- /dev/null +++ b/rt/t/data/initialdata/initialdata @@ -0,0 +1,101 @@ +# Samples of all things we support in initialdata + +@Queues = ( + { + Name => 'Test Queue', + CorrespondAddress => 'help@example.com', + CommentAddress => 'help-comment@example.com', + } +); + +@Scrips = ( + { + Description => 'Test Without Stage', + ScripCondition => 'On Resolve', + ScripAction => 'Notify Requestors', + Template => 'Correspondence in HTML', + }, + { + Queue => 'General', + Description => 'Test Without Stage and One Queue', + ScripCondition => 'On Resolve', + ScripAction => 'Notify Requestors', + Template => 'Correspondence in HTML', + }, + { + Queue => ['General', 'Test Queue'], + Description => 'Test Without Stage and Two Queues', + ScripCondition => 'On Resolve', + ScripAction => 'Notify Requestors', + Template => 'Correspondence in HTML', + }, + { + Description => 'Test TransactionCreate', + ScripCondition => 'On Resolve', + ScripAction => 'Notify Requestors', + Template => 'Correspondence in HTML', + Stage => 'TransactionCreate', + }, + { + Description => 'Test TransactionBatch', + ScripCondition => 'On Resolve', + ScripAction => 'Notify Requestors', + Template => 'Correspondence in HTML', + Stage => 'TransactionBatch', + }, +); + +@CustomFields = ( + { + Name => 'Favorite color', + Type => 'FreeformSingle', + LookupType => 'RT::Queue-RT::Ticket', + Queue => 'Test Queue', + }, +); + +@Groups = ( + { + Name => 'Test Employees', + Description => 'All of the employees of my company', + Attributes => [ + { + Name => 'SavedSearch', + Description => 'Stalled Tickets in Test Queue', + Content => { + Query => "Status = 'stalled' AND Queue = 'Test Queue'", + OrderBy => 'id', + Order => 'DESC' + }, + }, + ], + } +); + +@ACL = ( + { GroupId => 'Test Employees', + GroupDomain => 'UserDefined', + CF => 'Favorite Color', + Queue => 'Test Queue', + Right => ['SeeCustomField', 'ModifyCustomField'], + }, +); + +@Attributes = ({ + Name => 'SavedSearch', + Description => 'New Tickets in Test Queue', + Object => sub { + my $GroupName = 'Test Employees'; + my $group = RT::Group->new( RT->SystemUser ); + + my( $ret, $msg ) = $group->LoadUserDefinedGroup( $GroupName ); + die $msg unless $ret; + + return $group; + }, + Content => { + Query => "Status = 'new' AND Queue = 'Test Queue'", + OrderBy => 'id', + Order => 'DESC' + }, +}); diff --git a/rt/t/data/initialdata/transaction-cfs b/rt/t/data/initialdata/transaction-cfs new file mode 100644 index 000000000..25c8274ff --- /dev/null +++ b/rt/t/data/initialdata/transaction-cfs @@ -0,0 +1,52 @@ +use strict; +use warnings; + +our @Queues = ( + { Name => "Blues" }, + { Name => "Purples" }, +); + +our @CustomFields = ( + map +{ + LookupType => RT::Transaction->CustomFieldLookupType, + MaxValues => 1, + Type => "Freeform", + %$_ + }, + { Name => "Billable", + Type => "Select", + Values => [ + { Name => "Yes", SortOrder => 1 }, + { Name => "No", SortOrder => 2 }, + ], + }, + { Name => "Who", + Type => "SelectMultiple", + Values => [ + map +{ Name => $_ }, + "Facilities", + "Information Technology", + "Library", + "Telecom", + ], + }, + { Name => "When", + Type => "Date", + }, + + # Two CFs named the same, but each applied to only one queue + # Note: Queue => ref forces RT::Handle to apply rather than + # RT::CustomField->Create; the former respects LookupType, the latter + # doesn't. + { Name => "Color", + Queue => ["Blues"], + }, + { Name => "Color", + Queue => ["Purples"], + }, + + # Some ticket CFs to test mixed searches + { Name => "Location", + LookupType => RT::Ticket->CustomFieldLookupType, + }, +); |