1 <% include("/elements/header.html", "Export Listing") %>
3 Provisioning services to external machines, databases and APIs.<BR><BR>
5 <A HREF="<% $p %>edit/part_export.cgi"><I>Add a new export</I></A><BR><BR>
8 function part_export_areyousure(href) {
9 if (confirm("Are you sure you want to delete this export?") == true)
10 window.location.href = href;
14 <% include('/elements/table-grid.html') %>
15 % my $bgcolor1 = '#eeeeee';
16 % my $bgcolor2 = '#ffffff';
20 <TH COLSPAN=2 CLASS="grid" BGCOLOR="#cccccc">Export</TH>
21 <TH CLASS="grid" BGCOLOR="#cccccc">Options</TH>
24 % foreach my $part_export ( sort {
25 % $a->getfield('exportnum') <=> $b->getfield('exportnum')
26 % } qsearch('part_export',{})
28 % if ( $bgcolor eq $bgcolor1 ) {
29 % $bgcolor = $bgcolor2;
31 % $bgcolor = $bgcolor1;
36 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="<% $p %>edit/part_export.cgi?<% $part_export->exportnum %>"><% $part_export->exportnum %></A></TD>
38 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
39 <% $part_export->label_html %>
40 (<A HREF="<% $p %>edit/part_export.cgi?<% $part_export->exportnum %>">edit</A> | <A HREF="javascript:part_export_areyousure('<% $p %>misc/delete-part_export.cgi?<% $part_export->exportnum %>')">delete</A>)
41 % if ( my @actions = $part_export->actions ) {
42 <P STYLE="position: absolute">
45 % my $label = shift @actions;
46 % my $path = shift @actions;
47 <& /elements/popup_link.html,
49 'action' => $fsurl.$path.'?'.$part_export->exportnum,
50 'actionlabel' => $label,
51 &><% @actions ? ' | ' : '' %>
58 <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
60 % my %opt = $part_export->options;
61 % my $defs = $part_export->info->{options};
63 % foreach my $optname (keys %$defs) { # is a Tie::IxHash
64 % my $def = $defs->{$optname};
65 % my $group = $def->{multiple};
67 % my @values = split("\n", $opt{$optname});
68 % $multiples{$group} ||= [];
69 % push @{ $multiples{$group} }, [ $optname, @values ] if @values;
70 % delete $opt{$optname};
71 % } elsif (length($opt{$optname})) { # the normal case
72 % my $value = $opt{$optname};
73 % if ( $def->{option_labels} ) {
74 % $value = $def->{option_labels}->{$value} || $value;
78 <TD ALIGN="right" VALIGN="top" WIDTH="33%"><% $optname %>: </TD>
79 <TD ALIGN="left" WIDTH="67%"><% encode_entities($value) %></TD>
81 % delete $opt{$optname};
84 % # now any that are somehow not in the options list
85 % foreach my $opt (keys %opt) {
86 % if ( length($opt{$opt}) ) {
88 <TD ALIGN="right" VALIGN="top" WIDTH="33%"><% $opt %>: </TD>
89 <TD ALIGN="left" WIDTH="67%"><% encode_entities($opt{$opt}) %></TD>
93 % # now show any multiple-option groups
94 % foreach (sort keys %multiples) {
95 % my $set = $multiples{$_};
96 <TR><TD ALIGN="center" COLSPAN=2><TABLE CLASS="grid">
98 % foreach my $col (@$set) {
99 <TH><% shift @$col %></TH>
105 % foreach my $col (@$set) {
106 <TD><% shift @$col %></TD>
113 % } #foreach keys %multiples
124 <% include('/elements/footer.html') %>
128 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');