NAME

RT::Extension::Converter::RT3 - Handle the RT3 side of a conversion

SYNOPSIS

use RT::Extension::Converter::RT3;
my $converter = RT::Extension::Converter::RT3->new;

DESCRIPTION

Object that should be used by converter scripts to

METHODS

new

Returns a converter object after setting up things such as the config

config

Returns a config object

create_user

Creates a new user, expects a hash of valid values for RT3's User::Create method plus one special SuperUser argument that will cause SuperUser rights to be granted after creation

returns an RT::User object, or undef on failure

create_queue

Creates a new queue, expects a hash of valid values for RT3's Queue::Create method

returns an RT::Queue object, or undef on failure

create_queue_area

Takes Queue => RT::Queue, Area => Area's name

Returns an error message if making the appropriate custom fields fails. Otherwise returns the empty string

This is rather RT1 specific. RT2 has a more hierarchical Keyword option that translates into CFs. Areas are the RT1 "custom field" but there was only one of them, so we just make an RT3 Custom Field called Area and whack a simple select list into it

_create_queue_area_cf

Wraps up the nasty logic of loading/creating a CF for the area

create_queue_acl

Takes Queue => RT::Queue Acl => acl data from RT1

Sets a number of new rights based on the old display/manipulate/admin categories. This should probably be reworked manually to use groups once RT3 is being tested. But, if you have a lot of users, this will at least get you converted.

XXX Possibly create 3 groups, granting rights on the queues and adding users to the groups, rather than doing individual rights

create_ticket

Takes arguments similar to RT3::Ticket's Create. Will take a Requestors argument and try to chop it up into individual Requestor values.

create_transactions

takes Path => /path/to/transaction/file, Ticket => RT::Ticket, Transactions => [arrayref of transaction data]

_find_transaction_file

RT1 would sometimes get confused about timezones and store a file in tomorrow or yesterday's path. Go find the file.

_process_transaction_file

We need to turn the RT1 files back into MIME objects This means converting the old Headers Follow line and the broken MIME headers into something MIME::Parser won't choke on.

_load_or_create_user

Given an EmailAddress, Name (username) will try to load the user by username first and then by EmailAddress. If that fails, a new unprivileged user will be created with Name => Name|EmailAddress

Will carp if loading AND creating fail Otherwise returns a valid user object

creates all accumulated links. We do this at the end so that all the tickets will exist, rather than doing it during ticket creation and having to work around future tickets not being imported yet.

_merge_list

private data storage routine to hold what tickets are merged where

_merges

takes ticket => id, into => otherid tracks what merges need doing after we're done creating all the tickets.

When called without arguments, returns a hashref containing ticketid => ticket to merge into

_encode_data

Used to make sure data gets properly unicode'd for RT3.6. Failure to use this in places will make non-americans unhappy

Takes a hashref of arguments, returns an encoded hashref.

AUTHOR

Kevin Falcone <falcone@bestpractical.com>

LICENCE AND COPYRIGHT

Copyright (c) 2007, Best Practical Solutions, LLC. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.