4 #if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {
5 # $cgi->param('clone', $1);
7 # $cgi->param('clone', '');
10 my($query) = $cgi->keywords;
13 if ( $cgi->param('error') ) {
14 $part_export = new FS::part_export ( {
15 map { $_, scalar($cgi->param($_)) } fields('part_export')
17 } elsif ( $query =~ /^(\d+)$/ ) {
18 $part_export = qsearchs('part_export', { 'exportnum' => $1 } );
20 $part_export = new FS::part_export;
22 $action ||= $part_export->exportnum ? 'Edit' : 'Add';
28 'Batch export of /etc/passwd and /etc/shadow files (Linux/SysV)',
33 'Batch export of /etc/passwd and /etc/master.passwd files (BSD)',
38 # 'Batch export of /etc/global/passwd and /etc/global/shadow for NIS ',
43 'Batch export of /etc/passwd and /etc/master.passwd files (BSD)',
47 'desc' => 'Batch export of a text /etc/raddb/users file (Livingston, Cistron)',
50 'desc' => 'Real-time export to SQL-backed RADIUS (ICRADIUS, FreeRADIUS)',
52 'datasrc' => { label=>'DBI data source' },
53 'username' => { label=>'Database username' },
54 'password' => { label=>'Database password' },
57 'notes' => 'Not specifying datasrc will export to the freeside database? (no... notes on MySQL replication, DBI::Proxy, etc., from Conf.pm && export.html etc., reset with bin/sqlradius_reset',
60 'desc' => 'Real-time export to Cyrus IMAP server',
63 'desc' => 'Real-time export to Critical Path Account Provisioning Protocol',
66 'desc' => 'Real-time export to InfoStreet streetSmartAPI',
68 'url' => { label=>'XML-RPC Access URL', },
69 'login' => { label=>'InfoStreet login', },
70 'password' => { label=>'InfoStreet password', },
71 'groupID' => { label=>'InfoStreet groupID', },
74 'notes' => 'Real-time export to <a href="http://www.infostreet.com/">InfoStreet</a> streetSmartAPI. Requires installation of <a href="http://search.cpan.org/search?dist=Frontier-Client">Frontier::Client</a> from CPAN.',
88 #my $svcdb = $part_export->part_svc->svcdb;
90 my $svcdb = 'svc_acct';
92 my %layers = map { $_ => "$_ - ". $exports{$svcdb}{$_}{desc} }
93 keys %{$exports{$svcdb}};
96 my $widget = new HTML::Widgets::SelectLayers(
97 'selected_layer' => $part_export->exporttype,
98 'options' => \%layers,
99 'form_name' => 'dummy',
100 'form_action' => 'process/part_export.cgi',
101 'form_text' => [qw( exportnum machine )],
102 # 'form_checkbox' => [qw()],
103 'html_between' => "</TD></TR></TABLE>\n",
104 'layer_callback' => sub {
106 my $html = qq!<INPUT TYPE="hidden" NAME="exporttype" VALUE="$layer">!.
108 foreach my $option ( keys %{$exports{$svcdb}->{$layer}{options}} ) {
109 # foreach my $option ( qw(url login password groupID ) ) {
110 my $optinfo = $exports{$svcdb}->{$layer}{options}{$option};
111 my $label = $optinfo->{label};
112 my $value = $cgi->param($option) || $part_export->option($option);
113 $html .= qq!<TR><TD ALIGN="right">$label</TD><TD>!.
114 qq!<TD><INPUT TYPE="text" NAME="$option" VALUE="$value"></TD>!.
119 $html .= '<INPUT TYPE="hidden" NAME="options" VALUE="'.
120 join(',', keys %{$exports{$svcdb}->{$layer}{options}} ). '">';
122 $html .= '<INPUT TYPE="hidden" NAME="nodomain" VALUE="'.
123 $exports{$svcdb}->{$layer}{nodomain}. '">';
125 $html .= '<INPUT TYPE="submit" VALUE="'.
126 ( $part_export->exportnum ? "Apply changes" : "Add export" ).
134 <%= header("$action Export", menubar(
135 'Main Menu' => popurl(2),
136 ), ' onLoad="visualize()"')
139 <% if ( $cgi->param('error') ) { %>
140 <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
145 <INPUT TYPE="hidden" NAME="exportnum" VALUE="<%= $part_export->exportnum %>">
147 <%= ntable("#cccccc",2) %>
149 <TD ALIGN="right">Export host</TD>
151 <INPUT TYPE="text" NAME="machine" VALUE="<%= $part_export->machine %>">
155 <TD ALIGN="right">Export</TD>
156 <TD><%= $widget->html %>