0749fec0921db45348bfd148ca8b37c51f06ed30
[freeside.git] / FS / FS / part_export / domain_sql.pm
1 package FS::part_export::domain_sql;
2 use base qw( FS::part_export::sql_Common );
3
4 use strict;
5 use vars qw(%info);
6 use Tie::IxHash;
7 use FS::part_export;
8
9 tie my %options, 'Tie::IxHash', %{__PACKAGE__->sql_options};
10
11 tie my %postfix_transport_map, 'Tie::IxHash', 
12   'domain' => 'domain'
13 ;
14 my $postfix_transport_map = 
15   join('\n', map "$_ $postfix_transport_map{$_}",
16                  keys %postfix_transport_map      );
17 tie my %postfix_transport_static, 'Tie::IxHash',
18   'transport' => 'virtual:',
19 ;
20 my $postfix_transport_static = 
21   join('\n', map "$_ $postfix_transport_static{$_}",
22                  keys %postfix_transport_static      );
23
24 %info  = (
25   'svc'     => 'svc_domain',
26   'desc'    => 'Real time export of domains to SQL databases '.
27                '(postfix, others?)',
28   'options' => \%options,
29   'notes'   => <<END
30 Export domains (svc_domain records) to SQL databases.  Currently this is a
31 simple export with a default for Postfix, but it can be extended for other
32 uses.
33
34 <BR><BR>Use these buttons for useful presets:
35 <UL>
36   <LI><INPUT TYPE="button" VALUE="postfix_transport" onClick='
37     this.form.table.value = "transport";
38     this.form.schema.value = "$postfix_transport_map";
39     this.form.static.value = "$postfix_transport_static";
40     this.form.primary_key.value = "domain";
41   '>
42 </UL>
43 END
44 );
45
46 # inherit everything else from sql_Common
47
48 1;
49