Optimize "Customer has a referring customer" condition, RT#74452
[freeside.git] / httemplate / browse / part_export.cgi
index 876633a..bbb723d 100755 (executable)
@@ -38,6 +38,11 @@ function part_export_areyousure(href) {
       <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
         <% $part_export->label_html %>
         (<A HREF="<% $p %>edit/part_export.cgi?<% $part_export->exportnum %>">edit</A>&nbsp;|&nbsp;<A HREF="javascript:part_export_areyousure('<% $p %>misc/delete-part_export.cgi?<% $part_export->exportnum %>')">delete</A>)
+%       if ( $part_export->no_suspend ) {
+        <P STYLE="position: absolute">
+        This export will not suspend services.
+        </P>
+%       }
 %       if ( my @actions = $part_export->actions ) {
         <P STYLE="position: absolute">
         Management:
@@ -60,21 +65,25 @@ function part_export_areyousure(href) {
 %         my %opt = $part_export->options;
 %         my $defs = $part_export->info->{options};
 %         my %multiples;
-%         foreach my $opt (keys %$defs) { # is a Tie::IxHash
-%           my $group = $defs->{$opt}->{multiple};
+%         foreach my $optname (keys %$defs) { # is a Tie::IxHash
+%           my $def = $defs->{$optname};
+%           my $group = $def->{multiple};
 %           if ( $group ) {
-%             my @values = split("\n", $opt{$opt});
+%             my @values = split("\n", $opt{$optname});
 %             $multiples{$group} ||= [];
-%             push @{ $multiples{$group} }, [ $opt, @values ] if @values;
-%             delete $opt{$opt};
-%           } elsif (length($opt{$opt})) { # the normal case
-%#         foreach my $opt ( keys %opt ) { 
+%             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;
+%             }
   
             <TR>
-              <TD ALIGN="right" VALIGN="top" WIDTH="33%"><% $opt %>:&nbsp;</TD>
-              <TD ALIGN="left" WIDTH="67%"><% encode_entities($opt{$opt}) %></TD>
+              <TD ALIGN="right" VALIGN="top" WIDTH="33%"><% $optname %>:&nbsp;</TD>
+              <TD ALIGN="left" WIDTH="67%"><% encode_entities($value) %></TD>
             </TR>
-%             delete $opt{$opt};
+%             delete $opt{$optname};
 %           }
 %         }
 %         # now any that are somehow not in the options list