+ if ( $layer ) {
+ $html .= '<TR><TD ALIGN="right">Description</TD><TD BGCOLOR=#ffffff>'.
+ $exports->{$layer}{notes}. '</TD></TR>';
+
+ if ( $exports->{$layer}{no_machine} ) {
+ $html .= '<INPUT TYPE="hidden" NAME="machine" VALUE="">'.
+ '<INPUT TYPE="hidden" NAME="svc_machine" VALUE=N">';
+ } else {
+ $html .= '<TR><TD ALIGN="right">Hostname or IP</TD><TD>';
+ my $machine = $part_export->machine;
+ if ( $exports->{$layer}{svc_machine} ) {
+ my( $N_CHK, $Y_CHK) = ( 'CHECKED', '' );
+ my( $machine_DISABLED, $pem_DISABLED) = ( '', 'DISABLED' );
+ my @part_export_machine;
+ my $default_machine = '';
+ if ( $cgi->param('svc_machine') eq 'Y'
+ || $machine eq '_SVC_MACHINE'
+ )
+ {
+ $Y_CHK = 'CHECKED';
+ $N_CHK = 'CHECKED';
+ $machine_DISABLED = 'DISABLED';
+ $pem_DISABLED = '';
+ $machine = '';
+ @part_export_machine = $cgi->param('part_export_machine');
+ if (!@part_export_machine) {
+ @part_export_machine =
+ map $_->machine,
+ grep ! $_->disabled,
+ $part_export->part_export_machine;
+ }
+ $default_machine =
+ $cgi->param('default_machine_name')
+ || $part_export->default_export_machine;
+ }
+ my $oc = qq(onChange="svc_machine_changed(this, '$layer')");
+ $html .= qq[
+ <INPUT TYPE="radio" NAME="svc_machine" VALUE="N" $N_CHK $oc>
+ <INPUT TYPE="text" NAME="machine" ID="${layer}_machine" VALUE="$machine" $machine_DISABLED>
+ <BR>
+ <INPUT TYPE="radio" NAME="svc_machine" VALUE="Y" $Y_CHK $oc>
+ <DIV STYLE="display:inline-block; vertical-align: top; text-align: right">
+ Selected in each customer service from these choices:
+ <TEXTAREA STYLE="vertical-align: top" NAME="part_export_machine"
+ ID="${layer}_part_export_machine"
+ onchange="part_export_machine_changed(this, '$layer')"
+ $pem_DISABLED>] .
+
+ join("\n", @part_export_machine) .
+
+ qq[</TEXTAREA>
+ <BR>
+ Default:
+ <SELECT NAME="default_machine_name" ID="${layer}_default_machine">
+ ];
+ foreach (@part_export_machine) {
+ $_ = encode_entities($_); # oh noes, XSS
+ my $sel = ($default_machine eq $_) ? ' SELECTED' : '';
+ $html .= qq!<OPTION VALUE="$_"$sel>$_</OPTION>\n!;
+ }
+ $html .= '</DIV></SELECT>'
+ } else {
+ $html .= qq(<INPUT TYPE="text" NAME="machine" VALUE="$machine">).
+ '<INPUT TYPE="hidden" NAME="svc_machine" VALUE=N">';
+ }
+ $html .= "</TD></TR>";
+ }
+
+ }