+ Export |
+ <% $widget->html %>
+
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
#if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {
# $cgi->param('clone', $1);
@@ -24,15 +51,19 @@ $action ||= $part_export->exportnum ? 'Edit' : 'Add';
#my $exports = FS::part_export::export_info($svcdb);
my $exports = FS::part_export::export_info();
-my %layers = map { $_ => "$_ - ". $exports->{$_}{desc} } keys %$exports;
-$layers{''}='';
+tie my %layers, 'Tie::IxHash',
+ '' => '',
+ map { $_ => "$_ - ". $exports->{$_}{desc} }
+ sort { $a cmp $b }
+ keys %$exports;
+;
my $widget = new HTML::Widgets::SelectLayers(
'selected_layer' => $part_export->exporttype,
'options' => \%layers,
'form_name' => 'dummy',
'form_action' => 'process/part_export.cgi',
- 'form_text' => [qw( exportnum machine )],
+ 'form_text' => [qw( exportnum exportname machine )],
# 'form_checkbox' => [qw()],
'html_between' => " |
\n",
'layer_callback' => sub {
@@ -46,6 +77,8 @@ my $widget = new HTML::Widgets::SelectLayers(
foreach my $option ( keys %{$exports->{$layer}{options}} ) {
my $optinfo = $exports->{$layer}{options}{$option};
+ die "Retreived non-ref export info option from $layer export: $optinfo"
+ unless ref($optinfo);
my $label = $optinfo->{label};
my $type = defined($optinfo->{type}) ? $optinfo->{type} : 'text';
my $value = $cgi->param($option)
@@ -54,29 +87,89 @@ my $widget = new HTML::Widgets::SelectLayers(
? $optinfo->{default}
: ''
);
- $html .= qq!Export RADIUS clients | ';
+
+ $html .= include('/elements/checkboxes-table.html',
+ 'source_obj' => $part_export,
+ 'link_table' => 'export_nas',
+ 'target_table' => 'nas',
+ #hashref => {},
+ 'name_callback' => sub {
+ $_[0]->shortname . ' (' . $_[0]->nasname . ')',
+ },
+ 'default' => 'yes',
+ 'target_link' => $p.'edit/nas.html?',
+ );
+
$html .= ' |
';
}
+
$html .= '';
$html .= '