Permalink
Browse files

Move xmlopts to a data structure instead of in the XMLout call

Just a bit cleaner
  • Loading branch information...
1 parent d5970e6 commit 4362abc433bcd7211dcd8fef7163a1377c02e6a7 @afresh1 committed Aug 13, 2012
Showing with 13 additions and 7 deletions.
  1. +13 −7 rt-ticket-dumper
View
20 rt-ticket-dumper
@@ -13,6 +13,18 @@ my %queues;
my %lut;
my %users;
+my %xmlopts = (
+ RootName => 'Ticket',
+ NoAttr => 1,
+ SuppressEmpty => 1,
+ XMLDecl => '<?xml version="1.0" encoding="UTF-8"?>',
+ GroupTags => {
+ CustomFields => 'CustomField',
+ Transactions => 'Transaction',
+ Attachments => 'Attachment',
+ },
+);
+
my %user_types = map { $_ => 1 } qw(
Owner
Creator
@@ -222,12 +234,6 @@ sub export_ticket {
my $filename = sprintf "Ticket_%05d.xml", $data->{id};
open my $fh, '>', $filename or die $!;
- print $fh XMLout(
- $data,
- RootName => 'Ticket',
- NoAttr => 1,
- SuppressEmpty => '',
- XMLDecl => '<?xml version="1.0" encoding="UTF-8"?>',
- );
+ print $fh XMLout( $data, %xmlopts );
close $fh;
}

0 comments on commit 4362abc

Please sign in to comment.