X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_export.cgi;h=bbb723dbfac79428a886871fe6dfa174ba32d170;hp=79c57aefc846e96a1edae8fd448c129e35c11021;hb=833cfe5c9938d33c3e6b97ed610c25a7afa6eb04;hpb=673b9a458d9138523026963df6fa3b4683e09bae diff --git a/httemplate/browse/part_export.cgi b/httemplate/browse/part_export.cgi index 79c57aefc..bbb723dbf 100755 --- a/httemplate/browse/part_export.cgi +++ b/httemplate/browse/part_export.cgi @@ -1,7 +1,9 @@ - -<%= header("Export Listing", menubar( 'Main Menu' => "$p#sysadmin" )) %> +<% include("/elements/header.html", "Export Listing") %> + Provisioning services to external machines, databases and APIs.

-Add a new export

+ +Add a new export

+ -<%= table() %> - - Export - Options - +<% include('/elements/table-grid.html') %> +% my $bgcolor1 = '#eeeeee'; +% my $bgcolor2 = '#ffffff'; +% my $bgcolor = ''; -<% foreach my $part_export ( sort { - $a->getfield('exportnum') <=> $b->getfield('exportnum') - } qsearch('part_export',{}) ) { -%> - <%= $part_export->exportnum %> - <%= $part_export->exporttype %> to <%= $part_export->machine %> (edit | delete) - - <%= itable() %> - <% my %opt = $part_export->options; - foreach my $opt ( keys %opt ) { %> - <%= $opt %><%= encode_entities($opt{$opt}) %> - <% } %> - - + Export + Options -<% } %> +% foreach my $part_export ( sort { +% $a->getfield('exportnum') <=> $b->getfield('exportnum') +% } qsearch('part_export',{}) +% ) { +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } + + + + <% $part_export->exportnum %> + + + <% $part_export->label_html %> + (edit | delete) +% if ( $part_export->no_suspend ) { +

+ This export will not suspend services. +

+% } +% if ( my @actions = $part_export->actions ) { +

+ Management: +% while (@actions) { +% my $label = shift @actions; +% my $path = shift @actions; + <& /elements/popup_link.html, + 'label' => $label, + 'action' => $fsurl.$path.'?'.$part_export->exportnum, + 'actionlabel' => $label, + &><% @actions ? ' | ' : '' %> +% } +

+% } #if @actions + + + + + <% itable() %> +% my %opt = $part_export->options; +% my $defs = $part_export->info->{options}; +% my %multiples; +% foreach my $optname (keys %$defs) { # is a Tie::IxHash +% my $def = $defs->{$optname}; +% my $group = $def->{multiple}; +% if ( $group ) { +% my @values = split("\n", $opt{$optname}); +% $multiples{$group} ||= []; +% push @{ $multiples{$group} }, [ $def->{label} || $optname, @values ] if @values; +% delete $opt{$optname}; +% } elsif (length($opt{$optname})) { # the normal case +% my $value = $opt{$optname}; +% if ( $def->{option_labels} ) { +% $value = $def->{option_labels}->{$value} || $value; +% } + + + <% $optname %>:  + <% encode_entities($value) %> + +% delete $opt{$optname}; +% } +% } +% # now any that are somehow not in the options list +% foreach my $opt (keys %opt) { +% if ( length($opt{$opt}) ) { + + <% $opt %>:  + <% encode_entities($opt{$opt}) %> + +% } +% } +% # now show any multiple-option groups +% foreach (sort keys %multiples) { +% my $set = $multiples{$_}; + + +% foreach my $col (@$set) { + +% } + +% while ( 1 ) { + +% my $end = 1; +% foreach my $col (@$set) { + +% $end = 0 if @$col; +% } + +% last if $end; +% } +
<% shift @$col %>
<% shift @$col %>
+% } #foreach keys %multiples + + + + + + +% } - - + +<% include('/elements/footer.html') %> + +<%init> +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); +