4.x style
[freeside.git] / httemplate / elements / tr-svc_export_machine.html
1 % foreach my $part_export (@part_export) {
2 %   my $label = ( $part_export->exportname
3 %                   ? $part_export->exportname
4 %                   : $part_export->label
5 %               ).
6 %               ' hostname';
7 %
8 %   my $element = 'exportnum'. $part_export->exportnum. 'machinenum';
9 %   my $machinenum = $opt{cgi}->param($element);
10 %   if ( ! $machinenum && $opt{svc}->svcnum ) {
11 %     my $svc_export_machine = qsearchs('svc_export_machine', {
12 %       'svcnum'    => $opt{svc}->svcnum,
13 %       'exportnum' => $part_export->exportnum,
14 %     });
15 %     $machinenum = $svc_export_machine->machinenum if $svc_export_machine;
16 %   }
17
18     <& /elements/tr-select-table.html,
19          'label'        => $label,
20          'element_name' => 'exportnum'. $part_export->exportnum. 'machinenum',
21          'table'        => 'part_export_machine',
22          'name_col'     => 'machine',
23          'hashref'      => { 'exportnum' => $part_export->exportnum,
24                              'disabled'  => '',
25                            },
26          'curr_value'   => $machinenum,
27          'empty_label'  => 'Select export hostname',
28     &>
29 % }
30 <%init>
31
32 my %opt = @_;
33
34 my @part_export = grep { $_->machine eq '_SVC_MACHINE' }
35                     $opt{part_svc}->part_export;
36
37 </%init>