%doc> -- Add Host form -- %doc> % <%attr> title => 'Add Host' %attr> % % %####################################################################### %# %# Args section %# %####################################################################### <%args> $add_host_block $address => undef # Can be passed optionally $user => $ui->get_current_user($r) $zone_id => undef $name => undef $aliases => undef $expiration => undef $cpu => undef $other_cpu => undef $os => undef $other_os => undef $site_id => undef $site_name => undef $room_id => undef $room_number => undef $ethernet => undef $duid => undef $submit => undef $contact_name => undef $contact_email => undef $contact_phone => undef $v6_assign => undef %args> % % % %####################################################################### %# %# INIT section %# %####################################################################### % <%init> my $DEBUG = 0; print '%ARGS is
', Dumper(%ARGS), '
(*) Field is required
Help is available for some fields by clicking on the field name.
IP Address <% $address %>
IPv6 Address Automatic Assignment Manual Assignment
% if ( $ui->config->get('IPV6_ADDRESS_USER_ENTRY_HOST_ONLY') ){ % my $blockaddr = $block->address; % my $prefix = $block->prefix; % my $num = (128 - $prefix) / 16; % my @txt; % for (my $i=1; $i <= $num; $i++){ % push @txt, ''; % } % my $txt = join ':', @txt; % $blockaddr =~ s/:$//; % print $blockaddr . $txt; % }else{ % }
IP Address Automatic Assignment Manual Assignment
IP Address An available address will be automatically assigned.
Domain * % if ( $zone ){ <% $zone->get_label %> % }else{ % my $default_zone; % # Show only zones that this user has access to % my $ao = $ui->get_allowed_objects($r, $user); % my %zones; % if ( exists $ao->{Zone} ){ % foreach my $id ( keys %{$ao->{Zone}} ){ % if ( my $zone = Zone->retrieve($id) ){ % $zones{$id} = $zone; % } % } % } % if ( my $fz = $block->forward_zone ){ % $zones{$fz->id} = $fz; % $default_zone = $fz; % }else{ % my $default_domain = Netdot->config->get('DEFAULT_DNSDOMAIN'); % $default_zone = (Zone->search(name=>$default_domain))[0]; % } -- Select -- % foreach my $z ( sort { $a->get_label cmp $b->get_label } values %zones ){ % if ( $default_zone && $default_zone->id == $z->id ){ <% $z->get_label %> % }else{ <% $z->get_label %> % } % } % }
<% $ui->help_link('../user_help/hosts.html#Hostname', '', '', 'Host Name') %> *
<% $ui->help_link('../user_help/hosts.html#Ethernet', '', '', 'Ethernet Address') %>
<% $ui->help_link('../user_help/hosts.html#DUID', '', '', 'DUID') %>
<% $ui->help_link('../user_help/hosts.html#Cnames', '', '', 'Aliases') %>
<% $ui->help_link('../user_help/hosts.html#Expiration', '', '', 'Expiraton Date') %> <% $ui->date_field(table=>"RR", column=>"expiration", edit=>1, shortFieldName=>1, returnAsVar=>1) %>
<% $ui->help_link('../user_help/hosts.html#CPU', '', '', 'CPU') %> -- Select -- % foreach my $key ( sort { $cpu_defaults->{$a} cmp $cpu_defaults->{$b} } keys %$cpu_defaults ){ % my $value = $cpu_defaults->{$key}; <% $value %> % } Other
(if not listed)
<% $ui->help_link('../user_help/hosts.html#OS', '', '', 'Operating System') %> -- Select -- % foreach my $key ( sort { $os_defaults->{$a} cmp $os_defaults->{$b} } keys %$os_defaults ){ % my $value = $os_defaults->{$key}; <% $value %> % } Other
Site % my @sites; % if ( $block->sites ){ % @sites = map { $_->site } $block->sites; % }else{ % @sites = Site->retrieve_all(); % } -- Select -- % foreach my $site ( sort { $a->get_label cmp $b->get_label } @sites ){ <% $site->get_label %> % }
Room -- Select --
Name
Email
Phone